bootstrap 45 KB

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