2003-03-27 23:29:38 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
2003-06-21 19:57:13 +04:00
|
|
|
#=========================================================================
|
|
|
|
#
|
|
|
|
# Program: CMake - Cross-Platform Makefile Generator
|
|
|
|
# Module: $RCSfile$
|
|
|
|
# Language: Bourne Shell
|
|
|
|
# Date: $Date$
|
|
|
|
# Version: $Revision$
|
|
|
|
#
|
|
|
|
# Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
|
|
|
|
# See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
|
|
|
|
#
|
|
|
|
# This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
# PURPOSE. See the above copyright notices for more information.
|
|
|
|
#
|
|
|
|
#=========================================================================
|
|
|
|
|
2006-08-26 05:21:10 +04:00
|
|
|
# Version number extraction function.
|
|
|
|
cmake_version_component()
|
|
|
|
{
|
|
|
|
cat "${cmake_source_dir}/CMakeLists.txt" | sed -n "
|
|
|
|
/^SET(CMake_VERSION_${1}/ {s/SET(CMake_VERSION_${1} *\([0-9]*\))/\1/;p;}
|
|
|
|
"
|
|
|
|
}
|
|
|
|
|
2007-11-15 05:17:53 +03:00
|
|
|
cmake_date_stamp_component()
|
|
|
|
{
|
|
|
|
cat "${cmake_source_dir}/Source/kwsys/kwsysDateStamp.cmake" | sed -n "
|
|
|
|
/KWSYS_DATE_STAMP_${1}/ {s/^.* \([0-9][0-9]*\))$/\1/;p;}
|
|
|
|
"
|
|
|
|
}
|
|
|
|
|
2006-02-01 02:50:16 +03:00
|
|
|
# Detect system and directory information.
|
|
|
|
cmake_system=`uname`
|
|
|
|
cmake_source_dir=`echo $0 | sed -n '/\//{s/\/[^\/]*$//;p;}'`
|
|
|
|
cmake_source_dir=`(cd "${cmake_source_dir}";pwd)`
|
|
|
|
cmake_binary_dir=`pwd`
|
|
|
|
cmake_bootstrap_dir="${cmake_binary_dir}/Bootstrap.cmk"
|
2007-11-15 05:17:53 +03:00
|
|
|
cmake_version_major="`cmake_version_component MAJOR`"
|
|
|
|
cmake_version_minor="`cmake_version_component MINOR`"
|
|
|
|
cmake_version_patch="`cmake_version_component PATCH`"
|
|
|
|
cmake_version="${cmake_version_major}.${cmake_version_minor}"
|
|
|
|
cmake_version_full="${cmake_version_major}.${cmake_version_minor}.${cmake_version_patch}"
|
|
|
|
cmake_date_stamp="`cmake_date_stamp_component YEAR``cmake_date_stamp_component MONTH``cmake_date_stamp_component DAY`"
|
2006-08-26 05:21:10 +04:00
|
|
|
cmake_data_dir="/share/cmake-${cmake_version}"
|
|
|
|
cmake_doc_dir="/doc/cmake-${cmake_version}"
|
2006-02-01 02:50:16 +03:00
|
|
|
cmake_man_dir="/man"
|
|
|
|
cmake_init_file=""
|
2006-10-19 23:17:58 +04:00
|
|
|
cmake_bootstrap_system_libs=""
|
2008-02-13 22:47:03 +03:00
|
|
|
cmake_bootstrap_qt_gui=""
|
|
|
|
cmake_bootstrap_qt_qmake=""
|
2006-02-01 02:50:16 +03:00
|
|
|
|
|
|
|
# Determine whether this is a MinGW environment.
|
|
|
|
if echo "${cmake_system}" | grep MINGW >/dev/null 2>&1; then
|
|
|
|
cmake_system_mingw=true
|
|
|
|
else
|
|
|
|
cmake_system_mingw=false
|
|
|
|
fi
|
|
|
|
|
2006-04-13 19:00:52 +04:00
|
|
|
# Determine whether this is OS X
|
|
|
|
if echo "${cmake_system}" | grep Darwin >/dev/null 2>&1; then
|
|
|
|
cmake_system_darwin=true
|
|
|
|
else
|
|
|
|
cmake_system_darwin=false
|
|
|
|
fi
|
|
|
|
|
2006-12-05 01:26:41 +03:00
|
|
|
# Determine whether this is BeOS
|
|
|
|
if echo "${cmake_system}" | grep BeOS >/dev/null 2>&1; then
|
|
|
|
cmake_system_beos=true
|
|
|
|
else
|
|
|
|
cmake_system_beos=false
|
|
|
|
fi
|
|
|
|
|
2006-02-01 02:50:16 +03:00
|
|
|
# Choose the generator to use for bootstrapping.
|
|
|
|
if ${cmake_system_mingw}; then
|
|
|
|
# Bootstrapping from an MSYS prompt.
|
|
|
|
cmake_bootstrap_generator="MSYS Makefiles"
|
|
|
|
else
|
|
|
|
# Bootstrapping from a standard UNIX prompt.
|
|
|
|
cmake_bootstrap_generator="Unix Makefiles"
|
|
|
|
fi
|
|
|
|
|
2006-02-17 04:13:54 +03:00
|
|
|
# Helper function to fix windows paths.
|
|
|
|
cmake_fix_slashes ()
|
|
|
|
{
|
|
|
|
echo "$1" | sed 's/\\/\//g'
|
|
|
|
}
|
|
|
|
|
|
|
|
# Choose the default install prefix.
|
|
|
|
if ${cmake_system_mingw}; then
|
|
|
|
if [ "x${PROGRAMFILES}" != "x" ]; then
|
|
|
|
cmake_default_prefix=`cmake_fix_slashes "${PROGRAMFILES}/CMake"`
|
|
|
|
elif [ "x${ProgramFiles}" != "x" ]; then
|
|
|
|
cmake_default_prefix=`cmake_fix_slashes "${ProgramFiles}/CMake"`
|
|
|
|
elif [ "x${SYSTEMDRIVE}" != "x" ]; then
|
|
|
|
cmake_default_prefix=`cmake_fix_slashes "${SYSTEMDRIVE}/Program Files/CMake"`
|
|
|
|
elif [ "x${SystemDrive}" != "x" ]; then
|
|
|
|
cmake_default_prefix=`cmake_fix_slashes "${SystemDrive}/Program Files/CMake"`
|
|
|
|
else
|
|
|
|
cmake_default_prefix="c:/Program Files/CMake"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
cmake_default_prefix="/usr/local"
|
|
|
|
fi
|
|
|
|
|
2003-03-27 23:29:38 +03:00
|
|
|
CMAKE_KNOWN_C_COMPILERS="cc gcc xlc icc tcc"
|
2004-10-05 19:29:16 +04:00
|
|
|
CMAKE_KNOWN_CXX_COMPILERS="aCC xlC CC g++ c++ icc como "
|
2004-10-19 22:51:25 +04:00
|
|
|
CMAKE_KNOWN_MAKE_PROCESSORS="gmake make"
|
2003-03-27 23:29:38 +03:00
|
|
|
|
2004-10-18 19:34:02 +04:00
|
|
|
CMAKE_PROBLEMATIC_FILES="\
|
|
|
|
CMakeCache.txt \
|
|
|
|
CMakeSystem.cmake \
|
|
|
|
CMakeCCompiler.cmake \
|
|
|
|
CMakeCXXCompiler.cmake \
|
|
|
|
Source/cmConfigure.h \
|
|
|
|
Source/CTest/Curl/config.h \
|
|
|
|
Utilities/cmexpat/expatConfig.h \
|
|
|
|
Utilities/cmexpat/expatDllConfig.h \
|
|
|
|
"
|
|
|
|
|
2006-03-22 17:58:11 +03:00
|
|
|
CMAKE_UNUSED_SOURCES="\
|
|
|
|
cmGlobalXCodeGenerator \
|
|
|
|
cmLocalXCodeGenerator \
|
|
|
|
cmXCodeObject \
|
|
|
|
cmXCode21Object \
|
|
|
|
cmSourceGroup \
|
|
|
|
"
|
|
|
|
|
2003-12-08 22:11:58 +03:00
|
|
|
CMAKE_CXX_SOURCES="\
|
2003-03-27 23:29:38 +03:00
|
|
|
cmake \
|
|
|
|
cmakemain \
|
2006-03-31 22:17:23 +04:00
|
|
|
cmakewizard \
|
2005-06-13 19:00:29 +04:00
|
|
|
cmCommandArgumentLexer \
|
|
|
|
cmCommandArgumentParser \
|
|
|
|
cmCommandArgumentParserHelper \
|
2005-03-01 20:26:25 +03:00
|
|
|
cmDepends \
|
|
|
|
cmDependsC \
|
2006-12-07 18:48:11 +03:00
|
|
|
cmProperty \
|
|
|
|
cmPropertyMap \
|
|
|
|
cmPropertyDefinition \
|
|
|
|
cmPropertyDefinitionMap \
|
2003-03-27 23:29:38 +03:00
|
|
|
cmMakeDepend \
|
|
|
|
cmMakefile \
|
2004-11-03 15:23:18 +03:00
|
|
|
cmGeneratedFileStream \
|
2003-03-27 23:29:38 +03:00
|
|
|
cmGlobalGenerator \
|
|
|
|
cmLocalGenerator \
|
2006-02-19 23:25:27 +03:00
|
|
|
cmInstallGenerator \
|
2006-02-20 02:47:13 +03:00
|
|
|
cmInstallFilesGenerator \
|
2006-02-19 23:25:27 +03:00
|
|
|
cmInstallScriptGenerator \
|
|
|
|
cmInstallTargetGenerator \
|
2003-03-27 23:29:38 +03:00
|
|
|
cmSourceFile \
|
2007-06-18 19:59:23 +04:00
|
|
|
cmSourceFileLocation \
|
2003-03-27 23:29:38 +03:00
|
|
|
cmSystemTools \
|
2006-11-30 01:45:55 +03:00
|
|
|
cmVersion \
|
2005-10-12 21:36:07 +04:00
|
|
|
cmFileTimeComparison \
|
2005-05-12 19:53:42 +04:00
|
|
|
cmGlobalUnixMakefileGenerator3 \
|
|
|
|
cmLocalUnixMakefileGenerator3 \
|
2006-02-15 18:34:11 +03:00
|
|
|
cmMakefileExecutableTargetGenerator \
|
|
|
|
cmMakefileLibraryTargetGenerator \
|
|
|
|
cmMakefileTargetGenerator \
|
|
|
|
cmMakefileUtilityTargetGenerator \
|
2005-01-21 18:27:51 +03:00
|
|
|
cmBootstrapCommands \
|
2003-03-27 23:29:38 +03:00
|
|
|
cmCommands \
|
|
|
|
cmTarget \
|
2005-04-24 23:59:51 +04:00
|
|
|
cmTest \
|
2003-03-27 23:29:38 +03:00
|
|
|
cmCustomCommand \
|
2007-10-18 17:39:02 +04:00
|
|
|
cmDocumentVariables \
|
2003-03-27 23:29:38 +03:00
|
|
|
cmCacheManager \
|
|
|
|
cmListFileCache \
|
2008-01-27 21:42:49 +03:00
|
|
|
cmComputeLinkDepends \
|
2008-01-22 17:13:04 +03:00
|
|
|
cmComputeLinkInformation \
|
2008-02-01 16:56:00 +03:00
|
|
|
cmOrderRuntimeDirectories \
|
2008-02-06 07:10:41 +03:00
|
|
|
cmComputeTargetDepends \
|
2008-02-08 00:14:05 +03:00
|
|
|
cmComputeComponentGraph \
|
2008-02-13 22:47:03 +03:00
|
|
|
cmExprLexer \
|
|
|
|
cmExprParser \
|
|
|
|
cmExprParserHelper \
|
2006-03-22 17:58:11 +03:00
|
|
|
"
|
2003-03-27 23:29:38 +03:00
|
|
|
|
2006-02-01 02:50:16 +03:00
|
|
|
if ${cmake_system_mingw}; then
|
|
|
|
CMAKE_CXX_SOURCES="${CMAKE_CXX_SOURCES}\
|
|
|
|
cmGlobalMSYSMakefileGenerator \
|
|
|
|
cmGlobalMinGWMakefileGenerator \
|
|
|
|
cmWin32ProcessExecution"
|
|
|
|
fi
|
|
|
|
|
2003-12-08 22:11:58 +03:00
|
|
|
CMAKE_C_SOURCES="\
|
|
|
|
cmListFileLexer \
|
|
|
|
"
|
|
|
|
|
2006-02-01 02:50:16 +03:00
|
|
|
if ${cmake_system_mingw}; then
|
|
|
|
KWSYS_C_SOURCES="\
|
2006-09-21 21:47:54 +04:00
|
|
|
ProcessWin32 \
|
2008-01-17 18:35:32 +03:00
|
|
|
String \
|
2006-09-21 21:47:54 +04:00
|
|
|
System"
|
2006-02-01 02:50:16 +03:00
|
|
|
KWSYS_C_MINGW_SOURCES="\
|
|
|
|
ProcessFwd9x \
|
|
|
|
EncodeExecutable"
|
|
|
|
KWSYS_C_GENERATED_SOURCES="\
|
|
|
|
cmsysProcessFwd9xEnc"
|
|
|
|
else
|
|
|
|
KWSYS_C_SOURCES="\
|
2006-09-21 21:47:54 +04:00
|
|
|
ProcessUNIX \
|
2008-01-17 18:35:32 +03:00
|
|
|
String \
|
2006-09-21 21:47:54 +04:00
|
|
|
System"
|
2006-02-01 02:50:16 +03:00
|
|
|
KWSYS_C_MINGW_SOURCES=""
|
|
|
|
KWSYS_C_GENERATED_SOURCES=""
|
|
|
|
fi
|
2003-07-08 01:52:53 +04:00
|
|
|
|
|
|
|
KWSYS_CXX_SOURCES="\
|
2003-06-23 16:58:58 +04:00
|
|
|
Directory \
|
2005-10-18 22:08:55 +04:00
|
|
|
Glob \
|
2003-06-23 16:58:58 +04:00
|
|
|
RegularExpression \
|
|
|
|
SystemTools"
|
|
|
|
|
|
|
|
KWSYS_FILES="\
|
2008-01-17 18:35:32 +03:00
|
|
|
auto_ptr.hxx \
|
2003-06-23 16:58:58 +04:00
|
|
|
Directory.hxx \
|
2005-10-18 22:08:55 +04:00
|
|
|
Glob.hxx \
|
2003-06-23 16:58:58 +04:00
|
|
|
Process.h \
|
|
|
|
RegularExpression.hxx \
|
2008-01-17 18:35:32 +03:00
|
|
|
String.h \
|
2006-02-07 18:11:40 +03:00
|
|
|
String.hxx \
|
2006-09-21 21:47:54 +04:00
|
|
|
System.h \
|
2003-06-23 16:58:58 +04:00
|
|
|
SystemTools.hxx"
|
|
|
|
|
2003-12-23 19:03:38 +03:00
|
|
|
KWSYS_IOS_FILES="
|
2003-06-23 16:58:58 +04:00
|
|
|
fstream \
|
|
|
|
iosfwd \
|
|
|
|
iostream \
|
|
|
|
sstream"
|
|
|
|
|
2003-05-15 17:35:16 +04:00
|
|
|
# Display CMake bootstrap usage
|
2003-03-27 23:29:38 +03:00
|
|
|
cmake_usage()
|
|
|
|
{
|
2003-07-22 00:38:53 +04:00
|
|
|
cat <<EOF
|
2003-03-27 23:29:38 +03:00
|
|
|
Usage: $0 [options]
|
|
|
|
Options: [defaults in brackets after descriptions]
|
|
|
|
Configuration:
|
|
|
|
--help print this message
|
2003-05-15 17:35:16 +04:00
|
|
|
--version only print version information
|
2003-03-27 23:29:38 +03:00
|
|
|
--verbose display more information
|
2003-05-15 17:35:16 +04:00
|
|
|
--parallel=n bootstrap cmake in parallel, where n is
|
|
|
|
number of nodes [1]
|
2003-07-22 00:38:53 +04:00
|
|
|
--init=FILE use FILE for cmake initialization
|
2006-10-19 23:17:58 +04:00
|
|
|
--system-libs use system-installed third-party libraries
|
|
|
|
(for use only by package maintainers)
|
|
|
|
--no-system-libs use cmake-provided third-party libraries
|
|
|
|
(default)
|
2008-02-13 22:47:03 +03:00
|
|
|
--qt-gui build the Qt-based GUI (requires Qt >= 4.2)
|
|
|
|
--no-qt-gui do not build the Qt-based GUI (default)
|
|
|
|
--qt-qmake=<qmake> use <qmake> as the qmake executable to find Qt
|
2003-05-15 17:35:16 +04:00
|
|
|
|
2003-03-27 23:29:38 +03:00
|
|
|
Directory and file names:
|
2003-07-22 00:38:53 +04:00
|
|
|
--prefix=PREFIX install files in tree rooted at PREFIX
|
2006-02-17 04:13:54 +03:00
|
|
|
[${cmake_default_prefix}]
|
2003-07-22 00:38:53 +04:00
|
|
|
--datadir=DIR install data files in PREFIX/DIR
|
|
|
|
[/share/CMake]
|
|
|
|
--docdir=DIR install documentation files in PREFIX/DIR
|
|
|
|
[/doc/CMake]
|
|
|
|
--mandir=DIR install man pages files in PREFIX/DIR/manN
|
|
|
|
[/man]
|
2003-03-27 23:29:38 +03:00
|
|
|
EOF
|
|
|
|
exit 10
|
|
|
|
}
|
|
|
|
|
2003-05-15 17:35:16 +04:00
|
|
|
# Display CMake bootstrap usage
|
2008-01-24 01:43:08 +03:00
|
|
|
cmake_version_display()
|
2003-05-15 17:35:16 +04:00
|
|
|
{
|
2007-11-15 05:17:53 +03:00
|
|
|
(
|
2003-05-15 17:35:16 +04:00
|
|
|
# Get CMake version
|
2007-11-15 05:17:53 +03:00
|
|
|
if echo "${cmake_version_full}" | grep "[0-9]\.[0-9]*[13579]\.[0-9]" > /dev/null 2>&1; then
|
|
|
|
version="${cmake_version}-${cmake_date_stamp}"
|
2005-03-25 22:23:55 +03:00
|
|
|
else
|
2007-11-15 05:17:53 +03:00
|
|
|
version="${cmake_version}-${cmake_version_patch}"
|
2005-03-25 22:23:55 +03:00
|
|
|
fi
|
2007-11-15 05:17:53 +03:00
|
|
|
echo "CMake ${version}, Copyright (c) 2007 Kitware, Inc., Insight Consortium"
|
|
|
|
)
|
2003-05-15 17:35:16 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
# Display CMake bootstrap error, display the log file and exit
|
2003-05-14 17:19:12 +04:00
|
|
|
cmake_error()
|
|
|
|
{
|
2003-12-23 19:03:38 +03:00
|
|
|
res=$1
|
|
|
|
shift 1
|
2003-03-27 23:29:38 +03:00
|
|
|
echo "---------------------------------------------"
|
2003-05-14 17:19:12 +04:00
|
|
|
echo "Error when bootstrapping CMake:"
|
|
|
|
echo "$*"
|
|
|
|
echo "---------------------------------------------"
|
|
|
|
if [ -f cmake_bootstrap.log ]; then
|
2003-12-23 19:03:38 +03:00
|
|
|
echo "Log of errors: `pwd`/cmake_bootstrap.log"
|
|
|
|
#cat cmake_bootstrap.log
|
2003-05-14 17:19:12 +04:00
|
|
|
echo "---------------------------------------------"
|
|
|
|
fi
|
2003-12-23 19:03:38 +03:00
|
|
|
exit ${res}
|
2003-05-14 17:19:12 +04:00
|
|
|
}
|
2003-03-27 23:29:38 +03:00
|
|
|
|
2003-06-21 19:57:13 +04:00
|
|
|
# Replace KWSYS_NAMESPACE with cmsys
|
|
|
|
cmake_replace_string ()
|
|
|
|
{
|
|
|
|
INFILE="$1"
|
|
|
|
OUTFILE="$2"
|
|
|
|
SEARCHFOR="$3"
|
|
|
|
REPLACEWITH="$4"
|
|
|
|
if [ -f "${INFILE}" ]; then
|
|
|
|
cat "${INFILE}" |
|
|
|
|
sed "s/\@${SEARCHFOR}\@/${REPLACEWITH}/g" > "${OUTFILE}.tmp"
|
|
|
|
if [ -f "${OUTFILE}.tmp" ]; then
|
|
|
|
if diff "${OUTFILE}" "${OUTFILE}.tmp" > /dev/null 2> /dev/null ; then
|
|
|
|
#echo "Files are the same"
|
|
|
|
rm -f "${OUTFILE}.tmp"
|
|
|
|
else
|
|
|
|
mv -f "${OUTFILE}.tmp" "${OUTFILE}"
|
|
|
|
fi
|
|
|
|
fi
|
2003-06-23 16:58:58 +04:00
|
|
|
else
|
2003-12-23 19:03:38 +03:00
|
|
|
cmake_error 1 "Cannot find file ${INFILE}"
|
2003-06-21 19:57:13 +04:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2003-12-23 19:03:38 +03:00
|
|
|
cmake_kwsys_config_replace_string ()
|
|
|
|
{
|
|
|
|
INFILE="$1"
|
|
|
|
OUTFILE="$2"
|
|
|
|
shift 2
|
|
|
|
APPEND="$*"
|
|
|
|
if [ -f "${INFILE}" ]; then
|
|
|
|
echo "${APPEND}" > "${OUTFILE}.tmp"
|
|
|
|
cat "${INFILE}" |
|
|
|
|
sed "/./ {s/\@KWSYS_NAMESPACE\@/cmsys/g;
|
|
|
|
s/@KWSYS_BUILD_SHARED@/${KWSYS_BUILD_SHARED}/g;
|
2006-08-26 04:52:37 +04:00
|
|
|
s/@KWSYS_LFS_AVAILABLE@/${KWSYS_LFS_AVAILABLE}/g;
|
|
|
|
s/@KWSYS_LFS_REQUESTED@/${KWSYS_LFS_REQUESTED}/g;
|
2003-12-23 19:03:38 +03:00
|
|
|
s/@KWSYS_NAME_IS_KWSYS@/${KWSYS_NAME_IS_KWSYS}/g;
|
2003-12-31 16:56:37 +03:00
|
|
|
s/@KWSYS_IOS_USE_ANSI@/${KWSYS_IOS_USE_ANSI}/g;
|
2003-12-23 19:03:38 +03:00
|
|
|
s/@KWSYS_IOS_HAVE_STD@/${KWSYS_IOS_HAVE_STD}/g;
|
2003-12-31 16:56:37 +03:00
|
|
|
s/@KWSYS_IOS_USE_SSTREAM@/${KWSYS_IOS_USE_SSTREAM}/g;
|
|
|
|
s/@KWSYS_IOS_USE_STRSTREAM_H@/${KWSYS_IOS_USE_STRSTREAM_H}/g;
|
|
|
|
s/@KWSYS_IOS_USE_STRSTREA_H@/${KWSYS_IOS_USE_STRSTREA_H}/g;
|
2005-02-17 19:27:15 +03:00
|
|
|
s/@KWSYS_STL_HAVE_STD@/${KWSYS_STL_HAVE_STD}/g;
|
2005-03-29 17:20:08 +04:00
|
|
|
s/@KWSYS_STL_STRING_HAVE_ISTREAM@/${KWSYS_STL_STRING_HAVE_ISTREAM}/g;
|
|
|
|
s/@KWSYS_STL_STRING_HAVE_OSTREAM@/${KWSYS_STL_STRING_HAVE_OSTREAM}/g;
|
2005-04-06 21:34:09 +04:00
|
|
|
s/@KWSYS_STL_STRING_HAVE_NEQ_CHAR@/${KWSYS_STL_STRING_HAVE_NEQ_CHAR}/g;
|
2005-04-15 17:54:03 +04:00
|
|
|
s/@KWSYS_STL_HAS_ITERATOR_TRAITS@/${KWSYS_STL_HAS_ITERATOR_TRAITS}/g;
|
|
|
|
s/@KWSYS_STL_HAS_ITERATOR_CATEGORY@/${KWSYS_STL_HAS_ITERATOR_CATEGORY}/g;
|
|
|
|
s/@KWSYS_STL_HAS___ITERATOR_CATEGORY@/${KWSYS_STL_HAS___ITERATOR_CATEGORY}/g;
|
2005-04-21 21:47:43 +04:00
|
|
|
s/@KWSYS_STL_HAS_ALLOCATOR_TEMPLATE@/${KWSYS_STL_HAS_ALLOCATOR_TEMPLATE}/g;
|
2005-04-15 17:54:03 +04:00
|
|
|
s/@KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE@/${KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE}/g;
|
2005-04-13 22:13:35 +04:00
|
|
|
s/@KWSYS_STL_HAS_ALLOCATOR_REBIND@/${KWSYS_STL_HAS_ALLOCATOR_REBIND}/g;
|
2005-04-13 23:39:03 +04:00
|
|
|
s/@KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT@/${KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT}/g;
|
2005-04-21 21:47:43 +04:00
|
|
|
s/@KWSYS_STL_HAS_ALLOCATOR_OBJECTS@/${KWSYS_STL_HAS_ALLOCATOR_OBJECTS}/g;
|
2005-04-16 00:00:44 +04:00
|
|
|
s/@KWSYS_CXX_HAS_CSTDDEF@/${KWSYS_CXX_HAS_CSTDDEF}/g;
|
2005-04-13 22:13:35 +04:00
|
|
|
s/@KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS@/${KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS}/g;
|
|
|
|
s/@KWSYS_CXX_HAS_MEMBER_TEMPLATES@/${KWSYS_CXX_HAS_MEMBER_TEMPLATES}/g;
|
|
|
|
s/@KWSYS_CXX_HAS_FULL_SPECIALIZATION@/${KWSYS_CXX_HAS_FULL_SPECIALIZATION}/g;
|
2005-04-15 16:59:30 +04:00
|
|
|
s/@KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP@/${KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP}/g;
|
2005-02-17 19:27:15 +03:00
|
|
|
s/@KWSYS_STAT_HAS_ST_MTIM@/${KWSYS_STAT_HAS_ST_MTIM}/g;}" >> "${OUTFILE}.tmp"
|
2003-12-23 19:03:38 +03:00
|
|
|
if [ -f "${OUTFILE}.tmp" ]; then
|
|
|
|
if diff "${OUTFILE}" "${OUTFILE}.tmp" > /dev/null 2> /dev/null ; then
|
|
|
|
#echo "Files are the same"
|
|
|
|
rm -f "${OUTFILE}.tmp"
|
|
|
|
else
|
|
|
|
mv -f "${OUTFILE}.tmp" "${OUTFILE}"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
cmake_error 2 "Cannot find file ${INFILE}"
|
|
|
|
fi
|
|
|
|
}
|
2003-05-15 17:35:16 +04:00
|
|
|
# Write string into a file
|
2003-03-27 23:29:38 +03:00
|
|
|
cmake_report ()
|
|
|
|
{
|
|
|
|
FILE=$1
|
|
|
|
shift
|
|
|
|
echo "$*" >> ${FILE}
|
|
|
|
}
|
|
|
|
|
2003-05-15 17:35:16 +04:00
|
|
|
# Escape spaces in strings
|
2003-03-27 23:29:38 +03:00
|
|
|
cmake_escape ()
|
|
|
|
{
|
|
|
|
echo $1 | sed "s/ /\\\\ /g"
|
|
|
|
}
|
|
|
|
|
2003-05-15 17:35:16 +04:00
|
|
|
# Write message to the log
|
2003-03-27 23:29:38 +03:00
|
|
|
cmake_log ()
|
|
|
|
{
|
|
|
|
echo "$*" >> cmake_bootstrap.log
|
|
|
|
}
|
|
|
|
|
2003-05-15 17:35:16 +04:00
|
|
|
# Return temp file
|
2003-03-27 23:29:38 +03:00
|
|
|
cmake_tmp_file ()
|
|
|
|
{
|
|
|
|
echo "cmake_bootstrap_$$.test"
|
|
|
|
}
|
|
|
|
|
2003-05-15 17:35:16 +04:00
|
|
|
# Run a compiler test. First argument is compiler, second one are compiler
|
|
|
|
# flags, third one is test source file to be compiled
|
2003-03-27 23:29:38 +03:00
|
|
|
cmake_try_run ()
|
|
|
|
{
|
|
|
|
COMPILER=$1
|
|
|
|
FLAGS=$2
|
|
|
|
TESTFILE=$3
|
|
|
|
if [ ! -f "${TESTFILE}" ]; then
|
|
|
|
echo "Test file ${TESTFILE} missing. Please verify your CMake source tree."
|
|
|
|
exit 4
|
|
|
|
fi
|
|
|
|
TMPFILE=`cmake_tmp_file`
|
|
|
|
echo "Try: ${COMPILER}"
|
2003-06-30 17:56:33 +04:00
|
|
|
echo "Line: ${COMPILER} ${FLAGS} ${TESTFILE} -o ${TMPFILE}"
|
|
|
|
echo "---------- file -----------------------"
|
2005-04-13 22:13:35 +04:00
|
|
|
cat "${TESTFILE}"
|
2003-06-30 17:56:33 +04:00
|
|
|
echo "------------------------------------------"
|
2003-03-27 23:29:38 +03:00
|
|
|
"${COMPILER}" ${FLAGS} "${TESTFILE}" -o "${TMPFILE}"
|
|
|
|
RES=$?
|
|
|
|
if [ "${RES}" -ne "0" ]; then
|
2003-12-23 19:03:38 +03:00
|
|
|
echo "Test failed to compile"
|
|
|
|
return 1
|
2003-03-27 23:29:38 +03:00
|
|
|
fi
|
|
|
|
if [ ! -f "${TMPFILE}" ] && [ ! -f "${TMPFILE}.exe" ]; then
|
2003-12-23 19:03:38 +03:00
|
|
|
echo "Test failed to produce executable"
|
2003-03-27 23:29:38 +03:00
|
|
|
return 2
|
|
|
|
fi
|
|
|
|
./${TMPFILE}
|
|
|
|
RES=$?
|
|
|
|
rm -f "${TMPFILE}"
|
|
|
|
if [ "${RES}" -ne "0" ]; then
|
2003-12-23 19:03:38 +03:00
|
|
|
echo "Test produced non-zero return code"
|
2003-03-27 23:29:38 +03:00
|
|
|
return 3
|
|
|
|
fi
|
2003-12-23 19:03:38 +03:00
|
|
|
echo "Test succeded"
|
2003-03-27 23:29:38 +03:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2003-05-15 17:35:16 +04:00
|
|
|
# Run a make test. First argument is the make interpreter.
|
2003-03-27 23:29:38 +03:00
|
|
|
cmake_try_make ()
|
|
|
|
{
|
2003-08-22 17:52:05 +04:00
|
|
|
MAKE_PROC="$1"
|
|
|
|
MAKE_FLAGS="$2"
|
2003-03-27 23:29:38 +03:00
|
|
|
echo "Try: ${MAKE_PROC}"
|
2003-08-22 17:52:05 +04:00
|
|
|
"${MAKE_PROC}" ${MAKE_FLAGS}
|
2003-03-27 23:29:38 +03:00
|
|
|
RES=$?
|
|
|
|
if [ "${RES}" -ne "0" ]; then
|
2003-08-22 17:52:05 +04:00
|
|
|
echo "${MAKE_PROC} does not work"
|
|
|
|
return 1
|
2003-03-27 23:29:38 +03:00
|
|
|
fi
|
|
|
|
if [ ! -f "test" ] && [ ! -f "test.exe" ]; then
|
|
|
|
echo "${COMPILER} does not produce output"
|
|
|
|
return 2
|
|
|
|
fi
|
|
|
|
./test
|
|
|
|
RES=$?
|
|
|
|
rm -f "test"
|
|
|
|
if [ "${RES}" -ne "0" ]; then
|
|
|
|
echo "${MAKE_PROC} produces strange executable"
|
|
|
|
return 3
|
|
|
|
fi
|
|
|
|
echo "${MAKE_PROC} works"
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2003-05-15 17:35:16 +04:00
|
|
|
# Parse arguments
|
2003-05-14 17:19:12 +04:00
|
|
|
cmake_verbose=
|
2003-05-14 17:27:39 +04:00
|
|
|
cmake_parallel_make=
|
2006-02-17 04:13:54 +03:00
|
|
|
cmake_prefix_dir="${cmake_default_prefix}"
|
2003-05-14 17:19:12 +04:00
|
|
|
for a in "$@"; do
|
2003-05-14 17:27:39 +04:00
|
|
|
if echo $a | grep "^--prefix=" > /dev/null 2> /dev/null; then
|
2003-05-14 17:19:12 +04:00
|
|
|
cmake_prefix_dir=`echo $a | sed "s/^--prefix=//"`
|
2006-02-17 04:13:54 +03:00
|
|
|
cmake_prefix_dir=`cmake_fix_slashes "${cmake_prefix_dir}"`
|
2003-05-14 17:19:12 +04:00
|
|
|
fi
|
2003-05-14 17:27:39 +04:00
|
|
|
if echo $a | grep "^--parallel=" > /dev/null 2> /dev/null; then
|
|
|
|
cmake_parallel_make=`echo $a | sed "s/^--parallel=//" | grep "[0-9][0-9]*"`
|
|
|
|
fi
|
2003-07-22 00:38:53 +04:00
|
|
|
if echo $a | grep "^--datadir=" > /dev/null 2> /dev/null; then
|
|
|
|
cmake_data_dir=`echo $a | sed "s/^--datadir=//"`
|
|
|
|
fi
|
|
|
|
if echo $a | grep "^--docdir=" > /dev/null 2> /dev/null; then
|
|
|
|
cmake_doc_dir=`echo $a | sed "s/^--docdir=//"`
|
|
|
|
fi
|
|
|
|
if echo $a | grep "^--mandir=" > /dev/null 2> /dev/null; then
|
|
|
|
cmake_man_dir=`echo $a | sed "s/^--mandir=//"`
|
|
|
|
fi
|
|
|
|
if echo $a | grep "^--init=" > /dev/null 2> /dev/null; then
|
|
|
|
cmake_init_file=`echo $a | sed "s/^--init=//"`
|
|
|
|
fi
|
2006-10-19 23:17:58 +04:00
|
|
|
if echo $a | grep "^--system-libs" > /dev/null 2> /dev/null; then
|
|
|
|
cmake_bootstrap_system_libs="-DCMAKE_USE_SYSTEM_LIBRARIES=1"
|
|
|
|
fi
|
|
|
|
if echo $a | grep "^--no-system-libs" > /dev/null 2> /dev/null; then
|
|
|
|
cmake_bootstrap_system_libs="-DCMAKE_USE_SYSTEM_LIBRARIES=0"
|
|
|
|
fi
|
2008-02-13 22:47:03 +03:00
|
|
|
if echo $a | grep "^--qt-gui" > /dev/null 2> /dev/null; then
|
|
|
|
cmake_bootstrap_qt_gui="1"
|
|
|
|
fi
|
|
|
|
if echo $a | grep "^--no-qt-gui" > /dev/null 2> /dev/null; then
|
|
|
|
cmake_bootstrap_qt_gui="0"
|
|
|
|
fi
|
|
|
|
if echo $a | grep "^--qt-qmake=" > /dev/null 2> /dev/null; then
|
|
|
|
cmake_bootstrap_qt_qmake=`echo $a | sed "s/^--qt-qmake=//"`
|
|
|
|
fi
|
2003-05-14 17:27:39 +04:00
|
|
|
if echo $a | grep "^--help" > /dev/null 2> /dev/null; then
|
2003-05-14 17:19:12 +04:00
|
|
|
cmake_usage
|
|
|
|
fi
|
2003-05-15 17:35:16 +04:00
|
|
|
if echo $a | grep "^--version" > /dev/null 2> /dev/null; then
|
2008-01-24 01:43:08 +03:00
|
|
|
cmake_version_display
|
2003-05-15 17:35:16 +04:00
|
|
|
exit 2
|
|
|
|
fi
|
2003-05-14 17:27:39 +04:00
|
|
|
if echo $a | grep "^--verbose" > /dev/null 2> /dev/null; then
|
2003-05-14 17:19:12 +04:00
|
|
|
cmake_verbose=TRUE
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2003-05-15 17:35:16 +04:00
|
|
|
# If verbose, display some information about bootstrap
|
2003-05-14 17:19:12 +04:00
|
|
|
if [ -n "${cmake_verbose}" ]; then
|
|
|
|
echo "---------------------------------------------"
|
|
|
|
echo "Source directory: ${cmake_source_dir}"
|
|
|
|
echo "Binary directory: ${cmake_binary_dir}"
|
|
|
|
echo "Prefix directory: ${cmake_prefix_dir}"
|
|
|
|
echo "System: ${cmake_system}"
|
2003-05-14 17:27:39 +04:00
|
|
|
if [ "x${cmake_parallel_make}" != "x" ]; then
|
|
|
|
echo "Doing parallel make: ${cmake_parallel_make}"
|
|
|
|
fi
|
|
|
|
echo ""
|
2003-05-14 17:19:12 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "---------------------------------------------"
|
2003-05-15 17:35:16 +04:00
|
|
|
# Get CMake version
|
2008-01-24 01:43:08 +03:00
|
|
|
echo "`cmake_version_display`"
|
2003-05-14 17:19:12 +04:00
|
|
|
|
2004-10-18 19:34:02 +04:00
|
|
|
# Check for in-source build
|
|
|
|
cmake_in_source_build=
|
|
|
|
if [ -f "${cmake_binary_dir}/Source/cmake.cxx" -a \
|
|
|
|
-f "${cmake_binary_dir}/Source/cmake.h" ]; then
|
|
|
|
if [ -n "${cmake_verbose}" ]; then
|
|
|
|
echo "Warning: This is an in-source build"
|
|
|
|
fi
|
|
|
|
cmake_in_source_build=TRUE
|
|
|
|
fi
|
|
|
|
|
|
|
|
# If this is not an in-source build, then Bootstrap stuff should not exist.
|
|
|
|
if [ -z "${cmake_in_source_build}" ]; then
|
|
|
|
# Did somebody bootstrap in the source tree?
|
2004-10-19 02:11:42 +04:00
|
|
|
if [ -d "${cmake_source_dir}/Bootstrap.cmk" ]; then
|
2004-10-18 19:34:02 +04:00
|
|
|
cmake_error 10 "Found directory \"${cmake_source_dir}/Bootstrap.cmk\".
|
|
|
|
Looks like somebody did bootstrap CMake in the source tree, but now you are
|
|
|
|
trying to do bootstrap in the binary tree. Please remove Bootstrap.cmk
|
|
|
|
directory from the source tree."
|
|
|
|
fi
|
|
|
|
# Is there a cache in the source tree?
|
|
|
|
for cmake_problematic_file in ${CMAKE_PROBLEMATIC_FILES}; do
|
2004-10-19 02:11:42 +04:00
|
|
|
if [ -f "${cmake_source_dir}/${cmake_problematic_file}" ]; then
|
2004-10-18 19:34:02 +04:00
|
|
|
cmake_error 10 "Found \"${cmake_source_dir}/${cmake_problematic_file}\".
|
|
|
|
Looks like somebody tried to build CMake in the source tree, but now you are
|
|
|
|
trying to do bootstrap in the binary tree. Please remove \"${cmake_problematic_file}\"
|
|
|
|
from the source tree."
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2003-05-15 17:35:16 +04:00
|
|
|
# Make bootstrap directory
|
2003-05-14 17:19:12 +04:00
|
|
|
[ -d "${cmake_bootstrap_dir}" ] || mkdir "${cmake_bootstrap_dir}"
|
|
|
|
if [ ! -d "${cmake_bootstrap_dir}" ]; then
|
2003-12-23 19:03:38 +03:00
|
|
|
cmake_error 3 "Cannot create directory ${cmake_bootstrap_dir} to bootstrap CMake."
|
2003-05-14 17:19:12 +04:00
|
|
|
fi
|
|
|
|
cd "${cmake_bootstrap_dir}"
|
|
|
|
|
2003-06-23 16:58:58 +04:00
|
|
|
[ -d "cmsys" ] || mkdir "cmsys"
|
|
|
|
if [ ! -d "cmsys" ]; then
|
2003-12-23 19:03:38 +03:00
|
|
|
cmake_error 4 "Cannot create directory ${cmake_bootstrap_dir}/cmsys"
|
2003-06-23 16:58:58 +04:00
|
|
|
fi
|
|
|
|
|
2003-12-23 19:03:38 +03:00
|
|
|
for a in stl ios; do
|
|
|
|
[ -d "cmsys/${a}" ] || mkdir "cmsys/${a}"
|
|
|
|
if [ ! -d "cmsys/${a}" ]; then
|
|
|
|
cmake_error 5 "Cannot create directory ${cmake_bootstrap_dir}/cmsys/${a}"
|
|
|
|
fi
|
|
|
|
done
|
2003-06-23 16:58:58 +04:00
|
|
|
|
2003-05-15 17:35:16 +04:00
|
|
|
# Delete all the bootstrap files
|
2003-05-14 17:19:12 +04:00
|
|
|
rm -f "${cmake_bootstrap_dir}/cmake_bootstrap.log"
|
2003-06-30 17:56:33 +04:00
|
|
|
rm -f "${cmake_bootstrap_dir}/cmConfigure.h.tmp"
|
2003-05-14 17:19:12 +04:00
|
|
|
|
2003-05-15 17:35:16 +04:00
|
|
|
# If exist compiler flags, set them
|
2003-03-27 23:29:38 +03:00
|
|
|
cmake_c_flags=${CFLAGS}
|
|
|
|
cmake_cxx_flags=${CXXFLAGS}
|
2006-12-05 16:47:06 +03:00
|
|
|
cmake_ld_flags=${LDFLAGS}
|
2003-03-27 23:29:38 +03:00
|
|
|
|
2006-04-13 19:00:52 +04:00
|
|
|
# Add Carbon framework on Darwin
|
|
|
|
if ${cmake_system_darwin}; then
|
|
|
|
cmake_ld_flags="${LDFLAGS} -framework Carbon"
|
|
|
|
fi
|
|
|
|
|
2006-12-05 01:26:41 +03:00
|
|
|
# Add BeOS toolkits...
|
|
|
|
if ${cmake_system_beos}; then
|
|
|
|
cmake_ld_flags="${LDFLAGS} -lroot -lbe"
|
|
|
|
fi
|
|
|
|
|
2003-03-27 23:29:38 +03:00
|
|
|
# Test C compiler
|
|
|
|
cmake_c_compiler=
|
|
|
|
|
2003-05-15 17:35:16 +04:00
|
|
|
# If CC is set, use that for compiler, otherwise use list of known compilers
|
2003-03-27 23:29:38 +03:00
|
|
|
if [ -n "${CC}" ]; then
|
|
|
|
cmake_c_compilers="${CC}"
|
|
|
|
else
|
|
|
|
cmake_c_compilers="${CMAKE_KNOWN_C_COMPILERS}"
|
|
|
|
fi
|
|
|
|
|
2003-05-15 17:35:16 +04:00
|
|
|
# Check if C compiler works
|
2003-03-27 23:29:38 +03:00
|
|
|
TMPFILE=`cmake_tmp_file`
|
2003-07-22 00:38:53 +04:00
|
|
|
cat > "${TMPFILE}.c" <<EOF
|
2006-07-26 22:10:14 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
# error "The CMAKE_C_COMPILER is set to a C++ compiler"
|
2006-07-26 19:46:22 +04:00
|
|
|
#endif
|
|
|
|
|
2006-07-26 22:10:14 +04:00
|
|
|
#include<stdio.h>
|
|
|
|
|
|
|
|
#if defined(__CLASSIC_C__)
|
2006-07-26 19:46:22 +04:00
|
|
|
int main(argc, argv)
|
|
|
|
int argc;
|
|
|
|
char* argv[];
|
|
|
|
#else
|
2006-07-25 19:00:10 +04:00
|
|
|
int main(int argc, char* argv[])
|
2006-07-26 19:46:22 +04:00
|
|
|
#endif
|
2003-03-27 23:29:38 +03:00
|
|
|
{
|
2006-07-25 19:00:10 +04:00
|
|
|
printf("%d\n", (argv != 0));
|
|
|
|
return argc-1;
|
2003-03-27 23:29:38 +03:00
|
|
|
}
|
|
|
|
EOF
|
|
|
|
for a in ${cmake_c_compilers}; do
|
2003-12-23 19:03:38 +03:00
|
|
|
if [ -z "${cmake_c_compiler}" ] && \
|
|
|
|
cmake_try_run "${a}" "${cmake_c_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then
|
2003-03-27 23:29:38 +03:00
|
|
|
cmake_c_compiler="${a}"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
rm -f "${TMPFILE}.c"
|
|
|
|
|
|
|
|
if [ -z "${cmake_c_compiler}" ]; then
|
2003-12-23 19:03:38 +03:00
|
|
|
cmake_error 6 "Cannot find appropriate C compiler on this system.
|
2004-10-12 18:57:24 +04:00
|
|
|
Please specify one using environment variable CC.
|
|
|
|
See cmake_bootstrap.log for compilers attempted.
|
|
|
|
"
|
2003-03-27 23:29:38 +03:00
|
|
|
fi
|
|
|
|
echo "C compiler on this system is: ${cmake_c_compiler} ${cmake_c_flags}"
|
|
|
|
|
|
|
|
# Test CXX compiler
|
|
|
|
cmake_cxx_compiler=
|
2003-05-15 17:35:16 +04:00
|
|
|
|
2003-06-30 17:56:33 +04:00
|
|
|
# On Mac OSX, CC is the same as cc, so make sure not to try CC as c++ compiler.
|
|
|
|
|
2003-05-15 17:35:16 +04:00
|
|
|
# If CC is set, use that for compiler, otherwise use list of known compilers
|
2003-03-27 23:29:38 +03:00
|
|
|
if [ -n "${CXX}" ]; then
|
|
|
|
cmake_cxx_compilers="${CXX}"
|
|
|
|
else
|
|
|
|
cmake_cxx_compilers="${CMAKE_KNOWN_CXX_COMPILERS}"
|
|
|
|
fi
|
|
|
|
|
2003-05-15 17:35:16 +04:00
|
|
|
# Check if C++ compiler works
|
2003-03-27 23:29:38 +03:00
|
|
|
TMPFILE=`cmake_tmp_file`
|
2003-07-22 00:38:53 +04:00
|
|
|
cat > "${TMPFILE}.cxx" <<EOF
|
2003-12-23 19:03:38 +03:00
|
|
|
#if defined(TEST1)
|
|
|
|
# include <iostream>
|
|
|
|
#else
|
|
|
|
# include <iostream.h>
|
|
|
|
#endif
|
|
|
|
|
2003-06-30 17:56:33 +04:00
|
|
|
class NeedCXX
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NeedCXX() { this->Foo = 1; }
|
|
|
|
int GetFoo() { return this->Foo; }
|
|
|
|
private:
|
|
|
|
int Foo;
|
|
|
|
};
|
2003-03-27 23:29:38 +03:00
|
|
|
int main()
|
|
|
|
{
|
2003-06-30 17:56:33 +04:00
|
|
|
NeedCXX c;
|
2003-12-23 19:03:38 +03:00
|
|
|
#ifdef TEST3
|
|
|
|
cout << c.GetFoo() << endl;
|
|
|
|
#else
|
|
|
|
std::cout << c.GetFoo() << std::endl;
|
|
|
|
#endif
|
2003-03-27 23:29:38 +03:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
for a in ${cmake_cxx_compilers}; do
|
2003-12-23 19:03:38 +03:00
|
|
|
for b in 1 2 3; do
|
|
|
|
if [ -z "${cmake_cxx_compiler}" ] && \
|
|
|
|
cmake_try_run "${a}" "${cmake_cxx_flags} -DTEST${b}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
|
|
|
|
cmake_cxx_compiler="${a}"
|
|
|
|
fi
|
|
|
|
done
|
2003-03-27 23:29:38 +03:00
|
|
|
done
|
|
|
|
rm -f "${TMPFILE}.cxx"
|
|
|
|
|
|
|
|
if [ -z "${cmake_cxx_compiler}" ]; then
|
2003-12-23 19:03:38 +03:00
|
|
|
cmake_error 7 "Cannot find appropriate C++ compiler on this system.
|
2004-10-12 18:57:24 +04:00
|
|
|
Please specify one using environment variable CXX.
|
|
|
|
See cmake_bootstrap.log for compilers attempted."
|
2003-03-27 23:29:38 +03:00
|
|
|
fi
|
|
|
|
echo "C++ compiler on this system is: ${cmake_cxx_compiler} ${cmake_cxx_flags}"
|
|
|
|
|
|
|
|
# Test Make
|
|
|
|
|
|
|
|
cmake_make_processor=
|
2003-08-22 17:52:05 +04:00
|
|
|
cmake_make_flags=
|
2003-05-15 17:35:16 +04:00
|
|
|
|
|
|
|
# If MAKE is set, use that for make processor, otherwise use list of known make
|
2003-03-27 23:29:38 +03:00
|
|
|
if [ -n "${MAKE}" ]; then
|
|
|
|
cmake_make_processors="${MAKE}"
|
|
|
|
else
|
|
|
|
cmake_make_processors="${CMAKE_KNOWN_MAKE_PROCESSORS}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
TMPFILE="`cmake_tmp_file`_dir"
|
|
|
|
rm -rf "${cmake_bootstrap_dir}/${TMPFILE}"
|
|
|
|
mkdir "${cmake_bootstrap_dir}/${TMPFILE}"
|
|
|
|
cd "${cmake_bootstrap_dir}/${TMPFILE}"
|
|
|
|
cat>"Makefile"<<EOF
|
|
|
|
test: test.c
|
2003-08-22 17:52:05 +04:00
|
|
|
"${cmake_c_compiler}" -o test test.c
|
2003-03-27 23:29:38 +03:00
|
|
|
EOF
|
|
|
|
cat>"test.c"<<EOF
|
|
|
|
#include <stdio.h>
|
|
|
|
int main(){ printf("1\n"); return 0; }
|
|
|
|
EOF
|
2004-09-23 15:53:42 +04:00
|
|
|
cmake_original_make_flags="${cmake_make_flags}"
|
2003-08-22 17:52:05 +04:00
|
|
|
if [ "x${cmake_parallel_make}" != "x" ]; then
|
|
|
|
cmake_make_flags="${cmake_make_flags} -j ${cmake_parallel_make}"
|
|
|
|
fi
|
2003-03-27 23:29:38 +03:00
|
|
|
for a in ${cmake_make_processors}; do
|
2003-08-22 17:52:05 +04:00
|
|
|
if [ -z "${cmake_make_processor}" ] && cmake_try_make "${a}" "${cmake_make_flags}" >> cmake_bootstrap.log 2>&1; then
|
2003-03-27 23:29:38 +03:00
|
|
|
cmake_make_processor="${a}"
|
|
|
|
fi
|
|
|
|
done
|
2004-09-23 15:53:42 +04:00
|
|
|
cmake_full_make_flags="${cmake_make_flags}"
|
|
|
|
if [ "x${cmake_original_make_flags}" != "x${cmake_make_flags}" ]; then
|
|
|
|
if [ -z "${cmake_make_processor}" ]; then
|
|
|
|
cmake_make_flags="${cmake_original_make_flags}"
|
|
|
|
for a in ${cmake_make_processors}; do
|
|
|
|
if [ -z "${cmake_make_processor}" ] && cmake_try_make "${a}" "${cmake_make_flags}" >> cmake_bootstrap.log 2>&1; then
|
|
|
|
cmake_make_processor="${a}"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
fi
|
2003-03-27 23:29:38 +03:00
|
|
|
cd "${cmake_bootstrap_dir}"
|
|
|
|
rm -rf "${cmake_bootstrap_dir}/${TMPFILE}"
|
|
|
|
|
2003-08-12 01:53:10 +04:00
|
|
|
if [ -z "${cmake_make_processor}" ]; then
|
2003-12-23 19:03:38 +03:00
|
|
|
cmake_error 8 "Cannot find appropriate Makefile processor on this system.
|
2003-08-12 01:53:10 +04:00
|
|
|
Please specify one using environment variable MAKE."
|
|
|
|
fi
|
2004-09-23 15:53:42 +04:00
|
|
|
echo "Makefile processor on this system is: ${cmake_make_processor}"
|
|
|
|
if [ "x${cmake_full_make_flags}" != "x${cmake_make_flags}" ]; then
|
|
|
|
echo "---------------------------------------------"
|
|
|
|
echo "Makefile processor ${cmake_make_processor} does not support parallel build"
|
|
|
|
echo "---------------------------------------------"
|
|
|
|
fi
|
2003-03-27 23:29:38 +03:00
|
|
|
|
2003-05-15 17:35:16 +04:00
|
|
|
# Ok, we have CC, CXX, and MAKE.
|
|
|
|
|
2003-03-27 23:29:38 +03:00
|
|
|
# Test C++ compiler features
|
2003-04-22 22:32:48 +04:00
|
|
|
|
2004-10-01 00:24:54 +04:00
|
|
|
# Are we GCC?
|
|
|
|
|
|
|
|
TMPFILE=`cmake_tmp_file`
|
|
|
|
cat > ${TMPFILE}.cxx <<EOF
|
|
|
|
#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
|
|
|
|
#include <iostream>
|
|
|
|
int main() { std::cout << "This is GNU" << std::endl; return 0;}
|
|
|
|
#endif
|
2003-04-22 22:32:48 +04:00
|
|
|
EOF
|
2004-10-01 00:24:54 +04:00
|
|
|
cmake_cxx_compiler_is_gnu=0
|
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
|
|
|
"${cmake_cxx_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
|
|
|
|
cmake_cxx_compiler_is_gnu=1
|
|
|
|
fi
|
|
|
|
if [ "x${cmake_cxx_compiler_is_gnu}" = "x1" ]; then
|
|
|
|
echo "${cmake_cxx_compiler} is GNU compiler"
|
|
|
|
else
|
|
|
|
echo "${cmake_cxx_compiler} is not GNU compiler"
|
|
|
|
fi
|
|
|
|
rm -f "${TMPFILE}.cxx"
|
|
|
|
|
|
|
|
if [ "x${cmake_cxx_compiler_is_gnu}" != "x1" ]; then
|
|
|
|
# Check for non-GNU compiler flags
|
|
|
|
|
|
|
|
# If we are on IRIX, check for -LANG:std
|
|
|
|
cmake_test_flags="-LANG:std"
|
|
|
|
if [ "x${cmake_system}" = "xIRIX64" ]; then
|
|
|
|
TMPFILE=`cmake_tmp_file`
|
|
|
|
cat > ${TMPFILE}.cxx <<EOF
|
|
|
|
#include <iostream>
|
|
|
|
int main() { std::cout << "No need for ${cmake_test_flags}" << std::endl; return 0;}
|
|
|
|
EOF
|
|
|
|
cmake_need_lang_std=0
|
2003-12-23 19:03:38 +03:00
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
2004-10-01 00:24:54 +04:00
|
|
|
"${cmake_cxx_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
|
|
|
|
:
|
|
|
|
else
|
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
|
|
|
"${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
|
|
|
|
cmake_need_lang_std=1
|
|
|
|
fi
|
2003-04-22 22:32:48 +04:00
|
|
|
fi
|
2004-10-01 00:24:54 +04:00
|
|
|
if [ "x${cmake_need_lang_std}" = "x1" ]; then
|
|
|
|
cmake_cxx_flags="${cmake_cxx_flags} ${cmake_test_flags}"
|
|
|
|
echo "${cmake_cxx_compiler} needs ${cmake_test_flags}"
|
|
|
|
else
|
|
|
|
echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
|
|
|
|
fi
|
|
|
|
rm -f "${TMPFILE}.cxx"
|
2003-04-22 22:32:48 +04:00
|
|
|
fi
|
2004-10-01 00:24:54 +04:00
|
|
|
cmake_test_flags=
|
2003-06-26 17:44:27 +04:00
|
|
|
|
2004-10-01 00:24:54 +04:00
|
|
|
# If we are on OSF, check for -timplicit_local -no_implicit_include
|
|
|
|
cmake_test_flags="-timplicit_local -no_implicit_include"
|
|
|
|
if [ "x${cmake_system}" = "xOSF1" ]; then
|
|
|
|
TMPFILE=`cmake_tmp_file`
|
|
|
|
cat > ${TMPFILE}.cxx <<EOF
|
|
|
|
#include <iostream>
|
|
|
|
int main() { std::cout << "We need ${cmake_test_flags}" << std::endl; return 0;}
|
2003-06-26 17:44:27 +04:00
|
|
|
EOF
|
2004-10-01 00:24:54 +04:00
|
|
|
cmake_need_flags=1
|
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
|
|
|
"${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
|
|
|
|
:
|
|
|
|
else
|
|
|
|
cmake_need_flags=0
|
|
|
|
fi
|
|
|
|
if [ "x${cmake_need_flags}" = "x1" ]; then
|
|
|
|
cmake_cxx_flags="${cmake_cxx_flags} ${cmake_test_flags}"
|
|
|
|
echo "${cmake_cxx_compiler} needs ${cmake_test_flags}"
|
|
|
|
else
|
|
|
|
echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
|
|
|
|
fi
|
|
|
|
rm -f "${TMPFILE}.cxx"
|
2003-06-26 17:44:27 +04:00
|
|
|
fi
|
2004-10-01 00:24:54 +04:00
|
|
|
cmake_test_flags=
|
2003-06-26 17:44:27 +04:00
|
|
|
|
2004-10-01 00:24:54 +04:00
|
|
|
# If we are on OSF, check for -std strict_ansi -nopure_cname
|
|
|
|
cmake_test_flags="-std strict_ansi -nopure_cname"
|
|
|
|
if [ "x${cmake_system}" = "xOSF1" ]; then
|
|
|
|
TMPFILE=`cmake_tmp_file`
|
|
|
|
cat > ${TMPFILE}.cxx <<EOF
|
|
|
|
#include <iostream>
|
|
|
|
int main() { std::cout << "We need ${cmake_test_flags}" << std::endl; return 0;}
|
2003-06-26 17:44:27 +04:00
|
|
|
EOF
|
2004-10-01 00:24:54 +04:00
|
|
|
cmake_need_flags=1
|
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
|
|
|
"${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
|
|
|
|
:
|
|
|
|
else
|
|
|
|
cmake_need_flags=0
|
|
|
|
fi
|
|
|
|
if [ "x${cmake_need_flags}" = "x1" ]; then
|
|
|
|
cmake_cxx_flags="${cmake_cxx_flags} ${cmake_test_flags}"
|
|
|
|
echo "${cmake_cxx_compiler} needs ${cmake_test_flags}"
|
|
|
|
else
|
|
|
|
echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
|
|
|
|
fi
|
|
|
|
rm -f "${TMPFILE}.cxx"
|
2003-06-26 17:44:27 +04:00
|
|
|
fi
|
2004-10-01 00:24:54 +04:00
|
|
|
cmake_test_flags=
|
2003-04-22 22:32:48 +04:00
|
|
|
|
2004-10-01 00:24:54 +04:00
|
|
|
# If we are on HP-UX, check for -Ae for the C compiler.
|
|
|
|
cmake_test_flags="-Ae"
|
|
|
|
if [ "x${cmake_system}" = "xHP-UX" ]; then
|
|
|
|
TMPFILE=`cmake_tmp_file`
|
|
|
|
cat > ${TMPFILE}.c <<EOF
|
|
|
|
int main(int argc, char** argv) { (void)argc; (void)argv; return 0; }
|
2003-09-15 23:58:27 +04:00
|
|
|
EOF
|
2004-10-01 00:24:54 +04:00
|
|
|
cmake_need_Ae=0
|
|
|
|
if cmake_try_run "${cmake_c_compiler}" "${cmake_c_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then
|
|
|
|
:
|
|
|
|
else
|
|
|
|
if cmake_try_run "${cmake_c_compiler}" \
|
|
|
|
"${cmake_c_flags} ${cmake_test_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then
|
|
|
|
cmake_need_Ae=1
|
|
|
|
fi
|
2003-09-15 23:58:27 +04:00
|
|
|
fi
|
2004-10-01 00:24:54 +04:00
|
|
|
if [ "x${cmake_need_Ae}" = "x1" ]; then
|
|
|
|
cmake_c_flags="${cmake_c_flags} ${cmake_test_flags}"
|
|
|
|
echo "${cmake_c_compiler} needs ${cmake_test_flags}"
|
|
|
|
else
|
|
|
|
echo "${cmake_c_compiler} does not need ${cmake_test_flags}"
|
|
|
|
fi
|
|
|
|
rm -f "${TMPFILE}.c"
|
2003-09-15 23:58:27 +04:00
|
|
|
fi
|
2004-10-01 00:24:54 +04:00
|
|
|
cmake_test_flags=
|
2003-09-15 23:58:27 +04:00
|
|
|
fi
|
|
|
|
|
2003-12-23 19:03:38 +03:00
|
|
|
# Test for kwsys features
|
|
|
|
KWSYS_NAME_IS_KWSYS=0
|
|
|
|
KWSYS_BUILD_SHARED=0
|
2006-08-26 04:52:37 +04:00
|
|
|
KWSYS_LFS_AVAILABLE=0
|
|
|
|
KWSYS_LFS_REQUESTED=0
|
2003-12-31 16:56:37 +03:00
|
|
|
KWSYS_IOS_USE_STRSTREAM_H=0
|
|
|
|
KWSYS_IOS_USE_STRSTREA_H=0
|
2003-12-23 19:03:38 +03:00
|
|
|
KWSYS_IOS_HAVE_STD=0
|
2003-12-31 16:56:37 +03:00
|
|
|
KWSYS_IOS_USE_SSTREAM=0
|
|
|
|
KWSYS_IOS_USE_ANSI=0
|
2003-12-23 19:03:38 +03:00
|
|
|
KWSYS_STL_HAVE_STD=0
|
2005-02-17 19:27:15 +03:00
|
|
|
KWSYS_STAT_HAS_ST_MTIM=0
|
2005-04-06 21:34:09 +04:00
|
|
|
KWSYS_STL_STRING_HAVE_NEQ_CHAR=0
|
2005-04-15 17:54:03 +04:00
|
|
|
KWSYS_STL_HAS_ITERATOR_TRAITS=0
|
|
|
|
KWSYS_STL_HAS_ITERATOR_CATEGORY=0
|
|
|
|
KWSYS_STL_HAS___ITERATOR_CATEGORY=0
|
2005-04-21 21:47:43 +04:00
|
|
|
KWSYS_STL_HAS_ALLOCATOR_TEMPLATE=0
|
2005-04-15 17:54:03 +04:00
|
|
|
KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE=0
|
2005-04-13 22:13:35 +04:00
|
|
|
KWSYS_STL_HAS_ALLOCATOR_REBIND=0
|
2005-04-13 23:39:03 +04:00
|
|
|
KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT=0
|
2005-04-21 21:47:43 +04:00
|
|
|
KWSYS_STL_HAS_ALLOCATOR_OBJECTS=0
|
2005-04-16 00:00:44 +04:00
|
|
|
KWSYS_CXX_HAS_CSTDDEF=0
|
2005-04-13 22:13:35 +04:00
|
|
|
KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS=0
|
|
|
|
KWSYS_CXX_HAS_MEMBER_TEMPLATES=0
|
|
|
|
KWSYS_CXX_HAS_FULL_SPECIALIZATION=0
|
2005-04-15 16:59:30 +04:00
|
|
|
KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP=0
|
2003-12-23 19:03:38 +03:00
|
|
|
|
2005-03-29 17:20:08 +04:00
|
|
|
# Hardcode these kwsys features. They work on all known UNIX compilers anyway.
|
|
|
|
KWSYS_STL_STRING_HAVE_ISTREAM=1
|
|
|
|
KWSYS_STL_STRING_HAVE_OSTREAM=1
|
|
|
|
|
2003-12-23 19:03:38 +03:00
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
|
|
|
"${cmake_cxx_flags} -DTEST_KWSYS_STL_HAVE_STD" \
|
2006-10-05 01:24:36 +04:00
|
|
|
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
|
2003-12-23 19:03:38 +03:00
|
|
|
KWSYS_STL_HAVE_STD=1
|
|
|
|
echo "${cmake_cxx_compiler} has STL in std:: namespace"
|
|
|
|
else
|
|
|
|
echo "${cmake_cxx_compiler} does not have STL in std:: namespace"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
2003-12-31 16:56:37 +03:00
|
|
|
"${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_ANSI" \
|
2006-10-05 01:24:36 +04:00
|
|
|
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
|
2003-12-31 16:56:37 +03:00
|
|
|
KWSYS_IOS_USE_ANSI=1
|
2003-12-23 19:03:38 +03:00
|
|
|
echo "${cmake_cxx_compiler} has ANSI streams"
|
|
|
|
else
|
|
|
|
echo "${cmake_cxx_compiler} does not have ANSI streams"
|
|
|
|
fi
|
|
|
|
|
2003-12-31 16:56:37 +03:00
|
|
|
if [ "x$KWSYS_IOS_USE_ANSI" = "x1" ]; then
|
2003-12-23 19:03:38 +03:00
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
|
|
|
"${cmake_cxx_flags} -DTEST_KWSYS_IOS_HAVE_STD" \
|
2006-10-05 01:24:36 +04:00
|
|
|
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
|
2003-12-23 19:03:38 +03:00
|
|
|
KWSYS_IOS_HAVE_STD=1
|
|
|
|
echo "${cmake_cxx_compiler} has streams in std:: namespace"
|
|
|
|
else
|
|
|
|
echo "${cmake_cxx_compiler} does not have streams in std:: namespace"
|
|
|
|
fi
|
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
2003-12-31 16:56:37 +03:00
|
|
|
"${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_SSTREAM" \
|
2006-10-05 01:24:36 +04:00
|
|
|
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
|
2003-12-31 16:56:37 +03:00
|
|
|
KWSYS_IOS_USE_SSTREAM=1
|
2003-12-23 19:03:38 +03:00
|
|
|
echo "${cmake_cxx_compiler} has sstream"
|
|
|
|
else
|
|
|
|
echo "${cmake_cxx_compiler} does not have sstream"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2003-12-31 16:56:37 +03:00
|
|
|
if [ "x$KWSYS_IOS_USE_SSTREAM" = "x0" ]; then
|
2003-12-23 19:03:38 +03:00
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
2003-12-31 16:56:37 +03:00
|
|
|
"${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_STRSTREAM_H" \
|
2006-10-05 01:24:36 +04:00
|
|
|
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
|
2003-12-31 16:56:37 +03:00
|
|
|
KWSYS_IOS_USE_STRSTREAM_H=1
|
2003-12-23 19:03:38 +03:00
|
|
|
echo "${cmake_cxx_compiler} has strstream.h"
|
|
|
|
else
|
|
|
|
echo "${cmake_cxx_compiler} does not have strstream.h"
|
|
|
|
fi
|
2003-12-31 16:56:37 +03:00
|
|
|
if [ "x$KWSYS_IOS_USE_STRSTREAM_H" = "x0" ]; then
|
2003-12-23 19:03:38 +03:00
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
2003-12-31 16:56:37 +03:00
|
|
|
"${cmake_cxx_flags} -DTEST_KWSYS_IOS_USE_STRSTREA_H" \
|
2006-10-05 01:24:36 +04:00
|
|
|
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
|
2003-12-31 16:56:37 +03:00
|
|
|
KWSYS_IOS_USE_STRSTREA_H=1
|
2003-12-23 19:03:38 +03:00
|
|
|
echo "${cmake_cxx_compiler} has strstrea.h"
|
|
|
|
else
|
|
|
|
echo "${cmake_cxx_compiler} does not have strstrea.h"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2005-04-06 21:34:09 +04:00
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
|
|
|
"${cmake_cxx_flags} -DTEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
|
2006-10-05 01:24:36 +04:00
|
|
|
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
|
2005-04-06 21:34:09 +04:00
|
|
|
KWSYS_STL_STRING_HAVE_NEQ_CHAR=1
|
|
|
|
echo "${cmake_cxx_compiler} has operator!=(string, char*)"
|
|
|
|
else
|
|
|
|
echo "${cmake_cxx_compiler} does not have operator!=(string, char*)"
|
|
|
|
fi
|
|
|
|
|
2005-04-13 22:13:35 +04:00
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
2005-04-15 17:54:03 +04:00
|
|
|
"${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ITERATOR_TRAITS -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
|
2006-10-05 01:24:36 +04:00
|
|
|
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
|
2005-04-15 17:54:03 +04:00
|
|
|
KWSYS_STL_HAS_ITERATOR_TRAITS=1
|
|
|
|
echo "${cmake_cxx_compiler} has stl iterator_traits"
|
2005-04-13 22:13:35 +04:00
|
|
|
else
|
2005-04-15 17:54:03 +04:00
|
|
|
echo "${cmake_cxx_compiler} does not have stl iterator_traits"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "x${KWSYS_STL_HAS_ITERATOR_TRAITS}" = "x0" ]; then
|
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
|
|
|
"${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ITERATOR_CATEGORY -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
|
2006-10-05 01:24:36 +04:00
|
|
|
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
|
2005-04-15 17:54:03 +04:00
|
|
|
KWSYS_STL_HAS_ITERATOR_CATEGORY=1
|
|
|
|
echo "${cmake_cxx_compiler} has old iterator_category"
|
|
|
|
else
|
|
|
|
echo "${cmake_cxx_compiler} does not have old iterator_category"
|
|
|
|
fi
|
|
|
|
if [ "x${KWSYS_STL_HAS_ITERATOR_CATEGORY}" = "x0" ]; then
|
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
|
|
|
"${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS___ITERATOR_CATEGORY -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
|
2006-10-05 01:24:36 +04:00
|
|
|
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
|
2005-04-15 17:54:03 +04:00
|
|
|
KWSYS_STL_HAS___ITERATOR_CATEGORY=1
|
|
|
|
echo "${cmake_cxx_compiler} has old __iterator_category"
|
|
|
|
else
|
|
|
|
echo "${cmake_cxx_compiler} does not have old __iterator_category"
|
|
|
|
fi
|
|
|
|
fi
|
2005-04-13 22:13:35 +04:00
|
|
|
fi
|
|
|
|
|
2005-04-13 23:39:03 +04:00
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
2005-04-21 21:47:43 +04:00
|
|
|
"${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
|
2006-10-05 01:24:36 +04:00
|
|
|
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
|
2005-04-21 21:47:43 +04:00
|
|
|
KWSYS_STL_HAS_ALLOCATOR_TEMPLATE=1
|
|
|
|
echo "${cmake_cxx_compiler} has standard template allocator"
|
2005-04-13 23:39:03 +04:00
|
|
|
else
|
2005-04-21 21:47:43 +04:00
|
|
|
echo "${cmake_cxx_compiler} does not have standard template allocator"
|
2005-04-15 17:54:03 +04:00
|
|
|
fi
|
|
|
|
|
2005-04-21 21:47:43 +04:00
|
|
|
if [ "x${KWSYS_STL_HAS_ALLOCATOR_TEMPLATE}" = "x1" ]; then
|
2005-04-15 17:54:03 +04:00
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
|
|
|
"${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_REBIND -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
|
2006-10-05 01:24:36 +04:00
|
|
|
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
|
2005-04-15 17:54:03 +04:00
|
|
|
KWSYS_STL_HAS_ALLOCATOR_REBIND=1
|
|
|
|
echo "${cmake_cxx_compiler} has allocator<>::rebind<>"
|
|
|
|
else
|
|
|
|
echo "${cmake_cxx_compiler} does not have allocator<>::rebind<>"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
|
|
|
"${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
|
2006-10-05 01:24:36 +04:00
|
|
|
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
|
2005-04-15 17:54:03 +04:00
|
|
|
KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT=1
|
|
|
|
echo "${cmake_cxx_compiler} has non-standard allocator<>::max_size argument"
|
|
|
|
else
|
|
|
|
echo "${cmake_cxx_compiler} does not have non-standard allocator<>::max_size argument"
|
|
|
|
fi
|
2005-04-21 21:47:43 +04:00
|
|
|
else
|
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
|
|
|
"${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
|
2006-10-05 01:24:36 +04:00
|
|
|
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
|
2005-04-21 21:47:43 +04:00
|
|
|
KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE=1
|
|
|
|
echo "${cmake_cxx_compiler} has old non-template allocator"
|
|
|
|
else
|
|
|
|
echo "${cmake_cxx_compiler} does not have old non-template allocator"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
|
|
|
"${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS -DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD}" \
|
2006-10-05 01:24:36 +04:00
|
|
|
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
|
2005-04-21 21:47:43 +04:00
|
|
|
KWSYS_STL_HAS_ALLOCATOR_OBJECTS=1
|
|
|
|
echo "${cmake_cxx_compiler} has stl containers supporting allocator objects"
|
|
|
|
else
|
|
|
|
echo "${cmake_cxx_compiler} does not have stl containers supporting allocator objects"
|
2005-04-13 23:39:03 +04:00
|
|
|
fi
|
|
|
|
|
2005-04-16 00:00:44 +04:00
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
|
|
|
"${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_CSTDDEF" \
|
2006-10-05 01:24:36 +04:00
|
|
|
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
|
2005-04-16 00:00:44 +04:00
|
|
|
KWSYS_CXX_HAS_CSTDDEF=1
|
|
|
|
echo "${cmake_cxx_compiler} has header cstddef"
|
|
|
|
else
|
|
|
|
echo "${cmake_cxx_compiler} does not have header cstddef"
|
|
|
|
fi
|
|
|
|
|
2005-04-13 22:13:35 +04:00
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
|
|
|
"${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS" \
|
2006-10-05 01:24:36 +04:00
|
|
|
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
|
2005-04-13 22:13:35 +04:00
|
|
|
echo "${cmake_cxx_compiler} does not require template friends to use <>"
|
|
|
|
else
|
|
|
|
KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS=1
|
|
|
|
echo "${cmake_cxx_compiler} requires template friends to use <>"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
|
|
|
"${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES" \
|
2006-10-05 01:24:36 +04:00
|
|
|
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
|
2005-04-13 22:13:35 +04:00
|
|
|
KWSYS_CXX_HAS_MEMBER_TEMPLATES=1
|
|
|
|
echo "${cmake_cxx_compiler} supports member templates"
|
|
|
|
else
|
|
|
|
echo "${cmake_cxx_compiler} does not support member templates"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
|
|
|
"${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION" \
|
2006-10-05 01:24:36 +04:00
|
|
|
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
|
2005-04-13 22:13:35 +04:00
|
|
|
KWSYS_CXX_HAS_FULL_SPECIALIZATION=1
|
|
|
|
echo "${cmake_cxx_compiler} has standard template specialization syntax"
|
|
|
|
else
|
|
|
|
echo "${cmake_cxx_compiler} does not have standard template specialization syntax"
|
|
|
|
fi
|
|
|
|
|
2005-04-15 16:59:30 +04:00
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
|
|
|
"${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP" \
|
2006-10-05 01:24:36 +04:00
|
|
|
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
|
2005-04-15 16:59:30 +04:00
|
|
|
KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP=1
|
|
|
|
echo "${cmake_cxx_compiler} has argument dependent lookup"
|
|
|
|
else
|
|
|
|
echo "${cmake_cxx_compiler} does not have argument dependent lookup"
|
|
|
|
fi
|
|
|
|
|
2005-02-17 19:27:15 +03:00
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
|
|
|
"${cmake_cxx_flags} -DTEST_KWSYS_STAT_HAS_ST_MTIM" \
|
2006-10-05 01:24:36 +04:00
|
|
|
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
|
2005-02-17 19:27:15 +03:00
|
|
|
KWSYS_STAT_HAS_ST_MTIM=1
|
|
|
|
echo "${cmake_cxx_compiler} has struct stat with st_mtim member"
|
|
|
|
else
|
|
|
|
echo "${cmake_cxx_compiler} does not have struct stat with st_mtim member"
|
|
|
|
fi
|
|
|
|
|
2003-06-21 19:57:13 +04:00
|
|
|
# Just to be safe, let us store compiler and flags to the header file
|
|
|
|
|
2003-12-23 19:03:38 +03:00
|
|
|
cmake_bootstrap_version='$Revision$'
|
|
|
|
cmake_compiler_settings_comment="/*
|
|
|
|
* Generated by ${cmake_source_dir}/bootstrap
|
|
|
|
* Version: ${cmake_bootstrap_version}
|
|
|
|
*
|
|
|
|
* Source directory: ${cmake_source_dir}
|
|
|
|
* Binary directory: ${cmake_bootstrap_dir}
|
|
|
|
*
|
|
|
|
* C compiler: ${cmake_c_compiler}
|
|
|
|
* C flags: ${cmake_c_flags}
|
|
|
|
*
|
|
|
|
* C++ compiler: ${cmake_cxx_compiler}
|
|
|
|
* C++ flags: ${cmake_cxx_flags}
|
|
|
|
*
|
|
|
|
* Make: ${cmake_make_processor}
|
|
|
|
*
|
|
|
|
* Sources:
|
|
|
|
* ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES}
|
|
|
|
* kwSys Sources:
|
2006-02-01 02:50:16 +03:00
|
|
|
* ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES} ${KWSYS_C_MINGW_SOURCES}
|
2003-12-23 19:03:38 +03:00
|
|
|
*/
|
|
|
|
"
|
|
|
|
|
|
|
|
cmake_report cmConfigure.h.tmp "${cmake_compiler_settings_comment}"
|
|
|
|
|
|
|
|
if [ "x$KWSYS_STL_HAVE_STD" = "x1" ]; then
|
2003-06-21 19:57:13 +04:00
|
|
|
cmake_report cmConfigure.h.tmp "/* #undef CMAKE_NO_STD_NAMESPACE */"
|
2003-03-27 23:29:38 +03:00
|
|
|
else
|
2003-06-21 19:57:13 +04:00
|
|
|
cmake_report cmConfigure.h.tmp "#define CMAKE_NO_STD_NAMESPACE 1"
|
2003-03-27 23:29:38 +03:00
|
|
|
fi
|
|
|
|
|
2003-12-31 16:56:37 +03:00
|
|
|
if [ "x$KWSYS_IOS_USE_ANSI" = "x1" ]; then
|
2003-06-21 19:57:13 +04:00
|
|
|
cmake_report cmConfigure.h.tmp "/* #undef CMAKE_NO_ANSI_STREAM_HEADERS */"
|
2003-03-27 23:29:38 +03:00
|
|
|
else
|
2003-06-21 19:57:13 +04:00
|
|
|
cmake_report cmConfigure.h.tmp "#define CMAKE_NO_ANSI_STREAM_HEADERS 1"
|
2003-03-27 23:29:38 +03:00
|
|
|
fi
|
|
|
|
|
2003-12-31 16:56:37 +03:00
|
|
|
if [ "x$KWSYS_IOS_USE_SSTREAM" = "x1" ]; then
|
2003-06-21 19:57:13 +04:00
|
|
|
cmake_report cmConfigure.h.tmp "/* #undef CMAKE_NO_ANSI_STRING_STREAM */"
|
2003-03-27 23:29:38 +03:00
|
|
|
else
|
2003-06-21 19:57:13 +04:00
|
|
|
cmake_report cmConfigure.h.tmp "#define CMAKE_NO_ANSI_STRING_STREAM 1"
|
2003-03-27 23:29:38 +03:00
|
|
|
fi
|
|
|
|
|
2003-05-15 17:35:16 +04:00
|
|
|
# Test for ansi FOR scope
|
2003-12-23 19:03:38 +03:00
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
|
|
|
"${cmake_cxx_flags}" \
|
|
|
|
"${cmake_source_dir}/Modules/TestForAnsiForScope.cxx" >> cmake_bootstrap.log 2>&1; then
|
2003-06-21 19:57:13 +04:00
|
|
|
cmake_report cmConfigure.h.tmp "/* #undef CMAKE_NO_ANSI_FOR_SCOPE */"
|
2003-03-27 23:29:38 +03:00
|
|
|
echo "${cmake_cxx_compiler} has ANSI for scoping"
|
|
|
|
else
|
2003-06-21 19:57:13 +04:00
|
|
|
cmake_report cmConfigure.h.tmp "#define CMAKE_NO_ANSI_FOR_SCOPE 1"
|
2003-03-27 23:29:38 +03:00
|
|
|
echo "${cmake_cxx_compiler} does not have ANSI for scoping"
|
|
|
|
fi
|
|
|
|
|
2006-02-10 19:19:19 +03:00
|
|
|
# When bootstrapping on MinGW with MSYS we must convert the source
|
|
|
|
# directory to a windows path.
|
|
|
|
if ${cmake_system_mingw}; then
|
|
|
|
cmake_root_dir=`cd "${cmake_source_dir}"; pwd -W`
|
|
|
|
else
|
|
|
|
cmake_root_dir="${cmake_source_dir}"
|
|
|
|
fi
|
|
|
|
|
2003-05-15 17:35:16 +04:00
|
|
|
# Write CMake version
|
2007-11-15 05:17:53 +03:00
|
|
|
cmake_report cmConfigure.h.tmp "#define CMake_VERSION_MAJOR ${cmake_version_major}"
|
|
|
|
cmake_report cmConfigure.h.tmp "#define CMake_VERSION_MINOR ${cmake_version_minor}"
|
|
|
|
cmake_report cmConfigure.h.tmp "#define CMake_VERSION_PATCH ${cmake_version_patch}"
|
2006-02-10 19:19:19 +03:00
|
|
|
cmake_report cmConfigure.h.tmp "#define CMAKE_ROOT_DIR \"${cmake_root_dir}\""
|
2003-07-22 00:38:53 +04:00
|
|
|
cmake_report cmConfigure.h.tmp "#define CMAKE_DATA_DIR \"${cmake_data_dir}\""
|
2003-06-21 19:57:13 +04:00
|
|
|
cmake_report cmConfigure.h.tmp "#define CMAKE_BOOTSTRAP"
|
|
|
|
|
|
|
|
# Regenerate real cmConfigure.h
|
|
|
|
if diff cmConfigure.h cmConfigure.h.tmp > /dev/null 2> /dev/null; then
|
|
|
|
rm -f cmConfigure.h.tmp
|
|
|
|
else
|
|
|
|
mv -f cmConfigure.h.tmp cmConfigure.h
|
|
|
|
fi
|
2003-03-27 23:29:38 +03:00
|
|
|
|
2003-06-23 16:58:58 +04:00
|
|
|
# Prepare KWSYS
|
2003-12-23 19:03:38 +03:00
|
|
|
cmake_kwsys_config_replace_string \
|
|
|
|
"${cmake_source_dir}/Source/kwsys/Configure.hxx.in" \
|
|
|
|
"${cmake_bootstrap_dir}/cmsys/Configure.hxx" \
|
|
|
|
"${cmake_compiler_settings_comment}"
|
|
|
|
cmake_kwsys_config_replace_string \
|
|
|
|
"${cmake_source_dir}/Source/kwsys/Configure.h.in" \
|
|
|
|
"${cmake_bootstrap_dir}/cmsys/Configure.h" \
|
|
|
|
"${cmake_compiler_settings_comment}"
|
|
|
|
|
2007-11-15 05:17:53 +03:00
|
|
|
cat>"${cmake_bootstrap_dir}/cmsys/DateStamp.h"<<EOF
|
|
|
|
/* Minimal DateStamp header for CMake bootstrap build. */
|
|
|
|
#ifndef cmsys_DateStamp_h
|
|
|
|
#define cmsys_DateStamp_h
|
|
|
|
#define cmsys_DATE_STAMP_STRING_FULL "${cmake_date_stamp}"
|
|
|
|
#endif
|
|
|
|
EOF
|
|
|
|
|
2003-06-23 16:58:58 +04:00
|
|
|
for a in ${KWSYS_FILES}; do
|
|
|
|
cmake_replace_string "${cmake_source_dir}/Source/kwsys/${a}.in" \
|
|
|
|
"${cmake_bootstrap_dir}/cmsys/${a}" KWSYS_NAMESPACE cmsys
|
|
|
|
done
|
2003-12-23 19:03:38 +03:00
|
|
|
|
|
|
|
for a in ${KWSYS_IOS_FILES}; do
|
|
|
|
cmake_replace_string "${cmake_source_dir}/Source/kwsys/kwsys_ios_${a}.h.in" \
|
|
|
|
"${cmake_bootstrap_dir}/cmsys/ios/${a}" KWSYS_NAMESPACE cmsys
|
2003-06-23 16:58:58 +04:00
|
|
|
done
|
2003-12-23 19:03:38 +03:00
|
|
|
|
2005-03-29 17:20:08 +04:00
|
|
|
cmake_replace_string "${cmake_source_dir}/Source/kwsys/kwsys_stl.hxx.in" \
|
|
|
|
"${cmake_bootstrap_dir}/cmsys/stl/stl.hxx.in" KWSYS_STL_HEADER_EXTRA ""
|
|
|
|
|
|
|
|
cmake_replace_string "${cmake_bootstrap_dir}/cmsys/stl/stl.hxx.in" \
|
2003-12-23 19:03:38 +03:00
|
|
|
"${cmake_bootstrap_dir}/cmsys/stl/stl.h.in" KWSYS_NAMESPACE cmsys
|
|
|
|
|
2008-01-27 23:09:58 +03:00
|
|
|
for a in string vector map algorithm; do
|
2003-12-23 19:03:38 +03:00
|
|
|
cmake_replace_string "${cmake_bootstrap_dir}/cmsys/stl/stl.h.in" \
|
|
|
|
"${cmake_bootstrap_dir}/cmsys/stl/${a}" KWSYS_STL_HEADER ${a}
|
2003-06-23 16:58:58 +04:00
|
|
|
done
|
|
|
|
|
2003-03-27 23:29:38 +03:00
|
|
|
# Generate Makefile
|
2006-03-06 23:41:56 +03:00
|
|
|
dep="cmConfigure.h cmsys/*.hxx cmsys/*.h `cmake_escape \"${cmake_source_dir}\"`/Source/*.h"
|
2003-03-27 23:29:38 +03:00
|
|
|
objs=""
|
2006-02-01 02:50:16 +03:00
|
|
|
for a in ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES} ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES} ${KWSYS_C_GENERATED_SOURCES}; do
|
2003-03-27 23:29:38 +03:00
|
|
|
objs="${objs} ${a}.o"
|
|
|
|
done
|
2003-06-21 19:57:13 +04:00
|
|
|
|
2005-03-07 20:11:51 +03:00
|
|
|
# Generate dependencies for cmBootstrapCommands.cxx
|
2005-03-09 23:51:30 +03:00
|
|
|
for file in `grep "#include.*cm[^.]*.cxx" "${cmake_source_dir}/Source/cmBootstrapCommands.cxx" | sed "s/.* \"\(.*\)\"/\1/"`; do
|
|
|
|
cmBootstrapCommandsDeps="${cmBootstrapCommandsDeps} `cmake_escape "${cmake_source_dir}/Source/$file"`"
|
|
|
|
done
|
2005-03-07 20:11:51 +03:00
|
|
|
cmBootstrapCommandsDeps=`echo $cmBootstrapCommandsDeps`
|
|
|
|
|
2003-06-21 19:57:13 +04:00
|
|
|
if [ "x${cmake_ansi_cxx_flags}" != "x" ]; then
|
|
|
|
cmake_cxx_flags="${cmake_ansi_cxx_flags} ${cmake_cxx_flags}"
|
|
|
|
fi
|
|
|
|
|
2003-09-02 21:27:58 +04:00
|
|
|
if [ "x${cmake_c_flags}" != "x" ]; then
|
|
|
|
cmake_c_flags="${cmake_c_flags} "
|
|
|
|
fi
|
|
|
|
|
2003-06-21 19:57:13 +04:00
|
|
|
if [ "x${cmake_cxx_flags}" != "x" ]; then
|
|
|
|
cmake_cxx_flags="${cmake_cxx_flags} "
|
|
|
|
fi
|
|
|
|
|
2003-12-23 19:03:38 +03:00
|
|
|
cmake_c_flags="${cmake_c_flags}-I`cmake_escape \"${cmake_source_dir}/Source\"` \
|
|
|
|
-I`cmake_escape \"${cmake_bootstrap_dir}\"`"
|
|
|
|
cmake_cxx_flags="${cmake_cxx_flags}-I`cmake_escape \"${cmake_source_dir}/Source\"` \
|
|
|
|
-I`cmake_escape \"${cmake_bootstrap_dir}\"`"
|
2003-03-27 23:29:38 +03:00
|
|
|
echo "cmake: ${objs}" > "${cmake_bootstrap_dir}/Makefile"
|
2006-04-13 19:00:52 +04:00
|
|
|
echo " ${cmake_cxx_compiler} ${cmake_ld_flags} ${cmake_cxx_flags} ${objs} -o cmake" >> "${cmake_bootstrap_dir}/Makefile"
|
2003-12-08 22:11:58 +03:00
|
|
|
for a in ${CMAKE_CXX_SOURCES}; do
|
2003-03-27 23:29:38 +03:00
|
|
|
src=`cmake_escape "${cmake_source_dir}/Source/${a}.cxx"`
|
|
|
|
echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
|
|
|
|
echo " ${cmake_cxx_compiler} ${cmake_cxx_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
|
|
|
|
done
|
2005-03-09 01:27:08 +03:00
|
|
|
echo "cmBootstrapCommands.o : $cmBootstrapCommandsDeps" >> "${cmake_bootstrap_dir}/Makefile"
|
2003-12-08 22:11:58 +03:00
|
|
|
for a in ${CMAKE_C_SOURCES}; do
|
|
|
|
src=`cmake_escape "${cmake_source_dir}/Source/${a}.c"`
|
|
|
|
echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
|
|
|
|
echo " ${cmake_c_compiler} ${cmake_c_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
|
|
|
|
done
|
2006-02-01 02:50:16 +03:00
|
|
|
for a in ${KWSYS_C_SOURCES} ${KWSYS_C_MINGW_SOURCES}; do
|
2003-07-08 01:52:53 +04:00
|
|
|
src=`cmake_escape "${cmake_source_dir}/Source/kwsys/${a}.c"`
|
|
|
|
echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
|
2003-09-02 21:27:58 +04:00
|
|
|
echo " ${cmake_c_compiler} ${cmake_c_flags} -DKWSYS_NAMESPACE=cmsys -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
|
2003-07-08 01:52:53 +04:00
|
|
|
done
|
|
|
|
for a in ${KWSYS_CXX_SOURCES}; do
|
2003-06-23 16:58:58 +04:00
|
|
|
src=`cmake_escape "${cmake_source_dir}/Source/kwsys/${a}.cxx"`
|
|
|
|
echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
|
2003-07-12 01:21:28 +04:00
|
|
|
echo " ${cmake_cxx_compiler} ${cmake_cxx_flags} -DKWSYS_NAMESPACE=cmsys -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
|
2003-06-23 16:58:58 +04:00
|
|
|
done
|
2006-02-01 02:50:16 +03:00
|
|
|
if ${cmake_system_mingw}; then
|
|
|
|
src=`cmake_escape "${cmake_bootstrap_dir}/cmsysProcessFwd9xEnc.c"`
|
|
|
|
in=`cmake_escape "${cmake_bootstrap_dir}/cmsysProcessFwd9x.exe"`
|
|
|
|
cmd=`cmake_escape "${cmake_bootstrap_dir}/cmsysEncodeExecutable.exe"`
|
|
|
|
a="cmsysProcessFwd9xEnc"
|
|
|
|
echo "${cmd} : EncodeExecutable.o" >> "${cmake_bootstrap_dir}/Makefile"
|
2006-04-13 19:00:52 +04:00
|
|
|
echo " ${cmake_c_compiler} ${cmake_ld_flags} ${cmake_c_flags} EncodeExecutable.o -o ${cmd}" >> "${cmake_bootstrap_dir}/Makefile"
|
2006-02-01 02:50:16 +03:00
|
|
|
echo "${in} : ProcessFwd9x.o" >> "${cmake_bootstrap_dir}/Makefile"
|
2006-04-13 19:00:52 +04:00
|
|
|
echo " ${cmake_c_compiler} ${cmake_ld_flags} ${cmake_c_flags} ProcessFwd9x.o -o ${in}" >> "${cmake_bootstrap_dir}/Makefile"
|
2006-02-01 02:50:16 +03:00
|
|
|
echo "${src} : ${cmd} ${in}" >> "${cmake_bootstrap_dir}/Makefile"
|
|
|
|
echo " ${cmd} ${in} ${src} cmsys ProcessFwd9x" >> "${cmake_bootstrap_dir}/Makefile"
|
|
|
|
echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
|
|
|
|
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"
|
|
|
|
fi
|
2003-08-07 01:52:16 +04:00
|
|
|
cat>>"${cmake_bootstrap_dir}/Makefile"<<EOF
|
|
|
|
rebuild_cache:
|
|
|
|
cd "${cmake_binary_dir}" && "${cmake_source_dir}/bootstrap"
|
|
|
|
EOF
|
2003-03-27 23:29:38 +03:00
|
|
|
|
2003-07-23 16:37:44 +04:00
|
|
|
# Write our default settings to Bootstrap.cmk/InitialCacheFlags.cmake.
|
2003-07-22 00:38:53 +04:00
|
|
|
cat > "${cmake_bootstrap_dir}/InitialCacheFlags.cmake" <<EOF
|
|
|
|
# Generated by ${cmake_source_dir}/bootstrap
|
2003-07-23 16:37:44 +04:00
|
|
|
# Default cmake settings. These may be overridden any settings below.
|
|
|
|
SET (CMAKE_INSTALL_PREFIX "${cmake_prefix_dir}" CACHE PATH "Install path prefix, prepended onto install directories." FORCE)
|
|
|
|
SET (CMAKE_DOC_DIR "${cmake_doc_dir}" CACHE PATH "Install location for documentation (relative to prefix)." FORCE)
|
|
|
|
SET (CMAKE_MAN_DIR "${cmake_man_dir}" CACHE PATH "Install location for man pages (relative to prefix)." FORCE)
|
|
|
|
SET (CMAKE_DATA_DIR "${cmake_data_dir}" CACHE PATH "Install location for data (relative to prefix)." FORCE)
|
2003-07-22 00:38:53 +04:00
|
|
|
EOF
|
|
|
|
|
2008-02-13 22:47:03 +03:00
|
|
|
# Add configuration settings given as command-line options.
|
|
|
|
if [ "x${cmake_bootstrap_qt_gui}" != "x" ]; then
|
|
|
|
cat >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake" <<EOF
|
|
|
|
SET (BUILD_QtDialog ${cmake_bootstrap_qt_gui} CACHE BOOL "Build Qt dialog for CMake" FORCE)
|
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
if [ "x${cmake_bootstrap_qt_qmake}" != "x" ]; then
|
|
|
|
cat >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake" <<EOF
|
|
|
|
SET (QT_QMAKE_EXECUTABLE "${cmake_bootstrap_qt_qmake}" CACHE FILEPATH "Location of Qt qmake" FORCE)
|
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
|
2003-07-23 16:37:44 +04:00
|
|
|
# Add user-specified settings. Handle relative-path case for
|
2003-07-22 00:38:53 +04:00
|
|
|
# specification of cmake_init_file.
|
|
|
|
(
|
|
|
|
cd "${cmake_binary_dir}"
|
|
|
|
if [ -f "${cmake_init_file}" ]; then
|
|
|
|
cat "${cmake_init_file}" >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
|
|
|
|
fi
|
|
|
|
)
|
|
|
|
|
2003-03-27 23:29:38 +03:00
|
|
|
echo "---------------------------------------------"
|
|
|
|
|
2003-05-15 17:35:16 +04:00
|
|
|
# Run make to build bootstrap cmake
|
2003-05-14 17:27:39 +04:00
|
|
|
if [ "x${cmake_parallel_make}" != "x" ]; then
|
2003-08-22 17:52:05 +04:00
|
|
|
${cmake_make_processor} ${cmake_make_flags}
|
2003-05-14 17:27:39 +04:00
|
|
|
else
|
|
|
|
${cmake_make_processor}
|
|
|
|
fi
|
2003-03-27 23:29:38 +03:00
|
|
|
RES=$?
|
|
|
|
if [ "${RES}" -ne "0" ]; then
|
2003-12-23 19:03:38 +03:00
|
|
|
cmake_error 9 "Problem while running ${cmake_make_processor}"
|
2003-03-27 23:29:38 +03:00
|
|
|
fi
|
|
|
|
cd "${cmake_binary_dir}"
|
2003-05-15 17:35:16 +04:00
|
|
|
|
|
|
|
# Set C, CXX, and MAKE environment variables, so that real real cmake will be
|
|
|
|
# build with same compiler and make
|
|
|
|
CC="${cmake_c_compiler}"
|
|
|
|
CXX="${cmake_cxx_compiler}"
|
|
|
|
MAKE="${cmake_make_processor}"
|
|
|
|
export CC
|
|
|
|
export CXX
|
|
|
|
export MAKE
|
|
|
|
|
|
|
|
# Run bootstrap CMake to configure real CMake
|
2006-10-19 23:17:58 +04:00
|
|
|
"${cmake_bootstrap_dir}/cmake" "${cmake_source_dir}" "-C${cmake_bootstrap_dir}/InitialCacheFlags.cmake" "-G${cmake_bootstrap_generator}" ${cmake_bootstrap_system_libs}
|
2005-03-04 18:03:38 +03:00
|
|
|
RES=$?
|
|
|
|
if [ "${RES}" -ne "0" ]; then
|
|
|
|
cmake_error 11 "Problem while running initial CMake"
|
|
|
|
fi
|
2003-03-27 23:29:38 +03:00
|
|
|
|
|
|
|
echo "---------------------------------------------"
|
|
|
|
|
2003-05-15 17:35:16 +04:00
|
|
|
# And we are done. Now just run make
|
2003-07-23 16:37:44 +04:00
|
|
|
echo "CMake has bootstrapped. Now run ${cmake_make_processor}."
|