3 #=========================================================================
5 # Program: CMake - Cross-Platform Makefile Generator
6 # Module: $RCSfile: bootstrap,v $
7 # Language: Bourne Shell
8 # Date: $Date: 2008-02-13 19:47:03 $
9 # Version: $Revision: 1.109 $
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_bootstrap_dir
="${cmake_binary_dir}/Bootstrap.cmk"
41 cmake_version_major
="`cmake_version_component MAJOR`"
42 cmake_version_minor
="`cmake_version_component MINOR`"
43 cmake_version_patch
="`cmake_version_component PATCH`"
44 cmake_version
="${cmake_version_major}.${cmake_version_minor}"
45 cmake_version_full
="${cmake_version_major}.${cmake_version_minor}.${cmake_version_patch}"
46 cmake_date_stamp
="`cmake_date_stamp_component YEAR``cmake_date_stamp_component MONTH``cmake_date_stamp_component DAY`"
47 cmake_data_dir
="/share/cmake-${cmake_version}"
48 cmake_doc_dir
="/doc/cmake-${cmake_version}"
51 cmake_bootstrap_system_libs
=""
52 cmake_bootstrap_qt_gui
=""
53 cmake_bootstrap_qt_qmake
=""
55 # Determine whether this is a MinGW environment.
56 if echo "${cmake_system}" |
grep MINGW
>/dev
/null
2>&1; then
57 cmake_system_mingw
=true
59 cmake_system_mingw
=false
62 # Determine whether this is OS X
63 if echo "${cmake_system}" |
grep Darwin
>/dev
/null
2>&1; then
64 cmake_system_darwin
=true
66 cmake_system_darwin
=false
69 # Determine whether this is BeOS
70 if echo "${cmake_system}" |
grep BeOS
>/dev
/null
2>&1; then
71 cmake_system_beos
=true
73 cmake_system_beos
=false
76 # Choose the generator to use for bootstrapping.
77 if ${cmake_system_mingw}; then
78 # Bootstrapping from an MSYS prompt.
79 cmake_bootstrap_generator
="MSYS Makefiles"
81 # Bootstrapping from a standard UNIX prompt.
82 cmake_bootstrap_generator
="Unix Makefiles"
85 # Helper function to fix windows paths.
88 echo "$1" |
sed 's/\\/\//g'
91 # Choose the default install prefix.
92 if ${cmake_system_mingw}; then
93 if [ "x${PROGRAMFILES}" != "x" ]; then
94 cmake_default_prefix
=`cmake_fix_slashes "${PROGRAMFILES}/CMake"`
95 elif [ "x${ProgramFiles}" != "x" ]; then
96 cmake_default_prefix
=`cmake_fix_slashes "${ProgramFiles}/CMake"`
97 elif [ "x${SYSTEMDRIVE}" != "x" ]; then
98 cmake_default_prefix
=`cmake_fix_slashes "${SYSTEMDRIVE}/Program Files/CMake"`
99 elif [ "x${SystemDrive}" != "x" ]; then
100 cmake_default_prefix
=`cmake_fix_slashes "${SystemDrive}/Program Files/CMake"`
102 cmake_default_prefix
="c:/Program Files/CMake"
105 cmake_default_prefix
="/usr/local"
108 CMAKE_KNOWN_C_COMPILERS
="cc gcc xlc icc tcc"
109 CMAKE_KNOWN_CXX_COMPILERS
="aCC xlC CC g++ c++ icc como "
110 CMAKE_KNOWN_MAKE_PROCESSORS
="gmake make"
112 CMAKE_PROBLEMATIC_FILES
="\
115 CMakeCCompiler.cmake \
116 CMakeCXXCompiler.cmake \
117 Source/cmConfigure.h \
118 Source/CTest/Curl/config.h \
119 Utilities/cmexpat/expatConfig.h \
120 Utilities/cmexpat/expatDllConfig.h \
123 CMAKE_UNUSED_SOURCES
="\
124 cmGlobalXCodeGenerator \
125 cmLocalXCodeGenerator \
135 cmCommandArgumentLexer \
136 cmCommandArgumentParser \
137 cmCommandArgumentParserHelper \
142 cmPropertyDefinition \
143 cmPropertyDefinitionMap \
146 cmGeneratedFileStream \
150 cmInstallFilesGenerator \
151 cmInstallScriptGenerator \
152 cmInstallTargetGenerator \
154 cmSourceFileLocation \
157 cmFileTimeComparison \
158 cmGlobalUnixMakefileGenerator3 \
159 cmLocalUnixMakefileGenerator3 \
160 cmMakefileExecutableTargetGenerator \
161 cmMakefileLibraryTargetGenerator \
162 cmMakefileTargetGenerator \
163 cmMakefileUtilityTargetGenerator \
164 cmBootstrapCommands \
169 cmDocumentVariables \
172 cmComputeLinkDepends \
173 cmComputeLinkInformation \
174 cmOrderRuntimeDirectories \
175 cmComputeTargetDepends \
176 cmComputeComponentGraph \
182 if ${cmake_system_mingw}; then
183 CMAKE_CXX_SOURCES
="${CMAKE_CXX_SOURCES}\
184 cmGlobalMSYSMakefileGenerator \
185 cmGlobalMinGWMakefileGenerator \
186 cmWin32ProcessExecution"
193 if ${cmake_system_mingw}; then
198 KWSYS_C_MINGW_SOURCES
="\
201 KWSYS_C_GENERATED_SOURCES
="\
202 cmsysProcessFwd9xEnc"
208 KWSYS_C_MINGW_SOURCES
=""
209 KWSYS_C_GENERATED_SOURCES
=""
223 RegularExpression.hxx \
235 # Display CMake bootstrap usage
240 Options: [defaults in brackets after descriptions]
242 --help print this message
243 --version only print version information
244 --verbose display more information
245 --parallel=n bootstrap cmake in parallel, where n is
247 --init=FILE use FILE for cmake initialization
248 --system-libs use system-installed third-party libraries
249 (for use only by package maintainers)
250 --no-system-libs use cmake-provided third-party libraries
252 --qt-gui build the Qt-based GUI (requires Qt >= 4.2)
253 --no-qt-gui do not build the Qt-based GUI (default)
254 --qt-qmake=<qmake> use <qmake> as the qmake executable to find Qt
256 Directory and file names:
257 --prefix=PREFIX install files in tree rooted at PREFIX
258 [${cmake_default_prefix}]
259 --datadir=DIR install data files in PREFIX/DIR
261 --docdir=DIR install documentation files in PREFIX/DIR
263 --mandir=DIR install man pages files in PREFIX/DIR/manN
269 # Display CMake bootstrap usage
270 cmake_version_display
()
274 if echo "${cmake_version_full}" |
grep "[0-9]\.[0-9]*[13579]\.[0-9]" > /dev
/null
2>&1; then
275 version
="${cmake_version}-${cmake_date_stamp}"
277 version
="${cmake_version}-${cmake_version_patch}"
279 echo "CMake ${version}, Copyright (c) 2007 Kitware, Inc., Insight Consortium"
283 # Display CMake bootstrap error, display the log file and exit
288 echo "---------------------------------------------"
289 echo "Error when bootstrapping CMake:"
291 echo "---------------------------------------------"
292 if [ -f cmake_bootstrap.log
]; then
293 echo "Log of errors: `pwd`/cmake_bootstrap.log"
294 #cat cmake_bootstrap.log
295 echo "---------------------------------------------"
300 # Replace KWSYS_NAMESPACE with cmsys
301 cmake_replace_string
()
307 if [ -f "${INFILE}" ]; then
309 sed "s/\@${SEARCHFOR}\@/${REPLACEWITH}/g" > "${OUTFILE}.tmp"
310 if [ -f "${OUTFILE}.tmp" ]; then
311 if diff "${OUTFILE}" "${OUTFILE}.tmp" > /dev
/null
2> /dev
/null
; then
312 #echo "Files are the same"
313 rm -f "${OUTFILE}.tmp"
315 mv -f "${OUTFILE}.tmp" "${OUTFILE}"
319 cmake_error
1 "Cannot find file ${INFILE}"
323 cmake_kwsys_config_replace_string
()
329 if [ -f "${INFILE}" ]; then
330 echo "${APPEND}" > "${OUTFILE}.tmp"
332 sed "/./ {s/\@KWSYS_NAMESPACE\@/cmsys/g;
333 s/@KWSYS_BUILD_SHARED@/${KWSYS_BUILD_SHARED}/g;
334 s/@KWSYS_LFS_AVAILABLE@/${KWSYS_LFS_AVAILABLE}/g;
335 s/@KWSYS_LFS_REQUESTED@/${KWSYS_LFS_REQUESTED}/g;
336 s/@KWSYS_NAME_IS_KWSYS@/${KWSYS_NAME_IS_KWSYS}/g;
337 s/@KWSYS_IOS_USE_ANSI@/${KWSYS_IOS_USE_ANSI}/g;
338 s/@KWSYS_IOS_HAVE_STD@/${KWSYS_IOS_HAVE_STD}/g;
339 s/@KWSYS_IOS_USE_SSTREAM@/${KWSYS_IOS_USE_SSTREAM}/g;
340 s/@KWSYS_IOS_USE_STRSTREAM_H@/${KWSYS_IOS_USE_STRSTREAM_H}/g;
341 s/@KWSYS_IOS_USE_STRSTREA_H@/${KWSYS_IOS_USE_STRSTREA_H}/g;
342 s/@KWSYS_STL_HAVE_STD@/${KWSYS_STL_HAVE_STD}/g;
343 s/@KWSYS_STL_STRING_HAVE_ISTREAM@/${KWSYS_STL_STRING_HAVE_ISTREAM}/g;
344 s/@KWSYS_STL_STRING_HAVE_OSTREAM@/${KWSYS_STL_STRING_HAVE_OSTREAM}/g;
345 s/@KWSYS_STL_STRING_HAVE_NEQ_CHAR@/${KWSYS_STL_STRING_HAVE_NEQ_CHAR}/g;
346 s/@KWSYS_STL_HAS_ITERATOR_TRAITS@/${KWSYS_STL_HAS_ITERATOR_TRAITS}/g;
347 s/@KWSYS_STL_HAS_ITERATOR_CATEGORY@/${KWSYS_STL_HAS_ITERATOR_CATEGORY}/g;
348 s/@KWSYS_STL_HAS___ITERATOR_CATEGORY@/${KWSYS_STL_HAS___ITERATOR_CATEGORY}/g;
349 s/@KWSYS_STL_HAS_ALLOCATOR_TEMPLATE@/${KWSYS_STL_HAS_ALLOCATOR_TEMPLATE}/g;
350 s/@KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE@/${KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE}/g;
351 s/@KWSYS_STL_HAS_ALLOCATOR_REBIND@/${KWSYS_STL_HAS_ALLOCATOR_REBIND}/g;
352 s/@KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT@/${KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT}/g;
353 s/@KWSYS_STL_HAS_ALLOCATOR_OBJECTS@/${KWSYS_STL_HAS_ALLOCATOR_OBJECTS}/g;
354 s/@KWSYS_CXX_HAS_CSTDDEF@/${KWSYS_CXX_HAS_CSTDDEF}/g;
355 s/@KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS@/${KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS}/g;
356 s/@KWSYS_CXX_HAS_MEMBER_TEMPLATES@/${KWSYS_CXX_HAS_MEMBER_TEMPLATES}/g;
357 s/@KWSYS_CXX_HAS_FULL_SPECIALIZATION@/${KWSYS_CXX_HAS_FULL_SPECIALIZATION}/g;
358 s/@KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP@/${KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP}/g;
359 s/@KWSYS_STAT_HAS_ST_MTIM@/${KWSYS_STAT_HAS_ST_MTIM}/g;}" >> "${OUTFILE}.tmp"
360 if [ -f "${OUTFILE}.tmp" ]; then
361 if diff "${OUTFILE}" "${OUTFILE}.tmp" > /dev
/null
2> /dev
/null
; then
362 #echo "Files are the same"
363 rm -f "${OUTFILE}.tmp"
365 mv -f "${OUTFILE}.tmp" "${OUTFILE}"
369 cmake_error
2 "Cannot find file ${INFILE}"
372 # Write string into a file
380 # Escape spaces in strings
383 echo $1 |
sed "s/ /\\\\ /g"
386 # Write message to the log
389 echo "$*" >> cmake_bootstrap.log
395 echo "cmake_bootstrap_$$.test"
398 # Run a compiler test. First argument is compiler, second one are compiler
399 # flags, third one is test source file to be compiled
405 if [ ! -f "${TESTFILE}" ]; then
406 echo "Test file ${TESTFILE} missing. Please verify your CMake source tree."
409 TMPFILE
=`cmake_tmp_file`
410 echo "Try: ${COMPILER}"
411 echo "Line: ${COMPILER} ${FLAGS} ${TESTFILE} -o ${TMPFILE}"
412 echo "---------- file -----------------------"
414 echo "------------------------------------------"
415 "${COMPILER}" ${FLAGS} "${TESTFILE}" -o "${TMPFILE}"
417 if [ "${RES}" -ne "0" ]; then
418 echo "Test failed to compile"
421 if [ ! -f "${TMPFILE}" ] && [ ! -f "${TMPFILE}.exe" ]; then
422 echo "Test failed to produce executable"
428 if [ "${RES}" -ne "0" ]; then
429 echo "Test produced non-zero return code"
436 # Run a make test. First argument is the make interpreter.
441 echo "Try: ${MAKE_PROC}"
442 "${MAKE_PROC}" ${MAKE_FLAGS}
444 if [ "${RES}" -ne "0" ]; then
445 echo "${MAKE_PROC} does not work"
448 if [ ! -f "test" ] && [ ! -f "test.exe" ]; then
449 echo "${COMPILER} does not produce output"
455 if [ "${RES}" -ne "0" ]; then
456 echo "${MAKE_PROC} produces strange executable"
459 echo "${MAKE_PROC} works"
466 cmake_prefix_dir
="${cmake_default_prefix}"
468 if echo $a |
grep "^--prefix=" > /dev
/null
2> /dev
/null
; then
469 cmake_prefix_dir
=`echo $a | sed "s/^--prefix=//"`
470 cmake_prefix_dir
=`cmake_fix_slashes "${cmake_prefix_dir}"`
472 if echo $a |
grep "^--parallel=" > /dev
/null
2> /dev
/null
; then
473 cmake_parallel_make
=`echo $a | sed "s/^--parallel=//" | grep "[0-9][0-9]*"`
475 if echo $a |
grep "^--datadir=" > /dev
/null
2> /dev
/null
; then
476 cmake_data_dir
=`echo $a | sed "s/^--datadir=//"`
478 if echo $a |
grep "^--docdir=" > /dev
/null
2> /dev
/null
; then
479 cmake_doc_dir
=`echo $a | sed "s/^--docdir=//"`
481 if echo $a |
grep "^--mandir=" > /dev
/null
2> /dev
/null
; then
482 cmake_man_dir
=`echo $a | sed "s/^--mandir=//"`
484 if echo $a |
grep "^--init=" > /dev
/null
2> /dev
/null
; then
485 cmake_init_file
=`echo $a | sed "s/^--init=//"`
487 if echo $a |
grep "^--system-libs" > /dev
/null
2> /dev
/null
; then
488 cmake_bootstrap_system_libs
="-DCMAKE_USE_SYSTEM_LIBRARIES=1"
490 if echo $a |
grep "^--no-system-libs" > /dev
/null
2> /dev
/null
; then
491 cmake_bootstrap_system_libs
="-DCMAKE_USE_SYSTEM_LIBRARIES=0"
493 if echo $a |
grep "^--qt-gui" > /dev
/null
2> /dev
/null
; then
494 cmake_bootstrap_qt_gui
="1"
496 if echo $a |
grep "^--no-qt-gui" > /dev
/null
2> /dev
/null
; then
497 cmake_bootstrap_qt_gui
="0"
499 if echo $a |
grep "^--qt-qmake=" > /dev
/null
2> /dev
/null
; then
500 cmake_bootstrap_qt_qmake
=`echo $a | sed "s/^--qt-qmake=//"`
502 if echo $a |
grep "^--help" > /dev
/null
2> /dev
/null
; then
505 if echo $a |
grep "^--version" > /dev
/null
2> /dev
/null
; then
506 cmake_version_display
509 if echo $a |
grep "^--verbose" > /dev
/null
2> /dev
/null
; then
514 # If verbose, display some information about bootstrap
515 if [ -n "${cmake_verbose}" ]; then
516 echo "---------------------------------------------"
517 echo "Source directory: ${cmake_source_dir}"
518 echo "Binary directory: ${cmake_binary_dir}"
519 echo "Prefix directory: ${cmake_prefix_dir}"
520 echo "System: ${cmake_system}"
521 if [ "x${cmake_parallel_make}" != "x" ]; then
522 echo "Doing parallel make: ${cmake_parallel_make}"
527 echo "---------------------------------------------"
529 echo "`cmake_version_display`"
531 # Check for in-source build
532 cmake_in_source_build
=
533 if [ -f "${cmake_binary_dir}/Source/cmake.cxx" -a \
534 -f "${cmake_binary_dir}/Source/cmake.h" ]; then
535 if [ -n "${cmake_verbose}" ]; then
536 echo "Warning: This is an in-source build"
538 cmake_in_source_build
=TRUE
541 # If this is not an in-source build, then Bootstrap stuff should not exist.
542 if [ -z "${cmake_in_source_build}" ]; then
543 # Did somebody bootstrap in the source tree?
544 if [ -d "${cmake_source_dir}/Bootstrap.cmk" ]; then
545 cmake_error
10 "Found directory \"${cmake_source_dir}/Bootstrap.cmk\".
546 Looks like somebody did bootstrap CMake in the source tree, but now you are
547 trying to do bootstrap in the binary tree. Please remove Bootstrap.cmk
548 directory from the source tree."
550 # Is there a cache in the source tree?
551 for cmake_problematic_file
in ${CMAKE_PROBLEMATIC_FILES}; do
552 if [ -f "${cmake_source_dir}/${cmake_problematic_file}" ]; then
553 cmake_error
10 "Found \"${cmake_source_dir}/${cmake_problematic_file}\".
554 Looks like somebody tried to build CMake in the source tree, but now you are
555 trying to do bootstrap in the binary tree. Please remove \"${cmake_problematic_file}\"
556 from the source tree."
561 # Make bootstrap directory
562 [ -d "${cmake_bootstrap_dir}" ] || mkdir
"${cmake_bootstrap_dir}"
563 if [ ! -d "${cmake_bootstrap_dir}" ]; then
564 cmake_error
3 "Cannot create directory ${cmake_bootstrap_dir} to bootstrap CMake."
566 cd "${cmake_bootstrap_dir}"
568 [ -d "cmsys" ] || mkdir
"cmsys"
569 if [ ! -d "cmsys" ]; then
570 cmake_error
4 "Cannot create directory ${cmake_bootstrap_dir}/cmsys"
574 [ -d "cmsys/${a}" ] || mkdir
"cmsys/${a}"
575 if [ ! -d "cmsys/${a}" ]; then
576 cmake_error
5 "Cannot create directory ${cmake_bootstrap_dir}/cmsys/${a}"
580 # Delete all the bootstrap files
581 rm -f "${cmake_bootstrap_dir}/cmake_bootstrap.log"
582 rm -f "${cmake_bootstrap_dir}/cmConfigure.h.tmp"
584 # If exist compiler flags, set them
585 cmake_c_flags
=${CFLAGS}
586 cmake_cxx_flags
=${CXXFLAGS}
587 cmake_ld_flags
=${LDFLAGS}
589 # Add Carbon framework on Darwin
590 if ${cmake_system_darwin}; then
591 cmake_ld_flags
="${LDFLAGS} -framework Carbon"
594 # Add BeOS toolkits...
595 if ${cmake_system_beos}; then
596 cmake_ld_flags
="${LDFLAGS} -lroot -lbe"
602 # If CC is set, use that for compiler, otherwise use list of known compilers
603 if [ -n "${CC}" ]; then
604 cmake_c_compilers
="${CC}"
606 cmake_c_compilers
="${CMAKE_KNOWN_C_COMPILERS}"
609 # Check if C compiler works
610 TMPFILE
=`cmake_tmp_file`
611 cat > "${TMPFILE}.c" <<EOF
613 # error "The CMAKE_C_COMPILER is set to a C++ compiler"
618 #if defined(__CLASSIC_C__)
623 int main(int argc, char* argv[])
626 printf("%d\n", (argv != 0));
630 for a
in ${cmake_c_compilers}; do
631 if [ -z "${cmake_c_compiler}" ] && \
632 cmake_try_run
"${a}" "${cmake_c_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log
2>&1; then
633 cmake_c_compiler
="${a}"
638 if [ -z "${cmake_c_compiler}" ]; then
639 cmake_error
6 "Cannot find appropriate C compiler on this system.
640 Please specify one using environment variable CC.
641 See cmake_bootstrap.log for compilers attempted.
644 echo "C compiler on this system is: ${cmake_c_compiler} ${cmake_c_flags}"
649 # On Mac OSX, CC is the same as cc, so make sure not to try CC as c++ compiler.
651 # If CC is set, use that for compiler, otherwise use list of known compilers
652 if [ -n "${CXX}" ]; then
653 cmake_cxx_compilers
="${CXX}"
655 cmake_cxx_compilers
="${CMAKE_KNOWN_CXX_COMPILERS}"
658 # Check if C++ compiler works
659 TMPFILE
=`cmake_tmp_file`
660 cat > "${TMPFILE}.cxx" <<EOF
664 # include <iostream.h>
670 NeedCXX() { this->Foo = 1; }
671 int GetFoo() { return this->Foo; }
679 cout << c.GetFoo() << endl;
681 std::cout << c.GetFoo() << std::endl;
686 for a
in ${cmake_cxx_compilers}; do
688 if [ -z "${cmake_cxx_compiler}" ] && \
689 cmake_try_run
"${a}" "${cmake_cxx_flags} -DTEST${b}" "${TMPFILE}.cxx" >> cmake_bootstrap.log
2>&1; then
690 cmake_cxx_compiler
="${a}"
694 rm -f "${TMPFILE}.cxx"
696 if [ -z "${cmake_cxx_compiler}" ]; then
697 cmake_error
7 "Cannot find appropriate C++ compiler on this system.
698 Please specify one using environment variable CXX.
699 See cmake_bootstrap.log for compilers attempted."
701 echo "C++ compiler on this system is: ${cmake_cxx_compiler} ${cmake_cxx_flags}"
705 cmake_make_processor
=
708 # If MAKE is set, use that for make processor, otherwise use list of known make
709 if [ -n "${MAKE}" ]; then
710 cmake_make_processors
="${MAKE}"
712 cmake_make_processors
="${CMAKE_KNOWN_MAKE_PROCESSORS}"
715 TMPFILE
="`cmake_tmp_file`_dir"
716 rm -rf "${cmake_bootstrap_dir}/${TMPFILE}"
717 mkdir
"${cmake_bootstrap_dir}/${TMPFILE}"
718 cd "${cmake_bootstrap_dir}/${TMPFILE}"
721 "${cmake_c_compiler}" -o test test.c
725 int main(){ printf("1\n"); return 0; }
727 cmake_original_make_flags
="${cmake_make_flags}"
728 if [ "x${cmake_parallel_make}" != "x" ]; then
729 cmake_make_flags
="${cmake_make_flags} -j ${cmake_parallel_make}"
731 for a
in ${cmake_make_processors}; do
732 if [ -z "${cmake_make_processor}" ] && cmake_try_make "${a}" "${cmake_make_flags}" >> cmake_bootstrap.log
2>&1; then
733 cmake_make_processor
="${a}"
736 cmake_full_make_flags
="${cmake_make_flags}"
737 if [ "x${cmake_original_make_flags}" != "x${cmake_make_flags}" ]; then
738 if [ -z "${cmake_make_processor}" ]; then
739 cmake_make_flags
="${cmake_original_make_flags}"
740 for a
in ${cmake_make_processors}; do
741 if [ -z "${cmake_make_processor}" ] && cmake_try_make "${a}" "${cmake_make_flags}" >> cmake_bootstrap.log
2>&1; then
742 cmake_make_processor
="${a}"
747 cd "${cmake_bootstrap_dir}"
748 rm -rf "${cmake_bootstrap_dir}/${TMPFILE}"
750 if [ -z "${cmake_make_processor}" ]; then
751 cmake_error
8 "Cannot find appropriate Makefile processor on this system.
752 Please specify one using environment variable MAKE."
754 echo "Makefile processor on this system is: ${cmake_make_processor}"
755 if [ "x${cmake_full_make_flags}" != "x${cmake_make_flags}" ]; then
756 echo "---------------------------------------------"
757 echo "Makefile processor ${cmake_make_processor} does not support parallel build"
758 echo "---------------------------------------------"
761 # Ok, we have CC, CXX, and MAKE.
763 # Test C++ compiler features
767 TMPFILE
=`cmake_tmp_file`
768 cat > ${TMPFILE}.cxx
<<EOF
769 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
771 int main() { std::cout << "This is GNU" << std::endl; return 0;}
774 cmake_cxx_compiler_is_gnu
=0
775 if cmake_try_run
"${cmake_cxx_compiler}" \
776 "${cmake_cxx_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log
2>&1; then
777 cmake_cxx_compiler_is_gnu
=1
779 if [ "x${cmake_cxx_compiler_is_gnu}" = "x1" ]; then
780 echo "${cmake_cxx_compiler} is GNU compiler"
782 echo "${cmake_cxx_compiler} is not GNU compiler"
784 rm -f "${TMPFILE}.cxx"
786 if [ "x${cmake_cxx_compiler_is_gnu}" != "x1" ]; then
787 # Check for non-GNU compiler flags
789 # If we are on IRIX, check for -LANG:std
790 cmake_test_flags
="-LANG:std"
791 if [ "x${cmake_system}" = "xIRIX64" ]; then
792 TMPFILE
=`cmake_tmp_file`
793 cat > ${TMPFILE}.cxx
<<EOF
795 int main() { std::cout << "No need for ${cmake_test_flags}" << std::endl; return 0;}
797 cmake_need_lang_std
=0
798 if cmake_try_run
"${cmake_cxx_compiler}" \
799 "${cmake_cxx_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log
2>&1; then
802 if cmake_try_run
"${cmake_cxx_compiler}" \
803 "${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log
2>&1; then
804 cmake_need_lang_std
=1
807 if [ "x${cmake_need_lang_std}" = "x1" ]; then
808 cmake_cxx_flags
="${cmake_cxx_flags} ${cmake_test_flags}"
809 echo "${cmake_cxx_compiler} needs ${cmake_test_flags}"
811 echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
813 rm -f "${TMPFILE}.cxx"
817 # If we are on OSF, check for -timplicit_local -no_implicit_include
818 cmake_test_flags
="-timplicit_local -no_implicit_include"
819 if [ "x${cmake_system}" = "xOSF1" ]; then
820 TMPFILE
=`cmake_tmp_file`
821 cat > ${TMPFILE}.cxx
<<EOF
823 int main() { std::cout << "We need ${cmake_test_flags}" << std::endl; return 0;}
826 if cmake_try_run
"${cmake_cxx_compiler}" \
827 "${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log
2>&1; then
832 if [ "x${cmake_need_flags}" = "x1" ]; then
833 cmake_cxx_flags
="${cmake_cxx_flags} ${cmake_test_flags}"
834 echo "${cmake_cxx_compiler} needs ${cmake_test_flags}"
836 echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
838 rm -f "${TMPFILE}.cxx"
842 # If we are on OSF, check for -std strict_ansi -nopure_cname
843 cmake_test_flags
="-std strict_ansi -nopure_cname"
844 if [ "x${cmake_system}" = "xOSF1" ]; then
845 TMPFILE
=`cmake_tmp_file`
846 cat > ${TMPFILE}.cxx
<<EOF
848 int main() { std::cout << "We need ${cmake_test_flags}" << std::endl; return 0;}
851 if cmake_try_run
"${cmake_cxx_compiler}" \
852 "${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log
2>&1; then
857 if [ "x${cmake_need_flags}" = "x1" ]; then
858 cmake_cxx_flags
="${cmake_cxx_flags} ${cmake_test_flags}"
859 echo "${cmake_cxx_compiler} needs ${cmake_test_flags}"
861 echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
863 rm -f "${TMPFILE}.cxx"
867 # If we are on HP-UX, check for -Ae for the C compiler.
868 cmake_test_flags
="-Ae"
869 if [ "x${cmake_system}" = "xHP-UX" ]; then
870 TMPFILE
=`cmake_tmp_file`
871 cat > ${TMPFILE}.c
<<EOF
872 int main(int argc, char** argv) { (void)argc; (void)argv; return 0; }
875 if cmake_try_run
"${cmake_c_compiler}" "${cmake_c_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log
2>&1; then
878 if cmake_try_run
"${cmake_c_compiler}" \
879 "${cmake_c_flags} ${cmake_test_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log
2>&1; then
883 if [ "x${cmake_need_Ae}" = "x1" ]; then
884 cmake_c_flags
="${cmake_c_flags} ${cmake_test_flags}"
885 echo "${cmake_c_compiler} needs ${cmake_test_flags}"
887 echo "${cmake_c_compiler} does not need ${cmake_test_flags}"
894 # Test for kwsys features
895 KWSYS_NAME_IS_KWSYS
=0
897 KWSYS_LFS_AVAILABLE
=0
898 KWSYS_LFS_REQUESTED
=0
899 KWSYS_IOS_USE_STRSTREAM_H
=0
900 KWSYS_IOS_USE_STRSTREA_H
=0
902 KWSYS_IOS_USE_SSTREAM
=0
905 KWSYS_STAT_HAS_ST_MTIM
=0
906 KWSYS_STL_STRING_HAVE_NEQ_CHAR
=0
907 KWSYS_STL_HAS_ITERATOR_TRAITS
=0
908 KWSYS_STL_HAS_ITERATOR_CATEGORY
=0
909 KWSYS_STL_HAS___ITERATOR_CATEGORY
=0
910 KWSYS_STL_HAS_ALLOCATOR_TEMPLATE
=0
911 KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE
=0
912 KWSYS_STL_HAS_ALLOCATOR_REBIND
=0
913 KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT
=0
914 KWSYS_STL_HAS_ALLOCATOR_OBJECTS
=0
915 KWSYS_CXX_HAS_CSTDDEF
=0
916 KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS
=0
917 KWSYS_CXX_HAS_MEMBER_TEMPLATES
=0
918 KWSYS_CXX_HAS_FULL_SPECIALIZATION
=0
919 KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP
=0
921 # Hardcode these kwsys features. They work on all known UNIX compilers anyway.
922 KWSYS_STL_STRING_HAVE_ISTREAM
=1
923 KWSYS_STL_STRING_HAVE_OSTREAM
=1
925 if cmake_try_run
"${cmake_cxx_compiler}" \
926 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAVE_STD" \
927 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
929 echo "${cmake_cxx_compiler} has STL in std:: namespace"
931 echo "${cmake_cxx_compiler} does not have STL in std:: namespace"
934 if cmake_try_run
"${cmake_cxx_compiler}" \
935 "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_ANSI" \
936 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
938 echo "${cmake_cxx_compiler} has ANSI streams"
940 echo "${cmake_cxx_compiler} does not have ANSI streams"
943 if [ "x$KWSYS_IOS_USE_ANSI" = "x1" ]; then
944 if cmake_try_run
"${cmake_cxx_compiler}" \
945 "${cmake_cxx_flags} -DTEST_KWSYS_IOS_HAVE_STD" \
946 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
948 echo "${cmake_cxx_compiler} has streams in std:: namespace"
950 echo "${cmake_cxx_compiler} does not have streams in std:: namespace"
952 if cmake_try_run
"${cmake_cxx_compiler}" \
953 "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_SSTREAM" \
954 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
955 KWSYS_IOS_USE_SSTREAM
=1
956 echo "${cmake_cxx_compiler} has sstream"
958 echo "${cmake_cxx_compiler} does not have sstream"
962 if [ "x$KWSYS_IOS_USE_SSTREAM" = "x0" ]; then
963 if cmake_try_run
"${cmake_cxx_compiler}" \
964 "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_STRSTREAM_H" \
965 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
966 KWSYS_IOS_USE_STRSTREAM_H
=1
967 echo "${cmake_cxx_compiler} has strstream.h"
969 echo "${cmake_cxx_compiler} does not have strstream.h"
971 if [ "x$KWSYS_IOS_USE_STRSTREAM_H" = "x0" ]; then
972 if cmake_try_run
"${cmake_cxx_compiler}" \
973 "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_STRSTREA_H" \
974 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
975 KWSYS_IOS_USE_STRSTREA_H
=1
976 echo "${cmake_cxx_compiler} has strstrea.h"
978 echo "${cmake_cxx_compiler} does not have strstrea.h"
983 if cmake_try_run
"${cmake_cxx_compiler}" \
984 "${cmake_cxx_flags} -DTEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
985 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
986 KWSYS_STL_STRING_HAVE_NEQ_CHAR
=1
987 echo "${cmake_cxx_compiler} has operator!=(string, char*)"
989 echo "${cmake_cxx_compiler} does not have operator!=(string, char*)"
992 if cmake_try_run
"${cmake_cxx_compiler}" \
993 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ITERATOR_TRAITS -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
994 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
995 KWSYS_STL_HAS_ITERATOR_TRAITS
=1
996 echo "${cmake_cxx_compiler} has stl iterator_traits"
998 echo "${cmake_cxx_compiler} does not have stl iterator_traits"
1001 if [ "x${KWSYS_STL_HAS_ITERATOR_TRAITS}" = "x0" ]; then
1002 if cmake_try_run
"${cmake_cxx_compiler}" \
1003 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ITERATOR_CATEGORY -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1004 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1005 KWSYS_STL_HAS_ITERATOR_CATEGORY
=1
1006 echo "${cmake_cxx_compiler} has old iterator_category"
1008 echo "${cmake_cxx_compiler} does not have old iterator_category"
1010 if [ "x${KWSYS_STL_HAS_ITERATOR_CATEGORY}" = "x0" ]; then
1011 if cmake_try_run
"${cmake_cxx_compiler}" \
1012 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS___ITERATOR_CATEGORY -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1013 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1014 KWSYS_STL_HAS___ITERATOR_CATEGORY
=1
1015 echo "${cmake_cxx_compiler} has old __iterator_category"
1017 echo "${cmake_cxx_compiler} does not have old __iterator_category"
1022 if cmake_try_run
"${cmake_cxx_compiler}" \
1023 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1024 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1025 KWSYS_STL_HAS_ALLOCATOR_TEMPLATE
=1
1026 echo "${cmake_cxx_compiler} has standard template allocator"
1028 echo "${cmake_cxx_compiler} does not have standard template allocator"
1031 if [ "x${KWSYS_STL_HAS_ALLOCATOR_TEMPLATE}" = "x1" ]; then
1032 if cmake_try_run
"${cmake_cxx_compiler}" \
1033 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_REBIND -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1034 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1035 KWSYS_STL_HAS_ALLOCATOR_REBIND
=1
1036 echo "${cmake_cxx_compiler} has allocator<>::rebind<>"
1038 echo "${cmake_cxx_compiler} does not have allocator<>::rebind<>"
1041 if cmake_try_run
"${cmake_cxx_compiler}" \
1042 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1043 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1044 KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT
=1
1045 echo "${cmake_cxx_compiler} has non-standard allocator<>::max_size argument"
1047 echo "${cmake_cxx_compiler} does not have non-standard allocator<>::max_size argument"
1050 if cmake_try_run
"${cmake_cxx_compiler}" \
1051 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1052 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1053 KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE
=1
1054 echo "${cmake_cxx_compiler} has old non-template allocator"
1056 echo "${cmake_cxx_compiler} does not have old non-template allocator"
1060 if cmake_try_run
"${cmake_cxx_compiler}" \
1061 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1062 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1063 KWSYS_STL_HAS_ALLOCATOR_OBJECTS
=1
1064 echo "${cmake_cxx_compiler} has stl containers supporting allocator objects"
1066 echo "${cmake_cxx_compiler} does not have stl containers supporting allocator objects"
1069 if cmake_try_run
"${cmake_cxx_compiler}" \
1070 "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_CSTDDEF" \
1071 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1072 KWSYS_CXX_HAS_CSTDDEF
=1
1073 echo "${cmake_cxx_compiler} has header cstddef"
1075 echo "${cmake_cxx_compiler} does not have header cstddef"
1078 if cmake_try_run
"${cmake_cxx_compiler}" \
1079 "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS" \
1080 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1081 echo "${cmake_cxx_compiler} does not require template friends to use <>"
1083 KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS
=1
1084 echo "${cmake_cxx_compiler} requires template friends to use <>"
1087 if cmake_try_run
"${cmake_cxx_compiler}" \
1088 "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES" \
1089 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1090 KWSYS_CXX_HAS_MEMBER_TEMPLATES
=1
1091 echo "${cmake_cxx_compiler} supports member templates"
1093 echo "${cmake_cxx_compiler} does not support member templates"
1096 if cmake_try_run
"${cmake_cxx_compiler}" \
1097 "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION" \
1098 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1099 KWSYS_CXX_HAS_FULL_SPECIALIZATION
=1
1100 echo "${cmake_cxx_compiler} has standard template specialization syntax"
1102 echo "${cmake_cxx_compiler} does not have standard template specialization syntax"
1105 if cmake_try_run
"${cmake_cxx_compiler}" \
1106 "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP" \
1107 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1108 KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP
=1
1109 echo "${cmake_cxx_compiler} has argument dependent lookup"
1111 echo "${cmake_cxx_compiler} does not have argument dependent lookup"
1114 if cmake_try_run
"${cmake_cxx_compiler}" \
1115 "${cmake_cxx_flags} -DTEST_KWSYS_STAT_HAS_ST_MTIM" \
1116 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1117 KWSYS_STAT_HAS_ST_MTIM
=1
1118 echo "${cmake_cxx_compiler} has struct stat with st_mtim member"
1120 echo "${cmake_cxx_compiler} does not have struct stat with st_mtim member"
1123 # Just to be safe, let us store compiler and flags to the header file
1125 cmake_bootstrap_version
='$Revision: 1.109 $'
1126 cmake_compiler_settings_comment
="/*
1127 * Generated by ${cmake_source_dir}/bootstrap
1128 * Version: ${cmake_bootstrap_version}
1130 * Source directory: ${cmake_source_dir}
1131 * Binary directory: ${cmake_bootstrap_dir}
1133 * C compiler: ${cmake_c_compiler}
1134 * C flags: ${cmake_c_flags}
1136 * C++ compiler: ${cmake_cxx_compiler}
1137 * C++ flags: ${cmake_cxx_flags}
1139 * Make: ${cmake_make_processor}
1142 * ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES}
1144 * ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES} ${KWSYS_C_MINGW_SOURCES}
1148 cmake_report cmConfigure.h.tmp
"${cmake_compiler_settings_comment}"
1150 if [ "x$KWSYS_STL_HAVE_STD" = "x1" ]; then
1151 cmake_report cmConfigure.h.tmp
"/* #undef CMAKE_NO_STD_NAMESPACE */"
1153 cmake_report cmConfigure.h.tmp
"#define CMAKE_NO_STD_NAMESPACE 1"
1156 if [ "x$KWSYS_IOS_USE_ANSI" = "x1" ]; then
1157 cmake_report cmConfigure.h.tmp
"/* #undef CMAKE_NO_ANSI_STREAM_HEADERS */"
1159 cmake_report cmConfigure.h.tmp
"#define CMAKE_NO_ANSI_STREAM_HEADERS 1"
1162 if [ "x$KWSYS_IOS_USE_SSTREAM" = "x1" ]; then
1163 cmake_report cmConfigure.h.tmp
"/* #undef CMAKE_NO_ANSI_STRING_STREAM */"
1165 cmake_report cmConfigure.h.tmp
"#define CMAKE_NO_ANSI_STRING_STREAM 1"
1168 # Test for ansi FOR scope
1169 if cmake_try_run
"${cmake_cxx_compiler}" \
1170 "${cmake_cxx_flags}" \
1171 "${cmake_source_dir}/Modules/TestForAnsiForScope.cxx" >> cmake_bootstrap.log
2>&1; then
1172 cmake_report cmConfigure.h.tmp
"/* #undef CMAKE_NO_ANSI_FOR_SCOPE */"
1173 echo "${cmake_cxx_compiler} has ANSI for scoping"
1175 cmake_report cmConfigure.h.tmp
"#define CMAKE_NO_ANSI_FOR_SCOPE 1"
1176 echo "${cmake_cxx_compiler} does not have ANSI for scoping"
1179 # When bootstrapping on MinGW with MSYS we must convert the source
1180 # directory to a windows path.
1181 if ${cmake_system_mingw}; then
1182 cmake_root_dir
=`cd "${cmake_source_dir}"; pwd -W`
1184 cmake_root_dir
="${cmake_source_dir}"
1187 # Write CMake version
1188 cmake_report cmConfigure.h.tmp
"#define CMake_VERSION_MAJOR ${cmake_version_major}"
1189 cmake_report cmConfigure.h.tmp
"#define CMake_VERSION_MINOR ${cmake_version_minor}"
1190 cmake_report cmConfigure.h.tmp
"#define CMake_VERSION_PATCH ${cmake_version_patch}"
1191 cmake_report cmConfigure.h.tmp
"#define CMAKE_ROOT_DIR \"${cmake_root_dir}\""
1192 cmake_report cmConfigure.h.tmp
"#define CMAKE_DATA_DIR \"${cmake_data_dir}\""
1193 cmake_report cmConfigure.h.tmp
"#define CMAKE_BOOTSTRAP"
1195 # Regenerate real cmConfigure.h
1196 if diff cmConfigure.h cmConfigure.h.tmp
> /dev
/null
2> /dev
/null
; then
1197 rm -f cmConfigure.h.tmp
1199 mv -f cmConfigure.h.tmp cmConfigure.h
1203 cmake_kwsys_config_replace_string \
1204 "${cmake_source_dir}/Source/kwsys/Configure.hxx.in" \
1205 "${cmake_bootstrap_dir}/cmsys/Configure.hxx" \
1206 "${cmake_compiler_settings_comment}"
1207 cmake_kwsys_config_replace_string \
1208 "${cmake_source_dir}/Source/kwsys/Configure.h.in" \
1209 "${cmake_bootstrap_dir}/cmsys/Configure.h" \
1210 "${cmake_compiler_settings_comment}"
1212 cat>"${cmake_bootstrap_dir}/cmsys/DateStamp.h"<<EOF
1213 /* Minimal DateStamp header for CMake bootstrap build. */
1214 #ifndef cmsys_DateStamp_h
1215 #define cmsys_DateStamp_h
1216 #define cmsys_DATE_STAMP_STRING_FULL "${cmake_date_stamp}"
1220 for a
in ${KWSYS_FILES}; do
1221 cmake_replace_string
"${cmake_source_dir}/Source/kwsys/${a}.in" \
1222 "${cmake_bootstrap_dir}/cmsys/${a}" KWSYS_NAMESPACE cmsys
1225 for a
in ${KWSYS_IOS_FILES}; do
1226 cmake_replace_string
"${cmake_source_dir}/Source/kwsys/kwsys_ios_${a}.h.in" \
1227 "${cmake_bootstrap_dir}/cmsys/ios/${a}" KWSYS_NAMESPACE cmsys
1230 cmake_replace_string
"${cmake_source_dir}/Source/kwsys/kwsys_stl.hxx.in" \
1231 "${cmake_bootstrap_dir}/cmsys/stl/stl.hxx.in" KWSYS_STL_HEADER_EXTRA
""
1233 cmake_replace_string
"${cmake_bootstrap_dir}/cmsys/stl/stl.hxx.in" \
1234 "${cmake_bootstrap_dir}/cmsys/stl/stl.h.in" KWSYS_NAMESPACE cmsys
1236 for a
in string vector map algorithm
; do
1237 cmake_replace_string
"${cmake_bootstrap_dir}/cmsys/stl/stl.h.in" \
1238 "${cmake_bootstrap_dir}/cmsys/stl/${a}" KWSYS_STL_HEADER ${a}
1242 dep="cmConfigure.h cmsys
/*.hxx cmsys
/*.h
`cmake_escape \"${cmake_source_dir}\"`/Source
/*.h
"
1244 for a in ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES} ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES} ${KWSYS_C_GENERATED_SOURCES}; do
1245 objs="${objs} ${a}.o
"
1248 # Generate dependencies for cmBootstrapCommands.cxx
1249 for file in `grep "#include.*cm[^.]*.cxx" "${cmake_source_dir}/Source/cmBootstrapCommands.cxx" | sed "s/.* \"\(.*\)\"/\1/"`; do
1250 cmBootstrapCommandsDeps
="${cmBootstrapCommandsDeps} `cmake_escape "${cmake_source_dir}/Source
/$file"`"
1252 cmBootstrapCommandsDeps
=`echo $cmBootstrapCommandsDeps`
1254 if [ "x${cmake_ansi_cxx_flags}" != "x" ]; then
1255 cmake_cxx_flags
="${cmake_ansi_cxx_flags} ${cmake_cxx_flags}"
1258 if [ "x${cmake_c_flags}" != "x" ]; then
1259 cmake_c_flags
="${cmake_c_flags} "
1262 if [ "x${cmake_cxx_flags}" != "x" ]; then
1263 cmake_cxx_flags
="${cmake_cxx_flags} "
1266 cmake_c_flags
="${cmake_c_flags}-I`cmake_escape \"${cmake_source_dir}/Source\"` \
1267 -I`cmake_escape \"${cmake_bootstrap_dir}\"`"
1268 cmake_cxx_flags
="${cmake_cxx_flags}-I`cmake_escape \"${cmake_source_dir}/Source\"` \
1269 -I`cmake_escape \"${cmake_bootstrap_dir}\"`"
1270 echo "cmake: ${objs}" > "${cmake_bootstrap_dir}/Makefile"
1271 echo " ${cmake_cxx_compiler} ${cmake_ld_flags} ${cmake_cxx_flags} ${objs} -o cmake" >> "${cmake_bootstrap_dir}/Makefile"
1272 for a
in ${CMAKE_CXX_SOURCES}; do
1273 src
=`cmake_escape "${cmake_source_dir}/Source/${a}.cxx"`
1274 echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
1275 echo " ${cmake_cxx_compiler} ${cmake_cxx_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
1277 echo "cmBootstrapCommands.o : $cmBootstrapCommandsDeps" >> "${cmake_bootstrap_dir}/Makefile"
1278 for a
in ${CMAKE_C_SOURCES}; do
1279 src
=`cmake_escape "${cmake_source_dir}/Source/${a}.c"`
1280 echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
1281 echo " ${cmake_c_compiler} ${cmake_c_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
1283 for a
in ${KWSYS_C_SOURCES} ${KWSYS_C_MINGW_SOURCES}; do
1284 src
=`cmake_escape "${cmake_source_dir}/Source/kwsys/${a}.c"`
1285 echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
1286 echo " ${cmake_c_compiler} ${cmake_c_flags} -DKWSYS_NAMESPACE=cmsys -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
1288 for a
in ${KWSYS_CXX_SOURCES}; do
1289 src
=`cmake_escape "${cmake_source_dir}/Source/kwsys/${a}.cxx"`
1290 echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
1291 echo " ${cmake_cxx_compiler} ${cmake_cxx_flags} -DKWSYS_NAMESPACE=cmsys -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
1293 if ${cmake_system_mingw}; then
1294 src
=`cmake_escape "${cmake_bootstrap_dir}/cmsysProcessFwd9xEnc.c"`
1295 in=`cmake_escape "${cmake_bootstrap_dir}/cmsysProcessFwd9x.exe"`
1296 cmd
=`cmake_escape "${cmake_bootstrap_dir}/cmsysEncodeExecutable.exe"`
1297 a
="cmsysProcessFwd9xEnc"
1298 echo "${cmd} : EncodeExecutable.o" >> "${cmake_bootstrap_dir}/Makefile"
1299 echo " ${cmake_c_compiler} ${cmake_ld_flags} ${cmake_c_flags} EncodeExecutable.o -o ${cmd}" >> "${cmake_bootstrap_dir}/Makefile"
1300 echo "${in} : ProcessFwd9x.o" >> "${cmake_bootstrap_dir}/Makefile"
1301 echo " ${cmake_c_compiler} ${cmake_ld_flags} ${cmake_c_flags} ProcessFwd9x.o -o ${in}" >> "${cmake_bootstrap_dir}/Makefile"
1302 echo "${src} : ${cmd} ${in}" >> "${cmake_bootstrap_dir}/Makefile"
1303 echo " ${cmd} ${in} ${src} cmsys ProcessFwd9x" >> "${cmake_bootstrap_dir}/Makefile"
1304 echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
1305 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"
1307 cat>>"${cmake_bootstrap_dir}/Makefile"<<EOF
1309 cd "${cmake_binary_dir}" && "${cmake_source_dir}/bootstrap"
1312 # Write our default settings to Bootstrap.cmk/InitialCacheFlags.cmake.
1313 cat > "${cmake_bootstrap_dir}/InitialCacheFlags.cmake" <<EOF
1314 # Generated by ${cmake_source_dir}/bootstrap
1315 # Default cmake settings. These may be overridden any settings below.
1316 SET (CMAKE_INSTALL_PREFIX "${cmake_prefix_dir}" CACHE PATH "Install path prefix, prepended onto install directories." FORCE)
1317 SET (CMAKE_DOC_DIR "${cmake_doc_dir}" CACHE PATH "Install location for documentation (relative to prefix)." FORCE)
1318 SET (CMAKE_MAN_DIR "${cmake_man_dir}" CACHE PATH "Install location for man pages (relative to prefix)." FORCE)
1319 SET (CMAKE_DATA_DIR "${cmake_data_dir}" CACHE PATH "Install location for data (relative to prefix)." FORCE)
1322 # Add configuration settings given as command-line options.
1323 if [ "x${cmake_bootstrap_qt_gui}" != "x" ]; then
1324 cat >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake" <<EOF
1325 SET (BUILD_QtDialog ${cmake_bootstrap_qt_gui} CACHE BOOL "Build Qt dialog for CMake" FORCE)
1328 if [ "x${cmake_bootstrap_qt_qmake}" != "x" ]; then
1329 cat >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake" <<EOF
1330 SET (QT_QMAKE_EXECUTABLE "${cmake_bootstrap_qt_qmake}" CACHE FILEPATH "Location of Qt qmake" FORCE)
1334 # Add user-specified settings. Handle relative-path case for
1335 # specification of cmake_init_file.
1337 cd "${cmake_binary_dir}"
1338 if [ -f "${cmake_init_file}" ]; then
1339 cat "${cmake_init_file}" >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
1343 echo "---------------------------------------------"
1345 # Run make to build bootstrap cmake
1346 if [ "x${cmake_parallel_make}" != "x" ]; then
1347 ${cmake_make_processor} ${cmake_make_flags}
1349 ${cmake_make_processor}
1352 if [ "${RES}" -ne "0" ]; then
1353 cmake_error
9 "Problem while running ${cmake_make_processor}"
1355 cd "${cmake_binary_dir}"
1357 # Set C, CXX, and MAKE environment variables, so that real real cmake will be
1358 # build with same compiler and make
1359 CC
="${cmake_c_compiler}"
1360 CXX
="${cmake_cxx_compiler}"
1361 MAKE
="${cmake_make_processor}"
1366 # Run bootstrap CMake to configure real CMake
1367 "${cmake_bootstrap_dir}/cmake" "${cmake_source_dir}" "-C${cmake_bootstrap_dir}/InitialCacheFlags.cmake" "-G${cmake_bootstrap_generator}" ${cmake_bootstrap_system_libs}
1369 if [ "${RES}" -ne "0" ]; then
1370 cmake_error 11 "Problem
while running initial CMake
"
1373 echo "---------------------------------------------"
1375 # And we are done. Now just run make
1376 echo "CMake has bootstrapped. Now run
${cmake_make_processor}.
"