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