Imported Upstream version 3.15.0
[platform/upstream/cmake.git] / bootstrap
1 #!/bin/sh
2 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
3 # file Copyright.txt or https://cmake.org/licensing for details.
4
5 die() {
6   echo "$@" 1>&2 ; exit 1
7 }
8
9 # Compile flag extraction function.
10 cmake_extract_standard_flags()
11 {
12   sed -n "s/ *set *( *CMAKE_${2}${3}_EXTENSION_COMPILE_OPTION *\"\{0,1\}\([^\")]*\).*/\1/p" \
13     "${cmake_source_dir}/Modules/Compiler/"${1:-*}-${2}.cmake 2>/dev/null | tr ';' ' '
14 }
15
16 # Version number extraction function.
17 cmake_version_component()
18 {
19   sed -n "
20 /^set(CMake_VERSION_${1}/ {s/set(CMake_VERSION_${1} *\([0-9]*\))/\1/;p;}
21 " "${cmake_source_dir}/Source/CMakeVersion.cmake"
22 }
23
24 # Install destination extraction function.
25 cmake_install_dest_default()
26 {
27   sed -n '
28 /^ *set(CMAKE_'"${1}"'_DIR_DEFAULT.*) # '"${2}"'$/ {
29   s/^ *set(CMAKE_'"${1}"'_DIR_DEFAULT *"\([^"]*\)").*$/\1/
30   s/${CMake_VERSION_MAJOR}/'"${cmake_version_major}"'/
31   s/${CMake_VERSION_MINOR}/'"${cmake_version_minor}"'/
32   s/${CMake_VERSION_PATCH}/'"${cmake_version_patch}"'/
33   p
34   q
35 }
36 ' "${cmake_source_dir}/Source/CMakeInstallDestinations.cmake"
37 }
38
39 cmake_toupper()
40 {
41     echo "$1" | tr '[:lower:]' '[:upper:]'
42 }
43
44 # Detect system and directory information.
45 cmake_system=`uname`
46 cmake_source_dir=`cd "\`dirname \"$0\"\`";pwd`
47 cmake_binary_dir=`pwd`
48
49 # Load version information.
50 cmake_version_major="`cmake_version_component MAJOR`"
51 cmake_version_minor="`cmake_version_component MINOR`"
52 cmake_version_patch="`cmake_version_component PATCH`"
53 cmake_version="${cmake_version_major}.${cmake_version_minor}.${cmake_version_patch}"
54 cmake_version_rc="`cmake_version_component RC`"
55 if [ "$cmake_version_rc" != "" ]; then
56   cmake_version="${cmake_version}-rc${cmake_version_rc}"
57 fi
58
59 cmake_copyright="`grep '^Copyright .* Kitware' "${cmake_source_dir}/Copyright.txt"`"
60
61 cmake_bin_dir_keyword="OTHER"
62 cmake_data_dir_keyword="OTHER"
63 cmake_doc_dir_keyword="OTHER"
64 cmake_man_dir_keyword="OTHER"
65 cmake_xdgdata_dir_keyword="OTHER"
66 cmake_bin_dir=""
67 cmake_data_dir=""
68 cmake_doc_dir=""
69 cmake_man_dir=""
70 cmake_xdgdata_dir=""
71 cmake_init_file=""
72 cmake_bootstrap_system_libs=""
73 cmake_bootstrap_qt_gui=""
74 cmake_bootstrap_qt_qmake=""
75 cmake_sphinx_info=""
76 cmake_sphinx_man=""
77 cmake_sphinx_html=""
78 cmake_sphinx_qthelp=""
79 cmake_sphinx_build=""
80 cmake_sphinx_flags=""
81
82 # Determine whether this is a Cygwin environment.
83 if echo "${cmake_system}" | grep CYGWIN >/dev/null 2>&1; then
84   cmake_system_cygwin=true
85   cmake_doc_dir_keyword="CYGWIN"
86   cmake_man_dir_keyword="CYGWIN"
87 else
88   cmake_system_cygwin=false
89 fi
90
91 # Determine whether this is a MinGW environment.
92 if echo "${cmake_system}" | grep 'MINGW\|MSYS' >/dev/null 2>&1; then
93   cmake_system_mingw=true
94 else
95   cmake_system_mingw=false
96 fi
97
98 # Determine whether this is OS X
99 if echo "${cmake_system}" | grep Darwin >/dev/null 2>&1; then
100   cmake_system_darwin=true
101 else
102   cmake_system_darwin=false
103 fi
104
105 # Determine whether this is BeOS
106 if echo "${cmake_system}" | grep BeOS >/dev/null 2>&1; then
107   cmake_system_beos=true
108   cmake_doc_dir_keyword="HAIKU"
109   cmake_man_dir_keyword="HAIKU"
110 else
111   cmake_system_beos=false
112 fi
113
114 # Determine whether this is Haiku
115 if echo "${cmake_system}" | grep Haiku >/dev/null 2>&1; then
116   cmake_system_haiku=true
117   cmake_doc_dir_keyword="HAIKU"
118   cmake_man_dir_keyword="HAIKU"
119 else
120   cmake_system_haiku=false
121 fi
122
123 # Determine whether this is OpenVMS
124 if echo "${cmake_system}" | grep OpenVMS >/dev/null 2>&1; then
125   cmake_system_openvms=true
126 else
127   cmake_system_openvms=false
128 fi
129
130 # Determine whether this is HP-UX
131 if echo "${cmake_system}" | grep HP-UX >/dev/null 2>&1; then
132   die 'CMake no longer compiles on HP-UX.  See
133
134   https://gitlab.kitware.com/cmake/cmake/issues/17137
135
136 Use CMake 3.9 or lower instead.'
137   cmake_system_hpux=true
138 else
139   cmake_system_hpux=false
140 fi
141
142 # Determine whether this is Linux
143 if echo "${cmake_system}" | grep Linux >/dev/null 2>&1; then
144   cmake_system_linux=true
145 else
146   cmake_system_linux=false
147  fi
148
149 # Determine whether this is a PA-RISC machine
150 # This only works for Linux or HP-UX, not other PA-RISC OSs (BSD maybe?). Also
151 # may falsely detect parisc on HP-UX m68k
152 cmake_machine_parisc=false
153 if ${cmake_system_linux}; then
154   if uname -m | grep parisc >/dev/null 2>&1; then
155     cmake_machine_parisc=true
156   fi
157 elif ${cmake_system_hpux}; then
158   if uname -m | grep ia64 >/dev/null 2>&1; then : ; else
159     cmake_machine_parisc=true
160   fi
161 fi
162
163 # Choose the generator to use for bootstrapping.
164 if ${cmake_system_mingw}; then
165   # Bootstrapping from an MSYS prompt.
166   cmake_bootstrap_generator="MSYS Makefiles"
167 else
168   # Bootstrapping from a standard UNIX prompt.
169   cmake_bootstrap_generator="Unix Makefiles"
170 fi
171
172 # Choose tools and extensions for this platform.
173 if ${cmake_system_openvms}; then
174   _tmp="_tmp"
175   _cmk="_cmk"
176   _diff=`which diff`
177 else
178   _tmp=".tmp"
179   _cmk=".cmk"
180   _diff="diff"
181 fi
182
183 # Construct bootstrap directory name.
184 cmake_bootstrap_dir="${cmake_binary_dir}/Bootstrap${_cmk}"
185
186 # Helper function to fix windows paths.
187 case "${cmake_system}" in
188 *MINGW*)
189   cmake_fix_slashes()
190   {
191     cmd //c echo "$(echo "$1" | sed 's/\\/\//g')" | sed 's/^"//;s/" *$//'
192   }
193   ;;
194 *)
195   cmake_fix_slashes()
196   {
197     echo "$1" | sed 's/\\/\//g'
198   }
199   ;;
200 esac
201
202 # Choose the default install prefix.
203 if ${cmake_system_mingw}; then
204   if [ "x${PROGRAMFILES}" != "x" ]; then
205     cmake_default_prefix=`cmake_fix_slashes "${PROGRAMFILES}/CMake"`
206   elif [ "x${ProgramFiles}" != "x" ]; then
207     cmake_default_prefix=`cmake_fix_slashes "${ProgramFiles}/CMake"`
208   elif [ "x${SYSTEMDRIVE}" != "x" ]; then
209     cmake_default_prefix=`cmake_fix_slashes "${SYSTEMDRIVE}/Program Files/CMake"`
210   elif [ "x${SystemDrive}" != "x" ]; then
211     cmake_default_prefix=`cmake_fix_slashes "${SystemDrive}/Program Files/CMake"`
212   else
213     cmake_default_prefix="c:/Program Files/CMake"
214   fi
215 elif ${cmake_system_haiku}; then
216   cmake_default_prefix=`finddir B_COMMON_DIRECTORY`
217 else
218   cmake_default_prefix="/usr/local"
219 fi
220
221 # Lookup default install destinations.
222 cmake_bin_dir_default="`cmake_install_dest_default BIN ${cmake_bin_dir_keyword}`"
223 cmake_data_dir_default="`cmake_install_dest_default DATA ${cmake_data_dir_keyword}`"
224 cmake_doc_dir_default="`cmake_install_dest_default DOC ${cmake_doc_dir_keyword}`"
225 cmake_man_dir_default="`cmake_install_dest_default MAN ${cmake_man_dir_keyword}`"
226 cmake_xdgdata_dir_default="`cmake_install_dest_default XDGDATA ${cmake_xdgdata_dir_keyword}`"
227
228 CMAKE_KNOWN_C_COMPILERS="cc gcc clang xlc icc tcc"
229 CMAKE_KNOWN_CXX_COMPILERS="aCC xlC CC g++ clang++ c++ icc como "
230 CMAKE_KNOWN_MAKE_PROCESSORS="gmake make"
231
232 CMAKE_PROBLEMATIC_FILES="\
233   CMakeCache.txt \
234   CMakeSystem.cmake \
235   CMakeCCompiler.cmake \
236   CMakeCXXCompiler.cmake \
237   */CMakeSystem.cmake \
238   */CMakeCCompiler.cmake \
239   */CMakeCXXCompiler.cmake \
240   Source/cmConfigure.h \
241   Source/CTest/Curl/config.h \
242   Utilities/cmexpat/expatConfig.h \
243   Utilities/cmexpat/expatDllConfig.h \
244   "
245
246 CMAKE_UNUSED_SOURCES="\
247   cmGlobalXCodeGenerator \
248   cmLocalXCodeGenerator \
249   cmXCodeObject \
250   cmXCode21Object \
251   cmSourceGroup \
252 "
253
254 CMAKE_CXX_SOURCES="\
255   cmAddCustomCommandCommand \
256   cmAddCustomTargetCommand \
257   cmAddDefinitionsCommand \
258   cmAddDependenciesCommand \
259   cmAddExecutableCommand \
260   cmAddLibraryCommand \
261   cmAddSubDirectoryCommand \
262   cmAddTestCommand \
263   cmArgumentParser \
264   cmBreakCommand \
265   cmBuildCommand \
266   cmCMakeMinimumRequired \
267   cmCMakePolicyCommand \
268   cmCPackPropertiesGenerator \
269   cmCacheManager \
270   cmCommand \
271   cmCommandArgumentParserHelper \
272   cmCommands \
273   cmCommonTargetGenerator \
274   cmComputeComponentGraph \
275   cmComputeLinkDepends \
276   cmComputeLinkInformation \
277   cmComputeTargetDepends \
278   cmConditionEvaluator \
279   cmConfigureFileCommand \
280   cmContinueCommand \
281   cmCoreTryCompile \
282   cmCreateTestSourceList \
283   cmCustomCommand \
284   cmCustomCommandGenerator \
285   cmDefinePropertyCommand \
286   cmDefinitions \
287   cmDepends \
288   cmDependsC \
289   cmDisallowedCommand \
290   cmDocumentationFormatter \
291   cmEnableLanguageCommand \
292   cmEnableTestingCommand \
293   cmExecProgramCommand \
294   cmExecuteProcessCommand \
295   cmExpandedCommandArgument \
296   cmExportBuildFileGenerator \
297   cmExportFileGenerator \
298   cmExportInstallFileGenerator \
299   cmExportSet \
300   cmExportSetMap \
301   cmExportTryCompileFileGenerator \
302   cmExprParserHelper \
303   cmExternalMakefileProjectGenerator \
304   cmFileCommand \
305   cmFileCopier \
306   cmFileInstaller \
307   cmFileTime \
308   cmFileTimeCache \
309   cmFileTimes \
310   cmFindBase \
311   cmFindCommon \
312   cmFindFileCommand \
313   cmFindLibraryCommand \
314   cmFindPackageCommand \
315   cmFindPathCommand \
316   cmFindProgramCommand \
317   cmForEachCommand \
318   cmFunctionCommand \
319   cmFSPermissions \
320   cmGeneratedFileStream \
321   cmGeneratorExpression \
322   cmGeneratorExpressionContext \
323   cmGeneratorExpressionDAGChecker \
324   cmGeneratorExpressionEvaluationFile \
325   cmGeneratorExpressionEvaluator \
326   cmGeneratorExpressionLexer \
327   cmGeneratorExpressionNode \
328   cmGeneratorExpressionParser \
329   cmGeneratorTarget \
330   cmGetCMakePropertyCommand \
331   cmGetDirectoryPropertyCommand \
332   cmGetFilenameComponentCommand \
333   cmGetPipes \
334   cmGetPropertyCommand \
335   cmGetSourceFilePropertyCommand \
336   cmGetTargetPropertyCommand \
337   cmGetTestPropertyCommand \
338   cmGlobalCommonGenerator \
339   cmGlobalGenerator \
340   cmGlobalUnixMakefileGenerator3 \
341   cmGlobVerificationManager \
342   cmHexFileConverter \
343   cmIfCommand \
344   cmIncludeCommand \
345   cmIncludeGuardCommand \
346   cmIncludeDirectoryCommand \
347   cmIncludeRegularExpressionCommand \
348   cmInstallCommand \
349   cmInstallCommandArguments \
350   cmInstallDirectoryGenerator \
351   cmInstallExportGenerator \
352   cmInstallFilesCommand \
353   cmInstallFilesGenerator \
354   cmInstallGenerator \
355   cmInstallScriptGenerator \
356   cmInstallSubdirectoryGenerator \
357   cmInstallTargetGenerator \
358   cmInstallTargetsCommand \
359   cmInstalledFile \
360   cmLinkDirectoriesCommand \
361   cmLinkItem \
362   cmLinkLineComputer \
363   cmLinkLineDeviceComputer \
364   cmListCommand \
365   cmListFileCache \
366   cmLocalCommonGenerator \
367   cmLocalGenerator \
368   cmLocalUnixMakefileGenerator3 \
369   cmMSVC60LinkLineComputer \
370   cmMacroCommand \
371   cmMakeDirectoryCommand \
372   cmMakefile \
373   cmMakefileExecutableTargetGenerator \
374   cmMakefileLibraryTargetGenerator \
375   cmMakefileTargetGenerator \
376   cmMakefileUtilityTargetGenerator \
377   cmMarkAsAdvancedCommand \
378   cmMathCommand \
379   cmMessageCommand \
380   cmMessenger \
381   cmNewLineStyle \
382   cmOSXBundleGenerator \
383   cmOptionCommand \
384   cmOrderDirectories \
385   cmOutputConverter \
386   cmParseArgumentsCommand \
387   cmPathLabel \
388   cmPolicies \
389   cmProcessOutput \
390   cmProjectCommand \
391   cmProperty \
392   cmPropertyDefinition \
393   cmPropertyDefinitionMap \
394   cmPropertyMap \
395   cmReturnCommand \
396   cmRulePlaceholderExpander \
397   cmScriptGenerator \
398   cmSearchPath \
399   cmSeparateArgumentsCommand \
400   cmSetCommand \
401   cmSetDirectoryPropertiesCommand \
402   cmSetPropertyCommand \
403   cmSetSourceFilesPropertiesCommand \
404   cmSetTargetPropertiesCommand \
405   cmSetTestsPropertiesCommand \
406   cmSiteNameCommand \
407   cmSourceFile \
408   cmSourceFileLocation \
409   cmState \
410   cmStateDirectory \
411   cmStateSnapshot \
412   cmStringReplaceHelper \
413   cmStringCommand \
414   cmSubdirCommand \
415   cmSystemTools \
416   cmTarget \
417   cmTargetCompileDefinitionsCommand \
418   cmTargetCompileFeaturesCommand \
419   cmTargetCompileOptionsCommand \
420   cmTargetIncludeDirectoriesCommand \
421   cmTargetLinkLibrariesCommand \
422   cmTargetPropCommandBase \
423   cmTargetPropertyComputer \
424   cmTargetSourcesCommand \
425   cmTest \
426   cmTestGenerator \
427   cmTimestamp \
428   cmTryCompileCommand \
429   cmTryRunCommand \
430   cmUnexpectedCommand \
431   cmUnsetCommand \
432   cmUVHandlePtr \
433   cmUVProcessChain \
434   cmVersion \
435   cmWhileCommand \
436   cmWorkingDirectory \
437   cmake  \
438   cmakemain \
439   cmcmd  \
440   cm_string_view \
441 "
442
443 if ${cmake_system_mingw}; then
444   CMAKE_CXX_SOURCES="${CMAKE_CXX_SOURCES}\
445     cmGlobalMSYSMakefileGenerator \
446     cmGlobalMinGWMakefileGenerator"
447 fi
448
449 LexerParser_CXX_SOURCES="\
450   cmCommandArgumentLexer \
451   cmCommandArgumentParser \
452   cmExprLexer \
453   cmExprParser \
454 "
455
456 LexerParser_C_SOURCES="\
457   cmListFileLexer \
458 "
459
460 if ${cmake_system_mingw}; then
461   KWSYS_C_SOURCES="\
462     EncodingC \
463     ProcessWin32 \
464     String \
465     System \
466     Terminal"
467 else
468   KWSYS_C_SOURCES="\
469     EncodingC \
470     ProcessUNIX \
471     String \
472     System \
473     Terminal"
474 fi
475
476 KWSYS_CXX_SOURCES="\
477   Directory \
478   EncodingCXX \
479   FStream \
480   Glob \
481   RegularExpression \
482   SystemTools"
483
484 KWSYS_FILES="\
485   Directory.hxx \
486   Encoding.h \
487   Encoding.hxx \
488   FStream.hxx \
489   Glob.hxx \
490   Process.h \
491   RegularExpression.hxx \
492   String.h \
493   String.hxx \
494   System.h \
495   SystemTools.hxx \
496   Terminal.h"
497
498 if ${cmake_system_mingw}; then
499   LIBUV_C_SOURCES="\
500     src/fs-poll.c \
501     src/idna.c
502     src/inet.c \
503     src/threadpool.c \
504     src/strscpy.c \
505     src/timer.c \
506     src/uv-common.c \
507     src/win/async.c \
508     src/win/core.c \
509     src/win/detect-wakeup.c \
510     src/win/dl.c \
511     src/win/error.c \
512     src/win/fs-event.c \
513     src/win/fs.c \
514     src/win/getaddrinfo.c \
515     src/win/getnameinfo.c \
516     src/win/handle.c \
517     src/win/loop-watcher.c \
518     src/win/pipe.c \
519     src/win/poll.c \
520     src/win/process-stdio.c \
521     src/win/process.c \
522     src/win/signal.c \
523     src/win/stream.c \
524     src/win/tcp.c \
525     src/win/thread.c \
526     src/win/tty.c \
527     src/win/udp.c \
528     src/win/util.c \
529     src/win/winapi.c \
530     src/win/winsock.c \
531     "
532 else
533   LIBUV_C_SOURCES="\
534     src/strscpy.c \
535     src/timer.c \
536     src/uv-common.c \
537     src/unix/cmake-bootstrap.c \
538     src/unix/core.c \
539     src/unix/fs.c \
540     src/unix/loop.c \
541     src/unix/loop-watcher.c \
542     src/unix/no-fsevents.c \
543     src/unix/pipe.c \
544     src/unix/poll.c \
545     src/unix/posix-hrtime.c \
546     src/unix/posix-poll.c \
547     src/unix/process.c \
548     src/unix/signal.c \
549     src/unix/stream.c \
550     "
551 fi
552
553 # Display CMake bootstrap usage
554 cmake_usage()
555 {
556 echo '
557 Usage: '"$0"' [<options>...] [-- <cmake-options>...]
558 Options: [defaults in brackets after descriptions]
559 Configuration:
560   --help                  print this message
561   --version               only print version information
562   --verbose               display more information
563   --parallel=n            bootstrap cmake in parallel, where n is
564                           number of nodes [1]
565   --enable-ccache         Enable ccache when building cmake
566   --init=FILE             load FILE as script to populate cache
567   --system-libs           use all system-installed third-party libraries
568                           (for use only by package maintainers)
569   --no-system-libs        use all cmake-provided third-party libraries
570                           (default)
571   --system-curl           use system-installed curl library
572   --no-system-curl        use cmake-provided curl library (default)
573   --system-expat          use system-installed expat library
574   --no-system-expat       use cmake-provided expat library (default)
575   --system-jsoncpp        use system-installed jsoncpp library
576   --no-system-jsoncpp     use cmake-provided jsoncpp library (default)
577   --system-zlib           use system-installed zlib library
578   --no-system-zlib        use cmake-provided zlib library (default)
579   --system-bzip2          use system-installed bzip2 library
580   --no-system-bzip2       use cmake-provided bzip2 library (default)
581   --system-liblzma        use system-installed liblzma library
582   --no-system-liblzma     use cmake-provided liblzma library (default)
583   --system-zstd           use system-installed zstd library
584   --no-system-zstd        use cmake-provided zstd library (default)
585   --system-libarchive     use system-installed libarchive library
586   --no-system-libarchive  use cmake-provided libarchive library (default)
587   --system-librhash       use system-installed librhash library
588   --no-system-librhash    use cmake-provided librhash library (default)
589   --system-libuv          use system-installed libuv library
590   --no-system-libuv       use cmake-provided libuv library (default)
591
592   --qt-gui                build the Qt-based GUI (requires Qt >= 4.2)
593   --no-qt-gui             do not build the Qt-based GUI (default)
594   --qt-qmake=<qmake>      use <qmake> as the qmake executable to find Qt
595
596   --sphinx-info           build Info manual with Sphinx
597   --sphinx-man            build man pages with Sphinx
598   --sphinx-html           build html help with Sphinx
599   --sphinx-qthelp         build qch help with Sphinx
600   --sphinx-build=<sb>     use <sb> as the sphinx-build executable
601   --sphinx-flags=<flags>  pass <flags> to sphinx-build executable
602
603 Directory and file names:
604   --prefix=PREFIX         install files in tree rooted at PREFIX
605                           ['"${cmake_default_prefix}"']
606   --bindir=DIR            install binaries in PREFIX/DIR
607                           ['"${cmake_bin_dir_default}"']
608   --datadir=DIR           install data files in PREFIX/DIR
609                           ['"${cmake_data_dir_default}"']
610   --docdir=DIR            install documentation files in PREFIX/DIR
611                           ['"${cmake_doc_dir_default}"']
612   --mandir=DIR            install man pages files in PREFIX/DIR/manN
613                           ['"${cmake_man_dir_default}"']
614   --xdgdatadir=DIR        install XDG specific files in PREFIX/DIR
615                           ['"${cmake_xdgdata_dir_default}"']
616 '
617   exit 10
618 }
619
620 # Display CMake bootstrap usage
621 cmake_version_display()
622 {
623   echo "CMake ${cmake_version}, ${cmake_copyright}"
624 }
625
626 # Display CMake bootstrap error, display the log file and exit
627 cmake_error()
628 {
629   res=$1
630   shift 1
631   echo "---------------------------------------------"
632   echo "Error when bootstrapping CMake:"
633   echo "$*"
634   echo "---------------------------------------------"
635   if [ -f cmake_bootstrap.log ]; then
636     echo "Log of errors: `pwd`/cmake_bootstrap.log"
637     #cat cmake_bootstrap.log
638     echo "---------------------------------------------"
639   fi
640   exit ${res}
641 }
642
643 cmake_generate_file ()
644 {
645   OUTFILE="$1"
646   CONTENT="$2"
647   echo "$CONTENT" > "$OUTFILE.tmp"
648   if "${_diff}" "$OUTFILE.tmp" "$OUTFILE" > /dev/null 2> /dev/null ; then
649     rm -f "$OUTFILE.tmp"
650   else
651     mv -f "$OUTFILE.tmp" "$OUTFILE"
652   fi
653 }
654
655 # Replace KWSYS_NAMESPACE with cmsys
656 cmake_replace_string ()
657 {
658   INFILE="$1"
659   OUTFILE="$2"
660   SEARCHFOR="$3"
661   REPLACEWITH="$4"
662   if [ -f "${INFILE}" ] || ${cmake_system_openvms}; then
663     sed "s/\@${SEARCHFOR}\@/${REPLACEWITH}/g" "${INFILE}" > "${OUTFILE}${_tmp}"
664     if [ -f "${OUTFILE}${_tmp}" ]; then
665       if "${_diff}" "${OUTFILE}" "${OUTFILE}${_tmp}" > /dev/null 2> /dev/null ; then
666         #echo "Files are the same"
667         rm -f "${OUTFILE}${_tmp}"
668       else
669         mv -f "${OUTFILE}${_tmp}" "${OUTFILE}"
670       fi
671     fi
672   else
673     cmake_error 1 "Cannot find file ${INFILE}"
674   fi
675 }
676
677 cmake_kwsys_config_replace_string ()
678 {
679   INFILE="$1"
680   OUTFILE="$2"
681   shift 2
682   APPEND="$*"
683   if [ -f "${INFILE}" ] || ${cmake_system_openvms}; then
684     echo "${APPEND}" > "${OUTFILE}${_tmp}"
685     sed "/./ {s/\@KWSYS_NAMESPACE\@/cmsys/g;
686               s/@KWSYS_BUILD_SHARED@/${KWSYS_BUILD_SHARED}/g;
687               s/@KWSYS_LFS_AVAILABLE@/${KWSYS_LFS_AVAILABLE}/g;
688               s/@KWSYS_LFS_REQUESTED@/${KWSYS_LFS_REQUESTED}/g;
689               s/@KWSYS_NAME_IS_KWSYS@/${KWSYS_NAME_IS_KWSYS}/g;
690               s/@KWSYS_STL_HAS_WSTRING@/${KWSYS_STL_HAS_WSTRING}/g;
691               s/@KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H@/${KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H}/g;
692               s/@KWSYS_SYSTEMTOOLS_USE_TRANSLATION_MAP@/${KWSYS_SYSTEMTOOLS_USE_TRANSLATION_MAP}/g;
693              }" "${INFILE}" >> "${OUTFILE}${_tmp}"
694     if [ -f "${OUTFILE}${_tmp}" ]; then
695       if "${_diff}" "${OUTFILE}" "${OUTFILE}${_tmp}" > /dev/null 2> /dev/null ; then
696         #echo "Files are the same"
697         rm -f "${OUTFILE}${_tmp}"
698       else
699         mv -f "${OUTFILE}${_tmp}" "${OUTFILE}"
700       fi
701     fi
702   else
703     cmake_error 2 "Cannot find file ${INFILE}"
704   fi
705 }
706 # Write string into a file
707 cmake_report ()
708 {
709   FILE=$1
710   shift
711   echo "$*" >> ${FILE}
712 }
713
714 # Escape spaces in strings
715 cmake_escape ()
716 {
717   echo $1 | sed "s/ /\\\\ /g"
718 }
719
720 # Encode object file names.
721 cmake_obj ()
722 {
723   echo $1 | sed 's/\//-/g' | sed 's/$/\.o/'
724 }
725
726 # Strip prefix from argument
727 cmake_arg ()
728 {
729   echo "$1" | sed "s/^${2-[^=]*=}//"
730 }
731
732 # Write message to the log
733 cmake_log ()
734 {
735   echo "$*" >> cmake_bootstrap.log
736 }
737
738 # Return temp file
739 cmake_tmp_file ()
740 {
741   echo "cmake_bootstrap_$$_test"
742 }
743
744 # Run a compiler test. First argument is compiler, second one are compiler
745 # flags, third one is test source file to be compiled
746 cmake_try_run ()
747 {
748   COMPILER=$1
749   FLAGS=$2
750   TESTFILE=$3
751   if [ ! -f "${TESTFILE}" ]; then
752     echo "Test file ${TESTFILE} missing. Please verify your CMake source tree."
753     exit 4
754   fi
755   TMPFILE=`cmake_tmp_file`
756   echo "Try: ${COMPILER}"
757   echo "Line: ${COMPILER} ${FLAGS} ${TESTFILE} -o ${TMPFILE}"
758   echo "----------  file   -----------------------"
759   cat "${TESTFILE}"
760   echo "------------------------------------------"
761   "${COMPILER}" ${FLAGS} "${TESTFILE}" -o "${TMPFILE}"
762   RES=$?
763   if [ "${RES}" -ne "0" ]; then
764     echo "Test failed to compile"
765     return 1
766   fi
767   if [ ! -f "${TMPFILE}" ] && [ ! -f "${TMPFILE}.exe" ]; then
768     echo "Test failed to produce executable"
769     return 2
770   fi
771   ./${TMPFILE}
772   RES=$?
773   rm -f "${TMPFILE}"
774   if [ "${RES}" -ne "0" ]; then
775     echo "Test produced non-zero return code"
776     return 3
777   fi
778   echo "Test succeeded"
779   return 0
780 }
781
782 # Run a make test. First argument is the make interpreter.
783 cmake_try_make ()
784 {
785   MAKE_PROC="$1"
786   MAKE_FLAGS="$2"
787   echo "Try: ${MAKE_PROC}"
788   "${MAKE_PROC}" ${MAKE_FLAGS}
789   RES=$?
790   if [ "${RES}" -ne "0" ]; then
791     echo "${MAKE_PROC} does not work"
792     return 1
793   fi
794   if [ ! -f "test" ] && [ ! -f "test.exe" ]; then
795     echo "${COMPILER} does not produce output"
796     return 2
797   fi
798   ./test
799   RES=$?
800   rm -f "test"
801   if [ "${RES}" -ne "0" ]; then
802     echo "${MAKE_PROC} produces strange executable"
803     return 3
804   fi
805   echo "${MAKE_PROC} works"
806   return 0
807 }
808
809 # Parse arguments
810 cmake_verbose=
811 cmake_parallel_make=
812 cmake_ccache_enabled=
813 cmake_prefix_dir="${cmake_default_prefix}"
814 while test $# != 0; do
815   case "$1" in
816   --prefix=*) dir=`cmake_arg "$1"`
817               cmake_prefix_dir=`cmake_fix_slashes "$dir"` ;;
818   --parallel=*) cmake_parallel_make=`cmake_arg "$1"` ;;
819   --bindir=*) cmake_bin_dir=`cmake_arg "$1"` ;;
820   --datadir=*) cmake_data_dir=`cmake_arg "$1"` ;;
821   --docdir=*) cmake_doc_dir=`cmake_arg "$1"` ;;
822   --mandir=*) cmake_man_dir=`cmake_arg "$1"` ;;
823   --xdgdatadir=*) cmake_xdgdata_dir=`cmake_arg "$1"` ;;
824   --init=*) cmake_init_file=`cmake_arg "$1"` ;;
825   --system-libs) cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARIES=1" ;;
826   --no-system-libs) cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARIES=0" ;;
827   --system-bzip2|--system-curl|--system-expat|--system-jsoncpp|--system-libarchive|--system-librhash|--system-zlib|--system-liblzma|--system-zstd|--system-libuv)
828     lib=`cmake_arg "$1" "--system-"`
829     cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARY_`cmake_toupper $lib`=1" ;;
830   --no-system-bzip2|--no-system-curl|--no-system-expat|--no-system-jsoncpp|--no-system-libarchive|--no-system-librhash|--no-system-zlib|--no-system-liblzma|--no-system-zstd|--no-system-libuv)
831     lib=`cmake_arg "$1" "--no-system-"`
832     cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARY_`cmake_toupper $lib`=0" ;;
833   --qt-gui) cmake_bootstrap_qt_gui="1" ;;
834   --no-qt-gui) cmake_bootstrap_qt_gui="0" ;;
835   --qt-qmake=*) cmake_bootstrap_qt_qmake=`cmake_arg "$1"` ;;
836   --sphinx-info) cmake_sphinx_info="1" ;;
837   --sphinx-man) cmake_sphinx_man="1" ;;
838   --sphinx-html) cmake_sphinx_html="1" ;;
839   --sphinx-qthelp) cmake_sphinx_qthelp="1" ;;
840   --sphinx-build=*) cmake_sphinx_build=`cmake_arg "$1"` ;;
841   --sphinx-flags=*) cmake_sphinx_flags=`cmake_arg "$1"` ;;
842   --help) cmake_usage ;;
843   --version) cmake_version_display ; exit 2 ;;
844   --verbose) cmake_verbose=TRUE ;;
845   --enable-ccache) cmake_ccache_enabled=TRUE ;;
846   CC=*) CC=`cmake_arg "$1"` ;;
847   CXX=*) CXX=`cmake_arg "$1"` ;;
848   CFLAGS=*) CFLAGS=`cmake_arg "$1"` ;;
849   CXXFLAGS=*) CXXFLAGS=`cmake_arg "$1"` ;;
850   LDFLAGS=*) LDFLAGS=`cmake_arg "$1"` ;;
851   --) shift; break ;;
852   *) die "Unknown option: $1" ;;
853   esac
854   shift
855 done
856
857 # If verbose, display some information about bootstrap
858 if [ -n "${cmake_verbose}" ]; then
859   echo "---------------------------------------------"
860   echo "Source directory: ${cmake_source_dir}"
861   echo "Binary directory: ${cmake_binary_dir}"
862   echo "Prefix directory: ${cmake_prefix_dir}"
863   echo "System:           ${cmake_system}"
864   if [ "x${cmake_parallel_make}" != "x" ]; then
865     echo "Doing parallel make: ${cmake_parallel_make}"
866   fi
867   echo ""
868 fi
869
870 echo "---------------------------------------------"
871 # Get CMake version
872 echo "`cmake_version_display`"
873
874 # Check for in-source build
875 cmake_in_source_build=
876 if [ -f "${cmake_binary_dir}/Source/cmake.cxx" -a \
877      -f "${cmake_binary_dir}/Source/cmake.h" ]; then
878   if [ -n "${cmake_verbose}" ]; then
879     echo "Warning: This is an in-source build"
880   fi
881   cmake_in_source_build=TRUE
882 fi
883
884 # If this is not an in-source build, then Bootstrap stuff should not exist.
885 if [ -z "${cmake_in_source_build}" ]; then
886   # Did somebody bootstrap in the source tree?
887   if [ -d "${cmake_source_dir}/Bootstrap${_cmk}" ]; then
888     cmake_error 10 "Found directory \"${cmake_source_dir}/Bootstrap${_cmk}\".
889 Looks like somebody did bootstrap CMake in the source tree, but now you are
890 trying to do bootstrap in the binary tree. Please remove Bootstrap${_cmk}
891 directory from the source tree."
892   fi
893   # Is there a cache in the source tree?
894   for cmake_problematic_file in ${CMAKE_PROBLEMATIC_FILES}; do
895     if [ -f "${cmake_source_dir}/${cmake_problematic_file}" ]; then
896       cmake_error 10 "Found \"${cmake_source_dir}/${cmake_problematic_file}\".
897 Looks like somebody tried to build CMake in the source tree, but now you are
898 trying to do bootstrap in the binary tree. Please remove \"${cmake_problematic_file}\"
899 from the source tree."
900     fi
901   done
902 fi
903
904 # Make bootstrap directory
905 [ -d "${cmake_bootstrap_dir}" ] || mkdir "${cmake_bootstrap_dir}"
906 if [ ! -d "${cmake_bootstrap_dir}" ]; then
907   cmake_error 3 "Cannot create directory ${cmake_bootstrap_dir} to bootstrap CMake."
908 fi
909 cd "${cmake_bootstrap_dir}"
910
911 [ -d "cmsys" ] || mkdir "cmsys"
912 if [ ! -d "cmsys" ]; then
913   cmake_error 4 "Cannot create directory ${cmake_bootstrap_dir}/cmsys"
914 fi
915
916 # Delete all the bootstrap files
917 rm -f "${cmake_bootstrap_dir}/cmake_bootstrap.log"
918 rm -f "${cmake_bootstrap_dir}/cmConfigure.h${_tmp}"
919 rm -f "${cmake_bootstrap_dir}/cmVersionConfig.h${_tmp}"
920
921 # If building in-source, remove any cmConfigure.h that may
922 # have been created by a previous run of the bootstrap cmake.
923 if [ -n "${cmake_in_source_build}" ]; then
924   rm -f "${cmake_source_dir}/Source/cmConfigure.h"
925 fi
926
927 # If exist compiler flags, set them
928 cmake_c_flags=${CFLAGS}
929 cmake_cxx_flags=${CXXFLAGS}
930 cmake_ld_flags=${LDFLAGS}
931
932 # Add Cygwin-specific flags
933 if ${cmake_system_cygwin}; then
934   cmake_ld_flags="${LDFLAGS} -Wl,--enable-auto-import"
935 fi
936
937 # Add CoreFoundation framework on Darwin
938 if ${cmake_system_darwin}; then
939   cmake_ld_flags="${LDFLAGS} -framework CoreFoundation"
940 fi
941
942 # Add BeOS toolkits...
943 if ${cmake_system_beos}; then
944   cmake_ld_flags="${LDFLAGS} -lroot -lbe"
945 fi
946
947 # Add Haiku toolkits...
948 if ${cmake_system_haiku}; then
949   cmake_ld_flags="${LDFLAGS} -lroot -lbe"
950 fi
951
952 #-----------------------------------------------------------------------------
953 # Detect known toolchains on some platforms.
954 cmake_toolchains=''
955 case "${cmake_system}" in
956   *AIX*)   cmake_toolchains='XL GNU' ;;
957   *CYGWIN*) cmake_toolchains='GNU' ;;
958   *Darwin*) cmake_toolchains='Clang GNU' ;;
959   *Linux*) cmake_toolchains='GNU Clang XL PGI PathScale' ;;
960   *MINGW*) cmake_toolchains='GNU' ;;
961 esac
962
963 # Toolchain compiler name table.
964 cmake_toolchain_Clang_CC='clang'
965 cmake_toolchain_Clang_CXX='clang++'
966 cmake_toolchain_GNU_CC='gcc'
967 cmake_toolchain_GNU_CXX='g++'
968 cmake_toolchain_PGI_CC='pgcc'
969 cmake_toolchain_PGI_CXX='pgCC'
970 cmake_toolchain_PathScale_CC='pathcc'
971 cmake_toolchain_PathScale_CXX='pathCC'
972 cmake_toolchain_XL_CC='xlc'
973 cmake_toolchain_XL_CXX='xlC'
974
975 cmake_toolchain_try()
976 {
977   tc="$1"
978   TMPFILE=`cmake_tmp_file`
979
980   eval "tc_CC=\${cmake_toolchain_${tc}_CC}"
981   echo 'int main() { return 0; }' > "${TMPFILE}.c"
982   cmake_try_run "$tc_CC" "" "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1
983   tc_result_CC="$?"
984   rm -f "${TMPFILE}.c"
985   test "${tc_result_CC}" = "0" || return 1
986
987   eval "tc_CXX=\${cmake_toolchain_${tc}_CXX}"
988   echo 'int main() { return 0; }' > "${TMPFILE}.cpp"
989   cmake_try_run "$tc_CXX" "" "${TMPFILE}.cpp" >> cmake_bootstrap.log 2>&1
990   tc_result_CXX="$?"
991   rm -f "${TMPFILE}.cpp"
992   test "${tc_result_CXX}" = "0" || return 1
993
994   cmake_toolchain="$tc"
995 }
996
997 cmake_toolchain_detect()
998 {
999   cmake_toolchain=
1000   for tc in ${cmake_toolchains}; do
1001     echo "Checking for $tc toolchain" >> cmake_bootstrap.log 2>&1
1002     cmake_toolchain_try "$tc" &&
1003     echo "Found $tc toolchain" &&
1004     break
1005   done
1006 }
1007
1008 if [ -z "${CC}" -a -z "${CXX}" ]; then
1009   cmake_toolchain_detect
1010 fi
1011
1012 thread_flags=''
1013 case "${cmake_system}" in
1014   *AIX*)   thread_flags='-pthread' ;;
1015 esac
1016
1017 #-----------------------------------------------------------------------------
1018 # Test C compiler
1019 cmake_c_compiler=
1020
1021 # If CC is set, use that for compiler, otherwise use list of known compilers
1022 if [ -n "${cmake_toolchain}" ]; then
1023   eval cmake_c_compilers="\${cmake_toolchain_${cmake_toolchain}_CC}"
1024 elif [ -n "${CC}" ]; then
1025   cmake_c_compilers="${CC}"
1026 else
1027   cmake_c_compilers="${CMAKE_KNOWN_C_COMPILERS}"
1028 fi
1029
1030 # Check if C compiler works
1031 TMPFILE=`cmake_tmp_file`
1032 echo '
1033 #ifdef __cplusplus
1034 # error "The CMAKE_C_COMPILER is set to a C++ compiler"
1035 #endif
1036
1037 #if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
1038 #error "On AIX with GNU we need the -pthread flag."
1039 #endif
1040
1041 #if defined(__sun) && __STDC_VERSION__ < 199901L
1042 #error "On Solaris we need C99."
1043 #endif
1044
1045 #include <stdio.h>
1046
1047 int main(int argc, char* argv[])
1048 {
1049   printf("%d%c", (argv != 0), (char)0x0a);
1050   return argc - 1;
1051 }
1052 ' > "${TMPFILE}.c"
1053 for std in 11 99 90; do
1054   std_flags="`cmake_extract_standard_flags \"${cmake_toolchain}\" C \"${std}\"`"
1055   for compiler in ${cmake_c_compilers}; do
1056     for std_flag in '' $std_flags; do
1057       for thread_flag in '' $thread_flags; do
1058         echo "Checking whether '${compiler} ${cmake_c_flags} ${std_flag} ${thread_flag}' works." >> cmake_bootstrap.log 2>&1
1059         if cmake_try_run "${compiler}" "${cmake_c_flags} ${std_flag} ${thread_flag}" \
1060           "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then
1061           cmake_c_compiler="${compiler}"
1062           cmake_c_flags="${cmake_c_flags} ${std_flag} ${thread_flag}"
1063           break 3
1064         fi
1065       done
1066     done
1067   done
1068 done
1069 rm -f "${TMPFILE}.c"
1070
1071 if [ -z "${cmake_c_compiler}" ]; then
1072   cmake_error 6 "Cannot find appropriate C compiler on this system.
1073 Please specify one using environment variable CC.
1074 See cmake_bootstrap.log for compilers attempted.
1075 "
1076 fi
1077 echo "C compiler on this system is: ${cmake_c_compiler} ${cmake_c_flags}"
1078
1079 #-----------------------------------------------------------------------------
1080 # Test CXX compiler
1081 cmake_cxx_compiler=
1082
1083 # On Mac OSX, CC is the same as cc, so make sure not to try CC as c++ compiler.
1084
1085 # If CC is set, use that for compiler, otherwise use list of known compilers
1086 if [ -n "${cmake_toolchain}" ]; then
1087   eval cmake_cxx_compilers="\${cmake_toolchain_${cmake_toolchain}_CXX}"
1088 elif [ -n "${CXX}" ]; then
1089   cmake_cxx_compilers="${CXX}"
1090 else
1091   cmake_cxx_compilers="${CMAKE_KNOWN_CXX_COMPILERS}"
1092 fi
1093
1094 # Check if C++ compiler works
1095 TMPFILE=`cmake_tmp_file`
1096 echo '
1097 #include <iostream>
1098 #include <memory>
1099 #include <unordered_map>
1100
1101 #if __cplusplus < 201103L
1102 #error "Compiler is not in a mode aware of C++11."
1103 #endif
1104
1105 #if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
1106 #error "On AIX with GNU we need the -pthread flag."
1107 #endif
1108
1109 #if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
1110 #error "SunPro <= 5.13 mode not supported due to bug in move semantics."
1111 #endif
1112
1113 class Class
1114 {
1115 public:
1116   int Get() const { return this->Member; }
1117 private:
1118   int Member = 1;
1119 };
1120 int main()
1121 {
1122   auto const c = std::unique_ptr<Class>(new Class);
1123   std::cout << c->Get() << std::endl;
1124   return 0;
1125 }
1126 ' > "${TMPFILE}.cxx"
1127 for std in 17 14 11; do
1128   std_flags="`cmake_extract_standard_flags \"${cmake_toolchain}\" CXX \"${std}\"`"
1129   for compiler in ${cmake_cxx_compilers}; do
1130     for std_flag in '' $std_flags; do
1131       for thread_flag in '' $thread_flags; do
1132         echo "Checking whether '${compiler} ${cmake_cxx_flags} ${std_flag} ${thread_flag}' works." >> cmake_bootstrap.log 2>&1
1133         if cmake_try_run "${compiler}" "${cmake_cxx_flags} ${std_flag} ${thread_flag}" \
1134           "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
1135           cmake_cxx_compiler="${compiler}"
1136           cmake_cxx_flags="${cmake_cxx_flags} ${std_flag} ${thread_flag} "
1137           break 3
1138         fi
1139       done
1140     done
1141   done
1142 done
1143 rm -f "${TMPFILE}.cxx"
1144
1145 if [ -z "${cmake_cxx_compiler}" ]; then
1146 cmake_error 7 "Cannot find a C++ compiler that supports both C++11 and the specified C++ flags.
1147 Please specify one using environment variable CXX.
1148 The C++ flags are \"$cmake_cxx_flags\".
1149 They can be changed using the environment variable CXXFLAGS.
1150 See cmake_bootstrap.log for compilers attempted."
1151 fi
1152 echo "C++ compiler on this system is: ${cmake_cxx_compiler} ${cmake_cxx_flags}"
1153
1154 #-----------------------------------------------------------------------------
1155 # Test Make
1156
1157 cmake_make_processor=
1158 cmake_make_flags=
1159
1160 # If MAKE is set, use that for make processor, otherwise use list of known make
1161 if [ -n "${MAKE}" ]; then
1162   cmake_make_processors="${MAKE}"
1163 else
1164   cmake_make_processors="${CMAKE_KNOWN_MAKE_PROCESSORS}"
1165 fi
1166
1167 TMPFILE="`cmake_tmp_file`_dir"
1168 rm -rf "${cmake_bootstrap_dir}/${TMPFILE}"
1169 mkdir "${cmake_bootstrap_dir}/${TMPFILE}"
1170 cd "${cmake_bootstrap_dir}/${TMPFILE}"
1171 echo '
1172 test: test.c
1173         "'"${cmake_c_compiler}"'" '"${cmake_ld_flags} ${cmake_c_flags}"' -o test test.c
1174 '>"Makefile"
1175 echo '
1176 #include <stdio.h>
1177 int main(){ printf("1%c", (char)0x0a); return 0; }
1178 ' > "test.c"
1179 cmake_original_make_flags="${cmake_make_flags}"
1180 if [ "x${cmake_parallel_make}" != "x" ]; then
1181   cmake_make_flags="${cmake_make_flags} -j ${cmake_parallel_make}"
1182 fi
1183 for a in ${cmake_make_processors}; do
1184   if [ -z "${cmake_make_processor}" ] && cmake_try_make "${a}" "${cmake_make_flags}" >> ../cmake_bootstrap.log 2>&1; then
1185     cmake_make_processor="${a}"
1186   fi
1187 done
1188 cmake_full_make_flags="${cmake_make_flags}"
1189 if [ "x${cmake_original_make_flags}" != "x${cmake_make_flags}" ]; then
1190   if [ -z "${cmake_make_processor}" ]; then
1191     cmake_make_flags="${cmake_original_make_flags}"
1192     for a in ${cmake_make_processors}; do
1193       if [ -z "${cmake_make_processor}" ] && cmake_try_make "${a}" "${cmake_make_flags}" >> ../cmake_bootstrap.log 2>&1; then
1194         cmake_make_processor="${a}"
1195       fi
1196     done
1197   fi
1198 fi
1199 cd "${cmake_bootstrap_dir}"
1200
1201 if [ -z "${cmake_make_processor}" ]; then
1202   cmake_error 8 "Cannot find appropriate Makefile processor on this system.
1203 Please specify one using environment variable MAKE."
1204 fi
1205 rm -rf "${cmake_bootstrap_dir}/${TMPFILE}"
1206 echo "Makefile processor on this system is: ${cmake_make_processor}"
1207 if [ "x${cmake_full_make_flags}" != "x${cmake_make_flags}" ]; then
1208   echo "---------------------------------------------"
1209   echo "Makefile processor ${cmake_make_processor} does not support parallel build"
1210   echo "---------------------------------------------"
1211 fi
1212
1213 # Test for kwsys features
1214 KWSYS_NAME_IS_KWSYS=0
1215 KWSYS_BUILD_SHARED=0
1216 KWSYS_LFS_AVAILABLE=0
1217 KWSYS_LFS_REQUESTED=0
1218 KWSYS_STL_HAS_WSTRING=0
1219 KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H=0
1220 KWSYS_CXX_HAS_SETENV=0
1221 KWSYS_CXX_HAS_UNSETENV=0
1222 KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=0
1223 KWSYS_CXX_HAS_UTIMENSAT=0
1224 KWSYS_CXX_HAS_UTIMES=0
1225 KWSYS_SYSTEMTOOLS_USE_TRANSLATION_MAP=1
1226
1227 if cmake_try_run "${cmake_cxx_compiler}" \
1228   "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_SETENV" \
1229   "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
1230   KWSYS_CXX_HAS_SETENV=1
1231   echo "${cmake_cxx_compiler} has setenv"
1232 else
1233   echo "${cmake_cxx_compiler} does not have setenv"
1234 fi
1235
1236 if cmake_try_run "${cmake_cxx_compiler}" \
1237   "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_UNSETENV" \
1238   "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
1239   KWSYS_CXX_HAS_UNSETENV=1
1240   echo "${cmake_cxx_compiler} has unsetenv"
1241 else
1242   echo "${cmake_cxx_compiler} does not have unsetenv"
1243 fi
1244
1245 if cmake_try_run "${cmake_cxx_compiler}" \
1246   "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H" \
1247   "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
1248   KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=1
1249   echo "${cmake_cxx_compiler} has environ in stdlib.h"
1250 else
1251   echo "${cmake_cxx_compiler} does not have environ in stdlib.h"
1252 fi
1253
1254 if cmake_try_run "${cmake_cxx_compiler}" \
1255   "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_WSTRING" \
1256   "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
1257   KWSYS_STL_HAS_WSTRING=1
1258   echo "${cmake_cxx_compiler} has stl wstring"
1259 else
1260   echo "${cmake_cxx_compiler} does not have stl wstring"
1261 fi
1262
1263 if cmake_try_run "${cmake_cxx_compiler}" \
1264   "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H" \
1265   "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
1266   KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H=1
1267   echo "${cmake_cxx_compiler} has <ext/stdio_filebuf.h>"
1268 else
1269   echo "${cmake_cxx_compiler} does not have <ext/stdio_filebuf.h>"
1270 fi
1271
1272 if [ -n "${cmake_ccache_enabled}" ]; then
1273   echo "Building CMake with ccache"
1274   cmake_c_compiler="ccache ${cmake_c_compiler}"
1275   cmake_cxx_compiler="ccache ${cmake_cxx_compiler}"
1276 fi
1277
1278 # Just to be safe, let us store compiler and flags to the header file
1279
1280 cmake_bootstrap_version='$Revision$'
1281 cmake_compiler_settings_comment="/*
1282  * Generated by ${cmake_source_dir}/bootstrap
1283  * Version:     ${cmake_bootstrap_version}
1284  *
1285  * Source directory: ${cmake_source_dir}
1286  * Binary directory: ${cmake_bootstrap_dir}
1287  *
1288  * C compiler:   ${cmake_c_compiler}
1289  * C flags:      ${cmake_c_flags}
1290  *
1291  * C++ compiler: ${cmake_cxx_compiler}
1292  * C++ flags:    ${cmake_cxx_flags}
1293  *
1294  * Make:         ${cmake_make_processor}
1295  *
1296  * Sources:
1297  * ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES}
1298  * LexerParser Sources:
1299  * ${LexerParser_CXX_SOURCES} ${LexerParser_C_SOURCES}
1300  * kwSys Sources:
1301  * ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES}
1302  * libuv Sources:
1303  * ${LIBUV_C_SOURCES}
1304  */
1305 "
1306
1307 cmake_report cmConfigure.h${_tmp} "${cmake_compiler_settings_comment}"
1308
1309 # When bootstrapping on MinGW with MSYS we must convert the source
1310 # directory to a windows path.
1311 if ${cmake_system_mingw}; then
1312     CMAKE_BOOTSTRAP_SOURCE_DIR=`cd "${cmake_source_dir}"; pwd -W`
1313     CMAKE_BOOTSTRAP_BINARY_DIR=`cd "${cmake_binary_dir}"; pwd -W`
1314 else
1315     CMAKE_BOOTSTRAP_SOURCE_DIR="${cmake_source_dir}"
1316     CMAKE_BOOTSTRAP_BINARY_DIR="${cmake_binary_dir}"
1317 fi
1318
1319 # Write CMake version
1320 cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_MAJOR ${cmake_version_major}"
1321 cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_MINOR ${cmake_version_minor}"
1322 cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_PATCH ${cmake_version_patch}"
1323 cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION \"${cmake_version}\""
1324 cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP_SOURCE_DIR \"${CMAKE_BOOTSTRAP_SOURCE_DIR}\""
1325 cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP_BINARY_DIR \"${CMAKE_BOOTSTRAP_BINARY_DIR}\""
1326 cmake_report cmConfigure.h${_tmp} "#define CMake_DEFAULT_RECURSION_LIMIT 400"
1327 cmake_report cmConfigure.h${_tmp} "#define CMAKE_BIN_DIR \"/bootstrap-not-insalled\""
1328 cmake_report cmConfigure.h${_tmp} "#define CMAKE_DATA_DIR \"/bootstrap-not-insalled\""
1329 cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP"
1330 cmake_report cmConfigure.h${_tmp} "#define CM_FALLTHROUGH"
1331
1332 # Regenerate configured headers
1333 for h in Configure VersionConfig; do
1334   if "${_diff}" cm${h}.h cm${h}.h${_tmp} > /dev/null 2> /dev/null; then
1335     rm -f cm${h}.h${_tmp}
1336   else
1337     mv -f cm${h}.h${_tmp} cm${h}.h
1338   fi
1339 done
1340
1341 # Prepare KWSYS
1342 cmake_kwsys_config_replace_string \
1343   "${cmake_source_dir}/Source/kwsys/Configure.hxx.in" \
1344   "${cmake_bootstrap_dir}/cmsys/Configure.hxx" \
1345   "${cmake_compiler_settings_comment}"
1346 cmake_kwsys_config_replace_string \
1347   "${cmake_source_dir}/Source/kwsys/Configure.h.in" \
1348   "${cmake_bootstrap_dir}/cmsys/Configure.h" \
1349   "${cmake_compiler_settings_comment}"
1350
1351 for a in ${KWSYS_FILES}; do
1352   cmake_replace_string "${cmake_source_dir}/Source/kwsys/${a}.in" \
1353      "${cmake_bootstrap_dir}/cmsys/${a}" KWSYS_NAMESPACE cmsys
1354 done
1355
1356 cmake_generate_file "${cmake_bootstrap_dir}/cmThirdParty.h" ""
1357
1358 # Generate Makefile
1359 dep="cmConfigure.h cmsys/*.hxx cmsys/*.h `cmake_escape \"${cmake_source_dir}\"`/Source/*.h"
1360 objs=""
1361 for a in ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES} ${LexerParser_CXX_SOURCES} ${LexerParser_C_SOURCES} ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES}; do
1362   objs="${objs} ${a}.o"
1363 done
1364 for a in ${LIBUV_C_SOURCES}; do
1365   objs="${objs} uv-`cmake_obj ${a}`"
1366 done
1367
1368 libs=""
1369
1370 uv_c_flags=""
1371 if ${cmake_system_mingw}; then
1372   uv_c_flags="${uv_c_flags} -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0600"
1373   libs="${libs} -lws2_32 -lpsapi -liphlpapi -lshell32 -luserenv"
1374 else
1375   uv_c_flags="${uv_c_flags} -DCMAKE_BOOTSTRAP"
1376   case "${cmake_system}" in
1377     *AIX*)
1378       uv_c_flags="${uv_c_flags} -D_ALL_SOURCE -D_XOPEN_SOURCE=500 -D_LINUX_SOURCE_COMPAT"
1379       libs="${libs} -lperfstat"
1380       ;;
1381     *Darwin*)
1382       uv_c_flags="${uv_c_flags} -D_DARWIN_USE_64_BIT_INODE=1 -D_DARWIN_UNLIMITED_SELECT=1"
1383       ;;
1384     *Linux*)
1385       uv_c_flags="${uv_c_flags} -D_GNU_SOURCE"
1386       libs="${libs} -ldl -lrt"
1387       ;;
1388     *kFreeBSD*)
1389       libs="${libs} -lkvm -lfreebsd-glue"
1390       ;;
1391     *BSD*)
1392       libs="${libs} -lkvm"
1393       ;;
1394     *SunOS*)
1395       # Normally libuv uses '-D_XOPEN_SOURCE=500 -std=c90' on Solaris 5.10,
1396       # but we do not need to do that because we bootstrap using POSIX APIs.
1397       uv_c_flags="${uv_c_flags} -D__EXTENSIONS__ -D_XOPEN_SOURCE=600"
1398       libs="${libs} -lkstat -lnsl -lsendfile -lsocket -lrt"
1399       ;;
1400   esac
1401 fi
1402 uv_c_flags="${uv_c_flags} `cmake_escape "-I${cmake_source_dir}/Utilities/cmlibuv/include"`"
1403 if ${cmake_system_mingw}; then
1404   uv_c_flags="${uv_c_flags} `cmake_escape "-I${cmake_source_dir}/Utilities/cmlibuv/src/win"`"
1405 else
1406   uv_c_flags="${uv_c_flags} `cmake_escape "-I${cmake_source_dir}/Utilities/cmlibuv/src/unix"`"
1407 fi
1408 uv_c_flags="${uv_c_flags} `cmake_escape "-I${cmake_source_dir}/Utilities/cmlibuv/src"`"
1409
1410 if [ "x${cmake_ansi_cxx_flags}" != "x" ]; then
1411   cmake_cxx_flags="${cmake_ansi_cxx_flags} ${cmake_cxx_flags}"
1412 fi
1413
1414 if [ "x${cmake_c_flags}" != "x" ]; then
1415   cmake_c_flags="${cmake_c_flags} "
1416 fi
1417
1418 if [ "x${cmake_cxx_flags}" != "x" ]; then
1419   cmake_cxx_flags="${cmake_cxx_flags} "
1420 fi
1421
1422 cmake_c_flags_String="-DKWSYS_STRING_C"
1423 if ${cmake_system_mingw}; then
1424   cmake_c_flags_EncodingC="-DKWSYS_ENCODING_DEFAULT_CODEPAGE=CP_ACP"
1425   cmake_cxx_flags_EncodingCXX="${cmake_c_flags_EncodingC}"
1426   cmake_cxx_flags_cmProcessOutput="${cmake_c_flags_EncodingC}"
1427 fi
1428 cmake_cxx_flags_SystemTools="
1429   -DKWSYS_CXX_HAS_SETENV=${KWSYS_CXX_HAS_SETENV}
1430   -DKWSYS_CXX_HAS_UNSETENV=${KWSYS_CXX_HAS_UNSETENV}
1431   -DKWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=${KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H}
1432   -DKWSYS_CXX_HAS_UTIMENSAT=${KWSYS_CXX_HAS_UTIMENSAT}
1433   -DKWSYS_CXX_HAS_UTIMES=${KWSYS_CXX_HAS_UTIMES}
1434 "
1435 cmake_c_flags="${cmake_c_flags} \
1436   -I`cmake_escape \"${cmake_bootstrap_dir}\"` \
1437   -I`cmake_escape \"${cmake_source_dir}/Source\"` \
1438   -I`cmake_escape \"${cmake_source_dir}/Source/LexerParser\"` \
1439   -I`cmake_escape \"${cmake_source_dir}/Utilities\"`"
1440 cmake_cxx_flags="${cmake_cxx_flags} \
1441   -I`cmake_escape \"${cmake_bootstrap_dir}\"` \
1442   -I`cmake_escape \"${cmake_source_dir}/Source\"` \
1443   -I`cmake_escape \"${cmake_source_dir}/Source/LexerParser\"` \
1444   -I`cmake_escape \"${cmake_source_dir}/Utilities\"`"
1445 echo "cmake: ${objs}" > "${cmake_bootstrap_dir}/Makefile"
1446 echo "  ${cmake_cxx_compiler} ${cmake_ld_flags} ${cmake_cxx_flags} ${objs} ${libs} -o cmake" >> "${cmake_bootstrap_dir}/Makefile"
1447 for a in ${CMAKE_CXX_SOURCES}; do
1448   src=`cmake_escape "${cmake_source_dir}/Source/${a}.cxx"`
1449   src_flags=`eval echo \\${cmake_cxx_flags_\${a}}`
1450   echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
1451   echo "        ${cmake_cxx_compiler} ${cmake_cxx_flags} ${src_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
1452 done
1453 for a in ${CMAKE_C_SOURCES}; do
1454   src=`cmake_escape "${cmake_source_dir}/Source/${a}.c"`
1455   echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
1456   echo "        ${cmake_c_compiler} ${cmake_c_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
1457 done
1458 for a in ${LexerParser_CXX_SOURCES}; do
1459   src=`cmake_escape "${cmake_source_dir}/Source/LexerParser/${a}.cxx"`
1460   src_flags=`eval echo \\${cmake_cxx_flags_\${a}}`
1461   echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
1462   echo "        ${cmake_cxx_compiler} ${cmake_cxx_flags} ${src_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
1463 done
1464 for a in ${LexerParser_C_SOURCES}; do
1465   src=`cmake_escape "${cmake_source_dir}/Source/LexerParser/${a}.c"`
1466   echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
1467   echo "        ${cmake_c_compiler} ${cmake_c_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
1468 done
1469 for a in ${KWSYS_C_SOURCES}; do
1470   src=`cmake_escape "${cmake_source_dir}/Source/kwsys/${a}.c"`
1471   src_flags=`eval echo \\${cmake_c_flags_\${a}}`
1472   echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
1473   echo "        ${cmake_c_compiler} ${cmake_c_flags} -DKWSYS_NAMESPACE=cmsys ${src_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
1474 done
1475 for a in ${KWSYS_CXX_SOURCES}; do
1476   src=`cmake_escape "${cmake_source_dir}/Source/kwsys/${a}.cxx"`
1477   src_flags=`eval echo \\${cmake_cxx_flags_\${a}}`
1478   echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
1479   echo "        ${cmake_cxx_compiler} ${cmake_cxx_flags} -DKWSYS_NAMESPACE=cmsys ${src_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
1480 done
1481 for a in ${LIBUV_C_SOURCES}; do
1482   src=`cmake_escape "${cmake_source_dir}/Utilities/cmlibuv/${a}"`
1483   echo "uv-`cmake_obj ${a}` : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
1484   echo "        ${cmake_c_compiler} ${cmake_c_flags} ${uv_c_flags} -c ${src} -o uv-`cmake_obj ${a}`" >> "${cmake_bootstrap_dir}/Makefile"
1485 done
1486 echo '
1487 rebuild_cache:
1488         cd "${cmake_binary_dir}" && "${cmake_source_dir}/bootstrap"
1489 ' >> "${cmake_bootstrap_dir}/Makefile"
1490
1491 # Write our default settings to Bootstrap${_cmk}/InitialCacheFlags.cmake.
1492 echo '
1493 # Generated by '"${cmake_source_dir}"'/bootstrap
1494 # Default cmake settings.  These may be overridden any settings below.
1495 set (CMAKE_INSTALL_PREFIX "'"${cmake_prefix_dir}"'" CACHE PATH "Install path prefix, prepended onto install directories." FORCE)
1496 set (CMAKE_DOC_DIR "'"${cmake_doc_dir}"'" CACHE PATH "Install location for documentation (relative to prefix)." FORCE)
1497 set (CMAKE_MAN_DIR "'"${cmake_man_dir}"'" CACHE PATH "Install location for man pages (relative to prefix)." FORCE)
1498 set (CMAKE_BIN_DIR "'"${cmake_bin_dir}"'" CACHE PATH "Install location for binaries (relative to prefix)." FORCE)
1499 set (CMAKE_DATA_DIR "'"${cmake_data_dir}"'" CACHE PATH "Install location for data (relative to prefix)." FORCE)
1500 set (CMAKE_XDGDATA_DIR "'"${cmake_xdgdata_dir}"'" CACHE PATH "Install location for XDG specific files (relative to prefix)." FORCE)
1501 ' > "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
1502
1503 # Add configuration settings given as command-line options.
1504 if [ "x${cmake_bootstrap_qt_gui}" != "x" ]; then
1505   echo '
1506 set (BUILD_QtDialog '"${cmake_bootstrap_qt_gui}"' CACHE BOOL "Build Qt dialog for CMake" FORCE)
1507 ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
1508 fi
1509 if [ "x${cmake_bootstrap_qt_qmake}" != "x" ]; then
1510   echo '
1511 set (QT_QMAKE_EXECUTABLE "'"${cmake_bootstrap_qt_qmake}"'" CACHE FILEPATH "Location of Qt qmake" FORCE)
1512 ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
1513 fi
1514 if [ "x${cmake_sphinx_info}" != "x" ]; then
1515   echo '
1516 set (SPHINX_INFO "'"${cmake_sphinx_info}"'" CACHE BOOL "Build Info manual with Sphinx" FORCE)
1517 ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
1518 fi
1519 if [ "x${cmake_sphinx_man}" != "x" ]; then
1520   echo '
1521 set (SPHINX_MAN "'"${cmake_sphinx_man}"'" CACHE BOOL "Build man pages with Sphinx" FORCE)
1522 ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
1523 fi
1524 if [ "x${cmake_sphinx_html}" != "x" ]; then
1525   echo '
1526 set (SPHINX_HTML "'"${cmake_sphinx_html}"'" CACHE BOOL "Build html help with Sphinx" FORCE)
1527 ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
1528 fi
1529 if [ "x${cmake_sphinx_qthelp}" != "x" ]; then
1530   echo '
1531 set (SPHINX_QTHELP "'"${cmake_sphinx_qthelp}"'" CACHE BOOL "Build qch help with Sphinx" FORCE)
1532 ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
1533 fi
1534 if [ "x${cmake_sphinx_build}" != "x" ]; then
1535   echo '
1536 set (SPHINX_EXECUTABLE "'"${cmake_sphinx_build}"'" CACHE FILEPATH "Location of Qt sphinx-build" FORCE)
1537 ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
1538 fi
1539 if [ "x${cmake_sphinx_flags}" != "x" ]; then
1540   echo '
1541 set (SPHINX_FLAGS [==['"${cmake_sphinx_flags}"']==] CACHE STRING "Flags to pass to sphinx-build" FORCE)
1542 ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
1543 fi
1544
1545 # Add user-specified settings.  Handle relative-path case for
1546 # specification of cmake_init_file.
1547 (
1548 cd "${cmake_binary_dir}"
1549 if [ -f "${cmake_init_file}" ]; then
1550   cat "${cmake_init_file}" >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
1551 fi
1552 )
1553
1554 echo "---------------------------------------------"
1555
1556 # Run make to build bootstrap cmake
1557 if [ "x${cmake_parallel_make}" != "x" ]; then
1558   ${cmake_make_processor} ${cmake_make_flags}
1559 else
1560   ${cmake_make_processor}
1561 fi
1562 RES=$?
1563 if [ "${RES}" -ne "0" ]; then
1564   cmake_error 9 "Problem while running ${cmake_make_processor}"
1565 fi
1566 cd "${cmake_binary_dir}"
1567
1568 # Set C, CXX, and MAKE environment variables, so that real real cmake will be
1569 # build with same compiler and make
1570 CC="${cmake_c_compiler}"
1571 CXX="${cmake_cxx_compiler}"
1572 MAKE="${cmake_make_processor}"
1573 export CC
1574 export CXX
1575 export MAKE
1576 export CFLAGS
1577 export CXXFLAGS
1578 export LDFLAGS
1579
1580 # Run bootstrap CMake to configure real CMake
1581 cmake_options="-DCMAKE_BOOTSTRAP=1"
1582 if [ -n "${cmake_verbose}" ]; then
1583   cmake_options="${cmake_options} -DCMAKE_VERBOSE_MAKEFILE=1"
1584 fi
1585 "${cmake_bootstrap_dir}/cmake" "${cmake_source_dir}" "-C${cmake_bootstrap_dir}/InitialCacheFlags.cmake" "-G${cmake_bootstrap_generator}" ${cmake_options} ${cmake_bootstrap_system_libs} "$@"
1586 RES=$?
1587 if [ "${RES}" -ne "0" ]; then
1588   cmake_error 11 "Problem while running initial CMake"
1589 fi
1590
1591 echo "---------------------------------------------"
1592
1593 # And we are done. Now just run make
1594 echo "CMake has bootstrapped.  Now run ${cmake_make_processor}."