bootstrap 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988
  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. CMAKE_KNOWN_C_COMPILERS="cc gcc xlc icc tcc"
  19. CMAKE_KNOWN_CXX_COMPILERS="aCC xlC CC g++ c++ icc como "
  20. CMAKE_KNOWN_MAKE_PROCESSORS="gmake make"
  21. CMAKE_PROBLEMATIC_FILES="\
  22. CMakeCache.txt \
  23. CMakeSystem.cmake \
  24. CMakeCCompiler.cmake \
  25. CMakeCXXCompiler.cmake \
  26. Source/cmConfigure.h \
  27. Source/CTest/Curl/config.h \
  28. Utilities/cmexpat/expatConfig.h \
  29. Utilities/cmexpat/expatDllConfig.h \
  30. "
  31. CMAKE_CXX_SOURCES="\
  32. cmake \
  33. cmakewizard \
  34. cmakemain \
  35. cmDepends \
  36. cmDependsC \
  37. cmMakeDepend \
  38. cmMakefile \
  39. cmGeneratedFileStream \
  40. cmGlobalGenerator \
  41. cmLocalGenerator \
  42. cmSourceFile \
  43. cmSystemTools \
  44. cmGlobalUnixMakefileGenerator \
  45. cmGlobalXCodeGenerator \
  46. cmLocalXCodeGenerator \
  47. cmXCodeObject \
  48. cmLocalUnixMakefileGenerator2 \
  49. cmBootstrapCommands \
  50. cmCommands \
  51. cmTarget \
  52. cmCustomCommand \
  53. cmCacheManager \
  54. cmListFileCache \
  55. cmOrderLinkDirectories \
  56. cmSourceGroup"
  57. CMAKE_C_SOURCES="\
  58. cmListFileLexer \
  59. "
  60. KWSYS_C_SOURCES="\
  61. ProcessUNIX"
  62. KWSYS_CXX_SOURCES="\
  63. Directory \
  64. RegularExpression \
  65. SystemTools"
  66. KWSYS_FILES="\
  67. Directory.hxx \
  68. Process.h \
  69. RegularExpression.hxx \
  70. SystemTools.hxx"
  71. KWSYS_IOS_FILES="
  72. fstream \
  73. iosfwd \
  74. iostream \
  75. sstream"
  76. cmake_system=`uname`
  77. cmake_source_dir=`echo $0 | sed -n '/\//{s/\/[^\/]*$//;p;}'`
  78. cmake_source_dir=`(cd "${cmake_source_dir}";pwd)`
  79. cmake_binary_dir=`pwd`
  80. cmake_bootstrap_dir="${cmake_binary_dir}/Bootstrap.cmk"
  81. cmake_data_dir="/share/CMake"
  82. cmake_doc_dir="/doc/CMake"
  83. cmake_man_dir="/man"
  84. cmake_init_file=""
  85. # Display CMake bootstrap usage
  86. cmake_usage()
  87. {
  88. cat <<EOF
  89. Usage: $0 [options]
  90. Options: [defaults in brackets after descriptions]
  91. Configuration:
  92. --help print this message
  93. --version only print version information
  94. --verbose display more information
  95. --parallel=n bootstrap cmake in parallel, where n is
  96. number of nodes [1]
  97. --init=FILE use FILE for cmake initialization
  98. Directory and file names:
  99. --prefix=PREFIX install files in tree rooted at PREFIX
  100. [/usr/local]
  101. --datadir=DIR install data files in PREFIX/DIR
  102. [/share/CMake]
  103. --docdir=DIR install documentation files in PREFIX/DIR
  104. [/doc/CMake]
  105. --mandir=DIR install man pages files in PREFIX/DIR/manN
  106. [/man]
  107. EOF
  108. exit 10
  109. }
  110. # Display CMake bootstrap usage
  111. cmake_version()
  112. {
  113. # Get CMake version
  114. CMAKE_VERSION=""
  115. for a in MAJOR MINOR PATCH; do
  116. CMake_VERSION=`cat "${cmake_source_dir}/CMakeLists.txt" | \
  117. grep "SET(CMake_VERSION_${a} *[0-9]*)" | sed "s/SET(CMake_VERSION_${a} *\([0-9]*\))/\1/"`
  118. CMAKE_VERSION="${CMAKE_VERSION}.${CMake_VERSION}"
  119. done
  120. if echo "$CMAKE_VERSION" | grep "\.[0-9][0-9]*\.[0-9]*[13579]\.[0-9]" > /dev/null 2>&1; then
  121. CMake_DATE=`cat "${cmake_source_dir}/Source/cmVersion.cxx" | grep "\"\\\$Date$"`
  122. CMake_DATE=`echo "${CMake_DATE}" | sed "s/.*Date: \([0-9][0-9]*\)\/\([0-9][0-9]*\)\/\([0-9][0-9]*\) .*/\1\2\3/" `
  123. CMAKE_VERSION=`echo $CMAKE_VERSION | sed "s/\.\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\)/\1.\2-${CMake_DATE}/"`
  124. else
  125. CMAKE_VERSION=`echo $CMAKE_VERSION | sed "s/\.\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\)/\1.\2-\3/"`
  126. fi
  127. echo "CMake ${CMAKE_VERSION}, Copyright (c) 2002 Kitware, Inc., Insight Consortium"
  128. }
  129. # Display CMake bootstrap error, display the log file and exit
  130. cmake_error()
  131. {
  132. res=$1
  133. shift 1
  134. echo "---------------------------------------------"
  135. echo "Error when bootstrapping CMake:"
  136. echo "$*"
  137. echo "---------------------------------------------"
  138. if [ -f cmake_bootstrap.log ]; then
  139. echo "Log of errors: `pwd`/cmake_bootstrap.log"
  140. #cat cmake_bootstrap.log
  141. echo "---------------------------------------------"
  142. fi
  143. exit ${res}
  144. }
  145. # Replace KWSYS_NAMESPACE with cmsys
  146. cmake_replace_string ()
  147. {
  148. INFILE="$1"
  149. OUTFILE="$2"
  150. SEARCHFOR="$3"
  151. REPLACEWITH="$4"
  152. if [ -f "${INFILE}" ]; then
  153. cat "${INFILE}" |
  154. sed "s/\@${SEARCHFOR}\@/${REPLACEWITH}/g" > "${OUTFILE}.tmp"
  155. if [ -f "${OUTFILE}.tmp" ]; then
  156. if diff "${OUTFILE}" "${OUTFILE}.tmp" > /dev/null 2> /dev/null ; then
  157. #echo "Files are the same"
  158. rm -f "${OUTFILE}.tmp"
  159. else
  160. mv -f "${OUTFILE}.tmp" "${OUTFILE}"
  161. fi
  162. fi
  163. else
  164. cmake_error 1 "Cannot find file ${INFILE}"
  165. fi
  166. }
  167. cmake_kwsys_config_replace_string ()
  168. {
  169. INFILE="$1"
  170. OUTFILE="$2"
  171. shift 2
  172. APPEND="$*"
  173. if [ -f "${INFILE}" ]; then
  174. echo "${APPEND}" > "${OUTFILE}.tmp"
  175. cat "${INFILE}" |
  176. sed "/./ {s/\@KWSYS_NAMESPACE\@/cmsys/g;
  177. s/@KWSYS_BUILD_SHARED@/${KWSYS_BUILD_SHARED}/g;
  178. s/@KWSYS_NAME_IS_KWSYS@/${KWSYS_NAME_IS_KWSYS}/g;
  179. s/@KWSYS_IOS_USE_ANSI@/${KWSYS_IOS_USE_ANSI}/g;
  180. s/@KWSYS_IOS_HAVE_STD@/${KWSYS_IOS_HAVE_STD}/g;
  181. s/@KWSYS_IOS_USE_SSTREAM@/${KWSYS_IOS_USE_SSTREAM}/g;
  182. s/@KWSYS_IOS_USE_STRSTREAM_H@/${KWSYS_IOS_USE_STRSTREAM_H}/g;
  183. s/@KWSYS_IOS_USE_STRSTREA_H@/${KWSYS_IOS_USE_STRSTREA_H}/g;
  184. s/@KWSYS_STL_HAVE_STD@/${KWSYS_STL_HAVE_STD}/g;
  185. s/@KWSYS_STAT_HAS_ST_MTIM@/${KWSYS_STAT_HAS_ST_MTIM}/g;}" >> "${OUTFILE}.tmp"
  186. if [ -f "${OUTFILE}.tmp" ]; then
  187. if diff "${OUTFILE}" "${OUTFILE}.tmp" > /dev/null 2> /dev/null ; then
  188. #echo "Files are the same"
  189. rm -f "${OUTFILE}.tmp"
  190. else
  191. mv -f "${OUTFILE}.tmp" "${OUTFILE}"
  192. fi
  193. fi
  194. else
  195. cmake_error 2 "Cannot find file ${INFILE}"
  196. fi
  197. }
  198. # Write string into a file
  199. cmake_report ()
  200. {
  201. FILE=$1
  202. shift
  203. echo "$*" >> ${FILE}
  204. }
  205. # Escape spaces in strings
  206. cmake_escape ()
  207. {
  208. echo $1 | sed "s/ /\\\\ /g"
  209. }
  210. # Write message to the log
  211. cmake_log ()
  212. {
  213. echo "$*" >> cmake_bootstrap.log
  214. }
  215. # Return temp file
  216. cmake_tmp_file ()
  217. {
  218. echo "cmake_bootstrap_$$.test"
  219. }
  220. # Run a compiler test. First argument is compiler, second one are compiler
  221. # flags, third one is test source file to be compiled
  222. cmake_try_run ()
  223. {
  224. COMPILER=$1
  225. FLAGS=$2
  226. TESTFILE=$3
  227. if [ ! -f "${TESTFILE}" ]; then
  228. echo "Test file ${TESTFILE} missing. Please verify your CMake source tree."
  229. exit 4
  230. fi
  231. TMPFILE=`cmake_tmp_file`
  232. echo "Try: ${COMPILER}"
  233. echo "Line: ${COMPILER} ${FLAGS} ${TESTFILE} -o ${TMPFILE}"
  234. echo "---------- file -----------------------"
  235. cat ${TESTFILE}
  236. echo "------------------------------------------"
  237. "${COMPILER}" ${FLAGS} "${TESTFILE}" -o "${TMPFILE}"
  238. RES=$?
  239. if [ "${RES}" -ne "0" ]; then
  240. echo "Test failed to compile"
  241. return 1
  242. fi
  243. if [ ! -f "${TMPFILE}" ] && [ ! -f "${TMPFILE}.exe" ]; then
  244. echo "Test failed to produce executable"
  245. return 2
  246. fi
  247. ./${TMPFILE}
  248. RES=$?
  249. rm -f "${TMPFILE}"
  250. if [ "${RES}" -ne "0" ]; then
  251. echo "Test produced non-zero return code"
  252. return 3
  253. fi
  254. echo "Test succeded"
  255. return 0
  256. }
  257. # Run a make test. First argument is the make interpreter.
  258. cmake_try_make ()
  259. {
  260. MAKE_PROC="$1"
  261. MAKE_FLAGS="$2"
  262. echo "Try: ${MAKE_PROC}"
  263. "${MAKE_PROC}" ${MAKE_FLAGS}
  264. RES=$?
  265. if [ "${RES}" -ne "0" ]; then
  266. echo "${MAKE_PROC} does not work"
  267. return 1
  268. fi
  269. if [ ! -f "test" ] && [ ! -f "test.exe" ]; then
  270. echo "${COMPILER} does not produce output"
  271. return 2
  272. fi
  273. ./test
  274. RES=$?
  275. rm -f "test"
  276. if [ "${RES}" -ne "0" ]; then
  277. echo "${MAKE_PROC} produces strange executable"
  278. return 3
  279. fi
  280. echo "${MAKE_PROC} works"
  281. return 0
  282. }
  283. # Parse arguments
  284. cmake_verbose=
  285. cmake_parallel_make=
  286. cmake_prefix_dir="/usr/local"
  287. for a in "$@"; do
  288. if echo $a | grep "^--prefix=" > /dev/null 2> /dev/null; then
  289. cmake_prefix_dir=`echo $a | sed "s/^--prefix=//"`
  290. fi
  291. if echo $a | grep "^--parallel=" > /dev/null 2> /dev/null; then
  292. cmake_parallel_make=`echo $a | sed "s/^--parallel=//" | grep "[0-9][0-9]*"`
  293. fi
  294. if echo $a | grep "^--datadir=" > /dev/null 2> /dev/null; then
  295. cmake_data_dir=`echo $a | sed "s/^--datadir=//"`
  296. fi
  297. if echo $a | grep "^--docdir=" > /dev/null 2> /dev/null; then
  298. cmake_doc_dir=`echo $a | sed "s/^--docdir=//"`
  299. fi
  300. if echo $a | grep "^--mandir=" > /dev/null 2> /dev/null; then
  301. cmake_man_dir=`echo $a | sed "s/^--mandir=//"`
  302. fi
  303. if echo $a | grep "^--init=" > /dev/null 2> /dev/null; then
  304. cmake_init_file=`echo $a | sed "s/^--init=//"`
  305. fi
  306. if echo $a | grep "^--help" > /dev/null 2> /dev/null; then
  307. cmake_usage
  308. fi
  309. if echo $a | grep "^--version" > /dev/null 2> /dev/null; then
  310. cmake_version
  311. exit 2
  312. fi
  313. if echo $a | grep "^--verbose" > /dev/null 2> /dev/null; then
  314. cmake_verbose=TRUE
  315. fi
  316. done
  317. # If verbose, display some information about bootstrap
  318. if [ -n "${cmake_verbose}" ]; then
  319. echo "---------------------------------------------"
  320. echo "Source directory: ${cmake_source_dir}"
  321. echo "Binary directory: ${cmake_binary_dir}"
  322. echo "Prefix directory: ${cmake_prefix_dir}"
  323. echo "System: ${cmake_system}"
  324. if [ "x${cmake_parallel_make}" != "x" ]; then
  325. echo "Doing parallel make: ${cmake_parallel_make}"
  326. fi
  327. echo ""
  328. fi
  329. echo "---------------------------------------------"
  330. # Get CMake version
  331. echo "`cmake_version`"
  332. # Check for in-source build
  333. cmake_in_source_build=
  334. if [ -f "${cmake_binary_dir}/Source/cmake.cxx" -a \
  335. -f "${cmake_binary_dir}/Source/cmake.h" ]; then
  336. if [ -n "${cmake_verbose}" ]; then
  337. echo "Warning: This is an in-source build"
  338. fi
  339. cmake_in_source_build=TRUE
  340. fi
  341. # If this is not an in-source build, then Bootstrap stuff should not exist.
  342. if [ -z "${cmake_in_source_build}" ]; then
  343. # Did somebody bootstrap in the source tree?
  344. if [ -d "${cmake_source_dir}/Bootstrap.cmk" ]; then
  345. cmake_error 10 "Found directory \"${cmake_source_dir}/Bootstrap.cmk\".
  346. Looks like somebody did bootstrap CMake in the source tree, but now you are
  347. trying to do bootstrap in the binary tree. Please remove Bootstrap.cmk
  348. directory from the source tree."
  349. fi
  350. # Is there a cache in the source tree?
  351. for cmake_problematic_file in ${CMAKE_PROBLEMATIC_FILES}; do
  352. if [ -f "${cmake_source_dir}/${cmake_problematic_file}" ]; then
  353. cmake_error 10 "Found \"${cmake_source_dir}/${cmake_problematic_file}\".
  354. Looks like somebody tried to build CMake in the source tree, but now you are
  355. trying to do bootstrap in the binary tree. Please remove \"${cmake_problematic_file}\"
  356. from the source tree."
  357. fi
  358. done
  359. fi
  360. # Make bootstrap directory
  361. [ -d "${cmake_bootstrap_dir}" ] || mkdir "${cmake_bootstrap_dir}"
  362. if [ ! -d "${cmake_bootstrap_dir}" ]; then
  363. cmake_error 3 "Cannot create directory ${cmake_bootstrap_dir} to bootstrap CMake."
  364. fi
  365. cd "${cmake_bootstrap_dir}"
  366. [ -d "cmsys" ] || mkdir "cmsys"
  367. if [ ! -d "cmsys" ]; then
  368. cmake_error 4 "Cannot create directory ${cmake_bootstrap_dir}/cmsys"
  369. fi
  370. for a in stl ios; do
  371. [ -d "cmsys/${a}" ] || mkdir "cmsys/${a}"
  372. if [ ! -d "cmsys/${a}" ]; then
  373. cmake_error 5 "Cannot create directory ${cmake_bootstrap_dir}/cmsys/${a}"
  374. fi
  375. done
  376. # Delete all the bootstrap files
  377. rm -f "${cmake_bootstrap_dir}/cmake_bootstrap.log"
  378. rm -f "${cmake_bootstrap_dir}/cmConfigure.h.tmp"
  379. # If exist compiler flags, set them
  380. cmake_c_flags=${CFLAGS}
  381. cmake_cxx_flags=${CXXFLAGS}
  382. # Test C compiler
  383. cmake_c_compiler=
  384. # If CC is set, use that for compiler, otherwise use list of known compilers
  385. if [ -n "${CC}" ]; then
  386. cmake_c_compilers="${CC}"
  387. else
  388. cmake_c_compilers="${CMAKE_KNOWN_C_COMPILERS}"
  389. fi
  390. # Check if C compiler works
  391. TMPFILE=`cmake_tmp_file`
  392. cat > "${TMPFILE}.c" <<EOF
  393. #include<stdio.h>
  394. int main()
  395. {
  396. printf("1\n");
  397. return 0;
  398. }
  399. EOF
  400. for a in ${cmake_c_compilers}; do
  401. if [ -z "${cmake_c_compiler}" ] && \
  402. cmake_try_run "${a}" "${cmake_c_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then
  403. cmake_c_compiler="${a}"
  404. fi
  405. done
  406. rm -f "${TMPFILE}.c"
  407. if [ -z "${cmake_c_compiler}" ]; then
  408. cmake_error 6 "Cannot find appropriate C compiler on this system.
  409. Please specify one using environment variable CC.
  410. See cmake_bootstrap.log for compilers attempted.
  411. "
  412. fi
  413. echo "C compiler on this system is: ${cmake_c_compiler} ${cmake_c_flags}"
  414. # Test CXX compiler
  415. cmake_cxx_compiler=
  416. # On Mac OSX, CC is the same as cc, so make sure not to try CC as c++ compiler.
  417. # If CC is set, use that for compiler, otherwise use list of known compilers
  418. if [ -n "${CXX}" ]; then
  419. cmake_cxx_compilers="${CXX}"
  420. else
  421. cmake_cxx_compilers="${CMAKE_KNOWN_CXX_COMPILERS}"
  422. fi
  423. # Check if C++ compiler works
  424. TMPFILE=`cmake_tmp_file`
  425. cat > "${TMPFILE}.cxx" <<EOF
  426. #if defined(TEST1)
  427. # include <iostream>
  428. #else
  429. # include <iostream.h>
  430. #endif
  431. class NeedCXX
  432. {
  433. public:
  434. NeedCXX() { this->Foo = 1; }
  435. int GetFoo() { return this->Foo; }
  436. private:
  437. int Foo;
  438. };
  439. int main()
  440. {
  441. NeedCXX c;
  442. #ifdef TEST3
  443. cout << c.GetFoo() << endl;
  444. #else
  445. std::cout << c.GetFoo() << std::endl;
  446. #endif
  447. return 0;
  448. }
  449. EOF
  450. for a in ${cmake_cxx_compilers}; do
  451. for b in 1 2 3; do
  452. if [ -z "${cmake_cxx_compiler}" ] && \
  453. cmake_try_run "${a}" "${cmake_cxx_flags} -DTEST${b}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
  454. cmake_cxx_compiler="${a}"
  455. fi
  456. done
  457. done
  458. rm -f "${TMPFILE}.cxx"
  459. if [ -z "${cmake_cxx_compiler}" ]; then
  460. cmake_error 7 "Cannot find appropriate C++ compiler on this system.
  461. Please specify one using environment variable CXX.
  462. See cmake_bootstrap.log for compilers attempted."
  463. fi
  464. echo "C++ compiler on this system is: ${cmake_cxx_compiler} ${cmake_cxx_flags}"
  465. # Test Make
  466. cmake_make_processor=
  467. cmake_make_flags=
  468. # If MAKE is set, use that for make processor, otherwise use list of known make
  469. if [ -n "${MAKE}" ]; then
  470. cmake_make_processors="${MAKE}"
  471. else
  472. cmake_make_processors="${CMAKE_KNOWN_MAKE_PROCESSORS}"
  473. fi
  474. TMPFILE="`cmake_tmp_file`_dir"
  475. rm -rf "${cmake_bootstrap_dir}/${TMPFILE}"
  476. mkdir "${cmake_bootstrap_dir}/${TMPFILE}"
  477. cd "${cmake_bootstrap_dir}/${TMPFILE}"
  478. cat>"Makefile"<<EOF
  479. test: test.c
  480. "${cmake_c_compiler}" -o test test.c
  481. EOF
  482. cat>"test.c"<<EOF
  483. #include <stdio.h>
  484. int main(){ printf("1\n"); return 0; }
  485. EOF
  486. cmake_original_make_flags="${cmake_make_flags}"
  487. if [ "x${cmake_parallel_make}" != "x" ]; then
  488. cmake_make_flags="${cmake_make_flags} -j ${cmake_parallel_make}"
  489. fi
  490. for a in ${cmake_make_processors}; do
  491. if [ -z "${cmake_make_processor}" ] && cmake_try_make "${a}" "${cmake_make_flags}" >> cmake_bootstrap.log 2>&1; then
  492. cmake_make_processor="${a}"
  493. fi
  494. done
  495. cmake_full_make_flags="${cmake_make_flags}"
  496. if [ "x${cmake_original_make_flags}" != "x${cmake_make_flags}" ]; then
  497. if [ -z "${cmake_make_processor}" ]; then
  498. cmake_make_flags="${cmake_original_make_flags}"
  499. for a in ${cmake_make_processors}; do
  500. if [ -z "${cmake_make_processor}" ] && cmake_try_make "${a}" "${cmake_make_flags}" >> cmake_bootstrap.log 2>&1; then
  501. cmake_make_processor="${a}"
  502. fi
  503. done
  504. fi
  505. fi
  506. cd "${cmake_bootstrap_dir}"
  507. rm -rf "${cmake_bootstrap_dir}/${TMPFILE}"
  508. if [ -z "${cmake_make_processor}" ]; then
  509. cmake_error 8 "Cannot find appropriate Makefile processor on this system.
  510. Please specify one using environment variable MAKE."
  511. fi
  512. echo "Makefile processor on this system is: ${cmake_make_processor}"
  513. if [ "x${cmake_full_make_flags}" != "x${cmake_make_flags}" ]; then
  514. echo "---------------------------------------------"
  515. echo "Makefile processor ${cmake_make_processor} does not support parallel build"
  516. echo "---------------------------------------------"
  517. fi
  518. # Ok, we have CC, CXX, and MAKE.
  519. # Test C++ compiler features
  520. # Are we GCC?
  521. TMPFILE=`cmake_tmp_file`
  522. cat > ${TMPFILE}.cxx <<EOF
  523. #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
  524. #include <iostream>
  525. int main() { std::cout << "This is GNU" << std::endl; return 0;}
  526. #endif
  527. EOF
  528. cmake_cxx_compiler_is_gnu=0
  529. if cmake_try_run "${cmake_cxx_compiler}" \
  530. "${cmake_cxx_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
  531. cmake_cxx_compiler_is_gnu=1
  532. fi
  533. if [ "x${cmake_cxx_compiler_is_gnu}" = "x1" ]; then
  534. echo "${cmake_cxx_compiler} is GNU compiler"
  535. else
  536. echo "${cmake_cxx_compiler} is not GNU compiler"
  537. fi
  538. rm -f "${TMPFILE}.cxx"
  539. if [ "x${cmake_cxx_compiler_is_gnu}" != "x1" ]; then
  540. # Check for non-GNU compiler flags
  541. # If we are on IRIX, check for -LANG:std
  542. cmake_test_flags="-LANG:std"
  543. if [ "x${cmake_system}" = "xIRIX64" ]; then
  544. TMPFILE=`cmake_tmp_file`
  545. cat > ${TMPFILE}.cxx <<EOF
  546. #include <iostream>
  547. int main() { std::cout << "No need for ${cmake_test_flags}" << std::endl; return 0;}
  548. EOF
  549. cmake_need_lang_std=0
  550. if cmake_try_run "${cmake_cxx_compiler}" \
  551. "${cmake_cxx_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
  552. :
  553. else
  554. if cmake_try_run "${cmake_cxx_compiler}" \
  555. "${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
  556. cmake_need_lang_std=1
  557. fi
  558. fi
  559. if [ "x${cmake_need_lang_std}" = "x1" ]; then
  560. cmake_cxx_flags="${cmake_cxx_flags} ${cmake_test_flags}"
  561. echo "${cmake_cxx_compiler} needs ${cmake_test_flags}"
  562. else
  563. echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
  564. fi
  565. rm -f "${TMPFILE}.cxx"
  566. fi
  567. cmake_test_flags=
  568. # If we are on OSF, check for -timplicit_local -no_implicit_include
  569. cmake_test_flags="-timplicit_local -no_implicit_include"
  570. if [ "x${cmake_system}" = "xOSF1" ]; then
  571. TMPFILE=`cmake_tmp_file`
  572. cat > ${TMPFILE}.cxx <<EOF
  573. #include <iostream>
  574. int main() { std::cout << "We need ${cmake_test_flags}" << std::endl; return 0;}
  575. EOF
  576. cmake_need_flags=1
  577. if cmake_try_run "${cmake_cxx_compiler}" \
  578. "${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
  579. :
  580. else
  581. cmake_need_flags=0
  582. fi
  583. if [ "x${cmake_need_flags}" = "x1" ]; then
  584. cmake_cxx_flags="${cmake_cxx_flags} ${cmake_test_flags}"
  585. echo "${cmake_cxx_compiler} needs ${cmake_test_flags}"
  586. else
  587. echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
  588. fi
  589. rm -f "${TMPFILE}.cxx"
  590. fi
  591. cmake_test_flags=
  592. # If we are on OSF, check for -std strict_ansi -nopure_cname
  593. cmake_test_flags="-std strict_ansi -nopure_cname"
  594. if [ "x${cmake_system}" = "xOSF1" ]; then
  595. TMPFILE=`cmake_tmp_file`
  596. cat > ${TMPFILE}.cxx <<EOF
  597. #include <iostream>
  598. int main() { std::cout << "We need ${cmake_test_flags}" << std::endl; return 0;}
  599. EOF
  600. cmake_need_flags=1
  601. if cmake_try_run "${cmake_cxx_compiler}" \
  602. "${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
  603. :
  604. else
  605. cmake_need_flags=0
  606. fi
  607. if [ "x${cmake_need_flags}" = "x1" ]; then
  608. cmake_cxx_flags="${cmake_cxx_flags} ${cmake_test_flags}"
  609. echo "${cmake_cxx_compiler} needs ${cmake_test_flags}"
  610. else
  611. echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
  612. fi
  613. rm -f "${TMPFILE}.cxx"
  614. fi
  615. cmake_test_flags=
  616. # If we are on HP-UX, check for -Ae for the C compiler.
  617. cmake_test_flags="-Ae"
  618. if [ "x${cmake_system}" = "xHP-UX" ]; then
  619. TMPFILE=`cmake_tmp_file`
  620. cat > ${TMPFILE}.c <<EOF
  621. int main(int argc, char** argv) { (void)argc; (void)argv; return 0; }
  622. EOF
  623. cmake_need_Ae=0
  624. if cmake_try_run "${cmake_c_compiler}" "${cmake_c_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then
  625. :
  626. else
  627. if cmake_try_run "${cmake_c_compiler}" \
  628. "${cmake_c_flags} ${cmake_test_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then
  629. cmake_need_Ae=1
  630. fi
  631. fi
  632. if [ "x${cmake_need_Ae}" = "x1" ]; then
  633. cmake_c_flags="${cmake_c_flags} ${cmake_test_flags}"
  634. echo "${cmake_c_compiler} needs ${cmake_test_flags}"
  635. else
  636. echo "${cmake_c_compiler} does not need ${cmake_test_flags}"
  637. fi
  638. rm -f "${TMPFILE}.c"
  639. fi
  640. cmake_test_flags=
  641. fi
  642. # Test for kwsys features
  643. KWSYS_NAME_IS_KWSYS=0
  644. KWSYS_BUILD_SHARED=0
  645. KWSYS_IOS_USE_STRSTREAM_H=0
  646. KWSYS_IOS_USE_STRSTREA_H=0
  647. KWSYS_IOS_HAVE_STD=0
  648. KWSYS_IOS_USE_SSTREAM=0
  649. KWSYS_IOS_USE_ANSI=0
  650. KWSYS_STL_HAVE_STD=0
  651. KWSYS_STAT_HAS_ST_MTIM=0
  652. if cmake_try_run "${cmake_cxx_compiler}" \
  653. "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAVE_STD" \
  654. "${cmake_source_dir}/Source/kwsys/kwsysPlatformCxxTests.cxx" >> cmake_bootstrap.log 2>&1; then
  655. KWSYS_STL_HAVE_STD=1
  656. echo "${cmake_cxx_compiler} has STL in std:: namespace"
  657. else
  658. echo "${cmake_cxx_compiler} does not have STL in std:: namespace"
  659. fi
  660. if cmake_try_run "${cmake_cxx_compiler}" \
  661. "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_ANSI" \
  662. "${cmake_source_dir}/Source/kwsys/kwsysPlatformCxxTests.cxx" >> cmake_bootstrap.log 2>&1; then
  663. KWSYS_IOS_USE_ANSI=1
  664. echo "${cmake_cxx_compiler} has ANSI streams"
  665. else
  666. echo "${cmake_cxx_compiler} does not have ANSI streams"
  667. fi
  668. if [ "x$KWSYS_IOS_USE_ANSI" = "x1" ]; then
  669. if cmake_try_run "${cmake_cxx_compiler}" \
  670. "${cmake_cxx_flags} -DTEST_KWSYS_IOS_HAVE_STD" \
  671. "${cmake_source_dir}/Source/kwsys/kwsysPlatformCxxTests.cxx" >> cmake_bootstrap.log 2>&1; then
  672. KWSYS_IOS_HAVE_STD=1
  673. echo "${cmake_cxx_compiler} has streams in std:: namespace"
  674. else
  675. echo "${cmake_cxx_compiler} does not have streams in std:: namespace"
  676. fi
  677. if cmake_try_run "${cmake_cxx_compiler}" \
  678. "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_SSTREAM" \
  679. "${cmake_source_dir}/Source/kwsys/kwsysPlatformCxxTests.cxx" >> cmake_bootstrap.log 2>&1; then
  680. KWSYS_IOS_USE_SSTREAM=1
  681. echo "${cmake_cxx_compiler} has sstream"
  682. else
  683. echo "${cmake_cxx_compiler} does not have sstream"
  684. fi
  685. fi
  686. if [ "x$KWSYS_IOS_USE_SSTREAM" = "x0" ]; then
  687. if cmake_try_run "${cmake_cxx_compiler}" \
  688. "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_STRSTREAM_H" \
  689. "${cmake_source_dir}/Source/kwsys/kwsysPlatformCxxTests.cxx" >> cmake_bootstrap.log 2>&1; then
  690. KWSYS_IOS_USE_STRSTREAM_H=1
  691. echo "${cmake_cxx_compiler} has strstream.h"
  692. else
  693. echo "${cmake_cxx_compiler} does not have strstream.h"
  694. fi
  695. if [ "x$KWSYS_IOS_USE_STRSTREAM_H" = "x0" ]; then
  696. if cmake_try_run "${cmake_cxx_compiler}" \
  697. "${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_STRSTREA_H" \
  698. "${cmake_source_dir}/Source/kwsys/kwsysPlatformCxxTests.cxx" >> cmake_bootstrap.log 2>&1; then
  699. KWSYS_IOS_USE_STRSTREA_H=1
  700. echo "${cmake_cxx_compiler} has strstrea.h"
  701. else
  702. echo "${cmake_cxx_compiler} does not have strstrea.h"
  703. fi
  704. fi
  705. fi
  706. if cmake_try_run "${cmake_cxx_compiler}" \
  707. "${cmake_cxx_flags} -DTEST_KWSYS_STAT_HAS_ST_MTIM" \
  708. "${cmake_source_dir}/Source/kwsys/kwsysPlatformCxxTests.cxx" >> cmake_bootstrap.log 2>&1; then
  709. KWSYS_STAT_HAS_ST_MTIM=1
  710. echo "${cmake_cxx_compiler} has struct stat with st_mtim member"
  711. else
  712. echo "${cmake_cxx_compiler} does not have struct stat with st_mtim member"
  713. fi
  714. # Just to be safe, let us store compiler and flags to the header file
  715. cmake_bootstrap_version='$Revision$'
  716. cmake_compiler_settings_comment="/*
  717. * Generated by ${cmake_source_dir}/bootstrap
  718. * Version: ${cmake_bootstrap_version}
  719. *
  720. * Source directory: ${cmake_source_dir}
  721. * Binary directory: ${cmake_bootstrap_dir}
  722. *
  723. * C compiler: ${cmake_c_compiler}
  724. * C flags: ${cmake_c_flags}
  725. *
  726. * C++ compiler: ${cmake_cxx_compiler}
  727. * C++ flags: ${cmake_cxx_flags}
  728. *
  729. * Make: ${cmake_make_processor}
  730. *
  731. * Sources:
  732. * ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES}
  733. * kwSys Sources:
  734. * ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES}
  735. */
  736. "
  737. cmake_report cmConfigure.h.tmp "${cmake_compiler_settings_comment}"
  738. if [ "x$KWSYS_STL_HAVE_STD" = "x1" ]; then
  739. cmake_report cmConfigure.h.tmp "/* #undef CMAKE_NO_STD_NAMESPACE */"
  740. else
  741. cmake_report cmConfigure.h.tmp "#define CMAKE_NO_STD_NAMESPACE 1"
  742. fi
  743. if [ "x$KWSYS_IOS_USE_ANSI" = "x1" ]; then
  744. cmake_report cmConfigure.h.tmp "/* #undef CMAKE_NO_ANSI_STREAM_HEADERS */"
  745. else
  746. cmake_report cmConfigure.h.tmp "#define CMAKE_NO_ANSI_STREAM_HEADERS 1"
  747. fi
  748. if [ "x$KWSYS_IOS_USE_SSTREAM" = "x1" ]; then
  749. cmake_report cmConfigure.h.tmp "/* #undef CMAKE_NO_ANSI_STRING_STREAM */"
  750. else
  751. cmake_report cmConfigure.h.tmp "#define CMAKE_NO_ANSI_STRING_STREAM 1"
  752. fi
  753. # Test for ansi FOR scope
  754. if cmake_try_run "${cmake_cxx_compiler}" \
  755. "${cmake_cxx_flags}" \
  756. "${cmake_source_dir}/Modules/TestForAnsiForScope.cxx" >> cmake_bootstrap.log 2>&1; then
  757. cmake_report cmConfigure.h.tmp "/* #undef CMAKE_NO_ANSI_FOR_SCOPE */"
  758. echo "${cmake_cxx_compiler} has ANSI for scoping"
  759. else
  760. cmake_report cmConfigure.h.tmp "#define CMAKE_NO_ANSI_FOR_SCOPE 1"
  761. echo "${cmake_cxx_compiler} does not have ANSI for scoping"
  762. fi
  763. # Write CMake version
  764. for a in MAJOR MINOR PATCH; do
  765. CMake_VERSION=`cat "${cmake_source_dir}/CMakeLists.txt" | \
  766. grep "SET(CMake_VERSION_${a} *[0-9]*)" | sed "s/SET(CMake_VERSION_${a} *\([0-9]*\))/\1/"`
  767. cmake_report cmConfigure.h.tmp "#define CMake_VERSION_${a} ${CMake_VERSION}"
  768. done
  769. cmake_report cmConfigure.h.tmp "#define CMAKE_ROOT_DIR \"${cmake_source_dir}\""
  770. cmake_report cmConfigure.h.tmp "#define CMAKE_DATA_DIR \"${cmake_data_dir}\""
  771. cmake_report cmConfigure.h.tmp "#define CMAKE_BOOTSTRAP"
  772. # Regenerate real cmConfigure.h
  773. if diff cmConfigure.h cmConfigure.h.tmp > /dev/null 2> /dev/null; then
  774. rm -f cmConfigure.h.tmp
  775. else
  776. mv -f cmConfigure.h.tmp cmConfigure.h
  777. fi
  778. # Prepare KWSYS
  779. cmake_kwsys_config_replace_string \
  780. "${cmake_source_dir}/Source/kwsys/Configure.hxx.in" \
  781. "${cmake_bootstrap_dir}/cmsys/Configure.hxx" \
  782. "${cmake_compiler_settings_comment}"
  783. cmake_kwsys_config_replace_string \
  784. "${cmake_source_dir}/Source/kwsys/Configure.h.in" \
  785. "${cmake_bootstrap_dir}/cmsys/Configure.h" \
  786. "${cmake_compiler_settings_comment}"
  787. for a in ${KWSYS_FILES}; do
  788. cmake_replace_string "${cmake_source_dir}/Source/kwsys/${a}.in" \
  789. "${cmake_bootstrap_dir}/cmsys/${a}" KWSYS_NAMESPACE cmsys
  790. done
  791. for a in ${KWSYS_IOS_FILES}; do
  792. cmake_replace_string "${cmake_source_dir}/Source/kwsys/kwsys_ios_${a}.h.in" \
  793. "${cmake_bootstrap_dir}/cmsys/ios/${a}" KWSYS_NAMESPACE cmsys
  794. done
  795. cmake_replace_string "${cmake_source_dir}/Source/kwsys/kwsys_stl.h.in" \
  796. "${cmake_bootstrap_dir}/cmsys/stl/stl.h.in" KWSYS_NAMESPACE cmsys
  797. for a in string vector map; do
  798. cmake_replace_string "${cmake_bootstrap_dir}/cmsys/stl/stl.h.in" \
  799. "${cmake_bootstrap_dir}/cmsys/stl/${a}" KWSYS_STL_HEADER ${a}
  800. done
  801. # Generate Makefile
  802. dep="cmConfigure.h cmsys/Configure.hxx cmsys/Configure.h `cmake_escape \"${cmake_source_dir}\"`/Source/*.h"
  803. objs=""
  804. for a in ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES} ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES}; do
  805. objs="${objs} ${a}.o"
  806. done
  807. # Generate dependencies for cmBootstrapCommands.cxx
  808. for file in `grep "#include.*cm[^.]*.cxx" "${cmake_source_dir}/Source/cmBootstrapCommands.cxx" | sed "s/.* \"\(.*\)\"/\1/"`; do
  809. cmBootstrapCommandsDeps="${cmBootstrapCommandsDeps} `cmake_escape "${cmake_source_dir}/Source/$file"`"
  810. done
  811. cmBootstrapCommandsDeps=`echo $cmBootstrapCommandsDeps`
  812. if [ "x${cmake_ansi_cxx_flags}" != "x" ]; then
  813. cmake_cxx_flags="${cmake_ansi_cxx_flags} ${cmake_cxx_flags}"
  814. fi
  815. if [ "x${cmake_c_flags}" != "x" ]; then
  816. cmake_c_flags="${cmake_c_flags} "
  817. fi
  818. if [ "x${cmake_cxx_flags}" != "x" ]; then
  819. cmake_cxx_flags="${cmake_cxx_flags} "
  820. fi
  821. cmake_c_flags="${cmake_c_flags}-I`cmake_escape \"${cmake_source_dir}/Source\"` \
  822. -I`cmake_escape \"${cmake_bootstrap_dir}\"`"
  823. cmake_cxx_flags="${cmake_cxx_flags}-I`cmake_escape \"${cmake_source_dir}/Source\"` \
  824. -I`cmake_escape \"${cmake_bootstrap_dir}\"`"
  825. echo "cmake: ${objs}" > "${cmake_bootstrap_dir}/Makefile"
  826. echo " ${cmake_cxx_compiler} ${LDFLAGS} ${cmake_cxx_flags} ${objs} -o cmake" >> "${cmake_bootstrap_dir}/Makefile"
  827. for a in ${CMAKE_CXX_SOURCES}; do
  828. src=`cmake_escape "${cmake_source_dir}/Source/${a}.cxx"`
  829. echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
  830. echo " ${cmake_cxx_compiler} ${cmake_cxx_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
  831. done
  832. echo "cmBootstrapCommands.o : $cmBootstrapCommandsDeps" >> "${cmake_bootstrap_dir}/Makefile"
  833. for a in ${CMAKE_C_SOURCES}; do
  834. src=`cmake_escape "${cmake_source_dir}/Source/${a}.c"`
  835. echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
  836. echo " ${cmake_c_compiler} ${cmake_c_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
  837. done
  838. for a in ${KWSYS_C_SOURCES}; do
  839. src=`cmake_escape "${cmake_source_dir}/Source/kwsys/${a}.c"`
  840. echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
  841. echo " ${cmake_c_compiler} ${cmake_c_flags} -DKWSYS_NAMESPACE=cmsys -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
  842. done
  843. for a in ${KWSYS_CXX_SOURCES}; do
  844. src=`cmake_escape "${cmake_source_dir}/Source/kwsys/${a}.cxx"`
  845. echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
  846. echo " ${cmake_cxx_compiler} ${cmake_cxx_flags} -DKWSYS_NAMESPACE=cmsys -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
  847. done
  848. cat>>"${cmake_bootstrap_dir}/Makefile"<<EOF
  849. rebuild_cache:
  850. cd "${cmake_binary_dir}" && "${cmake_source_dir}/bootstrap"
  851. EOF
  852. # Write our default settings to Bootstrap.cmk/InitialCacheFlags.cmake.
  853. cat > "${cmake_bootstrap_dir}/InitialCacheFlags.cmake" <<EOF
  854. # Generated by ${cmake_source_dir}/bootstrap
  855. # Default cmake settings. These may be overridden any settings below.
  856. SET (CMAKE_INSTALL_PREFIX "${cmake_prefix_dir}" CACHE PATH "Install path prefix, prepended onto install directories." FORCE)
  857. SET (CMAKE_DOC_DIR "${cmake_doc_dir}" CACHE PATH "Install location for documentation (relative to prefix)." FORCE)
  858. SET (CMAKE_MAN_DIR "${cmake_man_dir}" CACHE PATH "Install location for man pages (relative to prefix)." FORCE)
  859. SET (CMAKE_DATA_DIR "${cmake_data_dir}" CACHE PATH "Install location for data (relative to prefix)." FORCE)
  860. EOF
  861. # Add user-specified settings. Handle relative-path case for
  862. # specification of cmake_init_file.
  863. (
  864. cd "${cmake_binary_dir}"
  865. if [ -f "${cmake_init_file}" ]; then
  866. cat "${cmake_init_file}" >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
  867. fi
  868. )
  869. echo "---------------------------------------------"
  870. # Run make to build bootstrap cmake
  871. if [ "x${cmake_parallel_make}" != "x" ]; then
  872. ${cmake_make_processor} ${cmake_make_flags}
  873. else
  874. ${cmake_make_processor}
  875. fi
  876. RES=$?
  877. if [ "${RES}" -ne "0" ]; then
  878. cmake_error 9 "Problem while running ${cmake_make_processor}"
  879. fi
  880. cd "${cmake_binary_dir}"
  881. # Set C, CXX, and MAKE environment variables, so that real real cmake will be
  882. # build with same compiler and make
  883. CC="${cmake_c_compiler}"
  884. CXX="${cmake_cxx_compiler}"
  885. MAKE="${cmake_make_processor}"
  886. export CC
  887. export CXX
  888. export MAKE
  889. # Run bootstrap CMake to configure real CMake
  890. "${cmake_bootstrap_dir}/cmake" "${cmake_source_dir}" "-C${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
  891. RES=$?
  892. if [ "${RES}" -ne "0" ]; then
  893. cmake_error 11 "Problem while running initial CMake"
  894. fi
  895. echo "---------------------------------------------"
  896. # And we are done. Now just run make
  897. echo "CMake has bootstrapped. Now run ${cmake_make_processor}."