3 #=========================================================================
5 # Program: CMake - Cross-Platform Makefile Generator
6 # Module: $RCSfile: bootstrap,v $
7 # Language: Bourne Shell
8 # Date: $Date: 2007-11-15 02:17:53 $
9 # Version: $Revision: 1.100 $
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
=""
53 # Determine whether this is a MinGW environment.
54 if echo "${cmake_system}" |
grep MINGW
>/dev
/null
2>&1; then
55 cmake_system_mingw
=true
57 cmake_system_mingw
=false
60 # Determine whether this is OS X
61 if echo "${cmake_system}" |
grep Darwin
>/dev
/null
2>&1; then
62 cmake_system_darwin
=true
64 cmake_system_darwin
=false
67 # Determine whether this is BeOS
68 if echo "${cmake_system}" |
grep BeOS
>/dev
/null
2>&1; then
69 cmake_system_beos
=true
71 cmake_system_beos
=false
74 # Choose the generator to use for bootstrapping.
75 if ${cmake_system_mingw}; then
76 # Bootstrapping from an MSYS prompt.
77 cmake_bootstrap_generator
="MSYS Makefiles"
79 # Bootstrapping from a standard UNIX prompt.
80 cmake_bootstrap_generator
="Unix Makefiles"
83 # Helper function to fix windows paths.
86 echo "$1" |
sed 's/\\/\//g'
89 # Choose the default install prefix.
90 if ${cmake_system_mingw}; then
91 if [ "x${PROGRAMFILES}" != "x" ]; then
92 cmake_default_prefix
=`cmake_fix_slashes "${PROGRAMFILES}/CMake"`
93 elif [ "x${ProgramFiles}" != "x" ]; then
94 cmake_default_prefix
=`cmake_fix_slashes "${ProgramFiles}/CMake"`
95 elif [ "x${SYSTEMDRIVE}" != "x" ]; then
96 cmake_default_prefix
=`cmake_fix_slashes "${SYSTEMDRIVE}/Program Files/CMake"`
97 elif [ "x${SystemDrive}" != "x" ]; then
98 cmake_default_prefix
=`cmake_fix_slashes "${SystemDrive}/Program Files/CMake"`
100 cmake_default_prefix
="c:/Program Files/CMake"
103 cmake_default_prefix
="/usr/local"
106 CMAKE_KNOWN_C_COMPILERS
="cc gcc xlc icc tcc"
107 CMAKE_KNOWN_CXX_COMPILERS
="aCC xlC CC g++ c++ icc como "
108 CMAKE_KNOWN_MAKE_PROCESSORS
="gmake make"
110 CMAKE_PROBLEMATIC_FILES
="\
113 CMakeCCompiler.cmake \
114 CMakeCXXCompiler.cmake \
115 Source/cmConfigure.h \
116 Source/CTest/Curl/config.h \
117 Utilities/cmexpat/expatConfig.h \
118 Utilities/cmexpat/expatDllConfig.h \
121 CMAKE_UNUSED_SOURCES
="\
122 cmGlobalXCodeGenerator \
123 cmLocalXCodeGenerator \
133 cmCommandArgumentLexer \
134 cmCommandArgumentParser \
135 cmCommandArgumentParserHelper \
140 cmPropertyDefinition \
141 cmPropertyDefinitionMap \
144 cmGeneratedFileStream \
148 cmInstallFilesGenerator \
149 cmInstallScriptGenerator \
150 cmInstallTargetGenerator \
152 cmSourceFileLocation \
155 cmFileTimeComparison \
156 cmGlobalUnixMakefileGenerator3 \
157 cmLocalUnixMakefileGenerator3 \
158 cmMakefileExecutableTargetGenerator \
159 cmMakefileLibraryTargetGenerator \
160 cmMakefileTargetGenerator \
161 cmMakefileUtilityTargetGenerator \
162 cmBootstrapCommands \
167 cmDocumentVariables \
170 cmOrderLinkDirectories \
173 if ${cmake_system_mingw}; then
174 CMAKE_CXX_SOURCES
="${CMAKE_CXX_SOURCES}\
175 cmGlobalMSYSMakefileGenerator \
176 cmGlobalMinGWMakefileGenerator \
177 cmWin32ProcessExecution"
184 if ${cmake_system_mingw}; then
188 KWSYS_C_MINGW_SOURCES
="\
191 KWSYS_C_GENERATED_SOURCES
="\
192 cmsysProcessFwd9xEnc"
197 KWSYS_C_MINGW_SOURCES
=""
198 KWSYS_C_GENERATED_SOURCES
=""
211 RegularExpression.hxx \
222 # Display CMake bootstrap usage
227 Options: [defaults in brackets after descriptions]
229 --help print this message
230 --version only print version information
231 --verbose display more information
232 --parallel=n bootstrap cmake in parallel, where n is
234 --init=FILE use FILE for cmake initialization
235 --system-libs use system-installed third-party libraries
236 (for use only by package maintainers)
237 --no-system-libs use cmake-provided third-party libraries
240 Directory and file names:
241 --prefix=PREFIX install files in tree rooted at PREFIX
242 [${cmake_default_prefix}]
243 --datadir=DIR install data files in PREFIX/DIR
245 --docdir=DIR install documentation files in PREFIX/DIR
247 --mandir=DIR install man pages files in PREFIX/DIR/manN
253 # Display CMake bootstrap usage
258 if echo "${cmake_version_full}" |
grep "[0-9]\.[0-9]*[13579]\.[0-9]" > /dev
/null
2>&1; then
259 version
="${cmake_version}-${cmake_date_stamp}"
261 version
="${cmake_version}-${cmake_version_patch}"
263 echo "CMake ${version}, Copyright (c) 2007 Kitware, Inc., Insight Consortium"
267 # Display CMake bootstrap error, display the log file and exit
272 echo "---------------------------------------------"
273 echo "Error when bootstrapping CMake:"
275 echo "---------------------------------------------"
276 if [ -f cmake_bootstrap.log
]; then
277 echo "Log of errors: `pwd`/cmake_bootstrap.log"
278 #cat cmake_bootstrap.log
279 echo "---------------------------------------------"
284 # Replace KWSYS_NAMESPACE with cmsys
285 cmake_replace_string
()
291 if [ -f "${INFILE}" ]; then
293 sed "s/\@${SEARCHFOR}\@/${REPLACEWITH}/g" > "${OUTFILE}.tmp"
294 if [ -f "${OUTFILE}.tmp" ]; then
295 if diff "${OUTFILE}" "${OUTFILE}.tmp" > /dev
/null
2> /dev
/null
; then
296 #echo "Files are the same"
297 rm -f "${OUTFILE}.tmp"
299 mv -f "${OUTFILE}.tmp" "${OUTFILE}"
303 cmake_error
1 "Cannot find file ${INFILE}"
307 cmake_kwsys_config_replace_string
()
313 if [ -f "${INFILE}" ]; then
314 echo "${APPEND}" > "${OUTFILE}.tmp"
316 sed "/./ {s/\@KWSYS_NAMESPACE\@/cmsys/g;
317 s/@KWSYS_BUILD_SHARED@/${KWSYS_BUILD_SHARED}/g;
318 s/@KWSYS_LFS_AVAILABLE@/${KWSYS_LFS_AVAILABLE}/g;
319 s/@KWSYS_LFS_REQUESTED@/${KWSYS_LFS_REQUESTED}/g;
320 s/@KWSYS_NAME_IS_KWSYS@/${KWSYS_NAME_IS_KWSYS}/g;
321 s/@KWSYS_IOS_USE_ANSI@/${KWSYS_IOS_USE_ANSI}/g;
322 s/@KWSYS_IOS_HAVE_STD@/${KWSYS_IOS_HAVE_STD}/g;
323 s/@KWSYS_IOS_USE_SSTREAM@/${KWSYS_IOS_USE_SSTREAM}/g;
324 s/@KWSYS_IOS_USE_STRSTREAM_H@/${KWSYS_IOS_USE_STRSTREAM_H}/g;
325 s/@KWSYS_IOS_USE_STRSTREA_H@/${KWSYS_IOS_USE_STRSTREA_H}/g;
326 s/@KWSYS_STL_HAVE_STD@/${KWSYS_STL_HAVE_STD}/g;
327 s/@KWSYS_STL_STRING_HAVE_ISTREAM@/${KWSYS_STL_STRING_HAVE_ISTREAM}/g;
328 s/@KWSYS_STL_STRING_HAVE_OSTREAM@/${KWSYS_STL_STRING_HAVE_OSTREAM}/g;
329 s/@KWSYS_STL_STRING_HAVE_NEQ_CHAR@/${KWSYS_STL_STRING_HAVE_NEQ_CHAR}/g;
330 s/@KWSYS_STL_HAS_ITERATOR_TRAITS@/${KWSYS_STL_HAS_ITERATOR_TRAITS}/g;
331 s/@KWSYS_STL_HAS_ITERATOR_CATEGORY@/${KWSYS_STL_HAS_ITERATOR_CATEGORY}/g;
332 s/@KWSYS_STL_HAS___ITERATOR_CATEGORY@/${KWSYS_STL_HAS___ITERATOR_CATEGORY}/g;
333 s/@KWSYS_STL_HAS_ALLOCATOR_TEMPLATE@/${KWSYS_STL_HAS_ALLOCATOR_TEMPLATE}/g;
334 s/@KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE@/${KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE}/g;
335 s/@KWSYS_STL_HAS_ALLOCATOR_REBIND@/${KWSYS_STL_HAS_ALLOCATOR_REBIND}/g;
336 s/@KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT@/${KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT}/g;
337 s/@KWSYS_STL_HAS_ALLOCATOR_OBJECTS@/${KWSYS_STL_HAS_ALLOCATOR_OBJECTS}/g;
338 s/@KWSYS_CXX_HAS_CSTDDEF@/${KWSYS_CXX_HAS_CSTDDEF}/g;
339 s/@KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS@/${KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS}/g;
340 s/@KWSYS_CXX_HAS_MEMBER_TEMPLATES@/${KWSYS_CXX_HAS_MEMBER_TEMPLATES}/g;
341 s/@KWSYS_CXX_HAS_FULL_SPECIALIZATION@/${KWSYS_CXX_HAS_FULL_SPECIALIZATION}/g;
342 s/@KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP@/${KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP}/g;
343 s/@KWSYS_STAT_HAS_ST_MTIM@/${KWSYS_STAT_HAS_ST_MTIM}/g;}" >> "${OUTFILE}.tmp"
344 if [ -f "${OUTFILE}.tmp" ]; then
345 if diff "${OUTFILE}" "${OUTFILE}.tmp" > /dev
/null
2> /dev
/null
; then
346 #echo "Files are the same"
347 rm -f "${OUTFILE}.tmp"
349 mv -f "${OUTFILE}.tmp" "${OUTFILE}"
353 cmake_error
2 "Cannot find file ${INFILE}"
356 # Write string into a file
364 # Escape spaces in strings
367 echo $1 |
sed "s/ /\\\\ /g"
370 # Write message to the log
373 echo "$*" >> cmake_bootstrap.log
379 echo "cmake_bootstrap_$$.test"
382 # Run a compiler test. First argument is compiler, second one are compiler
383 # flags, third one is test source file to be compiled
389 if [ ! -f "${TESTFILE}" ]; then
390 echo "Test file ${TESTFILE} missing. Please verify your CMake source tree."
393 TMPFILE
=`cmake_tmp_file`
394 echo "Try: ${COMPILER}"
395 echo "Line: ${COMPILER} ${FLAGS} ${TESTFILE} -o ${TMPFILE}"
396 echo "---------- file -----------------------"
398 echo "------------------------------------------"
399 "${COMPILER}" ${FLAGS} "${TESTFILE}" -o "${TMPFILE}"
401 if [ "${RES}" -ne "0" ]; then
402 echo "Test failed to compile"
405 if [ ! -f "${TMPFILE}" ] && [ ! -f "${TMPFILE}.exe" ]; then
406 echo "Test failed to produce executable"
412 if [ "${RES}" -ne "0" ]; then
413 echo "Test produced non-zero return code"
420 # Run a make test. First argument is the make interpreter.
425 echo "Try: ${MAKE_PROC}"
426 "${MAKE_PROC}" ${MAKE_FLAGS}
428 if [ "${RES}" -ne "0" ]; then
429 echo "${MAKE_PROC} does not work"
432 if [ ! -f "test" ] && [ ! -f "test.exe" ]; then
433 echo "${COMPILER} does not produce output"
439 if [ "${RES}" -ne "0" ]; then
440 echo "${MAKE_PROC} produces strange executable"
443 echo "${MAKE_PROC} works"
450 cmake_prefix_dir
="${cmake_default_prefix}"
452 if echo $a |
grep "^--prefix=" > /dev
/null
2> /dev
/null
; then
453 cmake_prefix_dir
=`echo $a | sed "s/^--prefix=//"`
454 cmake_prefix_dir
=`cmake_fix_slashes "${cmake_prefix_dir}"`
456 if echo $a |
grep "^--parallel=" > /dev
/null
2> /dev
/null
; then
457 cmake_parallel_make
=`echo $a | sed "s/^--parallel=//" | grep "[0-9][0-9]*"`
459 if echo $a |
grep "^--datadir=" > /dev
/null
2> /dev
/null
; then
460 cmake_data_dir
=`echo $a | sed "s/^--datadir=//"`
462 if echo $a |
grep "^--docdir=" > /dev
/null
2> /dev
/null
; then
463 cmake_doc_dir
=`echo $a | sed "s/^--docdir=//"`
465 if echo $a |
grep "^--mandir=" > /dev
/null
2> /dev
/null
; then
466 cmake_man_dir
=`echo $a | sed "s/^--mandir=//"`
468 if echo $a |
grep "^--init=" > /dev
/null
2> /dev
/null
; then
469 cmake_init_file
=`echo $a | sed "s/^--init=//"`
471 if echo $a |
grep "^--system-libs" > /dev
/null
2> /dev
/null
; then
472 cmake_bootstrap_system_libs
="-DCMAKE_USE_SYSTEM_LIBRARIES=1"
474 if echo $a |
grep "^--no-system-libs" > /dev
/null
2> /dev
/null
; then
475 cmake_bootstrap_system_libs
="-DCMAKE_USE_SYSTEM_LIBRARIES=0"
477 if echo $a |
grep "^--help" > /dev
/null
2> /dev
/null
; then
480 if echo $a |
grep "^--version" > /dev
/null
2> /dev
/null
; then
484 if echo $a |
grep "^--verbose" > /dev
/null
2> /dev
/null
; then
489 # If verbose, display some information about bootstrap
490 if [ -n "${cmake_verbose}" ]; then
491 echo "---------------------------------------------"
492 echo "Source directory: ${cmake_source_dir}"
493 echo "Binary directory: ${cmake_binary_dir}"
494 echo "Prefix directory: ${cmake_prefix_dir}"
495 echo "System: ${cmake_system}"
496 if [ "x${cmake_parallel_make}" != "x" ]; then
497 echo "Doing parallel make: ${cmake_parallel_make}"
502 echo "---------------------------------------------"
504 echo "`cmake_version`"
506 # Check for in-source build
507 cmake_in_source_build
=
508 if [ -f "${cmake_binary_dir}/Source/cmake.cxx" -a \
509 -f "${cmake_binary_dir}/Source/cmake.h" ]; then
510 if [ -n "${cmake_verbose}" ]; then
511 echo "Warning: This is an in-source build"
513 cmake_in_source_build
=TRUE
516 # If this is not an in-source build, then Bootstrap stuff should not exist.
517 if [ -z "${cmake_in_source_build}" ]; then
518 # Did somebody bootstrap in the source tree?
519 if [ -d "${cmake_source_dir}/Bootstrap.cmk" ]; then
520 cmake_error
10 "Found directory \"${cmake_source_dir}/Bootstrap.cmk\".
521 Looks like somebody did bootstrap CMake in the source tree, but now you are
522 trying to do bootstrap in the binary tree. Please remove Bootstrap.cmk
523 directory from the source tree."
525 # Is there a cache in the source tree?
526 for cmake_problematic_file
in ${CMAKE_PROBLEMATIC_FILES}; do
527 if [ -f "${cmake_source_dir}/${cmake_problematic_file}" ]; then
528 cmake_error
10 "Found \"${cmake_source_dir}/${cmake_problematic_file}\".
529 Looks like somebody tried to build CMake in the source tree, but now you are
530 trying to do bootstrap in the binary tree. Please remove \"${cmake_problematic_file}\"
531 from the source tree."
536 # Make bootstrap directory
537 [ -d "${cmake_bootstrap_dir}" ] || mkdir
"${cmake_bootstrap_dir}"
538 if [ ! -d "${cmake_bootstrap_dir}" ]; then
539 cmake_error
3 "Cannot create directory ${cmake_bootstrap_dir} to bootstrap CMake."
541 cd "${cmake_bootstrap_dir}"
543 [ -d "cmsys" ] || mkdir
"cmsys"
544 if [ ! -d "cmsys" ]; then
545 cmake_error
4 "Cannot create directory ${cmake_bootstrap_dir}/cmsys"
549 [ -d "cmsys/${a}" ] || mkdir
"cmsys/${a}"
550 if [ ! -d "cmsys/${a}" ]; then
551 cmake_error
5 "Cannot create directory ${cmake_bootstrap_dir}/cmsys/${a}"
555 # Delete all the bootstrap files
556 rm -f "${cmake_bootstrap_dir}/cmake_bootstrap.log"
557 rm -f "${cmake_bootstrap_dir}/cmConfigure.h.tmp"
559 # If exist compiler flags, set them
560 cmake_c_flags
=${CFLAGS}
561 cmake_cxx_flags
=${CXXFLAGS}
562 cmake_ld_flags
=${LDFLAGS}
564 # Add Carbon framework on Darwin
565 if ${cmake_system_darwin}; then
566 cmake_ld_flags
="${LDFLAGS} -framework Carbon"
569 # Add BeOS toolkits...
570 if ${cmake_system_beos}; then
571 cmake_ld_flags
="${LDFLAGS} -lroot -lbe"
577 # If CC is set, use that for compiler, otherwise use list of known compilers
578 if [ -n "${CC}" ]; then
579 cmake_c_compilers
="${CC}"
581 cmake_c_compilers
="${CMAKE_KNOWN_C_COMPILERS}"
584 # Check if C compiler works
585 TMPFILE
=`cmake_tmp_file`
586 cat > "${TMPFILE}.c" <<EOF
588 # error "The CMAKE_C_COMPILER is set to a C++ compiler"
593 #if defined(__CLASSIC_C__)
598 int main(int argc, char* argv[])
601 printf("%d\n", (argv != 0));
605 for a
in ${cmake_c_compilers}; do
606 if [ -z "${cmake_c_compiler}" ] && \
607 cmake_try_run
"${a}" "${cmake_c_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log
2>&1; then
608 cmake_c_compiler
="${a}"
613 if [ -z "${cmake_c_compiler}" ]; then
614 cmake_error
6 "Cannot find appropriate C compiler on this system.
615 Please specify one using environment variable CC.
616 See cmake_bootstrap.log for compilers attempted.
619 echo "C compiler on this system is: ${cmake_c_compiler} ${cmake_c_flags}"
624 # On Mac OSX, CC is the same as cc, so make sure not to try CC as c++ compiler.
626 # If CC is set, use that for compiler, otherwise use list of known compilers
627 if [ -n "${CXX}" ]; then
628 cmake_cxx_compilers
="${CXX}"
630 cmake_cxx_compilers
="${CMAKE_KNOWN_CXX_COMPILERS}"
633 # Check if C++ compiler works
634 TMPFILE
=`cmake_tmp_file`
635 cat > "${TMPFILE}.cxx" <<EOF
639 # include <iostream.h>
645 NeedCXX() { this->Foo = 1; }
646 int GetFoo() { return this->Foo; }
654 cout << c.GetFoo() << endl;
656 std::cout << c.GetFoo() << std::endl;
661 for a
in ${cmake_cxx_compilers}; do
663 if [ -z "${cmake_cxx_compiler}" ] && \
664 cmake_try_run
"${a}" "${cmake_cxx_flags} -DTEST${b}" "${TMPFILE}.cxx" >> cmake_bootstrap.log
2>&1; then
665 cmake_cxx_compiler
="${a}"
669 rm -f "${TMPFILE}.cxx"
671 if [ -z "${cmake_cxx_compiler}" ]; then
672 cmake_error
7 "Cannot find appropriate C++ compiler on this system.
673 Please specify one using environment variable CXX.
674 See cmake_bootstrap.log for compilers attempted."
676 echo "C++ compiler on this system is: ${cmake_cxx_compiler} ${cmake_cxx_flags}"
680 cmake_make_processor
=
683 # If MAKE is set, use that for make processor, otherwise use list of known make
684 if [ -n "${MAKE}" ]; then
685 cmake_make_processors
="${MAKE}"
687 cmake_make_processors
="${CMAKE_KNOWN_MAKE_PROCESSORS}"
690 TMPFILE
="`cmake_tmp_file`_dir"
691 rm -rf "${cmake_bootstrap_dir}/${TMPFILE}"
692 mkdir
"${cmake_bootstrap_dir}/${TMPFILE}"
693 cd "${cmake_bootstrap_dir}/${TMPFILE}"
696 "${cmake_c_compiler}" -o test test.c
700 int main(){ printf("1\n"); return 0; }
702 cmake_original_make_flags
="${cmake_make_flags}"
703 if [ "x${cmake_parallel_make}" != "x" ]; then
704 cmake_make_flags
="${cmake_make_flags} -j ${cmake_parallel_make}"
706 for a
in ${cmake_make_processors}; do
707 if [ -z "${cmake_make_processor}" ] && cmake_try_make "${a}" "${cmake_make_flags}" >> cmake_bootstrap.log
2>&1; then
708 cmake_make_processor
="${a}"
711 cmake_full_make_flags
="${cmake_make_flags}"
712 if [ "x${cmake_original_make_flags}" != "x${cmake_make_flags}" ]; then
713 if [ -z "${cmake_make_processor}" ]; then
714 cmake_make_flags
="${cmake_original_make_flags}"
715 for a
in ${cmake_make_processors}; do
716 if [ -z "${cmake_make_processor}" ] && cmake_try_make "${a}" "${cmake_make_flags}" >> cmake_bootstrap.log
2>&1; then
717 cmake_make_processor
="${a}"
722 cd "${cmake_bootstrap_dir}"
723 rm -rf "${cmake_bootstrap_dir}/${TMPFILE}"
725 if [ -z "${cmake_make_processor}" ]; then
726 cmake_error
8 "Cannot find appropriate Makefile processor on this system.
727 Please specify one using environment variable MAKE."
729 echo "Makefile processor on this system is: ${cmake_make_processor}"
730 if [ "x${cmake_full_make_flags}" != "x${cmake_make_flags}" ]; then
731 echo "---------------------------------------------"
732 echo "Makefile processor ${cmake_make_processor} does not support parallel build"
733 echo "---------------------------------------------"
736 # Ok, we have CC, CXX, and MAKE.
738 # Test C++ compiler features
742 TMPFILE
=`cmake_tmp_file`
743 cat > ${TMPFILE}.cxx
<<EOF
744 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
746 int main() { std::cout << "This is GNU" << std::endl; return 0;}
749 cmake_cxx_compiler_is_gnu
=0
750 if cmake_try_run
"${cmake_cxx_compiler}" \
751 "${cmake_cxx_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log
2>&1; then
752 cmake_cxx_compiler_is_gnu
=1
754 if [ "x${cmake_cxx_compiler_is_gnu}" = "x1" ]; then
755 echo "${cmake_cxx_compiler} is GNU compiler"
757 echo "${cmake_cxx_compiler} is not GNU compiler"
759 rm -f "${TMPFILE}.cxx"
761 if [ "x${cmake_cxx_compiler_is_gnu}" != "x1" ]; then
762 # Check for non-GNU compiler flags
764 # If we are on IRIX, check for -LANG:std
765 cmake_test_flags
="-LANG:std"
766 if [ "x${cmake_system}" = "xIRIX64" ]; then
767 TMPFILE
=`cmake_tmp_file`
768 cat > ${TMPFILE}.cxx
<<EOF
770 int main() { std::cout << "No need for ${cmake_test_flags}" << std::endl; return 0;}
772 cmake_need_lang_std
=0
773 if cmake_try_run
"${cmake_cxx_compiler}" \
774 "${cmake_cxx_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log
2>&1; then
777 if cmake_try_run
"${cmake_cxx_compiler}" \
778 "${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log
2>&1; then
779 cmake_need_lang_std
=1
782 if [ "x${cmake_need_lang_std}" = "x1" ]; then
783 cmake_cxx_flags
="${cmake_cxx_flags} ${cmake_test_flags}"
784 echo "${cmake_cxx_compiler} needs ${cmake_test_flags}"
786 echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
788 rm -f "${TMPFILE}.cxx"
792 # If we are on OSF, check for -timplicit_local -no_implicit_include
793 cmake_test_flags
="-timplicit_local -no_implicit_include"
794 if [ "x${cmake_system}" = "xOSF1" ]; then
795 TMPFILE
=`cmake_tmp_file`
796 cat > ${TMPFILE}.cxx
<<EOF
798 int main() { std::cout << "We need ${cmake_test_flags}" << std::endl; return 0;}
801 if cmake_try_run
"${cmake_cxx_compiler}" \
802 "${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log
2>&1; then
807 if [ "x${cmake_need_flags}" = "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 -std strict_ansi -nopure_cname
818 cmake_test_flags
="-std strict_ansi -nopure_cname"
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 HP-UX, check for -Ae for the C compiler.
843 cmake_test_flags
="-Ae"
844 if [ "x${cmake_system}" = "xHP-UX" ]; then
845 TMPFILE
=`cmake_tmp_file`
846 cat > ${TMPFILE}.c
<<EOF
847 int main(int argc, char** argv) { (void)argc; (void)argv; return 0; }
850 if cmake_try_run
"${cmake_c_compiler}" "${cmake_c_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log
2>&1; then
853 if cmake_try_run
"${cmake_c_compiler}" \
854 "${cmake_c_flags} ${cmake_test_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log
2>&1; then
858 if [ "x${cmake_need_Ae}" = "x1" ]; then
859 cmake_c_flags
="${cmake_c_flags} ${cmake_test_flags}"
860 echo "${cmake_c_compiler} needs ${cmake_test_flags}"
862 echo "${cmake_c_compiler} does not need ${cmake_test_flags}"
869 # Test for kwsys features
870 KWSYS_NAME_IS_KWSYS
=0
872 KWSYS_LFS_AVAILABLE
=0
873 KWSYS_LFS_REQUESTED
=0
874 KWSYS_IOS_USE_STRSTREAM_H
=0
875 KWSYS_IOS_USE_STRSTREA_H
=0
877 KWSYS_IOS_USE_SSTREAM
=0
880 KWSYS_STAT_HAS_ST_MTIM
=0
881 KWSYS_STL_STRING_HAVE_NEQ_CHAR
=0
882 KWSYS_STL_HAS_ITERATOR_TRAITS
=0
883 KWSYS_STL_HAS_ITERATOR_CATEGORY
=0
884 KWSYS_STL_HAS___ITERATOR_CATEGORY
=0
885 KWSYS_STL_HAS_ALLOCATOR_TEMPLATE
=0
886 KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE
=0
887 KWSYS_STL_HAS_ALLOCATOR_REBIND
=0
888 KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT
=0
889 KWSYS_STL_HAS_ALLOCATOR_OBJECTS
=0
890 KWSYS_CXX_HAS_CSTDDEF
=0
891 KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS
=0
892 KWSYS_CXX_HAS_MEMBER_TEMPLATES
=0
893 KWSYS_CXX_HAS_FULL_SPECIALIZATION
=0
894 KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP
=0
896 # Hardcode these kwsys features. They work on all known UNIX compilers anyway.
897 KWSYS_STL_STRING_HAVE_ISTREAM
=1
898 KWSYS_STL_STRING_HAVE_OSTREAM
=1
900 if cmake_try_run
"${cmake_cxx_compiler}" \
901 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAVE_STD" \
902 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
904 echo "${cmake_cxx_compiler} has STL in std:: namespace"
906 echo "${cmake_cxx_compiler} does not have STL in std:: namespace"
909 if cmake_try_run
"${cmake_cxx_compiler}" \
910 "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_ANSI" \
911 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
913 echo "${cmake_cxx_compiler} has ANSI streams"
915 echo "${cmake_cxx_compiler} does not have ANSI streams"
918 if [ "x$KWSYS_IOS_USE_ANSI" = "x1" ]; then
919 if cmake_try_run
"${cmake_cxx_compiler}" \
920 "${cmake_cxx_flags} -DTEST_KWSYS_IOS_HAVE_STD" \
921 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
923 echo "${cmake_cxx_compiler} has streams in std:: namespace"
925 echo "${cmake_cxx_compiler} does not have streams in std:: namespace"
927 if cmake_try_run
"${cmake_cxx_compiler}" \
928 "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_SSTREAM" \
929 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
930 KWSYS_IOS_USE_SSTREAM
=1
931 echo "${cmake_cxx_compiler} has sstream"
933 echo "${cmake_cxx_compiler} does not have sstream"
937 if [ "x$KWSYS_IOS_USE_SSTREAM" = "x0" ]; then
938 if cmake_try_run
"${cmake_cxx_compiler}" \
939 "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_STRSTREAM_H" \
940 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
941 KWSYS_IOS_USE_STRSTREAM_H
=1
942 echo "${cmake_cxx_compiler} has strstream.h"
944 echo "${cmake_cxx_compiler} does not have strstream.h"
946 if [ "x$KWSYS_IOS_USE_STRSTREAM_H" = "x0" ]; then
947 if cmake_try_run
"${cmake_cxx_compiler}" \
948 "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_STRSTREA_H" \
949 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
950 KWSYS_IOS_USE_STRSTREA_H
=1
951 echo "${cmake_cxx_compiler} has strstrea.h"
953 echo "${cmake_cxx_compiler} does not have strstrea.h"
958 if cmake_try_run
"${cmake_cxx_compiler}" \
959 "${cmake_cxx_flags} -DTEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
960 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
961 KWSYS_STL_STRING_HAVE_NEQ_CHAR
=1
962 echo "${cmake_cxx_compiler} has operator!=(string, char*)"
964 echo "${cmake_cxx_compiler} does not have operator!=(string, char*)"
967 if cmake_try_run
"${cmake_cxx_compiler}" \
968 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ITERATOR_TRAITS -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
969 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
970 KWSYS_STL_HAS_ITERATOR_TRAITS
=1
971 echo "${cmake_cxx_compiler} has stl iterator_traits"
973 echo "${cmake_cxx_compiler} does not have stl iterator_traits"
976 if [ "x${KWSYS_STL_HAS_ITERATOR_TRAITS}" = "x0" ]; then
977 if cmake_try_run
"${cmake_cxx_compiler}" \
978 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ITERATOR_CATEGORY -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
979 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
980 KWSYS_STL_HAS_ITERATOR_CATEGORY
=1
981 echo "${cmake_cxx_compiler} has old iterator_category"
983 echo "${cmake_cxx_compiler} does not have old iterator_category"
985 if [ "x${KWSYS_STL_HAS_ITERATOR_CATEGORY}" = "x0" ]; then
986 if cmake_try_run
"${cmake_cxx_compiler}" \
987 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS___ITERATOR_CATEGORY -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
988 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
989 KWSYS_STL_HAS___ITERATOR_CATEGORY
=1
990 echo "${cmake_cxx_compiler} has old __iterator_category"
992 echo "${cmake_cxx_compiler} does not have old __iterator_category"
997 if cmake_try_run
"${cmake_cxx_compiler}" \
998 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
999 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1000 KWSYS_STL_HAS_ALLOCATOR_TEMPLATE
=1
1001 echo "${cmake_cxx_compiler} has standard template allocator"
1003 echo "${cmake_cxx_compiler} does not have standard template allocator"
1006 if [ "x${KWSYS_STL_HAS_ALLOCATOR_TEMPLATE}" = "x1" ]; then
1007 if cmake_try_run
"${cmake_cxx_compiler}" \
1008 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_REBIND -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1009 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1010 KWSYS_STL_HAS_ALLOCATOR_REBIND
=1
1011 echo "${cmake_cxx_compiler} has allocator<>::rebind<>"
1013 echo "${cmake_cxx_compiler} does not have allocator<>::rebind<>"
1016 if cmake_try_run
"${cmake_cxx_compiler}" \
1017 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1018 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1019 KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT
=1
1020 echo "${cmake_cxx_compiler} has non-standard allocator<>::max_size argument"
1022 echo "${cmake_cxx_compiler} does not have non-standard allocator<>::max_size argument"
1025 if cmake_try_run
"${cmake_cxx_compiler}" \
1026 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1027 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1028 KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE
=1
1029 echo "${cmake_cxx_compiler} has old non-template allocator"
1031 echo "${cmake_cxx_compiler} does not have old non-template allocator"
1035 if cmake_try_run
"${cmake_cxx_compiler}" \
1036 "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
1037 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1038 KWSYS_STL_HAS_ALLOCATOR_OBJECTS
=1
1039 echo "${cmake_cxx_compiler} has stl containers supporting allocator objects"
1041 echo "${cmake_cxx_compiler} does not have stl containers supporting allocator objects"
1044 if cmake_try_run
"${cmake_cxx_compiler}" \
1045 "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_CSTDDEF" \
1046 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1047 KWSYS_CXX_HAS_CSTDDEF
=1
1048 echo "${cmake_cxx_compiler} has header cstddef"
1050 echo "${cmake_cxx_compiler} does not have header cstddef"
1053 if cmake_try_run
"${cmake_cxx_compiler}" \
1054 "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS" \
1055 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1056 echo "${cmake_cxx_compiler} does not require template friends to use <>"
1058 KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS
=1
1059 echo "${cmake_cxx_compiler} requires template friends to use <>"
1062 if cmake_try_run
"${cmake_cxx_compiler}" \
1063 "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES" \
1064 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1065 KWSYS_CXX_HAS_MEMBER_TEMPLATES
=1
1066 echo "${cmake_cxx_compiler} supports member templates"
1068 echo "${cmake_cxx_compiler} does not support member templates"
1071 if cmake_try_run
"${cmake_cxx_compiler}" \
1072 "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION" \
1073 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1074 KWSYS_CXX_HAS_FULL_SPECIALIZATION
=1
1075 echo "${cmake_cxx_compiler} has standard template specialization syntax"
1077 echo "${cmake_cxx_compiler} does not have standard template specialization syntax"
1080 if cmake_try_run
"${cmake_cxx_compiler}" \
1081 "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP" \
1082 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1083 KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP
=1
1084 echo "${cmake_cxx_compiler} has argument dependent lookup"
1086 echo "${cmake_cxx_compiler} does not have argument dependent lookup"
1089 if cmake_try_run
"${cmake_cxx_compiler}" \
1090 "${cmake_cxx_flags} -DTEST_KWSYS_STAT_HAS_ST_MTIM" \
1091 "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log
2>&1; then
1092 KWSYS_STAT_HAS_ST_MTIM
=1
1093 echo "${cmake_cxx_compiler} has struct stat with st_mtim member"
1095 echo "${cmake_cxx_compiler} does not have struct stat with st_mtim member"
1098 # Just to be safe, let us store compiler and flags to the header file
1100 cmake_bootstrap_version
='$Revision: 1.100 $'
1101 cmake_compiler_settings_comment
="/*
1102 * Generated by ${cmake_source_dir}/bootstrap
1103 * Version: ${cmake_bootstrap_version}
1105 * Source directory: ${cmake_source_dir}
1106 * Binary directory: ${cmake_bootstrap_dir}
1108 * C compiler: ${cmake_c_compiler}
1109 * C flags: ${cmake_c_flags}
1111 * C++ compiler: ${cmake_cxx_compiler}
1112 * C++ flags: ${cmake_cxx_flags}
1114 * Make: ${cmake_make_processor}
1117 * ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES}
1119 * ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES} ${KWSYS_C_MINGW_SOURCES}
1123 cmake_report cmConfigure.h.tmp
"${cmake_compiler_settings_comment}"
1125 if [ "x$KWSYS_STL_HAVE_STD" = "x1" ]; then
1126 cmake_report cmConfigure.h.tmp
"/* #undef CMAKE_NO_STD_NAMESPACE */"
1128 cmake_report cmConfigure.h.tmp
"#define CMAKE_NO_STD_NAMESPACE 1"
1131 if [ "x$KWSYS_IOS_USE_ANSI" = "x1" ]; then
1132 cmake_report cmConfigure.h.tmp
"/* #undef CMAKE_NO_ANSI_STREAM_HEADERS */"
1134 cmake_report cmConfigure.h.tmp
"#define CMAKE_NO_ANSI_STREAM_HEADERS 1"
1137 if [ "x$KWSYS_IOS_USE_SSTREAM" = "x1" ]; then
1138 cmake_report cmConfigure.h.tmp
"/* #undef CMAKE_NO_ANSI_STRING_STREAM */"
1140 cmake_report cmConfigure.h.tmp
"#define CMAKE_NO_ANSI_STRING_STREAM 1"
1143 # Test for ansi FOR scope
1144 if cmake_try_run
"${cmake_cxx_compiler}" \
1145 "${cmake_cxx_flags}" \
1146 "${cmake_source_dir}/Modules/TestForAnsiForScope.cxx" >> cmake_bootstrap.log
2>&1; then
1147 cmake_report cmConfigure.h.tmp
"/* #undef CMAKE_NO_ANSI_FOR_SCOPE */"
1148 echo "${cmake_cxx_compiler} has ANSI for scoping"
1150 cmake_report cmConfigure.h.tmp
"#define CMAKE_NO_ANSI_FOR_SCOPE 1"
1151 echo "${cmake_cxx_compiler} does not have ANSI for scoping"
1154 # When bootstrapping on MinGW with MSYS we must convert the source
1155 # directory to a windows path.
1156 if ${cmake_system_mingw}; then
1157 cmake_root_dir
=`cd "${cmake_source_dir}"; pwd -W`
1159 cmake_root_dir
="${cmake_source_dir}"
1162 # Write CMake version
1163 cmake_report cmConfigure.h.tmp
"#define CMake_VERSION_MAJOR ${cmake_version_major}"
1164 cmake_report cmConfigure.h.tmp
"#define CMake_VERSION_MINOR ${cmake_version_minor}"
1165 cmake_report cmConfigure.h.tmp
"#define CMake_VERSION_PATCH ${cmake_version_patch}"
1166 cmake_report cmConfigure.h.tmp
"#define CMAKE_ROOT_DIR \"${cmake_root_dir}\""
1167 cmake_report cmConfigure.h.tmp
"#define CMAKE_DATA_DIR \"${cmake_data_dir}\""
1168 cmake_report cmConfigure.h.tmp
"#define CMAKE_BOOTSTRAP"
1170 # Regenerate real cmConfigure.h
1171 if diff cmConfigure.h cmConfigure.h.tmp
> /dev
/null
2> /dev
/null
; then
1172 rm -f cmConfigure.h.tmp
1174 mv -f cmConfigure.h.tmp cmConfigure.h
1178 cmake_kwsys_config_replace_string \
1179 "${cmake_source_dir}/Source/kwsys/Configure.hxx.in" \
1180 "${cmake_bootstrap_dir}/cmsys/Configure.hxx" \
1181 "${cmake_compiler_settings_comment}"
1182 cmake_kwsys_config_replace_string \
1183 "${cmake_source_dir}/Source/kwsys/Configure.h.in" \
1184 "${cmake_bootstrap_dir}/cmsys/Configure.h" \
1185 "${cmake_compiler_settings_comment}"
1187 cat>"${cmake_bootstrap_dir}/cmsys/DateStamp.h"<<EOF
1188 /* Minimal DateStamp header for CMake bootstrap build. */
1189 #ifndef cmsys_DateStamp_h
1190 #define cmsys_DateStamp_h
1191 #define cmsys_DATE_STAMP_STRING_FULL "${cmake_date_stamp}"
1195 for a
in ${KWSYS_FILES}; do
1196 cmake_replace_string
"${cmake_source_dir}/Source/kwsys/${a}.in" \
1197 "${cmake_bootstrap_dir}/cmsys/${a}" KWSYS_NAMESPACE cmsys
1200 for a
in ${KWSYS_IOS_FILES}; do
1201 cmake_replace_string
"${cmake_source_dir}/Source/kwsys/kwsys_ios_${a}.h.in" \
1202 "${cmake_bootstrap_dir}/cmsys/ios/${a}" KWSYS_NAMESPACE cmsys
1205 cmake_replace_string
"${cmake_source_dir}/Source/kwsys/kwsys_stl.hxx.in" \
1206 "${cmake_bootstrap_dir}/cmsys/stl/stl.hxx.in" KWSYS_STL_HEADER_EXTRA
""
1208 cmake_replace_string
"${cmake_bootstrap_dir}/cmsys/stl/stl.hxx.in" \
1209 "${cmake_bootstrap_dir}/cmsys/stl/stl.h.in" KWSYS_NAMESPACE cmsys
1211 for a
in string vector map
; do
1212 cmake_replace_string
"${cmake_bootstrap_dir}/cmsys/stl/stl.h.in" \
1213 "${cmake_bootstrap_dir}/cmsys/stl/${a}" KWSYS_STL_HEADER ${a}
1217 dep="cmConfigure.h cmsys
/*.hxx cmsys
/*.h
`cmake_escape \"${cmake_source_dir}\"`/Source
/*.h
"
1219 for a in ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES} ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES} ${KWSYS_C_GENERATED_SOURCES}; do
1220 objs="${objs} ${a}.o
"
1223 # Generate dependencies for cmBootstrapCommands.cxx
1224 for file in `grep "#include.*cm[^.]*.cxx" "${cmake_source_dir}/Source/cmBootstrapCommands.cxx" | sed "s/.* \"\(.*\)\"/\1/"`; do
1225 cmBootstrapCommandsDeps
="${cmBootstrapCommandsDeps} `cmake_escape "${cmake_source_dir}/Source
/$file"`"
1227 cmBootstrapCommandsDeps
=`echo $cmBootstrapCommandsDeps`
1229 if [ "x${cmake_ansi_cxx_flags}" != "x" ]; then
1230 cmake_cxx_flags
="${cmake_ansi_cxx_flags} ${cmake_cxx_flags}"
1233 if [ "x${cmake_c_flags}" != "x" ]; then
1234 cmake_c_flags
="${cmake_c_flags} "
1237 if [ "x${cmake_cxx_flags}" != "x" ]; then
1238 cmake_cxx_flags
="${cmake_cxx_flags} "
1241 cmake_c_flags
="${cmake_c_flags}-I`cmake_escape \"${cmake_source_dir}/Source\"` \
1242 -I`cmake_escape \"${cmake_bootstrap_dir}\"`"
1243 cmake_cxx_flags
="${cmake_cxx_flags}-I`cmake_escape \"${cmake_source_dir}/Source\"` \
1244 -I`cmake_escape \"${cmake_bootstrap_dir}\"`"
1245 echo "cmake: ${objs}" > "${cmake_bootstrap_dir}/Makefile"
1246 echo " ${cmake_cxx_compiler} ${cmake_ld_flags} ${cmake_cxx_flags} ${objs} -o cmake" >> "${cmake_bootstrap_dir}/Makefile"
1247 for a
in ${CMAKE_CXX_SOURCES}; do
1248 src
=`cmake_escape "${cmake_source_dir}/Source/${a}.cxx"`
1249 echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
1250 echo " ${cmake_cxx_compiler} ${cmake_cxx_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
1252 echo "cmBootstrapCommands.o : $cmBootstrapCommandsDeps" >> "${cmake_bootstrap_dir}/Makefile"
1253 for a
in ${CMAKE_C_SOURCES}; do
1254 src
=`cmake_escape "${cmake_source_dir}/Source/${a}.c"`
1255 echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
1256 echo " ${cmake_c_compiler} ${cmake_c_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
1258 for a
in ${KWSYS_C_SOURCES} ${KWSYS_C_MINGW_SOURCES}; do
1259 src
=`cmake_escape "${cmake_source_dir}/Source/kwsys/${a}.c"`
1260 echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
1261 echo " ${cmake_c_compiler} ${cmake_c_flags} -DKWSYS_NAMESPACE=cmsys -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
1263 for a
in ${KWSYS_CXX_SOURCES}; do
1264 src
=`cmake_escape "${cmake_source_dir}/Source/kwsys/${a}.cxx"`
1265 echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
1266 echo " ${cmake_cxx_compiler} ${cmake_cxx_flags} -DKWSYS_NAMESPACE=cmsys -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
1268 if ${cmake_system_mingw}; then
1269 src
=`cmake_escape "${cmake_bootstrap_dir}/cmsysProcessFwd9xEnc.c"`
1270 in=`cmake_escape "${cmake_bootstrap_dir}/cmsysProcessFwd9x.exe"`
1271 cmd
=`cmake_escape "${cmake_bootstrap_dir}/cmsysEncodeExecutable.exe"`
1272 a
="cmsysProcessFwd9xEnc"
1273 echo "${cmd} : EncodeExecutable.o" >> "${cmake_bootstrap_dir}/Makefile"
1274 echo " ${cmake_c_compiler} ${cmake_ld_flags} ${cmake_c_flags} EncodeExecutable.o -o ${cmd}" >> "${cmake_bootstrap_dir}/Makefile"
1275 echo "${in} : ProcessFwd9x.o" >> "${cmake_bootstrap_dir}/Makefile"
1276 echo " ${cmake_c_compiler} ${cmake_ld_flags} ${cmake_c_flags} ProcessFwd9x.o -o ${in}" >> "${cmake_bootstrap_dir}/Makefile"
1277 echo "${src} : ${cmd} ${in}" >> "${cmake_bootstrap_dir}/Makefile"
1278 echo " ${cmd} ${in} ${src} cmsys ProcessFwd9x" >> "${cmake_bootstrap_dir}/Makefile"
1279 echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
1280 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"
1282 cat>>"${cmake_bootstrap_dir}/Makefile"<<EOF
1284 cd "${cmake_binary_dir}" && "${cmake_source_dir}/bootstrap"
1287 # Write our default settings to Bootstrap.cmk/InitialCacheFlags.cmake.
1288 cat > "${cmake_bootstrap_dir}/InitialCacheFlags.cmake" <<EOF
1289 # Generated by ${cmake_source_dir}/bootstrap
1290 # Default cmake settings. These may be overridden any settings below.
1291 SET (CMAKE_INSTALL_PREFIX "${cmake_prefix_dir}" CACHE PATH "Install path prefix, prepended onto install directories." FORCE)
1292 SET (CMAKE_DOC_DIR "${cmake_doc_dir}" CACHE PATH "Install location for documentation (relative to prefix)." FORCE)
1293 SET (CMAKE_MAN_DIR "${cmake_man_dir}" CACHE PATH "Install location for man pages (relative to prefix)." FORCE)
1294 SET (CMAKE_DATA_DIR "${cmake_data_dir}" CACHE PATH "Install location for data (relative to prefix)." FORCE)
1297 # Add user-specified settings. Handle relative-path case for
1298 # specification of cmake_init_file.
1300 cd "${cmake_binary_dir}"
1301 if [ -f "${cmake_init_file}" ]; then
1302 cat "${cmake_init_file}" >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
1306 echo "---------------------------------------------"
1308 # Run make to build bootstrap cmake
1309 if [ "x${cmake_parallel_make}" != "x" ]; then
1310 ${cmake_make_processor} ${cmake_make_flags}
1312 ${cmake_make_processor}
1315 if [ "${RES}" -ne "0" ]; then
1316 cmake_error
9 "Problem while running ${cmake_make_processor}"
1318 cd "${cmake_binary_dir}"
1320 # Set C, CXX, and MAKE environment variables, so that real real cmake will be
1321 # build with same compiler and make
1322 CC
="${cmake_c_compiler}"
1323 CXX
="${cmake_cxx_compiler}"
1324 MAKE
="${cmake_make_processor}"
1329 # Run bootstrap CMake to configure real CMake
1330 "${cmake_bootstrap_dir}/cmake" "${cmake_source_dir}" "-C${cmake_bootstrap_dir}/InitialCacheFlags.cmake" "-G${cmake_bootstrap_generator}" ${cmake_bootstrap_system_libs}
1332 if [ "${RES}" -ne "0" ]; then
1333 cmake_error 11 "Problem
while running initial CMake
"
1336 echo "---------------------------------------------"
1338 # And we are done. Now just run make
1339 echo "CMake has bootstrapped. Now run
${cmake_make_processor}.
"