3 #=========================================================================
5 # Program: CMake - Cross-Platform Makefile Generator
6 # Module: $RCSfile: bootstrap,v $
7 # Language: Bourne Shell
8 # Date: $Date: 2009-09-22 20:12:40 $
9 # Version: $Revision: 1.125 $
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_DO_NOT_CLEAN_PUTENV@/0/g;
374 s/@KWSYS_BUILD_SHARED@/${KWSYS_BUILD_SHARED}/g;
375 s/@KWSYS_LFS_AVAILABLE@/${KWSYS_LFS_AVAILABLE}/g;
376 s/@KWSYS_LFS_REQUESTED@/${KWSYS_LFS_REQUESTED}/g;
377 s/@KWSYS_NAME_IS_KWSYS@/${KWSYS_NAME_IS_KWSYS}/g;
378 s/@KWSYS_IOS_USE_ANSI@/${KWSYS_IOS_USE_ANSI}/g;
379 s/@KWSYS_IOS_HAVE_STD@/${KWSYS_IOS_HAVE_STD}/g;
380 s/@KWSYS_IOS_USE_SSTREAM@/${KWSYS_IOS_USE_SSTREAM}/g;
381 s/@KWSYS_IOS_USE_STRSTREAM_H@/${KWSYS_IOS_USE_STRSTREAM_H}/g;
382 s/@KWSYS_IOS_USE_STRSTREA_H@/${KWSYS_IOS_USE_STRSTREA_H}/g;
383 s/@KWSYS_IOS_HAVE_BINARY@/${KWSYS_IOS_HAVE_BINARY}/g;
384 s/@KWSYS_STL_HAVE_STD@/${KWSYS_STL_HAVE_STD}/g;
385 s/@KWSYS_STL_STRING_HAVE_ISTREAM@/${KWSYS_STL_STRING_HAVE_ISTREAM}/g;
386 s/@KWSYS_STL_STRING_HAVE_OSTREAM@/${KWSYS_STL_STRING_HAVE_OSTREAM}/g;
387 s/@KWSYS_STL_STRING_HAVE_NEQ_CHAR@/${KWSYS_STL_STRING_HAVE_NEQ_CHAR}/g;
388 s/@KWSYS_STL_HAS_ITERATOR_TRAITS@/${KWSYS_STL_HAS_ITERATOR_TRAITS}/g;
389 s/@KWSYS_STL_HAS_ITERATOR_CATEGORY@/${KWSYS_STL_HAS_ITERATOR_CATEGORY}/g;
390 s/@KWSYS_STL_HAS___ITERATOR_CATEGORY@/${KWSYS_STL_HAS___ITERATOR_CATEGORY}/g;
391 s/@KWSYS_STL_HAS_ALLOCATOR_TEMPLATE@/${KWSYS_STL_HAS_ALLOCATOR_TEMPLATE}/g;
392 s/@KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE@/${KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE}/g;
393 s/@KWSYS_STL_HAS_ALLOCATOR_REBIND@/${KWSYS_STL_HAS_ALLOCATOR_REBIND}/g;
394 s/@KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT@/${KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT}/g;
395 s/@KWSYS_STL_HAS_ALLOCATOR_OBJECTS@/${KWSYS_STL_HAS_ALLOCATOR_OBJECTS}/g;
396 s/@KWSYS_CXX_HAS_CSTDDEF@/${KWSYS_CXX_HAS_CSTDDEF}/g;
397 s/@KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS@/${KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS}/g;
398 s/@KWSYS_CXX_HAS_MEMBER_TEMPLATES@/${KWSYS_CXX_HAS_MEMBER_TEMPLATES}/g;
399 s/@KWSYS_CXX_HAS_FULL_SPECIALIZATION@/${KWSYS_CXX_HAS_FULL_SPECIALIZATION}/g;
400 s/@KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP@/${KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP}/g;
401 s/@KWSYS_STAT_HAS_ST_MTIM@/${KWSYS_STAT_HAS_ST_MTIM}/g;}" >> "${OUTFILE}${_tmp}"
402 if [ -f "${OUTFILE}${_tmp}" ]; then
403 if "${_diff}" "${OUTFILE}" "${OUTFILE}${_tmp}" > /dev
/null
2> /dev
/null
; then
404 #echo "Files are the same"
405 rm -f "${OUTFILE}${_tmp}"
407 mv -f "${OUTFILE}${_tmp}" "${OUTFILE}"
411 cmake_error
2 "Cannot find file ${INFILE}"
414 # Write string into a file
422 # Escape spaces in strings
425 echo $1 |
sed "s/ /\\\\ /g"
428 # Write message to the log
431 echo "$*" >> cmake_bootstrap.log
437 echo "cmake_bootstrap_$$_test"
440 # Run a compiler test. First argument is compiler, second one are compiler
441 # flags, third one is test source file to be compiled
447 if [ ! -f "${TESTFILE}" ]; then
448 echo "Test file ${TESTFILE} missing. Please verify your CMake source tree."
451 TMPFILE
=`cmake_tmp_file`
452 echo "Try: ${COMPILER}"
453 echo "Line: ${COMPILER} ${FLAGS} ${TESTFILE} -o ${TMPFILE}"
454 echo "---------- file -----------------------"
456 echo "------------------------------------------"
457 "${COMPILER}" ${FLAGS} "${TESTFILE}" -o "${TMPFILE}"
459 if [ "${RES}" -ne "0" ]; then
460 echo "Test failed to compile"
463 if [ ! -f "${TMPFILE}" ] && [ ! -f "${TMPFILE}.exe" ]; then
464 echo "Test failed to produce executable"
470 if [ "${RES}" -ne "0" ]; then
471 echo "Test produced non-zero return code"
478 # Run a make test. First argument is the make interpreter.
483 echo "Try: ${MAKE_PROC}"
484 "${MAKE_PROC}" ${MAKE_FLAGS}
486 if [ "${RES}" -ne "0" ]; then
487 echo "${MAKE_PROC} does not work"
490 if [ ! -f "test" ] && [ ! -f "test.exe" ]; then
491 echo "${COMPILER} does not produce output"
497 if [ "${RES}" -ne "0" ]; then
498 echo "${MAKE_PROC} produces strange executable"
501 echo "${MAKE_PROC} works"
508 cmake_prefix_dir
="${cmake_default_prefix}"
510 if echo $a |
grep "^--prefix=" > /dev
/null
2> /dev
/null
; then
511 cmake_prefix_dir
=`echo $a | sed "s/^--prefix=//"`
512 cmake_prefix_dir
=`cmake_fix_slashes "${cmake_prefix_dir}"`
514 if echo $a |
grep "^--parallel=" > /dev
/null
2> /dev
/null
; then
515 cmake_parallel_make
=`echo $a | sed "s/^--parallel=//" | grep "[0-9][0-9]*"`
517 if echo $a |
grep "^--datadir=" > /dev
/null
2> /dev
/null
; then
518 cmake_data_dir
=`echo $a | sed "s/^--datadir=//"`
520 if echo $a |
grep "^--docdir=" > /dev
/null
2> /dev
/null
; then
521 cmake_doc_dir
=`echo $a | sed "s/^--docdir=//"`
523 if echo $a |
grep "^--mandir=" > /dev
/null
2> /dev
/null
; then
524 cmake_man_dir
=`echo $a | sed "s/^--mandir=//"`
526 if echo $a |
grep "^--init=" > /dev
/null
2> /dev
/null
; then
527 cmake_init_file
=`echo $a | sed "s/^--init=//"`
529 if echo $a |
grep "^--system-libs" > /dev
/null
2> /dev
/null
; then
530 cmake_bootstrap_system_libs
="-DCMAKE_USE_SYSTEM_LIBRARIES=1"
532 if echo $a |
grep "^--no-system-libs" > /dev
/null
2> /dev
/null
; then
533 cmake_bootstrap_system_libs
="-DCMAKE_USE_SYSTEM_LIBRARIES=0"
535 if echo $a |
grep "^--qt-gui" > /dev
/null
2> /dev
/null
; then
536 cmake_bootstrap_qt_gui
="1"
538 if echo $a |
grep "^--no-qt-gui" > /dev
/null
2> /dev
/null
; then
539 cmake_bootstrap_qt_gui
="0"
541 if echo $a |
grep "^--qt-qmake=" > /dev
/null
2> /dev
/null
; then
542 cmake_bootstrap_qt_qmake
=`echo $a | sed "s/^--qt-qmake=//"`
544 if echo $a |
grep "^--help" > /dev
/null
2> /dev
/null
; then
547 if echo $a |
grep "^--version" > /dev
/null
2> /dev
/null
; then
548 cmake_version_display
551 if echo $a |
grep "^--verbose" > /dev
/null
2> /dev
/null
; then
556 # If verbose, display some information about bootstrap
557 if [ -n "${cmake_verbose}" ]; then
558 echo "---------------------------------------------"
559 echo "Source directory: ${cmake_source_dir}"
560 echo "Binary directory: ${cmake_binary_dir}"
561 echo "Prefix directory: ${cmake_prefix_dir}"
562 echo "System: ${cmake_system}"
563 if [ "x${cmake_parallel_make}" != "x" ]; then
564 echo "Doing parallel make: ${cmake_parallel_make}"
569 echo "---------------------------------------------"
571 echo "`cmake_version_display`"
573 # Check for in-source build
574 cmake_in_source_build
=
575 if [ -f "${cmake_binary_dir}/Source/cmake.cxx" -a \
576 -f "${cmake_binary_dir}/Source/cmake.h" ]; then
577 if [ -n "${cmake_verbose}" ]; then
578 echo "Warning: This is an in-source build"
580 cmake_in_source_build
=TRUE
583 # If this is not an in-source build, then Bootstrap stuff should not exist.
584 if [ -z "${cmake_in_source_build}" ]; then
585 # Did somebody bootstrap in the source tree?
586 if [ -d "${cmake_source_dir}/Bootstrap${_cmk}" ]; then
587 cmake_error
10 "Found directory \"${cmake_source_dir}/Bootstrap${_cmk}\".
588 Looks like somebody did bootstrap CMake in the source tree, but now you are
589 trying to do bootstrap in the binary tree. Please remove Bootstrap${_cmk}
590 directory from the source tree."
592 # Is there a cache in the source tree?
593 for cmake_problematic_file
in ${CMAKE_PROBLEMATIC_FILES}; do
594 if [ -f "${cmake_source_dir}/${cmake_problematic_file}" ]; then
595 cmake_error
10 "Found \"${cmake_source_dir}/${cmake_problematic_file}\".
596 Looks like somebody tried to build CMake in the source tree, but now you are
597 trying to do bootstrap in the binary tree. Please remove \"${cmake_problematic_file}\"
598 from the source tree."
603 # Make bootstrap directory
604 [ -d "${cmake_bootstrap_dir}" ] || mkdir
"${cmake_bootstrap_dir}"
605 if [ ! -d "${cmake_bootstrap_dir}" ]; then
606 cmake_error
3 "Cannot create directory ${cmake_bootstrap_dir} to bootstrap CMake."
608 cd "${cmake_bootstrap_dir}"
610 [ -d "cmsys" ] || mkdir
"cmsys"
611 if [ ! -d "cmsys" ]; then
612 cmake_error
4 "Cannot create directory ${cmake_bootstrap_dir}/cmsys"
616 [ -d "cmsys/${a}" ] || mkdir
"cmsys/${a}"
617 if [ ! -d "cmsys/${a}" ]; then
618 cmake_error
5 "Cannot create directory ${cmake_bootstrap_dir}/cmsys/${a}"
622 # Delete all the bootstrap files
623 rm -f "${cmake_bootstrap_dir}/cmake_bootstrap.log"
624 rm -f "${cmake_bootstrap_dir}/cmConfigure.h${_tmp}"
625 rm -f "${cmake_bootstrap_dir}/cmVersionConfig.h${_tmp}"
627 # If exist compiler flags, set them
628 cmake_c_flags
=${CFLAGS}
629 cmake_cxx_flags
=${CXXFLAGS}
630 cmake_ld_flags
=${LDFLAGS}
632 # Add Cygwin-specific flags
633 if ${cmake_system_cygwin}; then
634 cmake_ld_flags
="${LDFLAGS} -Wl,--enable-auto-import"
637 # Add Carbon framework on Darwin
638 if ${cmake_system_darwin}; then
639 cmake_ld_flags
="${LDFLAGS} -framework Carbon"
642 # Add BeOS toolkits...
643 if ${cmake_system_beos}; then
644 cmake_ld_flags
="${LDFLAGS} -lroot -lbe"
647 # Add Haiku toolkits...
648 if ${cmake_system_haiku}; then
649 cmake_ld_flags
="${LDFLAGS} -lroot -lbe"
655 # If CC is set, use that for compiler, otherwise use list of known compilers
656 if [ -n "${CC}" ]; then
657 cmake_c_compilers
="${CC}"
659 cmake_c_compilers
="${CMAKE_KNOWN_C_COMPILERS}"
662 # Check if C compiler works
663 TMPFILE
=`cmake_tmp_file`
666 # error "The CMAKE_C_COMPILER is set to a C++ compiler"
671 #if defined(__CLASSIC_C__)
676 int main(int argc, char* argv[])
679 printf("%d%c", (argv != 0), (char)0x0a);
683 for a
in ${cmake_c_compilers}; do
684 if [ -z "${cmake_c_compiler}" ] && \
685 cmake_try_run
"${a}" "${cmake_c_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log
2>&1; then
686 cmake_c_compiler
="${a}"
691 if [ -z "${cmake_c_compiler}" ]; then
692 cmake_error
6 "Cannot find appropriate C compiler on this system.
693 Please specify one using environment variable CC.
694 See cmake_bootstrap.log for compilers attempted.
697 echo "C compiler on this system is: ${cmake_c_compiler} ${cmake_c_flags}"
702 # On Mac OSX, CC is the same as cc, so make sure not to try CC as c++ compiler.
704 # If CC is set, use that for compiler, otherwise use list of known compilers
705 if [ -n "${CXX}" ]; then
706 cmake_cxx_compilers
="${CXX}"
708 cmake_cxx_compilers
="${CMAKE_KNOWN_CXX_COMPILERS}"
711 # Check if C++ compiler works
712 TMPFILE
=`cmake_tmp_file`
717 # include <iostream.h>
723 NeedCXX() { this->Foo = 1; }
724 int GetFoo() { return this->Foo; }
732 cout << c.GetFoo() << endl;
734 std::cout << c.GetFoo() << std::endl;
739 for a
in ${cmake_cxx_compilers}; do
741 if [ -z "${cmake_cxx_compiler}" ] && \
742 cmake_try_run
"${a}" "${cmake_cxx_flags} -DTEST${b}" "${TMPFILE}.cxx" >> cmake_bootstrap.log
2>&1; then
743 cmake_cxx_compiler
="${a}"
747 rm -f "${TMPFILE}.cxx"
749 if [ -z "${cmake_cxx_compiler}" ]; then
750 cmake_error
7 "Cannot find appropriate C++ compiler on this system.
751 Please specify one using environment variable CXX.
752 See cmake_bootstrap.log for compilers attempted."
754 echo "C++ compiler on this system is: ${cmake_cxx_compiler} ${cmake_cxx_flags}"
758 cmake_make_processor
=
761 # If MAKE is set, use that for make processor, otherwise use list of known make
762 if [ -n "${MAKE}" ]; then
763 cmake_make_processors
="${MAKE}"
765 cmake_make_processors
="${CMAKE_KNOWN_MAKE_PROCESSORS}"
768 TMPFILE
="`cmake_tmp_file`_dir"
769 rm -rf "${cmake_bootstrap_dir}/${TMPFILE}"
770 mkdir
"${cmake_bootstrap_dir}/${TMPFILE}"
771 cd "${cmake_bootstrap_dir}/${TMPFILE}"
774 "'"${cmake_c_compiler}"'" -o test test.c
778 int main(){ printf("1%c", (char)0x0a); return 0; }
780 cmake_original_make_flags
="${cmake_make_flags}"
781 if [ "x${cmake_parallel_make}" != "x" ]; then
782 cmake_make_flags
="${cmake_make_flags} -j ${cmake_parallel_make}"
784 for a
in ${cmake_make_processors}; do
785 if [ -z "${cmake_make_processor}" ] && cmake_try_make "${a}" "${cmake_make_flags}" >> cmake_bootstrap.log
2>&1; then
786 cmake_make_processor
="${a}"
789 cmake_full_make_flags
="${cmake_make_flags}"
790 if [ "x${cmake_original_make_flags}" != "x${cmake_make_flags}" ]; then
791 if [ -z "${cmake_make_processor}" ]; then
792 cmake_make_flags
="${cmake_original_make_flags}"
793 for a
in ${cmake_make_processors}; do
794 if [ -z "${cmake_make_processor}" ] && cmake_try_make "${a}" "${cmake_make_flags}" >> cmake_bootstrap.log
2>&1; then
795 cmake_make_processor
="${a}"
800 cd "${cmake_bootstrap_dir}"
801 rm -rf "${cmake_bootstrap_dir}/${TMPFILE}"
803 if [ -z "${cmake_make_processor}" ]; then
804 cmake_error
8 "Cannot find appropriate Makefile processor on this system.
805 Please specify one using environment variable MAKE."
807 echo "Makefile processor on this system is: ${cmake_make_processor}"
808 if [ "x${cmake_full_make_flags}" != "x${cmake_make_flags}" ]; then
809 echo "---------------------------------------------"
810 echo "Makefile processor ${cmake_make_processor} does not support parallel build"
811 echo "---------------------------------------------"
814 # Ok, we have CC, CXX, and MAKE.
816 # Test C++ compiler features
820 TMPFILE
=`cmake_tmp_file`
822 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
824 int main() { std::cout << "This is GNU" << std::endl; return 0;}
827 cmake_cxx_compiler_is_gnu
=0
828 if cmake_try_run
"${cmake_cxx_compiler}" \
829 "${cmake_cxx_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log
2>&1; then
830 cmake_cxx_compiler_is_gnu
=1
832 if [ "x${cmake_cxx_compiler_is_gnu}" = "x1" ]; then
833 echo "${cmake_cxx_compiler} is GNU compiler"
835 echo "${cmake_cxx_compiler} is not GNU compiler"
837 rm -f "${TMPFILE}.cxx"
839 if [ "x${cmake_cxx_compiler_is_gnu}" != "x1" ]; then
840 # Check for non-GNU compiler flags
842 # If we are on IRIX, check for -LANG:std
843 cmake_test_flags
="-LANG:std"
844 if [ "x${cmake_system}" = "xIRIX64" ]; then
845 TMPFILE
=`cmake_tmp_file`
848 int main() { std::cout << "No need for '"${cmake_test_flags}"'" << std::endl; return 0;}
850 cmake_need_lang_std
=0
851 if cmake_try_run
"${cmake_cxx_compiler}" \
852 "${cmake_cxx_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log
2>&1; then
855 if cmake_try_run
"${cmake_cxx_compiler}" \
856 "${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log
2>&1; then
857 cmake_need_lang_std
=1
860 if [ "x${cmake_need_lang_std}" = "x1" ]; then
861 cmake_cxx_flags
="${cmake_cxx_flags} ${cmake_test_flags}"
862 echo "${cmake_cxx_compiler} needs ${cmake_test_flags}"
864 echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
866 rm -f "${TMPFILE}.cxx"
870 # If we are on OSF, check for -timplicit_local -no_implicit_include
871 cmake_test_flags
="-timplicit_local -no_implicit_include"
872 if [ "x${cmake_system}" = "xOSF1" ]; then
873 TMPFILE
=`cmake_tmp_file`
876 int main() { std::cout << "We need '"${cmake_test_flags}"'" << std::endl; return 0;}
879 if cmake_try_run
"${cmake_cxx_compiler}" \
880 "${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log
2>&1; then
885 if [ "x${cmake_need_flags}" = "x1" ]; then
886 cmake_cxx_flags
="${cmake_cxx_flags} ${cmake_test_flags}"
887 echo "${cmake_cxx_compiler} needs ${cmake_test_flags}"
889 echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
891 rm -f "${TMPFILE}.cxx"
895 # If we are on OSF, check for -std strict_ansi -nopure_cname
896 cmake_test_flags
="-std strict_ansi -nopure_cname"
897 if [ "x${cmake_system}" = "xOSF1" ]; then
898 TMPFILE
=`cmake_tmp_file`
901 int main() { std::cout << "We need '"${cmake_test_flags}"'" << std::endl; return 0;}
904 if cmake_try_run
"${cmake_cxx_compiler}" \
905 "${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log
2>&1; then
910 if [ "x${cmake_need_flags}" = "x1" ]; then
911 cmake_cxx_flags
="${cmake_cxx_flags} ${cmake_test_flags}"
912 echo "${cmake_cxx_compiler} needs ${cmake_test_flags}"
914 echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
916 rm -f "${TMPFILE}.cxx"
920 # If we are on HP-UX, check for -Ae for the C compiler.
921 cmake_test_flags
="-Ae"
922 if [ "x${cmake_system}" = "xHP-UX" ]; then
923 TMPFILE
=`cmake_tmp_file`
925 int main(int argc, char** argv) { (void)argc; (void)argv; return 0; }
928 if cmake_try_run
"${cmake_c_compiler}" "${cmake_c_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log
2>&1; then
931 if cmake_try_run
"${cmake_c_compiler}" \
932 "${cmake_c_flags} ${cmake_test_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log
2>&1; then
936 if [ "x${cmake_need_Ae}" = "x1" ]; then
937 cmake_c_flags
="${cmake_c_flags} ${cmake_test_flags}"
938 echo "${cmake_c_compiler} needs ${cmake_test_flags}"
940 echo "${cmake_c_compiler} does not need ${cmake_test_flags}"
947 # Test for kwsys features
948 KWSYS_NAME_IS_KWSYS
=0
950 KWSYS_LFS_AVAILABLE
=0
951 KWSYS_LFS_REQUESTED
=0
952 KWSYS_IOS_USE_STRSTREAM_H
=0
953 KWSYS_IOS_USE_STRSTREA_H
=0
955 KWSYS_IOS_USE_SSTREAM
=0
957 KWSYS_IOS_HAVE_BINARY
=0
959 KWSYS_STAT_HAS_ST_MTIM
=0
960 KWSYS_STL_STRING_HAVE_NEQ_CHAR
=0
961 KWSYS_STL_HAS_ITERATOR_TRAITS
=0
962 KWSYS_STL_HAS_ITERATOR_CATEGORY
=0
963 KWSYS_STL_HAS___ITERATOR_CATEGORY
=0
964 KWSYS_STL_HAS_ALLOCATOR_TEMPLATE
=0
965 KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE
=0
966 KWSYS_STL_HAS_ALLOCATOR_REBIND
=0
967 KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT
=0
968 KWSYS_STL_HAS_ALLOCATOR_OBJECTS
=0
969 KWSYS_CXX_HAS_CSTDDEF
=0
970 KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS
=0
971 KWSYS_CXX_HAS_MEMBER_TEMPLATES
=0
972 KWSYS_CXX_HAS_FULL_SPECIALIZATION
=0
973 KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP
=0
975 # Hardcode these kwsys features. They work on all known UNIX compilers anyway.
976 KWSYS_STL_STRING_HAVE_ISTREAM
=1
977 KWSYS_STL_STRING_HAVE_OSTREAM
=1
979 if cmake_try_run
"${cmake_cxx_compiler}" \
980 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAVE_STD" \
981 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
983 echo "${cmake_cxx_compiler} has STL in std:: namespace"
985 echo "${cmake_cxx_compiler} does not have STL in std:: namespace"
988 if cmake_try_run
"${cmake_cxx_compiler}" \
989 "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_ANSI" \
990 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
992 echo "${cmake_cxx_compiler} has ANSI streams"
994 echo "${cmake_cxx_compiler} does not have ANSI streams"
997 if [ "x$KWSYS_IOS_USE_ANSI" = "x1" ]; then
998 if cmake_try_run
"${cmake_cxx_compiler}" \
999 "${cmake_cxx_flags} -DTEST_KWSYS_IOS_HAVE_STD" \
1000 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1001 KWSYS_IOS_HAVE_STD
=1
1002 echo "${cmake_cxx_compiler} has streams in std:: namespace"
1004 echo "${cmake_cxx_compiler} does not have streams in std:: namespace"
1006 if cmake_try_run
"${cmake_cxx_compiler}" \
1007 "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_SSTREAM" \
1008 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1009 KWSYS_IOS_USE_SSTREAM
=1
1010 echo "${cmake_cxx_compiler} has sstream"
1012 echo "${cmake_cxx_compiler} does not have sstream"
1016 if [ "x$KWSYS_IOS_USE_SSTREAM" = "x0" ]; then
1017 if cmake_try_run
"${cmake_cxx_compiler}" \
1018 "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_STRSTREAM_H" \
1019 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1020 KWSYS_IOS_USE_STRSTREAM_H
=1
1021 echo "${cmake_cxx_compiler} has strstream.h"
1023 echo "${cmake_cxx_compiler} does not have strstream.h"
1025 if [ "x$KWSYS_IOS_USE_STRSTREAM_H" = "x0" ]; then
1026 if cmake_try_run
"${cmake_cxx_compiler}" \
1027 "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_STRSTREA_H" \
1028 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1029 KWSYS_IOS_USE_STRSTREA_H
=1
1030 echo "${cmake_cxx_compiler} has strstrea.h"
1032 echo "${cmake_cxx_compiler} does not have strstrea.h"
1037 if cmake_try_run
"${cmake_cxx_compiler}" \
1038 "${cmake_cxx_flags} -DTEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1039 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1040 KWSYS_STL_STRING_HAVE_NEQ_CHAR
=1
1041 echo "${cmake_cxx_compiler} has operator!=(string, char*)"
1043 echo "${cmake_cxx_compiler} does not have operator!=(string, char*)"
1046 if cmake_try_run
"${cmake_cxx_compiler}" \
1047 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ITERATOR_TRAITS -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1048 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1049 KWSYS_STL_HAS_ITERATOR_TRAITS
=1
1050 echo "${cmake_cxx_compiler} has stl iterator_traits"
1052 echo "${cmake_cxx_compiler} does not have stl iterator_traits"
1055 if [ "x${KWSYS_STL_HAS_ITERATOR_TRAITS}" = "x0" ]; then
1056 if cmake_try_run
"${cmake_cxx_compiler}" \
1057 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ITERATOR_CATEGORY -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1058 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1059 KWSYS_STL_HAS_ITERATOR_CATEGORY
=1
1060 echo "${cmake_cxx_compiler} has old iterator_category"
1062 echo "${cmake_cxx_compiler} does not have old iterator_category"
1064 if [ "x${KWSYS_STL_HAS_ITERATOR_CATEGORY}" = "x0" ]; then
1065 if cmake_try_run
"${cmake_cxx_compiler}" \
1066 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS___ITERATOR_CATEGORY -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1067 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1068 KWSYS_STL_HAS___ITERATOR_CATEGORY
=1
1069 echo "${cmake_cxx_compiler} has old __iterator_category"
1071 echo "${cmake_cxx_compiler} does not have old __iterator_category"
1076 if cmake_try_run
"${cmake_cxx_compiler}" \
1077 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1078 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1079 KWSYS_STL_HAS_ALLOCATOR_TEMPLATE
=1
1080 echo "${cmake_cxx_compiler} has standard template allocator"
1082 echo "${cmake_cxx_compiler} does not have standard template allocator"
1085 if [ "x${KWSYS_STL_HAS_ALLOCATOR_TEMPLATE}" = "x1" ]; then
1086 if cmake_try_run
"${cmake_cxx_compiler}" \
1087 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_REBIND -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1088 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1089 KWSYS_STL_HAS_ALLOCATOR_REBIND
=1
1090 echo "${cmake_cxx_compiler} has allocator<>::rebind<>"
1092 echo "${cmake_cxx_compiler} does not have allocator<>::rebind<>"
1095 if cmake_try_run
"${cmake_cxx_compiler}" \
1096 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1097 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1098 KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT
=1
1099 echo "${cmake_cxx_compiler} has non-standard allocator<>::max_size argument"
1101 echo "${cmake_cxx_compiler} does not have non-standard allocator<>::max_size argument"
1104 if cmake_try_run
"${cmake_cxx_compiler}" \
1105 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1106 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1107 KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE
=1
1108 echo "${cmake_cxx_compiler} has old non-template allocator"
1110 echo "${cmake_cxx_compiler} does not have old non-template allocator"
1114 if cmake_try_run
"${cmake_cxx_compiler}" \
1115 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1116 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1117 KWSYS_STL_HAS_ALLOCATOR_OBJECTS
=1
1118 echo "${cmake_cxx_compiler} has stl containers supporting allocator objects"
1120 echo "${cmake_cxx_compiler} does not have stl containers supporting allocator objects"
1123 if cmake_try_run
"${cmake_cxx_compiler}" \
1124 "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_CSTDDEF" \
1125 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1126 KWSYS_CXX_HAS_CSTDDEF
=1
1127 echo "${cmake_cxx_compiler} has header cstddef"
1129 echo "${cmake_cxx_compiler} does not have header cstddef"
1132 if cmake_try_run
"${cmake_cxx_compiler}" \
1133 "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS" \
1134 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1135 echo "${cmake_cxx_compiler} does not require template friends to use <>"
1137 KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS
=1
1138 echo "${cmake_cxx_compiler} requires template friends to use <>"
1141 if cmake_try_run
"${cmake_cxx_compiler}" \
1142 "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES" \
1143 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1144 KWSYS_CXX_HAS_MEMBER_TEMPLATES
=1
1145 echo "${cmake_cxx_compiler} supports member templates"
1147 echo "${cmake_cxx_compiler} does not support member templates"
1150 if cmake_try_run
"${cmake_cxx_compiler}" \
1151 "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION" \
1152 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1153 KWSYS_CXX_HAS_FULL_SPECIALIZATION
=1
1154 echo "${cmake_cxx_compiler} has standard template specialization syntax"
1156 echo "${cmake_cxx_compiler} does not have standard template specialization syntax"
1159 if cmake_try_run
"${cmake_cxx_compiler}" \
1160 "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP" \
1161 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1162 KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP
=1
1163 echo "${cmake_cxx_compiler} has argument dependent lookup"
1165 echo "${cmake_cxx_compiler} does not have argument dependent lookup"
1168 if cmake_try_run
"${cmake_cxx_compiler}" \
1169 "${cmake_cxx_flags} -DTEST_KWSYS_STAT_HAS_ST_MTIM" \
1170 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1171 KWSYS_STAT_HAS_ST_MTIM
=1
1172 echo "${cmake_cxx_compiler} has struct stat with st_mtim member"
1174 echo "${cmake_cxx_compiler} does not have struct stat with st_mtim member"
1177 if cmake_try_run
"${cmake_cxx_compiler}" \
1178 "${cmake_cxx_flags} -DTEST_KWSYS_IOS_HAVE_BINARY -DKWSYS_IOS_USE_ANSI=${KWSYS_IOS_USE_ANSI} -DKWSYS_IOS_HAVE_STD=${KWSYS_IOS_HAVE_STD}" \
1179 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1180 KWSYS_IOS_HAVE_BINARY
=1
1181 echo "${cmake_cxx_compiler} has ios::binary openmode"
1183 echo "${cmake_cxx_compiler} does not have ios::binary openmode"
1186 # Just to be safe, let us store compiler and flags to the header file
1188 cmake_bootstrap_version
='$Revision: 1.125 $'
1189 cmake_compiler_settings_comment
="/*
1190 * Generated by ${cmake_source_dir}/bootstrap
1191 * Version: ${cmake_bootstrap_version}
1193 * Source directory: ${cmake_source_dir}
1194 * Binary directory: ${cmake_bootstrap_dir}
1196 * C compiler: ${cmake_c_compiler}
1197 * C flags: ${cmake_c_flags}
1199 * C++ compiler: ${cmake_cxx_compiler}
1200 * C++ flags: ${cmake_cxx_flags}
1202 * Make: ${cmake_make_processor}
1205 * ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES}
1207 * ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES} ${KWSYS_C_MINGW_SOURCES}
1211 cmake_report cmConfigure.h
${_tmp} "${cmake_compiler_settings_comment}"
1213 if [ "x$KWSYS_STL_HAVE_STD" = "x1" ]; then
1214 cmake_report cmConfigure.h
${_tmp} "/* #undef CMAKE_NO_STD_NAMESPACE */"
1216 cmake_report cmConfigure.h
${_tmp} "#define CMAKE_NO_STD_NAMESPACE 1"
1219 if [ "x$KWSYS_IOS_USE_ANSI" = "x1" ]; then
1220 cmake_report cmConfigure.h
${_tmp} "/* #undef CMAKE_NO_ANSI_STREAM_HEADERS */"
1222 cmake_report cmConfigure.h
${_tmp} "#define CMAKE_NO_ANSI_STREAM_HEADERS 1"
1225 if [ "x$KWSYS_IOS_USE_SSTREAM" = "x1" ]; then
1226 cmake_report cmConfigure.h
${_tmp} "/* #undef CMAKE_NO_ANSI_STRING_STREAM */"
1228 cmake_report cmConfigure.h
${_tmp} "#define CMAKE_NO_ANSI_STRING_STREAM 1"
1231 # Test for ansi FOR scope
1232 if cmake_try_run
"${cmake_cxx_compiler}" \
1233 "${cmake_cxx_flags}" \
1234 "${cmake_source_dir}/Modules/TestForAnsiForScope.cxx" >> cmake_bootstrap.log
2>&1; then
1235 cmake_report cmConfigure.h
${_tmp} "/* #undef CMAKE_NO_ANSI_FOR_SCOPE */"
1236 echo "${cmake_cxx_compiler} has ANSI for scoping"
1238 cmake_report cmConfigure.h
${_tmp} "#define CMAKE_NO_ANSI_FOR_SCOPE 1"
1239 echo "${cmake_cxx_compiler} does not have ANSI for scoping"
1242 # When bootstrapping on MinGW with MSYS we must convert the source
1243 # directory to a windows path.
1244 if ${cmake_system_mingw}; then
1245 cmake_root_dir
=`cd "${cmake_source_dir}"; pwd -W`
1247 cmake_root_dir
="${cmake_source_dir}"
1250 # Write CMake version
1251 cmake_report cmVersionConfig.h
${_tmp} "#define CMake_VERSION_MAJOR ${cmake_version_major}"
1252 cmake_report cmVersionConfig.h
${_tmp} "#define CMake_VERSION_MINOR ${cmake_version_minor}"
1253 cmake_report cmVersionConfig.h
${_tmp} "#define CMake_VERSION_PATCH ${cmake_version_patch}"
1254 cmake_report cmConfigure.h
${_tmp} "#define CMAKE_ROOT_DIR \"${cmake_root_dir}\""
1255 cmake_report cmConfigure.h
${_tmp} "#define CMAKE_DATA_DIR \"${cmake_data_dir}\""
1256 cmake_report cmConfigure.h
${_tmp} "#define CMAKE_BOOTSTRAP"
1258 # Regenerate configured headers
1259 for h
in Configure VersionConfig
; do
1260 if "${_diff}" cm${h}.h cm${h}.h${_tmp} > /dev/null 2> /dev/null; then
1261 rm -f cm${h}.h${_tmp}
1263 mv -f cm${h}.h${_tmp} cm${h}.h
1268 cmake_kwsys_config_replace_string \
1269 "${cmake_source_dir}/Source
/kwsys
/Configure.hxx.
in" \
1270 "${cmake_bootstrap_dir}/cmsys
/Configure.hxx
" \
1271 "${cmake_compiler_settings_comment}"
1272 cmake_kwsys_config_replace_string \
1273 "${cmake_source_dir}/Source
/kwsys
/Configure.h.
in" \
1274 "${cmake_bootstrap_dir}/cmsys
/Configure.h
" \
1275 "${cmake_compiler_settings_comment}"
1277 for a in ${KWSYS_FILES}; do
1278 cmake_replace_string "${cmake_source_dir}/Source
/kwsys
/${a}.
in" \
1279 "${cmake_bootstrap_dir}/cmsys
/${a}" KWSYS_NAMESPACE cmsys
1282 for a in ${KWSYS_IOS_FILES}; do
1283 cmake_replace_string "${cmake_source_dir}/Source
/kwsys
/kwsys_ios_
${a}.h.
in" \
1284 "${cmake_bootstrap_dir}/cmsys
/ios
/${a}" KWSYS_NAMESPACE cmsys
1287 cmake_replace_string "${cmake_source_dir}/Source
/kwsys
/kwsys_stl.hxx.
in" \
1288 "${cmake_bootstrap_dir}/cmsys
/stl
/stl.hxx_a
" KWSYS_STL_HEADER_EXTRA ""
1290 cmake_replace_string "${cmake_bootstrap_dir}/cmsys
/stl
/stl.hxx_a
" \
1291 "${cmake_bootstrap_dir}/cmsys
/stl
/stl.hxx_b
" KWSYS_NAMESPACE cmsys
1293 for a in string vector map algorithm; do
1294 cmake_replace_string "${cmake_bootstrap_dir}/cmsys
/stl
/stl.hxx_b
" \
1295 "${cmake_bootstrap_dir}/cmsys/stl/${a}" KWSYS_STL_HEADER ${a}
1299 dep
="cmConfigure.h cmsys/*.hxx cmsys/*.h `cmake_escape \"${cmake_source_dir}\"`/Source/*.h"
1301 for a
in ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES} ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES} ${KWSYS_C_GENERATED_SOURCES}; do
1302 objs
="${objs} ${a}.o"
1305 # Generate dependencies for cmBootstrapCommands.cxx
1306 for file in `grep "#include.*cm[^.]*.cxx" "${cmake_source_dir}/Source/cmBootstrapCommands.cxx" | sed "s/.* \"\(.*\)\"/\1/"`; do
1307 cmBootstrapCommandsDeps
="${cmBootstrapCommandsDeps} `cmake_escape "${cmake_source_dir}/Source
/$file"`"
1309 cmBootstrapCommandsDeps
=`echo $cmBootstrapCommandsDeps`
1311 if [ "x${cmake_ansi_cxx_flags}" != "x" ]; then
1312 cmake_cxx_flags
="${cmake_ansi_cxx_flags} ${cmake_cxx_flags}"
1315 if [ "x${cmake_c_flags}" != "x" ]; then
1316 cmake_c_flags
="${cmake_c_flags} "
1319 if [ "x${cmake_cxx_flags}" != "x" ]; then
1320 cmake_cxx_flags
="${cmake_cxx_flags} "
1323 cmake_c_flags_String
="-DKWSYS_STRING_C"
1324 cmake_c_flags
="${cmake_c_flags}-I`cmake_escape \"${cmake_source_dir}/Source\"` \
1325 -I`cmake_escape \"${cmake_bootstrap_dir}\"`"
1326 cmake_cxx_flags
="${cmake_cxx_flags}-I`cmake_escape \"${cmake_source_dir}/Source\"` \
1327 -I`cmake_escape \"${cmake_bootstrap_dir}\"`"
1328 echo "cmake: ${objs}" > "${cmake_bootstrap_dir}/Makefile"
1329 echo " ${cmake_cxx_compiler} ${cmake_ld_flags} ${cmake_cxx_flags} ${objs} -o cmake" >> "${cmake_bootstrap_dir}/Makefile"
1330 for a
in ${CMAKE_CXX_SOURCES}; do
1331 src
=`cmake_escape "${cmake_source_dir}/Source/${a}.cxx"`
1332 echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
1333 echo " ${cmake_cxx_compiler} ${cmake_cxx_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
1335 echo "cmBootstrapCommands.o : $cmBootstrapCommandsDeps" >> "${cmake_bootstrap_dir}/Makefile"
1336 for a
in ${CMAKE_C_SOURCES}; do
1337 src
=`cmake_escape "${cmake_source_dir}/Source/${a}.c"`
1338 echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
1339 echo " ${cmake_c_compiler} ${cmake_c_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
1341 for a
in ${KWSYS_C_SOURCES} ${KWSYS_C_MINGW_SOURCES}; do
1342 src
=`cmake_escape "${cmake_source_dir}/Source/kwsys/${a}.c"`
1343 src_flags
=`eval echo \\${cmake_c_flags_\${a}}`
1344 echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
1345 echo " ${cmake_c_compiler} ${cmake_c_flags} -DKWSYS_NAMESPACE=cmsys ${src_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
1347 for a
in ${KWSYS_CXX_SOURCES}; do
1348 src
=`cmake_escape "${cmake_source_dir}/Source/kwsys/${a}.cxx"`
1349 echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
1350 echo " ${cmake_cxx_compiler} ${cmake_cxx_flags} -DKWSYS_NAMESPACE=cmsys -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
1352 if ${cmake_system_mingw}; then
1353 src
=`cmake_escape "${cmake_bootstrap_dir}/cmsysProcessFwd9xEnc.c"`
1354 in=`cmake_escape "${cmake_bootstrap_dir}/cmsysProcessFwd9x.exe"`
1355 cmd
=`cmake_escape "${cmake_bootstrap_dir}/cmsysEncodeExecutable.exe"`
1356 a
="cmsysProcessFwd9xEnc"
1357 echo "${cmd} : EncodeExecutable.o" >> "${cmake_bootstrap_dir}/Makefile"
1358 echo " ${cmake_c_compiler} ${cmake_ld_flags} ${cmake_c_flags} EncodeExecutable.o -o ${cmd}" >> "${cmake_bootstrap_dir}/Makefile"
1359 echo "${in} : ProcessFwd9x.o" >> "${cmake_bootstrap_dir}/Makefile"
1360 echo " ${cmake_c_compiler} ${cmake_ld_flags} ${cmake_c_flags} ProcessFwd9x.o -o ${in}" >> "${cmake_bootstrap_dir}/Makefile"
1361 echo "${src} : ${cmd} ${in}" >> "${cmake_bootstrap_dir}/Makefile"
1362 echo " ${cmd} ${in} ${src} cmsys ProcessFwd9x" >> "${cmake_bootstrap_dir}/Makefile"
1363 echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
1364 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"
1368 cd "${cmake_binary_dir}" && "${cmake_source_dir}/bootstrap"
1369 ' >> "${cmake_bootstrap_dir}/Makefile"
1371 # Write our default settings to Bootstrap${_cmk}/InitialCacheFlags.cmake.
1373 # Generated by '"${cmake_source_dir}"'/bootstrap
1374 # Default cmake settings. These may be overridden any settings below.
1375 SET (CMAKE_INSTALL_PREFIX "'"${cmake_prefix_dir}"'" CACHE PATH "Install path prefix, prepended onto install directories." FORCE)
1376 SET (CMAKE_DOC_DIR "'"${cmake_doc_dir}"'" CACHE PATH "Install location for documentation (relative to prefix)." FORCE)
1377 SET (CMAKE_MAN_DIR "'"${cmake_man_dir}"'" CACHE PATH "Install location for man pages (relative to prefix)." FORCE)
1378 SET (CMAKE_DATA_DIR "'"${cmake_data_dir}"'" CACHE PATH "Install location for data (relative to prefix)." FORCE)
1379 ' > "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
1381 # Add configuration settings given as command-line options.
1382 if [ "x${cmake_bootstrap_qt_gui}" != "x" ]; then
1384 SET (BUILD_QtDialog '"${cmake_bootstrap_qt_gui}"' CACHE BOOL "Build Qt dialog for CMake" FORCE)
1385 ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
1387 if [ "x${cmake_bootstrap_qt_qmake}" != "x" ]; then
1389 SET (QT_QMAKE_EXECUTABLE "'"${cmake_bootstrap_qt_qmake}"'" CACHE FILEPATH "Location of Qt qmake" FORCE)
1390 ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
1393 # Add user-specified settings. Handle relative-path case for
1394 # specification of cmake_init_file.
1396 cd "${cmake_binary_dir}"
1397 if [ -f "${cmake_init_file}" ]; then
1398 cat "${cmake_init_file}" >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
1402 echo "---------------------------------------------"
1404 # Run make to build bootstrap cmake
1405 if [ "x${cmake_parallel_make}" != "x" ]; then
1406 ${cmake_make_processor} ${cmake_make_flags}
1408 ${cmake_make_processor}
1411 if [ "${RES}" -ne "0" ]; then
1412 cmake_error
9 "Problem while running ${cmake_make_processor}"
1414 cd "${cmake_binary_dir}"
1416 # Set C, CXX, and MAKE environment variables, so that real real cmake will be
1417 # build with same compiler and make
1418 CC
="${cmake_c_compiler}"
1419 CXX
="${cmake_cxx_compiler}"
1420 MAKE
="${cmake_make_processor}"
1425 # Run bootstrap CMake to configure real CMake
1426 "${cmake_bootstrap_dir}/cmake" "${cmake_source_dir}" "-C${cmake_bootstrap_dir}/InitialCacheFlags.cmake" "-G${cmake_bootstrap_generator}" ${cmake_bootstrap_system_libs}
1428 if [ "${RES}" -ne "0" ]; then
1429 cmake_error 11 "Problem
while running initial CMake
"
1432 echo "---------------------------------------------"
1434 # And we are done. Now just run make
1435 echo "CMake has bootstrapped. Now run
${cmake_make_processor}.
"