bootstrap 48 KB

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