bootstrap 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421
  1. #!/bin/sh
  2. #=========================================================================
  3. #
  4. # Program: CMake - Cross-Platform Makefile Generator
  5. # Module: $RCSfile$
  6. # Language: Bourne Shell
  7. # Date: $Date$
  8. # Version: $Revision$
  9. #
  10. # Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  11. # See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  12. #
  13. # This software is distributed WITHOUT ANY WARRANTY; without even
  14. # the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. # PURPOSE. See the above copyright notices for more information.
  16. #
  17. #=========================================================================
  18. # Version number extraction function.
  19. cmake_version_component()
  20. {
  21. cat "${cmake_source_dir}/CMakeLists.txt" | sed -n "
  22. /^SET(CMake_VERSION_${1}/ {s/SET(CMake_VERSION_${1} *\([0-9]*\))/\1/;p;}
  23. "
  24. }
  25. cmake_date_stamp_component()
  26. {
  27. cat "${cmake_source_dir}/Source/kwsys/kwsysDateStamp.cmake" | sed -n "
  28. /KWSYS_DATE_STAMP_${1}/ {s/^.* \([0-9][0-9]*\))$/\1/;p;}
  29. "
  30. }
  31. # Detect system and directory information.
  32. cmake_system=`uname`
  33. cmake_source_dir=`echo $0 | sed -n '/\//{s/\/[^\/]*$//;p;}'`
  34. cmake_source_dir=`(cd "${cmake_source_dir}";pwd)`
  35. cmake_binary_dir=`pwd`
  36. cmake_version_major="`cmake_version_component MAJOR`"
  37. cmake_version_minor="`cmake_version_component MINOR`"
  38. if echo "${cmake_version_minor}" | grep "[0-9]*[13579]" > /dev/null 2>&1; then
  39. cmake_version_patch="`cmake_date_stamp_component YEAR``cmake_date_stamp_component MONTH``cmake_date_stamp_component DAY`"
  40. else
  41. cmake_version_patch="`cmake_version_component PATCH`"
  42. fi
  43. cmake_version="${cmake_version_major}.${cmake_version_minor}"
  44. cmake_version_full="${cmake_version_major}.${cmake_version_minor}.${cmake_version_patch}"
  45. cmake_data_dir="/share/cmake-${cmake_version}"
  46. cmake_doc_dir="/doc/cmake-${cmake_version}"
  47. cmake_man_dir="/man"
  48. cmake_init_file=""
  49. cmake_bootstrap_system_libs=""
  50. cmake_bootstrap_qt_gui=""
  51. cmake_bootstrap_qt_qmake=""
  52. # Determine whether this is a Cygwin environment.
  53. if echo "${cmake_system}" | grep CYGWIN >/dev/null 2>&1; then
  54. cmake_system_cygwin=true
  55. else
  56. cmake_system_cygwin=false
  57. fi
  58. # Determine whether this is a MinGW environment.
  59. if echo "${cmake_system}" | grep MINGW >/dev/null 2>&1; then
  60. cmake_system_mingw=true
  61. else
  62. cmake_system_mingw=false
  63. fi
  64. # Determine whether this is OS X
  65. if echo "${cmake_system}" | grep Darwin >/dev/null 2>&1; then
  66. cmake_system_darwin=true
  67. else
  68. cmake_system_darwin=false
  69. fi
  70. # Determine whether this is BeOS
  71. if echo "${cmake_system}" | grep BeOS >/dev/null 2>&1; then
  72. cmake_system_beos=true
  73. else
  74. cmake_system_beos=false
  75. fi
  76. # Determine whether this is Haiku
  77. if echo "${cmake_system}" | grep Haiku >/dev/null 2>&1; then
  78. cmake_system_haiku=true
  79. else
  80. cmake_system_haiku=false
  81. fi
  82. # Determine whether this is OpenVMS
  83. if echo "${cmake_system}" | grep OpenVMS >/dev/null 2>&1; then
  84. cmake_system_openvms=true
  85. else
  86. cmake_system_openvms=false
  87. fi
  88. # Choose the generator to use for bootstrapping.
  89. if ${cmake_system_mingw}; then
  90. # Bootstrapping from an MSYS prompt.
  91. cmake_bootstrap_generator="MSYS Makefiles"
  92. else
  93. # Bootstrapping from a standard UNIX prompt.
  94. cmake_bootstrap_generator="Unix Makefiles"
  95. fi
  96. # Choose tools and extensions for this platform.
  97. if ${cmake_system_openvms}; then
  98. _tmp="_tmp"
  99. _cmk="_cmk"
  100. _diff=`which diff`
  101. else
  102. _tmp=".tmp"
  103. _cmk=".cmk"
  104. _diff="diff"
  105. fi
  106. # Construct bootstrap directory name.
  107. cmake_bootstrap_dir="${cmake_binary_dir}/Bootstrap${_cmk}"
  108. # Helper function to fix windows paths.
  109. cmake_fix_slashes ()
  110. {
  111. echo "$1" | sed 's/\\/\//g'
  112. }
  113. # Choose the default install prefix.
  114. if ${cmake_system_mingw}; then
  115. if [ "x${PROGRAMFILES}" != "x" ]; then
  116. cmake_default_prefix=`cmake_fix_slashes "${PROGRAMFILES}/CMake"`
  117. elif [ "x${ProgramFiles}" != "x" ]; then
  118. cmake_default_prefix=`cmake_fix_slashes "${ProgramFiles}/CMake"`
  119. elif [ "x${SYSTEMDRIVE}" != "x" ]; then
  120. cmake_default_prefix=`cmake_fix_slashes "${SYSTEMDRIVE}/Program Files/CMake"`
  121. elif [ "x${SystemDrive}" != "x" ]; then
  122. cmake_default_prefix=`cmake_fix_slashes "${SystemDrive}/Program Files/CMake"`
  123. else
  124. cmake_default_prefix="c:/Program Files/CMake"
  125. fi
  126. else
  127. cmake_default_prefix="/usr/local"
  128. fi
  129. CMAKE_KNOWN_C_COMPILERS="cc gcc xlc icc tcc"
  130. CMAKE_KNOWN_CXX_COMPILERS="aCC xlC CC g++ c++ icc como "
  131. CMAKE_KNOWN_MAKE_PROCESSORS="gmake make"
  132. CMAKE_PROBLEMATIC_FILES="\
  133. CMakeCache.txt \
  134. CMakeSystem.cmake \
  135. CMakeCCompiler.cmake \
  136. CMakeCXXCompiler.cmake \
  137. Source/cmConfigure.h \
  138. Source/CTest/Curl/config.h \
  139. Utilities/cmexpat/expatConfig.h \
  140. Utilities/cmexpat/expatDllConfig.h \
  141. "
  142. CMAKE_UNUSED_SOURCES="\
  143. cmGlobalXCodeGenerator \
  144. cmLocalXCodeGenerator \
  145. cmXCodeObject \
  146. cmXCode21Object \
  147. cmSourceGroup \
  148. "
  149. CMAKE_CXX_SOURCES="\
  150. cmake \
  151. cmakemain \
  152. cmakewizard \
  153. cmCommandArgumentLexer \
  154. cmCommandArgumentParser \
  155. cmCommandArgumentParserHelper \
  156. cmDepends \
  157. cmDependsC \
  158. cmDocumentationFormatter \
  159. cmDocumentationFormatterText \
  160. cmPolicies \
  161. cmProperty \
  162. cmPropertyMap \
  163. cmPropertyDefinition \
  164. cmPropertyDefinitionMap \
  165. cmMakeDepend \
  166. cmMakefile \
  167. cmExportFileGenerator \
  168. cmExportInstallFileGenerator \
  169. cmInstallDirectoryGenerator \
  170. cmGeneratedFileStream \
  171. cmGlobalGenerator \
  172. cmLocalGenerator \
  173. cmInstallGenerator \
  174. cmInstallExportGenerator \
  175. cmInstallFilesGenerator \
  176. cmInstallScriptGenerator \
  177. cmInstallTargetGenerator \
  178. cmScriptGenerator \
  179. cmSourceFile \
  180. cmSourceFileLocation \
  181. cmSystemTools \
  182. cmTestGenerator \
  183. cmVersion \
  184. cmFileTimeComparison \
  185. cmGlobalUnixMakefileGenerator3 \
  186. cmLocalUnixMakefileGenerator3 \
  187. cmMakefileExecutableTargetGenerator \
  188. cmMakefileLibraryTargetGenerator \
  189. cmMakefileTargetGenerator \
  190. cmMakefileUtilityTargetGenerator \
  191. cmBootstrapCommands \
  192. cmCommands \
  193. cmTarget \
  194. cmTest \
  195. cmCustomCommand \
  196. cmDocumentVariables \
  197. cmCacheManager \
  198. cmListFileCache \
  199. cmComputeLinkDepends \
  200. cmComputeLinkInformation \
  201. cmOrderDirectories \
  202. cmComputeTargetDepends \
  203. cmComputeComponentGraph \
  204. cmExprLexer \
  205. cmExprParser \
  206. cmExprParserHelper \
  207. "
  208. if ${cmake_system_mingw}; then
  209. CMAKE_CXX_SOURCES="${CMAKE_CXX_SOURCES}\
  210. cmGlobalMSYSMakefileGenerator \
  211. cmGlobalMinGWMakefileGenerator \
  212. cmWin32ProcessExecution"
  213. fi
  214. CMAKE_C_SOURCES="\
  215. cmListFileLexer \
  216. "
  217. if ${cmake_system_mingw}; then
  218. KWSYS_C_SOURCES="\
  219. ProcessWin32 \
  220. String \
  221. System"
  222. KWSYS_C_MINGW_SOURCES="\
  223. ProcessFwd9x \
  224. EncodeExecutable"
  225. KWSYS_C_GENERATED_SOURCES="\
  226. cmsysProcessFwd9xEnc"
  227. else
  228. KWSYS_C_SOURCES="\
  229. ProcessUNIX \
  230. String \
  231. System"
  232. KWSYS_C_MINGW_SOURCES=""
  233. KWSYS_C_GENERATED_SOURCES=""
  234. fi
  235. KWSYS_CXX_SOURCES="\
  236. Directory \
  237. Glob \
  238. RegularExpression \
  239. SystemTools"
  240. KWSYS_FILES="\
  241. auto_ptr.hxx \
  242. Directory.hxx \
  243. Glob.hxx \
  244. Process.h \
  245. RegularExpression.hxx \
  246. String.h \
  247. String.hxx \
  248. System.h \
  249. SystemTools.hxx"
  250. KWSYS_IOS_FILES="
  251. fstream \
  252. iosfwd \
  253. iostream \
  254. sstream"
  255. # Display CMake bootstrap usage
  256. cmake_usage()
  257. {
  258. echo '
  259. Usage: '"$0"' [options]
  260. Options: [defaults in brackets after descriptions]
  261. Configuration:
  262. --help print this message
  263. --version only print version information
  264. --verbose display more information
  265. --parallel=n bootstrap cmake in parallel, where n is
  266. number of nodes [1]
  267. --init=FILE use FILE for cmake initialization
  268. --system-libs use system-installed third-party libraries
  269. (for use only by package maintainers)
  270. --no-system-libs use cmake-provided third-party libraries
  271. (default)
  272. --qt-gui build the Qt-based GUI (requires Qt >= 4.2)
  273. --no-qt-gui do not build the Qt-based GUI (default)
  274. --qt-qmake=<qmake> use <qmake> as the qmake executable to find Qt
  275. Directory and file names:
  276. --prefix=PREFIX install files in tree rooted at PREFIX
  277. [${cmake_default_prefix}]
  278. --datadir=DIR install data files in PREFIX/DIR
  279. [/share/CMake]
  280. --docdir=DIR install documentation files in PREFIX/DIR
  281. [/doc/CMake]
  282. --mandir=DIR install man pages files in PREFIX/DIR/manN
  283. [/man]
  284. '
  285. exit 10
  286. }
  287. # Display CMake bootstrap usage
  288. cmake_version_display()
  289. {
  290. echo "CMake ${cmake_version_full}, Copyright (c) 2000-2009 Kitware, Inc., Insight Consortium"
  291. }
  292. # Display CMake bootstrap error, display the log file and exit
  293. cmake_error()
  294. {
  295. res=$1
  296. shift 1
  297. echo "---------------------------------------------"
  298. echo "Error when bootstrapping CMake:"
  299. echo "$*"
  300. echo "---------------------------------------------"
  301. if [ -f cmake_bootstrap.log ]; then
  302. echo "Log of errors: `pwd`/cmake_bootstrap.log"
  303. #cat cmake_bootstrap.log
  304. echo "---------------------------------------------"
  305. fi
  306. exit ${res}
  307. }
  308. # Replace KWSYS_NAMESPACE with cmsys
  309. cmake_replace_string ()
  310. {
  311. INFILE="$1"
  312. OUTFILE="$2"
  313. SEARCHFOR="$3"
  314. REPLACEWITH="$4"
  315. if [ -f "${INFILE}" ] || ${cmake_system_openvms}; then
  316. cat "${INFILE}" |
  317. sed "s/\@${SEARCHFOR}\@/${REPLACEWITH}/g" > "${OUTFILE}${_tmp}"
  318. if [ -f "${OUTFILE}${_tmp}" ]; then
  319. if "${_diff}" "${OUTFILE}" "${OUTFILE}${_tmp}" > /dev/null 2> /dev/null ; then
  320. #echo "Files are the same"
  321. rm -f "${OUTFILE}${_tmp}"
  322. else
  323. mv -f "${OUTFILE}${_tmp}" "${OUTFILE}"
  324. fi
  325. fi
  326. else
  327. cmake_error 1 "Cannot find file ${INFILE}"
  328. fi
  329. }
  330. cmake_kwsys_config_replace_string ()
  331. {
  332. INFILE="$1"
  333. OUTFILE="$2"
  334. shift 2
  335. APPEND="$*"
  336. if [ -f "${INFILE}" ] || ${cmake_system_openvms}; then
  337. echo "${APPEND}" > "${OUTFILE}${_tmp}"
  338. cat "${INFILE}" |
  339. sed "/./ {s/\@KWSYS_NAMESPACE\@/cmsys/g;
  340. s/@KWSYS_BUILD_SHARED@/${KWSYS_BUILD_SHARED}/g;
  341. s/@KWSYS_LFS_AVAILABLE@/${KWSYS_LFS_AVAILABLE}/g;
  342. s/@KWSYS_LFS_REQUESTED@/${KWSYS_LFS_REQUESTED}/g;
  343. s/@KWSYS_NAME_IS_KWSYS@/${KWSYS_NAME_IS_KWSYS}/g;
  344. s/@KWSYS_IOS_USE_ANSI@/${KWSYS_IOS_USE_ANSI}/g;
  345. s/@KWSYS_IOS_HAVE_STD@/${KWSYS_IOS_HAVE_STD}/g;
  346. s/@KWSYS_IOS_USE_SSTREAM@/${KWSYS_IOS_USE_SSTREAM}/g;
  347. s/@KWSYS_IOS_USE_STRSTREAM_H@/${KWSYS_IOS_USE_STRSTREAM_H}/g;
  348. s/@KWSYS_IOS_USE_STRSTREA_H@/${KWSYS_IOS_USE_STRSTREA_H}/g;
  349. s/@KWSYS_STL_HAVE_STD@/${KWSYS_STL_HAVE_STD}/g;
  350. s/@KWSYS_STL_STRING_HAVE_ISTREAM@/${KWSYS_STL_STRING_HAVE_ISTREAM}/g;
  351. s/@KWSYS_STL_STRING_HAVE_OSTREAM@/${KWSYS_STL_STRING_HAVE_OSTREAM}/g;
  352. s/@KWSYS_STL_STRING_HAVE_NEQ_CHAR@/${KWSYS_STL_STRING_HAVE_NEQ_CHAR}/g;
  353. s/@KWSYS_STL_HAS_ITERATOR_TRAITS@/${KWSYS_STL_HAS_ITERATOR_TRAITS}/g;
  354. s/@KWSYS_STL_HAS_ITERATOR_CATEGORY@/${KWSYS_STL_HAS_ITERATOR_CATEGORY}/g;
  355. s/@KWSYS_STL_HAS___ITERATOR_CATEGORY@/${KWSYS_STL_HAS___ITERATOR_CATEGORY}/g;
  356. s/@KWSYS_STL_HAS_ALLOCATOR_TEMPLATE@/${KWSYS_STL_HAS_ALLOCATOR_TEMPLATE}/g;
  357. s/@KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE@/${KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE}/g;
  358. s/@KWSYS_STL_HAS_ALLOCATOR_REBIND@/${KWSYS_STL_HAS_ALLOCATOR_REBIND}/g;
  359. s/@KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT@/${KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT}/g;
  360. s/@KWSYS_STL_HAS_ALLOCATOR_OBJECTS@/${KWSYS_STL_HAS_ALLOCATOR_OBJECTS}/g;
  361. s/@KWSYS_CXX_HAS_CSTDDEF@/${KWSYS_CXX_HAS_CSTDDEF}/g;
  362. s/@KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS@/${KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS}/g;
  363. s/@KWSYS_CXX_HAS_MEMBER_TEMPLATES@/${KWSYS_CXX_HAS_MEMBER_TEMPLATES}/g;
  364. s/@KWSYS_CXX_HAS_FULL_SPECIALIZATION@/${KWSYS_CXX_HAS_FULL_SPECIALIZATION}/g;
  365. s/@KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP@/${KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP}/g;
  366. s/@KWSYS_STAT_HAS_ST_MTIM@/${KWSYS_STAT_HAS_ST_MTIM}/g;}" >> "${OUTFILE}${_tmp}"
  367. if [ -f "${OUTFILE}${_tmp}" ]; then
  368. if "${_diff}" "${OUTFILE}" "${OUTFILE}${_tmp}" > /dev/null 2> /dev/null ; then
  369. #echo "Files are the same"
  370. rm -f "${OUTFILE}${_tmp}"
  371. else
  372. mv -f "${OUTFILE}${_tmp}" "${OUTFILE}"
  373. fi
  374. fi
  375. else
  376. cmake_error 2 "Cannot find file ${INFILE}"
  377. fi
  378. }
  379. # Write string into a file
  380. cmake_report ()
  381. {
  382. FILE=$1
  383. shift
  384. echo "$*" >> ${FILE}
  385. }
  386. # Escape spaces in strings
  387. cmake_escape ()
  388. {
  389. echo $1 | sed "s/ /\\\\ /g"
  390. }
  391. # Write message to the log
  392. cmake_log ()
  393. {
  394. echo "$*" >> cmake_bootstrap.log
  395. }
  396. # Return temp file
  397. cmake_tmp_file ()
  398. {
  399. echo "cmake_bootstrap_$$_test"
  400. }
  401. # Run a compiler test. First argument is compiler, second one are compiler
  402. # flags, third one is test source file to be compiled
  403. cmake_try_run ()
  404. {
  405. COMPILER=$1
  406. FLAGS=$2
  407. TESTFILE=$3
  408. if [ ! -f "${TESTFILE}" ]; then
  409. echo "Test file ${TESTFILE} missing. Please verify your CMake source tree."
  410. exit 4
  411. fi
  412. TMPFILE=`cmake_tmp_file`
  413. echo "Try: ${COMPILER}"
  414. echo "Line: ${COMPILER} ${FLAGS} ${TESTFILE} -o ${TMPFILE}"
  415. echo "---------- file -----------------------"
  416. cat "${TESTFILE}"
  417. echo "------------------------------------------"
  418. "${COMPILER}" ${FLAGS} "${TESTFILE}" -o "${TMPFILE}"
  419. RES=$?
  420. if [ "${RES}" -ne "0" ]; then
  421. echo "Test failed to compile"
  422. return 1
  423. fi
  424. if [ ! -f "${TMPFILE}" ] && [ ! -f "${TMPFILE}.exe" ]; then
  425. echo "Test failed to produce executable"
  426. return 2
  427. fi
  428. ./${TMPFILE}
  429. RES=$?
  430. rm -f "${TMPFILE}"
  431. if [ "${RES}" -ne "0" ]; then
  432. echo "Test produced non-zero return code"
  433. return 3
  434. fi
  435. echo "Test succeded"
  436. return 0
  437. }
  438. # Run a make test. First argument is the make interpreter.
  439. cmake_try_make ()
  440. {
  441. MAKE_PROC="$1"
  442. MAKE_FLAGS="$2"
  443. echo "Try: ${MAKE_PROC}"
  444. "${MAKE_PROC}" ${MAKE_FLAGS}
  445. RES=$?
  446. if [ "${RES}" -ne "0" ]; then
  447. echo "${MAKE_PROC} does not work"
  448. return 1
  449. fi
  450. if [ ! -f "test" ] && [ ! -f "test.exe" ]; then
  451. echo "${COMPILER} does not produce output"
  452. return 2
  453. fi
  454. ./test
  455. RES=$?
  456. rm -f "test"
  457. if [ "${RES}" -ne "0" ]; then
  458. echo "${MAKE_PROC} produces strange executable"
  459. return 3
  460. fi
  461. echo "${MAKE_PROC} works"
  462. return 0
  463. }
  464. # Parse arguments
  465. cmake_verbose=
  466. cmake_parallel_make=
  467. cmake_prefix_dir="${cmake_default_prefix}"
  468. for a in "$@"; do
  469. if echo $a | grep "^--prefix=" > /dev/null 2> /dev/null; then
  470. cmake_prefix_dir=`echo $a | sed "s/^--prefix=//"`
  471. cmake_prefix_dir=`cmake_fix_slashes "${cmake_prefix_dir}"`
  472. fi
  473. if echo $a | grep "^--parallel=" > /dev/null 2> /dev/null; then
  474. cmake_parallel_make=`echo $a | sed "s/^--parallel=//" | grep "[0-9][0-9]*"`
  475. fi
  476. if echo $a | grep "^--datadir=" > /dev/null 2> /dev/null; then
  477. cmake_data_dir=`echo $a | sed "s/^--datadir=//"`
  478. fi
  479. if echo $a | grep "^--docdir=" > /dev/null 2> /dev/null; then
  480. cmake_doc_dir=`echo $a | sed "s/^--docdir=//"`
  481. fi
  482. if echo $a | grep "^--mandir=" > /dev/null 2> /dev/null; then
  483. cmake_man_dir=`echo $a | sed "s/^--mandir=//"`
  484. fi
  485. if echo $a | grep "^--init=" > /dev/null 2> /dev/null; then
  486. cmake_init_file=`echo $a | sed "s/^--init=//"`
  487. fi
  488. if echo $a | grep "^--system-libs" > /dev/null 2> /dev/null; then
  489. cmake_bootstrap_system_libs="-DCMAKE_USE_SYSTEM_LIBRARIES=1"
  490. fi
  491. if echo $a | grep "^--no-system-libs" > /dev/null 2> /dev/null; then
  492. cmake_bootstrap_system_libs="-DCMAKE_USE_SYSTEM_LIBRARIES=0"
  493. fi
  494. if echo $a | grep "^--qt-gui" > /dev/null 2> /dev/null; then
  495. cmake_bootstrap_qt_gui="1"
  496. fi
  497. if echo $a | grep "^--no-qt-gui" > /dev/null 2> /dev/null; then
  498. cmake_bootstrap_qt_gui="0"
  499. fi
  500. if echo $a | grep "^--qt-qmake=" > /dev/null 2> /dev/null; then
  501. cmake_bootstrap_qt_qmake=`echo $a | sed "s/^--qt-qmake=//"`
  502. fi
  503. if echo $a | grep "^--help" > /dev/null 2> /dev/null; then
  504. cmake_usage
  505. fi
  506. if echo $a | grep "^--version" > /dev/null 2> /dev/null; then
  507. cmake_version_display
  508. exit 2
  509. fi
  510. if echo $a | grep "^--verbose" > /dev/null 2> /dev/null; then
  511. cmake_verbose=TRUE
  512. fi
  513. done
  514. # If verbose, display some information about bootstrap
  515. if [ -n "${cmake_verbose}" ]; then
  516. echo "---------------------------------------------"
  517. echo "Source directory: ${cmake_source_dir}"
  518. echo "Binary directory: ${cmake_binary_dir}"
  519. echo "Prefix directory: ${cmake_prefix_dir}"
  520. echo "System: ${cmake_system}"
  521. if [ "x${cmake_parallel_make}" != "x" ]; then
  522. echo "Doing parallel make: ${cmake_parallel_make}"
  523. fi
  524. echo ""
  525. fi
  526. echo "---------------------------------------------"
  527. # Get CMake version
  528. echo "`cmake_version_display`"
  529. # Check for in-source build
  530. cmake_in_source_build=
  531. if [ -f "${cmake_binary_dir}/Source/cmake.cxx" -a \
  532. -f "${cmake_binary_dir}/Source/cmake.h" ]; then
  533. if [ -n "${cmake_verbose}" ]; then
  534. echo "Warning: This is an in-source build"
  535. fi
  536. cmake_in_source_build=TRUE
  537. fi
  538. # If this is not an in-source build, then Bootstrap stuff should not exist.
  539. if [ -z "${cmake_in_source_build}" ]; then
  540. # Did somebody bootstrap in the source tree?
  541. if [ -d "${cmake_source_dir}/Bootstrap${_cmk}" ]; then
  542. cmake_error 10 "Found directory \"${cmake_source_dir}/Bootstrap${_cmk}\".
  543. Looks like somebody did bootstrap CMake in the source tree, but now you are
  544. trying to do bootstrap in the binary tree. Please remove Bootstrap${_cmk}
  545. directory from the source tree."
  546. fi
  547. # Is there a cache in the source tree?
  548. for cmake_problematic_file in ${CMAKE_PROBLEMATIC_FILES}; do
  549. if [ -f "${cmake_source_dir}/${cmake_problematic_file}" ]; then
  550. cmake_error 10 "Found \"${cmake_source_dir}/${cmake_problematic_file}\".
  551. Looks like somebody tried to build CMake in the source tree, but now you are
  552. trying to do bootstrap in the binary tree. Please remove \"${cmake_problematic_file}\"
  553. from the source tree."
  554. fi
  555. done
  556. fi
  557. # Make bootstrap directory
  558. [ -d "${cmake_bootstrap_dir}" ] || mkdir "${cmake_bootstrap_dir}"
  559. if [ ! -d "${cmake_bootstrap_dir}" ]; then
  560. cmake_error 3 "Cannot create directory ${cmake_bootstrap_dir} to bootstrap CMake."
  561. fi
  562. cd "${cmake_bootstrap_dir}"
  563. [ -d "cmsys" ] || mkdir "cmsys"
  564. if [ ! -d "cmsys" ]; then
  565. cmake_error 4 "Cannot create directory ${cmake_bootstrap_dir}/cmsys"
  566. fi
  567. for a in stl ios; do
  568. [ -d "cmsys/${a}" ] || mkdir "cmsys/${a}"
  569. if [ ! -d "cmsys/${a}" ]; then
  570. cmake_error 5 "Cannot create directory ${cmake_bootstrap_dir}/cmsys/${a}"
  571. fi
  572. done
  573. # Delete all the bootstrap files
  574. rm -f "${cmake_bootstrap_dir}/cmake_bootstrap.log"
  575. rm -f "${cmake_bootstrap_dir}/cmConfigure.h${_tmp}"
  576. rm -f "${cmake_bootstrap_dir}/cmVersionConfig.h${_tmp}"
  577. # If exist compiler flags, set them
  578. cmake_c_flags=${CFLAGS}
  579. cmake_cxx_flags=${CXXFLAGS}
  580. cmake_ld_flags=${LDFLAGS}
  581. # Add Cygwin-specific flags
  582. if ${cmake_system_cygwin}; then
  583. cmake_ld_flags="${LDFLAGS} -Wl,--enable-auto-import"
  584. fi
  585. # Add Carbon framework on Darwin
  586. if ${cmake_system_darwin}; then
  587. cmake_ld_flags="${LDFLAGS} -framework Carbon"
  588. fi
  589. # Add BeOS toolkits...
  590. if ${cmake_system_beos}; then
  591. cmake_ld_flags="${LDFLAGS} -lroot -lbe"
  592. fi
  593. # Add Haiku toolkits...
  594. if ${cmake_system_haiku}; then
  595. cmake_ld_flags="${LDFLAGS} -lroot -lbe"
  596. fi
  597. # Test C compiler
  598. cmake_c_compiler=
  599. # If CC is set, use that for compiler, otherwise use list of known compilers
  600. if [ -n "${CC}" ]; then
  601. cmake_c_compilers="${CC}"
  602. else
  603. cmake_c_compilers="${CMAKE_KNOWN_C_COMPILERS}"
  604. fi
  605. # Check if C compiler works
  606. TMPFILE=`cmake_tmp_file`
  607. echo '
  608. #ifdef __cplusplus
  609. # error "The CMAKE_C_COMPILER is set to a C++ compiler"
  610. #endif
  611. #include<stdio.h>
  612. #if defined(__CLASSIC_C__)
  613. int main(argc, argv)
  614. int argc;
  615. char* argv[];
  616. #else
  617. int main(int argc, char* argv[])
  618. #endif
  619. {
  620. printf("%d%c", (argv != 0), (char)0x0a);
  621. return argc-1;
  622. }
  623. ' > "${TMPFILE}.c"
  624. for a in ${cmake_c_compilers}; do
  625. if [ -z "${cmake_c_compiler}" ] && \
  626. cmake_try_run "${a}" "${cmake_c_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then
  627. cmake_c_compiler="${a}"
  628. fi
  629. done
  630. rm -f "${TMPFILE}.c"
  631. if [ -z "${cmake_c_compiler}" ]; then
  632. cmake_error 6 "Cannot find appropriate C compiler on this system.
  633. Please specify one using environment variable CC.
  634. See cmake_bootstrap.log for compilers attempted.
  635. "
  636. fi
  637. echo "C compiler on this system is: ${cmake_c_compiler} ${cmake_c_flags}"
  638. # Test CXX compiler
  639. cmake_cxx_compiler=
  640. # On Mac OSX, CC is the same as cc, so make sure not to try CC as c++ compiler.
  641. # If CC is set, use that for compiler, otherwise use list of known compilers
  642. if [ -n "${CXX}" ]; then
  643. cmake_cxx_compilers="${CXX}"
  644. else
  645. cmake_cxx_compilers="${CMAKE_KNOWN_CXX_COMPILERS}"
  646. fi
  647. # Check if C++ compiler works
  648. TMPFILE=`cmake_tmp_file`
  649. echo '
  650. #if defined(TEST1)
  651. # include <iostream>
  652. #else
  653. # include <iostream.h>
  654. #endif
  655. class NeedCXX
  656. {
  657. public:
  658. NeedCXX() { this->Foo = 1; }
  659. int GetFoo() { return this->Foo; }
  660. private:
  661. int Foo;
  662. };
  663. int main()
  664. {
  665. NeedCXX c;
  666. #ifdef TEST3
  667. cout << c.GetFoo() << endl;
  668. #else
  669. std::cout << c.GetFoo() << std::endl;
  670. #endif
  671. return 0;
  672. }
  673. ' > "${TMPFILE}.cxx"
  674. for a in ${cmake_cxx_compilers}; do
  675. for b in 1 2 3; do
  676. if [ -z "${cmake_cxx_compiler}" ] && \
  677. cmake_try_run "${a}" "${cmake_cxx_flags} -DTEST${b}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
  678. cmake_cxx_compiler="${a}"
  679. fi
  680. done
  681. done
  682. rm -f "${TMPFILE}.cxx"
  683. if [ -z "${cmake_cxx_compiler}" ]; then
  684. cmake_error 7 "Cannot find appropriate C++ compiler on this system.
  685. Please specify one using environment variable CXX.
  686. See cmake_bootstrap.log for compilers attempted."
  687. fi
  688. echo "C++ compiler on this system is: ${cmake_cxx_compiler} ${cmake_cxx_flags}"
  689. # Test Make
  690. cmake_make_processor=
  691. cmake_make_flags=
  692. # If MAKE is set, use that for make processor, otherwise use list of known make
  693. if [ -n "${MAKE}" ]; then
  694. cmake_make_processors="${MAKE}"
  695. else
  696. cmake_make_processors="${CMAKE_KNOWN_MAKE_PROCESSORS}"
  697. fi
  698. TMPFILE="`cmake_tmp_file`_dir"
  699. rm -rf "${cmake_bootstrap_dir}/${TMPFILE}"
  700. mkdir "${cmake_bootstrap_dir}/${TMPFILE}"
  701. cd "${cmake_bootstrap_dir}/${TMPFILE}"
  702. echo '
  703. test: test.c
  704. "'"${cmake_c_compiler}"'" -o test test.c
  705. '>"Makefile"
  706. echo '
  707. #include <stdio.h>
  708. int main(){ printf("1%c", (char)0x0a); return 0; }
  709. ' > "test.c"
  710. cmake_original_make_flags="${cmake_make_flags}"
  711. if [ "x${cmake_parallel_make}" != "x" ]; then
  712. cmake_make_flags="${cmake_make_flags} -j ${cmake_parallel_make}"
  713. fi
  714. for a in ${cmake_make_processors}; do
  715. if [ -z "${cmake_make_processor}" ] && cmake_try_make "${a}" "${cmake_make_flags}" >> cmake_bootstrap.log 2>&1; then
  716. cmake_make_processor="${a}"
  717. fi
  718. done
  719. cmake_full_make_flags="${cmake_make_flags}"
  720. if [ "x${cmake_original_make_flags}" != "x${cmake_make_flags}" ]; then
  721. if [ -z "${cmake_make_processor}" ]; then
  722. cmake_make_flags="${cmake_original_make_flags}"
  723. for a in ${cmake_make_processors}; do
  724. if [ -z "${cmake_make_processor}" ] && cmake_try_make "${a}" "${cmake_make_flags}" >> cmake_bootstrap.log 2>&1; then
  725. cmake_make_processor="${a}"
  726. fi
  727. done
  728. fi
  729. fi
  730. cd "${cmake_bootstrap_dir}"
  731. rm -rf "${cmake_bootstrap_dir}/${TMPFILE}"
  732. if [ -z "${cmake_make_processor}" ]; then
  733. cmake_error 8 "Cannot find appropriate Makefile processor on this system.
  734. Please specify one using environment variable MAKE."
  735. fi
  736. echo "Makefile processor on this system is: ${cmake_make_processor}"
  737. if [ "x${cmake_full_make_flags}" != "x${cmake_make_flags}" ]; then
  738. echo "---------------------------------------------"
  739. echo "Makefile processor ${cmake_make_processor} does not support parallel build"
  740. echo "---------------------------------------------"
  741. fi
  742. # Ok, we have CC, CXX, and MAKE.
  743. # Test C++ compiler features
  744. # Are we GCC?
  745. TMPFILE=`cmake_tmp_file`
  746. echo '
  747. #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
  748. #include <iostream>
  749. int main() { std::cout << "This is GNU" << std::endl; return 0;}
  750. #endif
  751. ' > ${TMPFILE}.cxx
  752. cmake_cxx_compiler_is_gnu=0
  753. if cmake_try_run "${cmake_cxx_compiler}" \
  754. "${cmake_cxx_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
  755. cmake_cxx_compiler_is_gnu=1
  756. fi
  757. if [ "x${cmake_cxx_compiler_is_gnu}" = "x1" ]; then
  758. echo "${cmake_cxx_compiler} is GNU compiler"
  759. else
  760. echo "${cmake_cxx_compiler} is not GNU compiler"
  761. fi
  762. rm -f "${TMPFILE}.cxx"
  763. if [ "x${cmake_cxx_compiler_is_gnu}" != "x1" ]; then
  764. # Check for non-GNU compiler flags
  765. # If we are on IRIX, check for -LANG:std
  766. cmake_test_flags="-LANG:std"
  767. if [ "x${cmake_system}" = "xIRIX64" ]; then
  768. TMPFILE=`cmake_tmp_file`
  769. echo '
  770. #include <iostream>
  771. int main() { std::cout << "No need for '"${cmake_test_flags}"'" << std::endl; return 0;}
  772. ' > ${TMPFILE}.cxx
  773. cmake_need_lang_std=0
  774. if cmake_try_run "${cmake_cxx_compiler}" \
  775. "${cmake_cxx_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
  776. :
  777. else
  778. if cmake_try_run "${cmake_cxx_compiler}" \
  779. "${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
  780. cmake_need_lang_std=1
  781. fi
  782. fi
  783. if [ "x${cmake_need_lang_std}" = "x1" ]; then
  784. cmake_cxx_flags="${cmake_cxx_flags} ${cmake_test_flags}"
  785. echo "${cmake_cxx_compiler} needs ${cmake_test_flags}"
  786. else
  787. echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
  788. fi
  789. rm -f "${TMPFILE}.cxx"
  790. fi
  791. cmake_test_flags=
  792. # If we are on OSF, check for -timplicit_local -no_implicit_include
  793. cmake_test_flags="-timplicit_local -no_implicit_include"
  794. if [ "x${cmake_system}" = "xOSF1" ]; then
  795. TMPFILE=`cmake_tmp_file`
  796. echo '
  797. #include <iostream>
  798. int main() { std::cout << "We need '"${cmake_test_flags}"'" << std::endl; return 0;}
  799. ' > ${TMPFILE}.cxx
  800. cmake_need_flags=1
  801. if cmake_try_run "${cmake_cxx_compiler}" \
  802. "${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
  803. :
  804. else
  805. cmake_need_flags=0
  806. fi
  807. if [ "x${cmake_need_flags}" = "x1" ]; then
  808. cmake_cxx_flags="${cmake_cxx_flags} ${cmake_test_flags}"
  809. echo "${cmake_cxx_compiler} needs ${cmake_test_flags}"
  810. else
  811. echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
  812. fi
  813. rm -f "${TMPFILE}.cxx"
  814. fi
  815. cmake_test_flags=
  816. # If we are on OSF, check for -std strict_ansi -nopure_cname
  817. cmake_test_flags="-std strict_ansi -nopure_cname"
  818. if [ "x${cmake_system}" = "xOSF1" ]; then
  819. TMPFILE=`cmake_tmp_file`
  820. echo '
  821. #include <iostream>
  822. int main() { std::cout << "We need '"${cmake_test_flags}"'" << std::endl; return 0;}
  823. ' > ${TMPFILE}.cxx
  824. cmake_need_flags=1
  825. if cmake_try_run "${cmake_cxx_compiler}" \
  826. "${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
  827. :
  828. else
  829. cmake_need_flags=0
  830. fi
  831. if [ "x${cmake_need_flags}" = "x1" ]; then
  832. cmake_cxx_flags="${cmake_cxx_flags} ${cmake_test_flags}"
  833. echo "${cmake_cxx_compiler} needs ${cmake_test_flags}"
  834. else
  835. echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
  836. fi
  837. rm -f "${TMPFILE}.cxx"
  838. fi
  839. cmake_test_flags=
  840. # If we are on HP-UX, check for -Ae for the C compiler.
  841. cmake_test_flags="-Ae"
  842. if [ "x${cmake_system}" = "xHP-UX" ]; then
  843. TMPFILE=`cmake_tmp_file`
  844. echo '
  845. int main(int argc, char** argv) { (void)argc; (void)argv; return 0; }
  846. ' > ${TMPFILE}.c
  847. cmake_need_Ae=0
  848. if cmake_try_run "${cmake_c_compiler}" "${cmake_c_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then
  849. :
  850. else
  851. if cmake_try_run "${cmake_c_compiler}" \
  852. "${cmake_c_flags} ${cmake_test_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then
  853. cmake_need_Ae=1
  854. fi
  855. fi
  856. if [ "x${cmake_need_Ae}" = "x1" ]; then
  857. cmake_c_flags="${cmake_c_flags} ${cmake_test_flags}"
  858. echo "${cmake_c_compiler} needs ${cmake_test_flags}"
  859. else
  860. echo "${cmake_c_compiler} does not need ${cmake_test_flags}"
  861. fi
  862. rm -f "${TMPFILE}.c"
  863. fi
  864. cmake_test_flags=
  865. fi
  866. # Test for kwsys features
  867. KWSYS_NAME_IS_KWSYS=0
  868. KWSYS_BUILD_SHARED=0
  869. KWSYS_LFS_AVAILABLE=0
  870. KWSYS_LFS_REQUESTED=0
  871. KWSYS_IOS_USE_STRSTREAM_H=0
  872. KWSYS_IOS_USE_STRSTREA_H=0
  873. KWSYS_IOS_HAVE_STD=0
  874. KWSYS_IOS_USE_SSTREAM=0
  875. KWSYS_IOS_USE_ANSI=0
  876. KWSYS_STL_HAVE_STD=0
  877. KWSYS_STAT_HAS_ST_MTIM=0
  878. KWSYS_STL_STRING_HAVE_NEQ_CHAR=0
  879. KWSYS_STL_HAS_ITERATOR_TRAITS=0
  880. KWSYS_STL_HAS_ITERATOR_CATEGORY=0
  881. KWSYS_STL_HAS___ITERATOR_CATEGORY=0
  882. KWSYS_STL_HAS_ALLOCATOR_TEMPLATE=0
  883. KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE=0
  884. KWSYS_STL_HAS_ALLOCATOR_REBIND=0
  885. KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT=0
  886. KWSYS_STL_HAS_ALLOCATOR_OBJECTS=0
  887. KWSYS_CXX_HAS_CSTDDEF=0
  888. KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS=0
  889. KWSYS_CXX_HAS_MEMBER_TEMPLATES=0
  890. KWSYS_CXX_HAS_FULL_SPECIALIZATION=0
  891. KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP=0
  892. # Hardcode these kwsys features. They work on all known UNIX compilers anyway.
  893. KWSYS_STL_STRING_HAVE_ISTREAM=1
  894. KWSYS_STL_STRING_HAVE_OSTREAM=1
  895. if cmake_try_run "${cmake_cxx_compiler}" \
  896. "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAVE_STD" \
  897. "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  898. KWSYS_STL_HAVE_STD=1
  899. echo "${cmake_cxx_compiler} has STL in std:: namespace"
  900. else
  901. echo "${cmake_cxx_compiler} does not have STL in std:: namespace"
  902. fi
  903. if cmake_try_run "${cmake_cxx_compiler}" \
  904. "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_ANSI" \
  905. "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  906. KWSYS_IOS_USE_ANSI=1
  907. echo "${cmake_cxx_compiler} has ANSI streams"
  908. else
  909. echo "${cmake_cxx_compiler} does not have ANSI streams"
  910. fi
  911. if [ "x$KWSYS_IOS_USE_ANSI" = "x1" ]; then
  912. if cmake_try_run "${cmake_cxx_compiler}" \
  913. "${cmake_cxx_flags} -DTEST_KWSYS_IOS_HAVE_STD" \
  914. "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  915. KWSYS_IOS_HAVE_STD=1
  916. echo "${cmake_cxx_compiler} has streams in std:: namespace"
  917. else
  918. echo "${cmake_cxx_compiler} does not have streams in std:: namespace"
  919. fi
  920. if cmake_try_run "${cmake_cxx_compiler}" \
  921. "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_SSTREAM" \
  922. "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  923. KWSYS_IOS_USE_SSTREAM=1
  924. echo "${cmake_cxx_compiler} has sstream"
  925. else
  926. echo "${cmake_cxx_compiler} does not have sstream"
  927. fi
  928. fi
  929. if [ "x$KWSYS_IOS_USE_SSTREAM" = "x0" ]; then
  930. if cmake_try_run "${cmake_cxx_compiler}" \
  931. "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_STRSTREAM_H" \
  932. "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  933. KWSYS_IOS_USE_STRSTREAM_H=1
  934. echo "${cmake_cxx_compiler} has strstream.h"
  935. else
  936. echo "${cmake_cxx_compiler} does not have strstream.h"
  937. fi
  938. if [ "x$KWSYS_IOS_USE_STRSTREAM_H" = "x0" ]; then
  939. if cmake_try_run "${cmake_cxx_compiler}" \
  940. "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_STRSTREA_H" \
  941. "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  942. KWSYS_IOS_USE_STRSTREA_H=1
  943. echo "${cmake_cxx_compiler} has strstrea.h"
  944. else
  945. echo "${cmake_cxx_compiler} does not have strstrea.h"
  946. fi
  947. fi
  948. fi
  949. if cmake_try_run "${cmake_cxx_compiler}" \
  950. "${cmake_cxx_flags} -DTEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
  951. "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  952. KWSYS_STL_STRING_HAVE_NEQ_CHAR=1
  953. echo "${cmake_cxx_compiler} has operator!=(string, char*)"
  954. else
  955. echo "${cmake_cxx_compiler} does not have operator!=(string, char*)"
  956. fi
  957. if cmake_try_run "${cmake_cxx_compiler}" \
  958. "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ITERATOR_TRAITS -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
  959. "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  960. KWSYS_STL_HAS_ITERATOR_TRAITS=1
  961. echo "${cmake_cxx_compiler} has stl iterator_traits"
  962. else
  963. echo "${cmake_cxx_compiler} does not have stl iterator_traits"
  964. fi
  965. if [ "x${KWSYS_STL_HAS_ITERATOR_TRAITS}" = "x0" ]; then
  966. if cmake_try_run "${cmake_cxx_compiler}" \
  967. "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ITERATOR_CATEGORY -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
  968. "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  969. KWSYS_STL_HAS_ITERATOR_CATEGORY=1
  970. echo "${cmake_cxx_compiler} has old iterator_category"
  971. else
  972. echo "${cmake_cxx_compiler} does not have old iterator_category"
  973. fi
  974. if [ "x${KWSYS_STL_HAS_ITERATOR_CATEGORY}" = "x0" ]; then
  975. if cmake_try_run "${cmake_cxx_compiler}" \
  976. "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS___ITERATOR_CATEGORY -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
  977. "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  978. KWSYS_STL_HAS___ITERATOR_CATEGORY=1
  979. echo "${cmake_cxx_compiler} has old __iterator_category"
  980. else
  981. echo "${cmake_cxx_compiler} does not have old __iterator_category"
  982. fi
  983. fi
  984. fi
  985. if cmake_try_run "${cmake_cxx_compiler}" \
  986. "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
  987. "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  988. KWSYS_STL_HAS_ALLOCATOR_TEMPLATE=1
  989. echo "${cmake_cxx_compiler} has standard template allocator"
  990. else
  991. echo "${cmake_cxx_compiler} does not have standard template allocator"
  992. fi
  993. if [ "x${KWSYS_STL_HAS_ALLOCATOR_TEMPLATE}" = "x1" ]; then
  994. if cmake_try_run "${cmake_cxx_compiler}" \
  995. "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_REBIND -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
  996. "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  997. KWSYS_STL_HAS_ALLOCATOR_REBIND=1
  998. echo "${cmake_cxx_compiler} has allocator<>::rebind<>"
  999. else
  1000. echo "${cmake_cxx_compiler} does not have allocator<>::rebind<>"
  1001. fi
  1002. if cmake_try_run "${cmake_cxx_compiler}" \
  1003. "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
  1004. "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  1005. KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT=1
  1006. echo "${cmake_cxx_compiler} has non-standard allocator<>::max_size argument"
  1007. else
  1008. echo "${cmake_cxx_compiler} does not have non-standard allocator<>::max_size argument"
  1009. fi
  1010. else
  1011. if cmake_try_run "${cmake_cxx_compiler}" \
  1012. "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
  1013. "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  1014. KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE=1
  1015. echo "${cmake_cxx_compiler} has old non-template allocator"
  1016. else
  1017. echo "${cmake_cxx_compiler} does not have old non-template allocator"
  1018. fi
  1019. fi
  1020. if cmake_try_run "${cmake_cxx_compiler}" \
  1021. "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
  1022. "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  1023. KWSYS_STL_HAS_ALLOCATOR_OBJECTS=1
  1024. echo "${cmake_cxx_compiler} has stl containers supporting allocator objects"
  1025. else
  1026. echo "${cmake_cxx_compiler} does not have stl containers supporting allocator objects"
  1027. fi
  1028. if cmake_try_run "${cmake_cxx_compiler}" \
  1029. "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_CSTDDEF" \
  1030. "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  1031. KWSYS_CXX_HAS_CSTDDEF=1
  1032. echo "${cmake_cxx_compiler} has header cstddef"
  1033. else
  1034. echo "${cmake_cxx_compiler} does not have header cstddef"
  1035. fi
  1036. if cmake_try_run "${cmake_cxx_compiler}" \
  1037. "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS" \
  1038. "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  1039. echo "${cmake_cxx_compiler} does not require template friends to use <>"
  1040. else
  1041. KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS=1
  1042. echo "${cmake_cxx_compiler} requires template friends to use <>"
  1043. fi
  1044. if cmake_try_run "${cmake_cxx_compiler}" \
  1045. "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES" \
  1046. "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  1047. KWSYS_CXX_HAS_MEMBER_TEMPLATES=1
  1048. echo "${cmake_cxx_compiler} supports member templates"
  1049. else
  1050. echo "${cmake_cxx_compiler} does not support member templates"
  1051. fi
  1052. if cmake_try_run "${cmake_cxx_compiler}" \
  1053. "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION" \
  1054. "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  1055. KWSYS_CXX_HAS_FULL_SPECIALIZATION=1
  1056. echo "${cmake_cxx_compiler} has standard template specialization syntax"
  1057. else
  1058. echo "${cmake_cxx_compiler} does not have standard template specialization syntax"
  1059. fi
  1060. if cmake_try_run "${cmake_cxx_compiler}" \
  1061. "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP" \
  1062. "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  1063. KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP=1
  1064. echo "${cmake_cxx_compiler} has argument dependent lookup"
  1065. else
  1066. echo "${cmake_cxx_compiler} does not have argument dependent lookup"
  1067. fi
  1068. if cmake_try_run "${cmake_cxx_compiler}" \
  1069. "${cmake_cxx_flags} -DTEST_KWSYS_STAT_HAS_ST_MTIM" \
  1070. "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  1071. KWSYS_STAT_HAS_ST_MTIM=1
  1072. echo "${cmake_cxx_compiler} has struct stat with st_mtim member"
  1073. else
  1074. echo "${cmake_cxx_compiler} does not have struct stat with st_mtim member"
  1075. fi
  1076. # Just to be safe, let us store compiler and flags to the header file
  1077. cmake_bootstrap_version='$Revision$'
  1078. cmake_compiler_settings_comment="/*
  1079. * Generated by ${cmake_source_dir}/bootstrap
  1080. * Version: ${cmake_bootstrap_version}
  1081. *
  1082. * Source directory: ${cmake_source_dir}
  1083. * Binary directory: ${cmake_bootstrap_dir}
  1084. *
  1085. * C compiler: ${cmake_c_compiler}
  1086. * C flags: ${cmake_c_flags}
  1087. *
  1088. * C++ compiler: ${cmake_cxx_compiler}
  1089. * C++ flags: ${cmake_cxx_flags}
  1090. *
  1091. * Make: ${cmake_make_processor}
  1092. *
  1093. * Sources:
  1094. * ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES}
  1095. * kwSys Sources:
  1096. * ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES} ${KWSYS_C_MINGW_SOURCES}
  1097. */
  1098. "
  1099. cmake_report cmConfigure.h${_tmp} "${cmake_compiler_settings_comment}"
  1100. if [ "x$KWSYS_STL_HAVE_STD" = "x1" ]; then
  1101. cmake_report cmConfigure.h${_tmp} "/* #undef CMAKE_NO_STD_NAMESPACE */"
  1102. else
  1103. cmake_report cmConfigure.h${_tmp} "#define CMAKE_NO_STD_NAMESPACE 1"
  1104. fi
  1105. if [ "x$KWSYS_IOS_USE_ANSI" = "x1" ]; then
  1106. cmake_report cmConfigure.h${_tmp} "/* #undef CMAKE_NO_ANSI_STREAM_HEADERS */"
  1107. else
  1108. cmake_report cmConfigure.h${_tmp} "#define CMAKE_NO_ANSI_STREAM_HEADERS 1"
  1109. fi
  1110. if [ "x$KWSYS_IOS_USE_SSTREAM" = "x1" ]; then
  1111. cmake_report cmConfigure.h${_tmp} "/* #undef CMAKE_NO_ANSI_STRING_STREAM */"
  1112. else
  1113. cmake_report cmConfigure.h${_tmp} "#define CMAKE_NO_ANSI_STRING_STREAM 1"
  1114. fi
  1115. # Test for ansi FOR scope
  1116. if cmake_try_run "${cmake_cxx_compiler}" \
  1117. "${cmake_cxx_flags}" \
  1118. "${cmake_source_dir}/Modules/TestForAnsiForScope.cxx" >> cmake_bootstrap.log 2>&1; then
  1119. cmake_report cmConfigure.h${_tmp} "/* #undef CMAKE_NO_ANSI_FOR_SCOPE */"
  1120. echo "${cmake_cxx_compiler} has ANSI for scoping"
  1121. else
  1122. cmake_report cmConfigure.h${_tmp} "#define CMAKE_NO_ANSI_FOR_SCOPE 1"
  1123. echo "${cmake_cxx_compiler} does not have ANSI for scoping"
  1124. fi
  1125. # When bootstrapping on MinGW with MSYS we must convert the source
  1126. # directory to a windows path.
  1127. if ${cmake_system_mingw}; then
  1128. cmake_root_dir=`cd "${cmake_source_dir}"; pwd -W`
  1129. else
  1130. cmake_root_dir="${cmake_source_dir}"
  1131. fi
  1132. # Write CMake version
  1133. cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_MAJOR ${cmake_version_major}"
  1134. cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_MINOR ${cmake_version_minor}"
  1135. cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_PATCH ${cmake_version_patch}"
  1136. cmake_report cmConfigure.h${_tmp} "#define CMAKE_ROOT_DIR \"${cmake_root_dir}\""
  1137. cmake_report cmConfigure.h${_tmp} "#define CMAKE_DATA_DIR \"${cmake_data_dir}\""
  1138. cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP"
  1139. # Regenerate configured headers
  1140. for h in Configure VersionConfig; do
  1141. if "${_diff}" cm${h}.h cm${h}.h${_tmp} > /dev/null 2> /dev/null; then
  1142. rm -f cm${h}.h${_tmp}
  1143. else
  1144. mv -f cm${h}.h${_tmp} cm${h}.h
  1145. fi
  1146. done
  1147. # Prepare KWSYS
  1148. cmake_kwsys_config_replace_string \
  1149. "${cmake_source_dir}/Source/kwsys/Configure.hxx.in" \
  1150. "${cmake_bootstrap_dir}/cmsys/Configure.hxx" \
  1151. "${cmake_compiler_settings_comment}"
  1152. cmake_kwsys_config_replace_string \
  1153. "${cmake_source_dir}/Source/kwsys/Configure.h.in" \
  1154. "${cmake_bootstrap_dir}/cmsys/Configure.h" \
  1155. "${cmake_compiler_settings_comment}"
  1156. for a in ${KWSYS_FILES}; do
  1157. cmake_replace_string "${cmake_source_dir}/Source/kwsys/${a}.in" \
  1158. "${cmake_bootstrap_dir}/cmsys/${a}" KWSYS_NAMESPACE cmsys
  1159. done
  1160. for a in ${KWSYS_IOS_FILES}; do
  1161. cmake_replace_string "${cmake_source_dir}/Source/kwsys/kwsys_ios_${a}.h.in" \
  1162. "${cmake_bootstrap_dir}/cmsys/ios/${a}" KWSYS_NAMESPACE cmsys
  1163. done
  1164. cmake_replace_string "${cmake_source_dir}/Source/kwsys/kwsys_stl.hxx.in" \
  1165. "${cmake_bootstrap_dir}/cmsys/stl/stl.hxx_a" KWSYS_STL_HEADER_EXTRA ""
  1166. cmake_replace_string "${cmake_bootstrap_dir}/cmsys/stl/stl.hxx_a" \
  1167. "${cmake_bootstrap_dir}/cmsys/stl/stl.hxx_b" KWSYS_NAMESPACE cmsys
  1168. for a in string vector map algorithm; do
  1169. cmake_replace_string "${cmake_bootstrap_dir}/cmsys/stl/stl.hxx_b" \
  1170. "${cmake_bootstrap_dir}/cmsys/stl/${a}" KWSYS_STL_HEADER ${a}
  1171. done
  1172. # Generate Makefile
  1173. dep="cmConfigure.h cmsys/*.hxx cmsys/*.h `cmake_escape \"${cmake_source_dir}\"`/Source/*.h"
  1174. objs=""
  1175. for a in ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES} ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES} ${KWSYS_C_GENERATED_SOURCES}; do
  1176. objs="${objs} ${a}.o"
  1177. done
  1178. # Generate dependencies for cmBootstrapCommands.cxx
  1179. for file in `grep "#include.*cm[^.]*.cxx" "${cmake_source_dir}/Source/cmBootstrapCommands.cxx" | sed "s/.* \"\(.*\)\"/\1/"`; do
  1180. cmBootstrapCommandsDeps="${cmBootstrapCommandsDeps} `cmake_escape "${cmake_source_dir}/Source/$file"`"
  1181. done
  1182. cmBootstrapCommandsDeps=`echo $cmBootstrapCommandsDeps`
  1183. if [ "x${cmake_ansi_cxx_flags}" != "x" ]; then
  1184. cmake_cxx_flags="${cmake_ansi_cxx_flags} ${cmake_cxx_flags}"
  1185. fi
  1186. if [ "x${cmake_c_flags}" != "x" ]; then
  1187. cmake_c_flags="${cmake_c_flags} "
  1188. fi
  1189. if [ "x${cmake_cxx_flags}" != "x" ]; then
  1190. cmake_cxx_flags="${cmake_cxx_flags} "
  1191. fi
  1192. cmake_c_flags_String="-DKWSYS_STRING_C"
  1193. cmake_c_flags="${cmake_c_flags}-I`cmake_escape \"${cmake_source_dir}/Source\"` \
  1194. -I`cmake_escape \"${cmake_bootstrap_dir}\"`"
  1195. cmake_cxx_flags="${cmake_cxx_flags}-I`cmake_escape \"${cmake_source_dir}/Source\"` \
  1196. -I`cmake_escape \"${cmake_bootstrap_dir}\"`"
  1197. echo "cmake: ${objs}" > "${cmake_bootstrap_dir}/Makefile"
  1198. echo " ${cmake_cxx_compiler} ${cmake_ld_flags} ${cmake_cxx_flags} ${objs} -o cmake" >> "${cmake_bootstrap_dir}/Makefile"
  1199. for a in ${CMAKE_CXX_SOURCES}; do
  1200. src=`cmake_escape "${cmake_source_dir}/Source/${a}.cxx"`
  1201. echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
  1202. echo " ${cmake_cxx_compiler} ${cmake_cxx_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
  1203. done
  1204. echo "cmBootstrapCommands.o : $cmBootstrapCommandsDeps" >> "${cmake_bootstrap_dir}/Makefile"
  1205. for a in ${CMAKE_C_SOURCES}; do
  1206. src=`cmake_escape "${cmake_source_dir}/Source/${a}.c"`
  1207. echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
  1208. echo " ${cmake_c_compiler} ${cmake_c_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
  1209. done
  1210. for a in ${KWSYS_C_SOURCES} ${KWSYS_C_MINGW_SOURCES}; do
  1211. src=`cmake_escape "${cmake_source_dir}/Source/kwsys/${a}.c"`
  1212. src_flags=`eval echo \\${cmake_c_flags_\${a}}`
  1213. echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
  1214. echo " ${cmake_c_compiler} ${cmake_c_flags} -DKWSYS_NAMESPACE=cmsys ${src_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
  1215. done
  1216. for a in ${KWSYS_CXX_SOURCES}; do
  1217. src=`cmake_escape "${cmake_source_dir}/Source/kwsys/${a}.cxx"`
  1218. echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
  1219. echo " ${cmake_cxx_compiler} ${cmake_cxx_flags} -DKWSYS_NAMESPACE=cmsys -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
  1220. done
  1221. if ${cmake_system_mingw}; then
  1222. src=`cmake_escape "${cmake_bootstrap_dir}/cmsysProcessFwd9xEnc.c"`
  1223. in=`cmake_escape "${cmake_bootstrap_dir}/cmsysProcessFwd9x.exe"`
  1224. cmd=`cmake_escape "${cmake_bootstrap_dir}/cmsysEncodeExecutable.exe"`
  1225. a="cmsysProcessFwd9xEnc"
  1226. echo "${cmd} : EncodeExecutable.o" >> "${cmake_bootstrap_dir}/Makefile"
  1227. echo " ${cmake_c_compiler} ${cmake_ld_flags} ${cmake_c_flags} EncodeExecutable.o -o ${cmd}" >> "${cmake_bootstrap_dir}/Makefile"
  1228. echo "${in} : ProcessFwd9x.o" >> "${cmake_bootstrap_dir}/Makefile"
  1229. echo " ${cmake_c_compiler} ${cmake_ld_flags} ${cmake_c_flags} ProcessFwd9x.o -o ${in}" >> "${cmake_bootstrap_dir}/Makefile"
  1230. echo "${src} : ${cmd} ${in}" >> "${cmake_bootstrap_dir}/Makefile"
  1231. echo " ${cmd} ${in} ${src} cmsys ProcessFwd9x" >> "${cmake_bootstrap_dir}/Makefile"
  1232. echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
  1233. echo " ${cmake_c_compiler} ${cmake_c_flags} -I`cmake_escape \"${cmake_source_dir}/Source/kwsys\"` -DKWSYS_NAMESPACE=cmsys -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
  1234. fi
  1235. echo '
  1236. rebuild_cache:
  1237. cd "${cmake_binary_dir}" && "${cmake_source_dir}/bootstrap"
  1238. ' >> "${cmake_bootstrap_dir}/Makefile"
  1239. # Write our default settings to Bootstrap${_cmk}/InitialCacheFlags.cmake.
  1240. echo '
  1241. # Generated by '"${cmake_source_dir}"'/bootstrap
  1242. # Default cmake settings. These may be overridden any settings below.
  1243. SET (CMAKE_INSTALL_PREFIX "'"${cmake_prefix_dir}"'" CACHE PATH "Install path prefix, prepended onto install directories." FORCE)
  1244. SET (CMAKE_DOC_DIR "'"${cmake_doc_dir}"'" CACHE PATH "Install location for documentation (relative to prefix)." FORCE)
  1245. SET (CMAKE_MAN_DIR "'"${cmake_man_dir}"'" CACHE PATH "Install location for man pages (relative to prefix)." FORCE)
  1246. SET (CMAKE_DATA_DIR "'"${cmake_data_dir}"'" CACHE PATH "Install location for data (relative to prefix)." FORCE)
  1247. ' > "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
  1248. # Add configuration settings given as command-line options.
  1249. if [ "x${cmake_bootstrap_qt_gui}" != "x" ]; then
  1250. echo '
  1251. SET (BUILD_QtDialog '"${cmake_bootstrap_qt_gui}"' CACHE BOOL "Build Qt dialog for CMake" FORCE)
  1252. ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
  1253. fi
  1254. if [ "x${cmake_bootstrap_qt_qmake}" != "x" ]; then
  1255. echo '
  1256. SET (QT_QMAKE_EXECUTABLE "'"${cmake_bootstrap_qt_qmake}"'" CACHE FILEPATH "Location of Qt qmake" FORCE)
  1257. ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
  1258. fi
  1259. # Add user-specified settings. Handle relative-path case for
  1260. # specification of cmake_init_file.
  1261. (
  1262. cd "${cmake_binary_dir}"
  1263. if [ -f "${cmake_init_file}" ]; then
  1264. cat "${cmake_init_file}" >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
  1265. fi
  1266. )
  1267. echo "---------------------------------------------"
  1268. # Run make to build bootstrap cmake
  1269. if [ "x${cmake_parallel_make}" != "x" ]; then
  1270. ${cmake_make_processor} ${cmake_make_flags}
  1271. else
  1272. ${cmake_make_processor}
  1273. fi
  1274. RES=$?
  1275. if [ "${RES}" -ne "0" ]; then
  1276. cmake_error 9 "Problem while running ${cmake_make_processor}"
  1277. fi
  1278. cd "${cmake_binary_dir}"
  1279. # Set C, CXX, and MAKE environment variables, so that real real cmake will be
  1280. # build with same compiler and make
  1281. CC="${cmake_c_compiler}"
  1282. CXX="${cmake_cxx_compiler}"
  1283. MAKE="${cmake_make_processor}"
  1284. export CC
  1285. export CXX
  1286. export MAKE
  1287. # Run bootstrap CMake to configure real CMake
  1288. "${cmake_bootstrap_dir}/cmake" "${cmake_source_dir}" "-C${cmake_bootstrap_dir}/InitialCacheFlags.cmake" "-G${cmake_bootstrap_generator}" ${cmake_bootstrap_system_libs}
  1289. RES=$?
  1290. if [ "${RES}" -ne "0" ]; then
  1291. cmake_error 11 "Problem while running initial CMake"
  1292. fi
  1293. echo "---------------------------------------------"
  1294. # And we are done. Now just run make
  1295. echo "CMake has bootstrapped. Now run ${cmake_make_processor}."