3 #=========================================================================
5 # Program: CMake - Cross-Platform Makefile Generator
6 # Module: $RCSfile: bootstrap,v $
7 # Language: Bourne Shell
8 # Date: $Date: 2009-08-31 17:25:40 $
9 # Version: $Revision: 1.124 $
11 # Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
12 # See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
14 # This software is distributed WITHOUT ANY WARRANTY; without even
15 # the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 # PURPOSE. See the above copyright notices for more information.
18 #=========================================================================
20 # Version number extraction function.
21 cmake_version_component
()
23 cat "${cmake_source_dir}/CMakeLists.txt" |
sed -n "
24 /^SET(CMake_VERSION_${1}/ {s/SET(CMake_VERSION_${1} *\([0-9]*\))/\1/;p;}
28 cmake_date_stamp_component
()
30 cat "${cmake_source_dir}/Source/kwsys/kwsysDateStamp.cmake" |
sed -n "
31 /KWSYS_DATE_STAMP_${1}/ {s/^.* \([0-9][0-9]*\))$/\1/;p;}
35 # Detect system and directory information.
37 cmake_source_dir
=`echo $0 | sed -n '/\//{s/\/[^\/]*$//;p;}'`
38 cmake_source_dir
=`(cd "${cmake_source_dir}";pwd)`
39 cmake_binary_dir
=`pwd`
40 cmake_version_major
="`cmake_version_component MAJOR`"
41 cmake_version_minor
="`cmake_version_component MINOR`"
42 if echo "${cmake_version_minor}" |
grep "[0-9]*[13579]" > /dev
/null
2>&1; then
43 cmake_version_patch
="`cmake_date_stamp_component YEAR``cmake_date_stamp_component MONTH``cmake_date_stamp_component DAY`"
45 cmake_version_patch
="`cmake_version_component PATCH`"
47 cmake_version
="${cmake_version_major}.${cmake_version_minor}"
48 cmake_version_full
="${cmake_version_major}.${cmake_version_minor}.${cmake_version_patch}"
49 cmake_data_dir
="/share/cmake-${cmake_version}"
50 cmake_doc_dir
="/doc/cmake-${cmake_version}"
53 cmake_bootstrap_system_libs
=""
54 cmake_bootstrap_qt_gui
=""
55 cmake_bootstrap_qt_qmake
=""
57 # Determine whether this is a Cygwin environment.
58 if echo "${cmake_system}" |
grep CYGWIN
>/dev
/null
2>&1; then
59 cmake_system_cygwin
=true
61 cmake_system_cygwin
=false
64 # Determine whether this is a MinGW environment.
65 if echo "${cmake_system}" |
grep MINGW
>/dev
/null
2>&1; then
66 cmake_system_mingw
=true
68 cmake_system_mingw
=false
71 # Determine whether this is OS X
72 if echo "${cmake_system}" |
grep Darwin
>/dev
/null
2>&1; then
73 cmake_system_darwin
=true
75 cmake_system_darwin
=false
78 # Determine whether this is BeOS
79 if echo "${cmake_system}" |
grep BeOS
>/dev
/null
2>&1; then
80 cmake_system_beos
=true
82 cmake_system_beos
=false
85 # Determine whether this is Haiku
86 if echo "${cmake_system}" |
grep Haiku
>/dev
/null
2>&1; then
87 cmake_system_haiku
=true
89 cmake_system_haiku
=false
92 # Determine whether this is OpenVMS
93 if echo "${cmake_system}" |
grep OpenVMS
>/dev
/null
2>&1; then
94 cmake_system_openvms
=true
96 cmake_system_openvms
=false
99 # Choose the generator to use for bootstrapping.
100 if ${cmake_system_mingw}; then
101 # Bootstrapping from an MSYS prompt.
102 cmake_bootstrap_generator
="MSYS Makefiles"
104 # Bootstrapping from a standard UNIX prompt.
105 cmake_bootstrap_generator
="Unix Makefiles"
108 # Choose tools and extensions for this platform.
109 if ${cmake_system_openvms}; then
119 # Construct bootstrap directory name.
120 cmake_bootstrap_dir
="${cmake_binary_dir}/Bootstrap${_cmk}"
122 # Helper function to fix windows paths.
125 echo "$1" |
sed 's/\\/\//g'
128 # Choose the default install prefix.
129 if ${cmake_system_mingw}; then
130 if [ "x${PROGRAMFILES}" != "x" ]; then
131 cmake_default_prefix
=`cmake_fix_slashes "${PROGRAMFILES}/CMake"`
132 elif [ "x${ProgramFiles}" != "x" ]; then
133 cmake_default_prefix
=`cmake_fix_slashes "${ProgramFiles}/CMake"`
134 elif [ "x${SYSTEMDRIVE}" != "x" ]; then
135 cmake_default_prefix
=`cmake_fix_slashes "${SYSTEMDRIVE}/Program Files/CMake"`
136 elif [ "x${SystemDrive}" != "x" ]; then
137 cmake_default_prefix
=`cmake_fix_slashes "${SystemDrive}/Program Files/CMake"`
139 cmake_default_prefix
="c:/Program Files/CMake"
142 cmake_default_prefix
="/usr/local"
145 CMAKE_KNOWN_C_COMPILERS
="cc gcc xlc icc tcc"
146 CMAKE_KNOWN_CXX_COMPILERS
="aCC xlC CC g++ c++ icc como "
147 CMAKE_KNOWN_MAKE_PROCESSORS
="gmake make"
149 CMAKE_PROBLEMATIC_FILES
="\
152 CMakeCCompiler.cmake \
153 CMakeCXXCompiler.cmake \
154 Source/cmConfigure.h \
155 Source/CTest/Curl/config.h \
156 Utilities/cmexpat/expatConfig.h \
157 Utilities/cmexpat/expatDllConfig.h \
160 CMAKE_UNUSED_SOURCES
="\
161 cmGlobalXCodeGenerator \
162 cmLocalXCodeGenerator \
172 cmCommandArgumentLexer \
173 cmCommandArgumentParser \
174 cmCommandArgumentParserHelper \
178 cmDocumentationFormatter \
179 cmDocumentationFormatterText \
183 cmPropertyDefinition \
184 cmPropertyDefinitionMap \
187 cmExportFileGenerator \
188 cmExportInstallFileGenerator \
189 cmInstallDirectoryGenerator \
190 cmGeneratedFileStream \
191 cmGeneratorExpression \
195 cmInstallExportGenerator \
196 cmInstallFilesGenerator \
197 cmInstallScriptGenerator \
198 cmInstallTargetGenerator \
201 cmSourceFileLocation \
205 cmFileTimeComparison \
206 cmGlobalUnixMakefileGenerator3 \
207 cmLocalUnixMakefileGenerator3 \
208 cmMakefileExecutableTargetGenerator \
209 cmMakefileLibraryTargetGenerator \
210 cmMakefileTargetGenerator \
211 cmMakefileUtilityTargetGenerator \
212 cmBootstrapCommands \
217 cmDocumentVariables \
220 cmComputeLinkDepends \
221 cmComputeLinkInformation \
223 cmComputeTargetDepends \
224 cmComputeComponentGraph \
230 if ${cmake_system_mingw}; then
231 CMAKE_CXX_SOURCES
="${CMAKE_CXX_SOURCES}\
232 cmGlobalMSYSMakefileGenerator \
233 cmGlobalMinGWMakefileGenerator \
234 cmWin32ProcessExecution"
241 if ${cmake_system_mingw}; then
246 KWSYS_C_MINGW_SOURCES
="\
249 KWSYS_C_GENERATED_SOURCES
="\
250 cmsysProcessFwd9xEnc"
256 KWSYS_C_MINGW_SOURCES
=""
257 KWSYS_C_GENERATED_SOURCES
=""
271 RegularExpression.hxx \
283 # Display CMake bootstrap usage
287 Usage: '"$0"' [options]
288 Options: [defaults in brackets after descriptions]
290 --help print this message
291 --version only print version information
292 --verbose display more information
293 --parallel=n bootstrap cmake in parallel, where n is
295 --init=FILE use FILE for cmake initialization
296 --system-libs use system-installed third-party libraries
297 (for use only by package maintainers)
298 --no-system-libs use cmake-provided third-party libraries
300 --qt-gui build the Qt-based GUI (requires Qt >= 4.2)
301 --no-qt-gui do not build the Qt-based GUI (default)
302 --qt-qmake=<qmake> use <qmake> as the qmake executable to find Qt
304 Directory and file names:
305 --prefix=PREFIX install files in tree rooted at PREFIX
306 [${cmake_default_prefix}]
307 --datadir=DIR install data files in PREFIX/DIR
309 --docdir=DIR install documentation files in PREFIX/DIR
311 --mandir=DIR install man pages files in PREFIX/DIR/manN
317 # Display CMake bootstrap usage
318 cmake_version_display
()
320 echo "CMake ${cmake_version_full}, Copyright (c) 2000-2009 Kitware, Inc., Insight Consortium"
323 # Display CMake bootstrap error, display the log file and exit
328 echo "---------------------------------------------"
329 echo "Error when bootstrapping CMake:"
331 echo "---------------------------------------------"
332 if [ -f cmake_bootstrap.log
]; then
333 echo "Log of errors: `pwd`/cmake_bootstrap.log"
334 #cat cmake_bootstrap.log
335 echo "---------------------------------------------"
340 # Replace KWSYS_NAMESPACE with cmsys
341 cmake_replace_string
()
347 if [ -f "${INFILE}" ] ||
${cmake_system_openvms}; then
349 sed "s/\@${SEARCHFOR}\@/${REPLACEWITH}/g" > "${OUTFILE}${_tmp}"
350 if [ -f "${OUTFILE}${_tmp}" ]; then
351 if "${_diff}" "${OUTFILE}" "${OUTFILE}${_tmp}" > /dev
/null
2> /dev
/null
; then
352 #echo "Files are the same"
353 rm -f "${OUTFILE}${_tmp}"
355 mv -f "${OUTFILE}${_tmp}" "${OUTFILE}"
359 cmake_error
1 "Cannot find file ${INFILE}"
363 cmake_kwsys_config_replace_string
()
369 if [ -f "${INFILE}" ] ||
${cmake_system_openvms}; then
370 echo "${APPEND}" > "${OUTFILE}${_tmp}"
372 sed "/./ {s/\@KWSYS_NAMESPACE\@/cmsys/g;
373 s/@KWSYS_BUILD_SHARED@/${KWSYS_BUILD_SHARED}/g;
374 s/@KWSYS_LFS_AVAILABLE@/${KWSYS_LFS_AVAILABLE}/g;
375 s/@KWSYS_LFS_REQUESTED@/${KWSYS_LFS_REQUESTED}/g;
376 s/@KWSYS_NAME_IS_KWSYS@/${KWSYS_NAME_IS_KWSYS}/g;
377 s/@KWSYS_IOS_USE_ANSI@/${KWSYS_IOS_USE_ANSI}/g;
378 s/@KWSYS_IOS_HAVE_STD@/${KWSYS_IOS_HAVE_STD}/g;
379 s/@KWSYS_IOS_USE_SSTREAM@/${KWSYS_IOS_USE_SSTREAM}/g;
380 s/@KWSYS_IOS_USE_STRSTREAM_H@/${KWSYS_IOS_USE_STRSTREAM_H}/g;
381 s/@KWSYS_IOS_USE_STRSTREA_H@/${KWSYS_IOS_USE_STRSTREA_H}/g;
382 s/@KWSYS_IOS_HAVE_BINARY@/${KWSYS_IOS_HAVE_BINARY}/g;
383 s/@KWSYS_STL_HAVE_STD@/${KWSYS_STL_HAVE_STD}/g;
384 s/@KWSYS_STL_STRING_HAVE_ISTREAM@/${KWSYS_STL_STRING_HAVE_ISTREAM}/g;
385 s/@KWSYS_STL_STRING_HAVE_OSTREAM@/${KWSYS_STL_STRING_HAVE_OSTREAM}/g;
386 s/@KWSYS_STL_STRING_HAVE_NEQ_CHAR@/${KWSYS_STL_STRING_HAVE_NEQ_CHAR}/g;
387 s/@KWSYS_STL_HAS_ITERATOR_TRAITS@/${KWSYS_STL_HAS_ITERATOR_TRAITS}/g;
388 s/@KWSYS_STL_HAS_ITERATOR_CATEGORY@/${KWSYS_STL_HAS_ITERATOR_CATEGORY}/g;
389 s/@KWSYS_STL_HAS___ITERATOR_CATEGORY@/${KWSYS_STL_HAS___ITERATOR_CATEGORY}/g;
390 s/@KWSYS_STL_HAS_ALLOCATOR_TEMPLATE@/${KWSYS_STL_HAS_ALLOCATOR_TEMPLATE}/g;
391 s/@KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE@/${KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE}/g;
392 s/@KWSYS_STL_HAS_ALLOCATOR_REBIND@/${KWSYS_STL_HAS_ALLOCATOR_REBIND}/g;
393 s/@KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT@/${KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT}/g;
394 s/@KWSYS_STL_HAS_ALLOCATOR_OBJECTS@/${KWSYS_STL_HAS_ALLOCATOR_OBJECTS}/g;
395 s/@KWSYS_CXX_HAS_CSTDDEF@/${KWSYS_CXX_HAS_CSTDDEF}/g;
396 s/@KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS@/${KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS}/g;
397 s/@KWSYS_CXX_HAS_MEMBER_TEMPLATES@/${KWSYS_CXX_HAS_MEMBER_TEMPLATES}/g;
398 s/@KWSYS_CXX_HAS_FULL_SPECIALIZATION@/${KWSYS_CXX_HAS_FULL_SPECIALIZATION}/g;
399 s/@KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP@/${KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP}/g;
400 s/@KWSYS_STAT_HAS_ST_MTIM@/${KWSYS_STAT_HAS_ST_MTIM}/g;}" >> "${OUTFILE}${_tmp}"
401 if [ -f "${OUTFILE}${_tmp}" ]; then
402 if "${_diff}" "${OUTFILE}" "${OUTFILE}${_tmp}" > /dev
/null
2> /dev
/null
; then
403 #echo "Files are the same"
404 rm -f "${OUTFILE}${_tmp}"
406 mv -f "${OUTFILE}${_tmp}" "${OUTFILE}"
410 cmake_error
2 "Cannot find file ${INFILE}"
413 # Write string into a file
421 # Escape spaces in strings
424 echo $1 |
sed "s/ /\\\\ /g"
427 # Write message to the log
430 echo "$*" >> cmake_bootstrap.log
436 echo "cmake_bootstrap_$$_test"
439 # Run a compiler test. First argument is compiler, second one are compiler
440 # flags, third one is test source file to be compiled
446 if [ ! -f "${TESTFILE}" ]; then
447 echo "Test file ${TESTFILE} missing. Please verify your CMake source tree."
450 TMPFILE
=`cmake_tmp_file`
451 echo "Try: ${COMPILER}"
452 echo "Line: ${COMPILER} ${FLAGS} ${TESTFILE} -o ${TMPFILE}"
453 echo "---------- file -----------------------"
455 echo "------------------------------------------"
456 "${COMPILER}" ${FLAGS} "${TESTFILE}" -o "${TMPFILE}"
458 if [ "${RES}" -ne "0" ]; then
459 echo "Test failed to compile"
462 if [ ! -f "${TMPFILE}" ] && [ ! -f "${TMPFILE}.exe" ]; then
463 echo "Test failed to produce executable"
469 if [ "${RES}" -ne "0" ]; then
470 echo "Test produced non-zero return code"
477 # Run a make test. First argument is the make interpreter.
482 echo "Try: ${MAKE_PROC}"
483 "${MAKE_PROC}" ${MAKE_FLAGS}
485 if [ "${RES}" -ne "0" ]; then
486 echo "${MAKE_PROC} does not work"
489 if [ ! -f "test" ] && [ ! -f "test.exe" ]; then
490 echo "${COMPILER} does not produce output"
496 if [ "${RES}" -ne "0" ]; then
497 echo "${MAKE_PROC} produces strange executable"
500 echo "${MAKE_PROC} works"
507 cmake_prefix_dir
="${cmake_default_prefix}"
509 if echo $a |
grep "^--prefix=" > /dev
/null
2> /dev
/null
; then
510 cmake_prefix_dir
=`echo $a | sed "s/^--prefix=//"`
511 cmake_prefix_dir
=`cmake_fix_slashes "${cmake_prefix_dir}"`
513 if echo $a |
grep "^--parallel=" > /dev
/null
2> /dev
/null
; then
514 cmake_parallel_make
=`echo $a | sed "s/^--parallel=//" | grep "[0-9][0-9]*"`
516 if echo $a |
grep "^--datadir=" > /dev
/null
2> /dev
/null
; then
517 cmake_data_dir
=`echo $a | sed "s/^--datadir=//"`
519 if echo $a |
grep "^--docdir=" > /dev
/null
2> /dev
/null
; then
520 cmake_doc_dir
=`echo $a | sed "s/^--docdir=//"`
522 if echo $a |
grep "^--mandir=" > /dev
/null
2> /dev
/null
; then
523 cmake_man_dir
=`echo $a | sed "s/^--mandir=//"`
525 if echo $a |
grep "^--init=" > /dev
/null
2> /dev
/null
; then
526 cmake_init_file
=`echo $a | sed "s/^--init=//"`
528 if echo $a |
grep "^--system-libs" > /dev
/null
2> /dev
/null
; then
529 cmake_bootstrap_system_libs
="-DCMAKE_USE_SYSTEM_LIBRARIES=1"
531 if echo $a |
grep "^--no-system-libs" > /dev
/null
2> /dev
/null
; then
532 cmake_bootstrap_system_libs
="-DCMAKE_USE_SYSTEM_LIBRARIES=0"
534 if echo $a |
grep "^--qt-gui" > /dev
/null
2> /dev
/null
; then
535 cmake_bootstrap_qt_gui
="1"
537 if echo $a |
grep "^--no-qt-gui" > /dev
/null
2> /dev
/null
; then
538 cmake_bootstrap_qt_gui
="0"
540 if echo $a |
grep "^--qt-qmake=" > /dev
/null
2> /dev
/null
; then
541 cmake_bootstrap_qt_qmake
=`echo $a | sed "s/^--qt-qmake=//"`
543 if echo $a |
grep "^--help" > /dev
/null
2> /dev
/null
; then
546 if echo $a |
grep "^--version" > /dev
/null
2> /dev
/null
; then
547 cmake_version_display
550 if echo $a |
grep "^--verbose" > /dev
/null
2> /dev
/null
; then
555 # If verbose, display some information about bootstrap
556 if [ -n "${cmake_verbose}" ]; then
557 echo "---------------------------------------------"
558 echo "Source directory: ${cmake_source_dir}"
559 echo "Binary directory: ${cmake_binary_dir}"
560 echo "Prefix directory: ${cmake_prefix_dir}"
561 echo "System: ${cmake_system}"
562 if [ "x${cmake_parallel_make}" != "x" ]; then
563 echo "Doing parallel make: ${cmake_parallel_make}"
568 echo "---------------------------------------------"
570 echo "`cmake_version_display`"
572 # Check for in-source build
573 cmake_in_source_build
=
574 if [ -f "${cmake_binary_dir}/Source/cmake.cxx" -a \
575 -f "${cmake_binary_dir}/Source/cmake.h" ]; then
576 if [ -n "${cmake_verbose}" ]; then
577 echo "Warning: This is an in-source build"
579 cmake_in_source_build
=TRUE
582 # If this is not an in-source build, then Bootstrap stuff should not exist.
583 if [ -z "${cmake_in_source_build}" ]; then
584 # Did somebody bootstrap in the source tree?
585 if [ -d "${cmake_source_dir}/Bootstrap${_cmk}" ]; then
586 cmake_error
10 "Found directory \"${cmake_source_dir}/Bootstrap${_cmk}\".
587 Looks like somebody did bootstrap CMake in the source tree, but now you are
588 trying to do bootstrap in the binary tree. Please remove Bootstrap${_cmk}
589 directory from the source tree."
591 # Is there a cache in the source tree?
592 for cmake_problematic_file
in ${CMAKE_PROBLEMATIC_FILES}; do
593 if [ -f "${cmake_source_dir}/${cmake_problematic_file}" ]; then
594 cmake_error
10 "Found \"${cmake_source_dir}/${cmake_problematic_file}\".
595 Looks like somebody tried to build CMake in the source tree, but now you are
596 trying to do bootstrap in the binary tree. Please remove \"${cmake_problematic_file}\"
597 from the source tree."
602 # Make bootstrap directory
603 [ -d "${cmake_bootstrap_dir}" ] || mkdir
"${cmake_bootstrap_dir}"
604 if [ ! -d "${cmake_bootstrap_dir}" ]; then
605 cmake_error
3 "Cannot create directory ${cmake_bootstrap_dir} to bootstrap CMake."
607 cd "${cmake_bootstrap_dir}"
609 [ -d "cmsys" ] || mkdir
"cmsys"
610 if [ ! -d "cmsys" ]; then
611 cmake_error
4 "Cannot create directory ${cmake_bootstrap_dir}/cmsys"
615 [ -d "cmsys/${a}" ] || mkdir
"cmsys/${a}"
616 if [ ! -d "cmsys/${a}" ]; then
617 cmake_error
5 "Cannot create directory ${cmake_bootstrap_dir}/cmsys/${a}"
621 # Delete all the bootstrap files
622 rm -f "${cmake_bootstrap_dir}/cmake_bootstrap.log"
623 rm -f "${cmake_bootstrap_dir}/cmConfigure.h${_tmp}"
624 rm -f "${cmake_bootstrap_dir}/cmVersionConfig.h${_tmp}"
626 # If exist compiler flags, set them
627 cmake_c_flags
=${CFLAGS}
628 cmake_cxx_flags
=${CXXFLAGS}
629 cmake_ld_flags
=${LDFLAGS}
631 # Add Cygwin-specific flags
632 if ${cmake_system_cygwin}; then
633 cmake_ld_flags
="${LDFLAGS} -Wl,--enable-auto-import"
636 # Add Carbon framework on Darwin
637 if ${cmake_system_darwin}; then
638 cmake_ld_flags
="${LDFLAGS} -framework Carbon"
641 # Add BeOS toolkits...
642 if ${cmake_system_beos}; then
643 cmake_ld_flags
="${LDFLAGS} -lroot -lbe"
646 # Add Haiku toolkits...
647 if ${cmake_system_haiku}; then
648 cmake_ld_flags
="${LDFLAGS} -lroot -lbe"
654 # If CC is set, use that for compiler, otherwise use list of known compilers
655 if [ -n "${CC}" ]; then
656 cmake_c_compilers
="${CC}"
658 cmake_c_compilers
="${CMAKE_KNOWN_C_COMPILERS}"
661 # Check if C compiler works
662 TMPFILE
=`cmake_tmp_file`
665 # error "The CMAKE_C_COMPILER is set to a C++ compiler"
670 #if defined(__CLASSIC_C__)
675 int main(int argc, char* argv[])
678 printf("%d%c", (argv != 0), (char)0x0a);
682 for a
in ${cmake_c_compilers}; do
683 if [ -z "${cmake_c_compiler}" ] && \
684 cmake_try_run
"${a}" "${cmake_c_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log
2>&1; then
685 cmake_c_compiler
="${a}"
690 if [ -z "${cmake_c_compiler}" ]; then
691 cmake_error
6 "Cannot find appropriate C compiler on this system.
692 Please specify one using environment variable CC.
693 See cmake_bootstrap.log for compilers attempted.
696 echo "C compiler on this system is: ${cmake_c_compiler} ${cmake_c_flags}"
701 # On Mac OSX, CC is the same as cc, so make sure not to try CC as c++ compiler.
703 # If CC is set, use that for compiler, otherwise use list of known compilers
704 if [ -n "${CXX}" ]; then
705 cmake_cxx_compilers
="${CXX}"
707 cmake_cxx_compilers
="${CMAKE_KNOWN_CXX_COMPILERS}"
710 # Check if C++ compiler works
711 TMPFILE
=`cmake_tmp_file`
716 # include <iostream.h>
722 NeedCXX() { this->Foo = 1; }
723 int GetFoo() { return this->Foo; }
731 cout << c.GetFoo() << endl;
733 std::cout << c.GetFoo() << std::endl;
738 for a
in ${cmake_cxx_compilers}; do
740 if [ -z "${cmake_cxx_compiler}" ] && \
741 cmake_try_run
"${a}" "${cmake_cxx_flags} -DTEST${b}" "${TMPFILE}.cxx" >> cmake_bootstrap.log
2>&1; then
742 cmake_cxx_compiler
="${a}"
746 rm -f "${TMPFILE}.cxx"
748 if [ -z "${cmake_cxx_compiler}" ]; then
749 cmake_error
7 "Cannot find appropriate C++ compiler on this system.
750 Please specify one using environment variable CXX.
751 See cmake_bootstrap.log for compilers attempted."
753 echo "C++ compiler on this system is: ${cmake_cxx_compiler} ${cmake_cxx_flags}"
757 cmake_make_processor
=
760 # If MAKE is set, use that for make processor, otherwise use list of known make
761 if [ -n "${MAKE}" ]; then
762 cmake_make_processors
="${MAKE}"
764 cmake_make_processors
="${CMAKE_KNOWN_MAKE_PROCESSORS}"
767 TMPFILE
="`cmake_tmp_file`_dir"
768 rm -rf "${cmake_bootstrap_dir}/${TMPFILE}"
769 mkdir
"${cmake_bootstrap_dir}/${TMPFILE}"
770 cd "${cmake_bootstrap_dir}/${TMPFILE}"
773 "'"${cmake_c_compiler}"'" -o test test.c
777 int main(){ printf("1%c", (char)0x0a); return 0; }
779 cmake_original_make_flags
="${cmake_make_flags}"
780 if [ "x${cmake_parallel_make}" != "x" ]; then
781 cmake_make_flags
="${cmake_make_flags} -j ${cmake_parallel_make}"
783 for a
in ${cmake_make_processors}; do
784 if [ -z "${cmake_make_processor}" ] && cmake_try_make "${a}" "${cmake_make_flags}" >> cmake_bootstrap.log
2>&1; then
785 cmake_make_processor
="${a}"
788 cmake_full_make_flags
="${cmake_make_flags}"
789 if [ "x${cmake_original_make_flags}" != "x${cmake_make_flags}" ]; then
790 if [ -z "${cmake_make_processor}" ]; then
791 cmake_make_flags
="${cmake_original_make_flags}"
792 for a
in ${cmake_make_processors}; do
793 if [ -z "${cmake_make_processor}" ] && cmake_try_make "${a}" "${cmake_make_flags}" >> cmake_bootstrap.log
2>&1; then
794 cmake_make_processor
="${a}"
799 cd "${cmake_bootstrap_dir}"
800 rm -rf "${cmake_bootstrap_dir}/${TMPFILE}"
802 if [ -z "${cmake_make_processor}" ]; then
803 cmake_error
8 "Cannot find appropriate Makefile processor on this system.
804 Please specify one using environment variable MAKE."
806 echo "Makefile processor on this system is: ${cmake_make_processor}"
807 if [ "x${cmake_full_make_flags}" != "x${cmake_make_flags}" ]; then
808 echo "---------------------------------------------"
809 echo "Makefile processor ${cmake_make_processor} does not support parallel build"
810 echo "---------------------------------------------"
813 # Ok, we have CC, CXX, and MAKE.
815 # Test C++ compiler features
819 TMPFILE
=`cmake_tmp_file`
821 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
823 int main() { std::cout << "This is GNU" << std::endl; return 0;}
826 cmake_cxx_compiler_is_gnu
=0
827 if cmake_try_run
"${cmake_cxx_compiler}" \
828 "${cmake_cxx_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log
2>&1; then
829 cmake_cxx_compiler_is_gnu
=1
831 if [ "x${cmake_cxx_compiler_is_gnu}" = "x1" ]; then
832 echo "${cmake_cxx_compiler} is GNU compiler"
834 echo "${cmake_cxx_compiler} is not GNU compiler"
836 rm -f "${TMPFILE}.cxx"
838 if [ "x${cmake_cxx_compiler_is_gnu}" != "x1" ]; then
839 # Check for non-GNU compiler flags
841 # If we are on IRIX, check for -LANG:std
842 cmake_test_flags
="-LANG:std"
843 if [ "x${cmake_system}" = "xIRIX64" ]; then
844 TMPFILE
=`cmake_tmp_file`
847 int main() { std::cout << "No need for '"${cmake_test_flags}"'" << std::endl; return 0;}
849 cmake_need_lang_std
=0
850 if cmake_try_run
"${cmake_cxx_compiler}" \
851 "${cmake_cxx_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log
2>&1; then
854 if cmake_try_run
"${cmake_cxx_compiler}" \
855 "${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log
2>&1; then
856 cmake_need_lang_std
=1
859 if [ "x${cmake_need_lang_std}" = "x1" ]; then
860 cmake_cxx_flags
="${cmake_cxx_flags} ${cmake_test_flags}"
861 echo "${cmake_cxx_compiler} needs ${cmake_test_flags}"
863 echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
865 rm -f "${TMPFILE}.cxx"
869 # If we are on OSF, check for -timplicit_local -no_implicit_include
870 cmake_test_flags
="-timplicit_local -no_implicit_include"
871 if [ "x${cmake_system}" = "xOSF1" ]; then
872 TMPFILE
=`cmake_tmp_file`
875 int main() { std::cout << "We need '"${cmake_test_flags}"'" << std::endl; return 0;}
878 if cmake_try_run
"${cmake_cxx_compiler}" \
879 "${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log
2>&1; then
884 if [ "x${cmake_need_flags}" = "x1" ]; then
885 cmake_cxx_flags
="${cmake_cxx_flags} ${cmake_test_flags}"
886 echo "${cmake_cxx_compiler} needs ${cmake_test_flags}"
888 echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
890 rm -f "${TMPFILE}.cxx"
894 # If we are on OSF, check for -std strict_ansi -nopure_cname
895 cmake_test_flags
="-std strict_ansi -nopure_cname"
896 if [ "x${cmake_system}" = "xOSF1" ]; then
897 TMPFILE
=`cmake_tmp_file`
900 int main() { std::cout << "We need '"${cmake_test_flags}"'" << std::endl; return 0;}
903 if cmake_try_run
"${cmake_cxx_compiler}" \
904 "${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log
2>&1; then
909 if [ "x${cmake_need_flags}" = "x1" ]; then
910 cmake_cxx_flags
="${cmake_cxx_flags} ${cmake_test_flags}"
911 echo "${cmake_cxx_compiler} needs ${cmake_test_flags}"
913 echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
915 rm -f "${TMPFILE}.cxx"
919 # If we are on HP-UX, check for -Ae for the C compiler.
920 cmake_test_flags
="-Ae"
921 if [ "x${cmake_system}" = "xHP-UX" ]; then
922 TMPFILE
=`cmake_tmp_file`
924 int main(int argc, char** argv) { (void)argc; (void)argv; return 0; }
927 if cmake_try_run
"${cmake_c_compiler}" "${cmake_c_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log
2>&1; then
930 if cmake_try_run
"${cmake_c_compiler}" \
931 "${cmake_c_flags} ${cmake_test_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log
2>&1; then
935 if [ "x${cmake_need_Ae}" = "x1" ]; then
936 cmake_c_flags
="${cmake_c_flags} ${cmake_test_flags}"
937 echo "${cmake_c_compiler} needs ${cmake_test_flags}"
939 echo "${cmake_c_compiler} does not need ${cmake_test_flags}"
946 # Test for kwsys features
947 KWSYS_NAME_IS_KWSYS
=0
949 KWSYS_LFS_AVAILABLE
=0
950 KWSYS_LFS_REQUESTED
=0
951 KWSYS_IOS_USE_STRSTREAM_H
=0
952 KWSYS_IOS_USE_STRSTREA_H
=0
954 KWSYS_IOS_USE_SSTREAM
=0
956 KWSYS_IOS_HAVE_BINARY
=0
958 KWSYS_STAT_HAS_ST_MTIM
=0
959 KWSYS_STL_STRING_HAVE_NEQ_CHAR
=0
960 KWSYS_STL_HAS_ITERATOR_TRAITS
=0
961 KWSYS_STL_HAS_ITERATOR_CATEGORY
=0
962 KWSYS_STL_HAS___ITERATOR_CATEGORY
=0
963 KWSYS_STL_HAS_ALLOCATOR_TEMPLATE
=0
964 KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE
=0
965 KWSYS_STL_HAS_ALLOCATOR_REBIND
=0
966 KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT
=0
967 KWSYS_STL_HAS_ALLOCATOR_OBJECTS
=0
968 KWSYS_CXX_HAS_CSTDDEF
=0
969 KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS
=0
970 KWSYS_CXX_HAS_MEMBER_TEMPLATES
=0
971 KWSYS_CXX_HAS_FULL_SPECIALIZATION
=0
972 KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP
=0
974 # Hardcode these kwsys features. They work on all known UNIX compilers anyway.
975 KWSYS_STL_STRING_HAVE_ISTREAM
=1
976 KWSYS_STL_STRING_HAVE_OSTREAM
=1
978 if cmake_try_run
"${cmake_cxx_compiler}" \
979 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAVE_STD" \
980 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
982 echo "${cmake_cxx_compiler} has STL in std:: namespace"
984 echo "${cmake_cxx_compiler} does not have STL in std:: namespace"
987 if cmake_try_run
"${cmake_cxx_compiler}" \
988 "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_ANSI" \
989 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
991 echo "${cmake_cxx_compiler} has ANSI streams"
993 echo "${cmake_cxx_compiler} does not have ANSI streams"
996 if [ "x$KWSYS_IOS_USE_ANSI" = "x1" ]; then
997 if cmake_try_run
"${cmake_cxx_compiler}" \
998 "${cmake_cxx_flags} -DTEST_KWSYS_IOS_HAVE_STD" \
999 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1000 KWSYS_IOS_HAVE_STD
=1
1001 echo "${cmake_cxx_compiler} has streams in std:: namespace"
1003 echo "${cmake_cxx_compiler} does not have streams in std:: namespace"
1005 if cmake_try_run
"${cmake_cxx_compiler}" \
1006 "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_SSTREAM" \
1007 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1008 KWSYS_IOS_USE_SSTREAM
=1
1009 echo "${cmake_cxx_compiler} has sstream"
1011 echo "${cmake_cxx_compiler} does not have sstream"
1015 if [ "x$KWSYS_IOS_USE_SSTREAM" = "x0" ]; then
1016 if cmake_try_run
"${cmake_cxx_compiler}" \
1017 "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_STRSTREAM_H" \
1018 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1019 KWSYS_IOS_USE_STRSTREAM_H
=1
1020 echo "${cmake_cxx_compiler} has strstream.h"
1022 echo "${cmake_cxx_compiler} does not have strstream.h"
1024 if [ "x$KWSYS_IOS_USE_STRSTREAM_H" = "x0" ]; then
1025 if cmake_try_run
"${cmake_cxx_compiler}" \
1026 "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_STRSTREA_H" \
1027 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1028 KWSYS_IOS_USE_STRSTREA_H
=1
1029 echo "${cmake_cxx_compiler} has strstrea.h"
1031 echo "${cmake_cxx_compiler} does not have strstrea.h"
1036 if cmake_try_run
"${cmake_cxx_compiler}" \
1037 "${cmake_cxx_flags} -DTEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1038 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1039 KWSYS_STL_STRING_HAVE_NEQ_CHAR
=1
1040 echo "${cmake_cxx_compiler} has operator!=(string, char*)"
1042 echo "${cmake_cxx_compiler} does not have operator!=(string, char*)"
1045 if cmake_try_run
"${cmake_cxx_compiler}" \
1046 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ITERATOR_TRAITS -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1047 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1048 KWSYS_STL_HAS_ITERATOR_TRAITS
=1
1049 echo "${cmake_cxx_compiler} has stl iterator_traits"
1051 echo "${cmake_cxx_compiler} does not have stl iterator_traits"
1054 if [ "x${KWSYS_STL_HAS_ITERATOR_TRAITS}" = "x0" ]; then
1055 if cmake_try_run
"${cmake_cxx_compiler}" \
1056 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ITERATOR_CATEGORY -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1057 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1058 KWSYS_STL_HAS_ITERATOR_CATEGORY
=1
1059 echo "${cmake_cxx_compiler} has old iterator_category"
1061 echo "${cmake_cxx_compiler} does not have old iterator_category"
1063 if [ "x${KWSYS_STL_HAS_ITERATOR_CATEGORY}" = "x0" ]; then
1064 if cmake_try_run
"${cmake_cxx_compiler}" \
1065 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS___ITERATOR_CATEGORY -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1066 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1067 KWSYS_STL_HAS___ITERATOR_CATEGORY
=1
1068 echo "${cmake_cxx_compiler} has old __iterator_category"
1070 echo "${cmake_cxx_compiler} does not have old __iterator_category"
1075 if cmake_try_run
"${cmake_cxx_compiler}" \
1076 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1077 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1078 KWSYS_STL_HAS_ALLOCATOR_TEMPLATE
=1
1079 echo "${cmake_cxx_compiler} has standard template allocator"
1081 echo "${cmake_cxx_compiler} does not have standard template allocator"
1084 if [ "x${KWSYS_STL_HAS_ALLOCATOR_TEMPLATE}" = "x1" ]; then
1085 if cmake_try_run
"${cmake_cxx_compiler}" \
1086 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_REBIND -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1087 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1088 KWSYS_STL_HAS_ALLOCATOR_REBIND
=1
1089 echo "${cmake_cxx_compiler} has allocator<>::rebind<>"
1091 echo "${cmake_cxx_compiler} does not have allocator<>::rebind<>"
1094 if cmake_try_run
"${cmake_cxx_compiler}" \
1095 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1096 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1097 KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT
=1
1098 echo "${cmake_cxx_compiler} has non-standard allocator<>::max_size argument"
1100 echo "${cmake_cxx_compiler} does not have non-standard allocator<>::max_size argument"
1103 if cmake_try_run
"${cmake_cxx_compiler}" \
1104 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1105 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1106 KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE
=1
1107 echo "${cmake_cxx_compiler} has old non-template allocator"
1109 echo "${cmake_cxx_compiler} does not have old non-template allocator"
1113 if cmake_try_run
"${cmake_cxx_compiler}" \
1114 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1115 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1116 KWSYS_STL_HAS_ALLOCATOR_OBJECTS
=1
1117 echo "${cmake_cxx_compiler} has stl containers supporting allocator objects"
1119 echo "${cmake_cxx_compiler} does not have stl containers supporting allocator objects"
1122 if cmake_try_run
"${cmake_cxx_compiler}" \
1123 "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_CSTDDEF" \
1124 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1125 KWSYS_CXX_HAS_CSTDDEF
=1
1126 echo "${cmake_cxx_compiler} has header cstddef"
1128 echo "${cmake_cxx_compiler} does not have header cstddef"
1131 if cmake_try_run
"${cmake_cxx_compiler}" \
1132 "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS" \
1133 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1134 echo "${cmake_cxx_compiler} does not require template friends to use <>"
1136 KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS
=1
1137 echo "${cmake_cxx_compiler} requires template friends to use <>"
1140 if cmake_try_run
"${cmake_cxx_compiler}" \
1141 "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES" \
1142 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1143 KWSYS_CXX_HAS_MEMBER_TEMPLATES
=1
1144 echo "${cmake_cxx_compiler} supports member templates"
1146 echo "${cmake_cxx_compiler} does not support member templates"
1149 if cmake_try_run
"${cmake_cxx_compiler}" \
1150 "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION" \
1151 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1152 KWSYS_CXX_HAS_FULL_SPECIALIZATION
=1
1153 echo "${cmake_cxx_compiler} has standard template specialization syntax"
1155 echo "${cmake_cxx_compiler} does not have standard template specialization syntax"
1158 if cmake_try_run
"${cmake_cxx_compiler}" \
1159 "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP" \
1160 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1161 KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP
=1
1162 echo "${cmake_cxx_compiler} has argument dependent lookup"
1164 echo "${cmake_cxx_compiler} does not have argument dependent lookup"
1167 if cmake_try_run
"${cmake_cxx_compiler}" \
1168 "${cmake_cxx_flags} -DTEST_KWSYS_STAT_HAS_ST_MTIM" \
1169 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1170 KWSYS_STAT_HAS_ST_MTIM
=1
1171 echo "${cmake_cxx_compiler} has struct stat with st_mtim member"
1173 echo "${cmake_cxx_compiler} does not have struct stat with st_mtim member"
1176 if cmake_try_run
"${cmake_cxx_compiler}" \
1177 "${cmake_cxx_flags} -DTEST_KWSYS_IOS_HAVE_BINARY -DKWSYS_IOS_USE_ANSI=${KWSYS_IOS_USE_ANSI} -DKWSYS_IOS_HAVE_STD=${KWSYS_IOS_HAVE_STD}" \
1178 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1179 KWSYS_IOS_HAVE_BINARY
=1
1180 echo "${cmake_cxx_compiler} has ios::binary openmode"
1182 echo "${cmake_cxx_compiler} does not have ios::binary openmode"
1185 # Just to be safe, let us store compiler and flags to the header file
1187 cmake_bootstrap_version
='$Revision: 1.124 $'
1188 cmake_compiler_settings_comment
="/*
1189 * Generated by ${cmake_source_dir}/bootstrap
1190 * Version: ${cmake_bootstrap_version}
1192 * Source directory: ${cmake_source_dir}
1193 * Binary directory: ${cmake_bootstrap_dir}
1195 * C compiler: ${cmake_c_compiler}
1196 * C flags: ${cmake_c_flags}
1198 * C++ compiler: ${cmake_cxx_compiler}
1199 * C++ flags: ${cmake_cxx_flags}
1201 * Make: ${cmake_make_processor}
1204 * ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES}
1206 * ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES} ${KWSYS_C_MINGW_SOURCES}
1210 cmake_report cmConfigure.h
${_tmp} "${cmake_compiler_settings_comment}"
1212 if [ "x$KWSYS_STL_HAVE_STD" = "x1" ]; then
1213 cmake_report cmConfigure.h
${_tmp} "/* #undef CMAKE_NO_STD_NAMESPACE */"
1215 cmake_report cmConfigure.h
${_tmp} "#define CMAKE_NO_STD_NAMESPACE 1"
1218 if [ "x$KWSYS_IOS_USE_ANSI" = "x1" ]; then
1219 cmake_report cmConfigure.h
${_tmp} "/* #undef CMAKE_NO_ANSI_STREAM_HEADERS */"
1221 cmake_report cmConfigure.h
${_tmp} "#define CMAKE_NO_ANSI_STREAM_HEADERS 1"
1224 if [ "x$KWSYS_IOS_USE_SSTREAM" = "x1" ]; then
1225 cmake_report cmConfigure.h
${_tmp} "/* #undef CMAKE_NO_ANSI_STRING_STREAM */"
1227 cmake_report cmConfigure.h
${_tmp} "#define CMAKE_NO_ANSI_STRING_STREAM 1"
1230 # Test for ansi FOR scope
1231 if cmake_try_run
"${cmake_cxx_compiler}" \
1232 "${cmake_cxx_flags}" \
1233 "${cmake_source_dir}/Modules/TestForAnsiForScope.cxx" >> cmake_bootstrap.log
2>&1; then
1234 cmake_report cmConfigure.h
${_tmp} "/* #undef CMAKE_NO_ANSI_FOR_SCOPE */"
1235 echo "${cmake_cxx_compiler} has ANSI for scoping"
1237 cmake_report cmConfigure.h
${_tmp} "#define CMAKE_NO_ANSI_FOR_SCOPE 1"
1238 echo "${cmake_cxx_compiler} does not have ANSI for scoping"
1241 # When bootstrapping on MinGW with MSYS we must convert the source
1242 # directory to a windows path.
1243 if ${cmake_system_mingw}; then
1244 cmake_root_dir
=`cd "${cmake_source_dir}"; pwd -W`
1246 cmake_root_dir
="${cmake_source_dir}"
1249 # Write CMake version
1250 cmake_report cmVersionConfig.h
${_tmp} "#define CMake_VERSION_MAJOR ${cmake_version_major}"
1251 cmake_report cmVersionConfig.h
${_tmp} "#define CMake_VERSION_MINOR ${cmake_version_minor}"
1252 cmake_report cmVersionConfig.h
${_tmp} "#define CMake_VERSION_PATCH ${cmake_version_patch}"
1253 cmake_report cmConfigure.h
${_tmp} "#define CMAKE_ROOT_DIR \"${cmake_root_dir}\""
1254 cmake_report cmConfigure.h
${_tmp} "#define CMAKE_DATA_DIR \"${cmake_data_dir}\""
1255 cmake_report cmConfigure.h
${_tmp} "#define CMAKE_BOOTSTRAP"
1257 # Regenerate configured headers
1258 for h
in Configure VersionConfig
; do
1259 if "${_diff}" cm${h}.h cm${h}.h${_tmp} > /dev/null 2> /dev/null; then
1260 rm -f cm${h}.h${_tmp}
1262 mv -f cm${h}.h${_tmp} cm${h}.h
1267 cmake_kwsys_config_replace_string \
1268 "${cmake_source_dir}/Source
/kwsys
/Configure.hxx.
in" \
1269 "${cmake_bootstrap_dir}/cmsys
/Configure.hxx
" \
1270 "${cmake_compiler_settings_comment}"
1271 cmake_kwsys_config_replace_string \
1272 "${cmake_source_dir}/Source
/kwsys
/Configure.h.
in" \
1273 "${cmake_bootstrap_dir}/cmsys
/Configure.h
" \
1274 "${cmake_compiler_settings_comment}"
1276 for a in ${KWSYS_FILES}; do
1277 cmake_replace_string "${cmake_source_dir}/Source
/kwsys
/${a}.
in" \
1278 "${cmake_bootstrap_dir}/cmsys
/${a}" KWSYS_NAMESPACE cmsys
1281 for a in ${KWSYS_IOS_FILES}; do
1282 cmake_replace_string "${cmake_source_dir}/Source
/kwsys
/kwsys_ios_
${a}.h.
in" \
1283 "${cmake_bootstrap_dir}/cmsys
/ios
/${a}" KWSYS_NAMESPACE cmsys
1286 cmake_replace_string "${cmake_source_dir}/Source
/kwsys
/kwsys_stl.hxx.
in" \
1287 "${cmake_bootstrap_dir}/cmsys
/stl
/stl.hxx_a
" KWSYS_STL_HEADER_EXTRA ""
1289 cmake_replace_string "${cmake_bootstrap_dir}/cmsys
/stl
/stl.hxx_a
" \
1290 "${cmake_bootstrap_dir}/cmsys
/stl
/stl.hxx_b
" KWSYS_NAMESPACE cmsys
1292 for a in string vector map algorithm; do
1293 cmake_replace_string "${cmake_bootstrap_dir}/cmsys
/stl
/stl.hxx_b
" \
1294 "${cmake_bootstrap_dir}/cmsys/stl/${a}" KWSYS_STL_HEADER ${a}
1298 dep
="cmConfigure.h cmsys/*.hxx cmsys/*.h `cmake_escape \"${cmake_source_dir}\"`/Source/*.h"
1300 for a
in ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES} ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES} ${KWSYS_C_GENERATED_SOURCES}; do
1301 objs
="${objs} ${a}.o"
1304 # Generate dependencies for cmBootstrapCommands.cxx
1305 for file in `grep "#include.*cm[^.]*.cxx" "${cmake_source_dir}/Source/cmBootstrapCommands.cxx" | sed "s/.* \"\(.*\)\"/\1/"`; do
1306 cmBootstrapCommandsDeps
="${cmBootstrapCommandsDeps} `cmake_escape "${cmake_source_dir}/Source
/$file"`"
1308 cmBootstrapCommandsDeps
=`echo $cmBootstrapCommandsDeps`
1310 if [ "x${cmake_ansi_cxx_flags}" != "x" ]; then
1311 cmake_cxx_flags
="${cmake_ansi_cxx_flags} ${cmake_cxx_flags}"
1314 if [ "x${cmake_c_flags}" != "x" ]; then
1315 cmake_c_flags
="${cmake_c_flags} "
1318 if [ "x${cmake_cxx_flags}" != "x" ]; then
1319 cmake_cxx_flags
="${cmake_cxx_flags} "
1322 cmake_c_flags_String
="-DKWSYS_STRING_C"
1323 cmake_c_flags
="${cmake_c_flags}-I`cmake_escape \"${cmake_source_dir}/Source\"` \
1324 -I`cmake_escape \"${cmake_bootstrap_dir}\"`"
1325 cmake_cxx_flags
="${cmake_cxx_flags}-I`cmake_escape \"${cmake_source_dir}/Source\"` \
1326 -I`cmake_escape \"${cmake_bootstrap_dir}\"`"
1327 echo "cmake: ${objs}" > "${cmake_bootstrap_dir}/Makefile"
1328 echo " ${cmake_cxx_compiler} ${cmake_ld_flags} ${cmake_cxx_flags} ${objs} -o cmake" >> "${cmake_bootstrap_dir}/Makefile"
1329 for a
in ${CMAKE_CXX_SOURCES}; do
1330 src
=`cmake_escape "${cmake_source_dir}/Source/${a}.cxx"`
1331 echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
1332 echo " ${cmake_cxx_compiler} ${cmake_cxx_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
1334 echo "cmBootstrapCommands.o : $cmBootstrapCommandsDeps" >> "${cmake_bootstrap_dir}/Makefile"
1335 for a
in ${CMAKE_C_SOURCES}; do
1336 src
=`cmake_escape "${cmake_source_dir}/Source/${a}.c"`
1337 echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
1338 echo " ${cmake_c_compiler} ${cmake_c_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
1340 for a
in ${KWSYS_C_SOURCES} ${KWSYS_C_MINGW_SOURCES}; do
1341 src
=`cmake_escape "${cmake_source_dir}/Source/kwsys/${a}.c"`
1342 src_flags
=`eval echo \\${cmake_c_flags_\${a}}`
1343 echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
1344 echo " ${cmake_c_compiler} ${cmake_c_flags} -DKWSYS_NAMESPACE=cmsys ${src_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
1346 for a
in ${KWSYS_CXX_SOURCES}; do
1347 src
=`cmake_escape "${cmake_source_dir}/Source/kwsys/${a}.cxx"`
1348 echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
1349 echo " ${cmake_cxx_compiler} ${cmake_cxx_flags} -DKWSYS_NAMESPACE=cmsys -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
1351 if ${cmake_system_mingw}; then
1352 src
=`cmake_escape "${cmake_bootstrap_dir}/cmsysProcessFwd9xEnc.c"`
1353 in=`cmake_escape "${cmake_bootstrap_dir}/cmsysProcessFwd9x.exe"`
1354 cmd
=`cmake_escape "${cmake_bootstrap_dir}/cmsysEncodeExecutable.exe"`
1355 a
="cmsysProcessFwd9xEnc"
1356 echo "${cmd} : EncodeExecutable.o" >> "${cmake_bootstrap_dir}/Makefile"
1357 echo " ${cmake_c_compiler} ${cmake_ld_flags} ${cmake_c_flags} EncodeExecutable.o -o ${cmd}" >> "${cmake_bootstrap_dir}/Makefile"
1358 echo "${in} : ProcessFwd9x.o" >> "${cmake_bootstrap_dir}/Makefile"
1359 echo " ${cmake_c_compiler} ${cmake_ld_flags} ${cmake_c_flags} ProcessFwd9x.o -o ${in}" >> "${cmake_bootstrap_dir}/Makefile"
1360 echo "${src} : ${cmd} ${in}" >> "${cmake_bootstrap_dir}/Makefile"
1361 echo " ${cmd} ${in} ${src} cmsys ProcessFwd9x" >> "${cmake_bootstrap_dir}/Makefile"
1362 echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
1363 echo " ${cmake_c_compiler} ${cmake_c_flags} -I`cmake_escape \"${cmake_source_dir}/Source/kwsys\"` -DKWSYS_NAMESPACE=cmsys -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
1367 cd "${cmake_binary_dir}" && "${cmake_source_dir}/bootstrap"
1368 ' >> "${cmake_bootstrap_dir}/Makefile"
1370 # Write our default settings to Bootstrap${_cmk}/InitialCacheFlags.cmake.
1372 # Generated by '"${cmake_source_dir}"'/bootstrap
1373 # Default cmake settings. These may be overridden any settings below.
1374 SET (CMAKE_INSTALL_PREFIX "'"${cmake_prefix_dir}"'" CACHE PATH "Install path prefix, prepended onto install directories." FORCE)
1375 SET (CMAKE_DOC_DIR "'"${cmake_doc_dir}"'" CACHE PATH "Install location for documentation (relative to prefix)." FORCE)
1376 SET (CMAKE_MAN_DIR "'"${cmake_man_dir}"'" CACHE PATH "Install location for man pages (relative to prefix)." FORCE)
1377 SET (CMAKE_DATA_DIR "'"${cmake_data_dir}"'" CACHE PATH "Install location for data (relative to prefix)." FORCE)
1378 ' > "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
1380 # Add configuration settings given as command-line options.
1381 if [ "x${cmake_bootstrap_qt_gui}" != "x" ]; then
1383 SET (BUILD_QtDialog '"${cmake_bootstrap_qt_gui}"' CACHE BOOL "Build Qt dialog for CMake" FORCE)
1384 ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
1386 if [ "x${cmake_bootstrap_qt_qmake}" != "x" ]; then
1388 SET (QT_QMAKE_EXECUTABLE "'"${cmake_bootstrap_qt_qmake}"'" CACHE FILEPATH "Location of Qt qmake" FORCE)
1389 ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
1392 # Add user-specified settings. Handle relative-path case for
1393 # specification of cmake_init_file.
1395 cd "${cmake_binary_dir}"
1396 if [ -f "${cmake_init_file}" ]; then
1397 cat "${cmake_init_file}" >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
1401 echo "---------------------------------------------"
1403 # Run make to build bootstrap cmake
1404 if [ "x${cmake_parallel_make}" != "x" ]; then
1405 ${cmake_make_processor} ${cmake_make_flags}
1407 ${cmake_make_processor}
1410 if [ "${RES}" -ne "0" ]; then
1411 cmake_error
9 "Problem while running ${cmake_make_processor}"
1413 cd "${cmake_binary_dir}"
1415 # Set C, CXX, and MAKE environment variables, so that real real cmake will be
1416 # build with same compiler and make
1417 CC
="${cmake_c_compiler}"
1418 CXX
="${cmake_cxx_compiler}"
1419 MAKE
="${cmake_make_processor}"
1424 # Run bootstrap CMake to configure real CMake
1425 "${cmake_bootstrap_dir}/cmake" "${cmake_source_dir}" "-C${cmake_bootstrap_dir}/InitialCacheFlags.cmake" "-G${cmake_bootstrap_generator}" ${cmake_bootstrap_system_libs}
1427 if [ "${RES}" -ne "0" ]; then
1428 cmake_error 11 "Problem
while running initial CMake
"
1431 echo "---------------------------------------------"
1433 # And we are done. Now just run make
1434 echo "CMake has bootstrapped. Now run
${cmake_make_processor}.
"