bootstrap 58 KB

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