2003-03-27 20:29:38 +00:00
|
|
|
#!/bin/sh
|
2016-09-27 19:01:08 +00:00
|
|
|
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
# file Copyright.txt or https://cmake.org/licensing for details.
|
2003-06-21 15:57:13 +00:00
|
|
|
|
2011-12-16 15:56:47 +00:00
|
|
|
die() {
|
|
|
|
echo "$@" 1>&2 ; exit 1
|
|
|
|
}
|
|
|
|
|
2017-05-14 17:41:55 +00:00
|
|
|
# Compile flag extraction function.
|
|
|
|
cmake_extract_standard_flags()
|
|
|
|
{
|
2017-06-07 17:34:10 +00:00
|
|
|
sed -n "s/ *set *( *CMAKE_${2}${3}_EXTENSION_COMPILE_OPTION *\"\{0,1\}\([^\")]*\).*/\1/p" \
|
2017-06-08 19:19:25 +00:00
|
|
|
"${cmake_source_dir}/Modules/Compiler/"${1:-*}-${2}.cmake 2>/dev/null | tr ';' ' '
|
2017-05-14 17:41:55 +00:00
|
|
|
}
|
|
|
|
|
2006-08-26 01:21:10 +00:00
|
|
|
# Version number extraction function.
|
|
|
|
cmake_version_component()
|
|
|
|
{
|
2017-06-07 17:16:42 +00:00
|
|
|
sed -n "
|
2012-08-13 17:47:32 +00:00
|
|
|
/^set(CMake_VERSION_${1}/ {s/set(CMake_VERSION_${1} *\([0-9]*\))/\1/;p;}
|
2017-06-07 17:16:42 +00:00
|
|
|
" "${cmake_source_dir}/Source/CMakeVersion.cmake"
|
2006-08-26 01:21:10 +00:00
|
|
|
}
|
|
|
|
|
2013-09-26 18:13:38 +00:00
|
|
|
# Install destination extraction function.
|
|
|
|
cmake_install_dest_default()
|
|
|
|
{
|
2017-06-07 17:16:42 +00:00
|
|
|
sed -n '
|
2013-09-26 18:13:38 +00:00
|
|
|
/^ *set(CMAKE_'"${1}"'_DIR_DEFAULT.*) # '"${2}"'$/ {
|
2013-10-25 12:55:50 +00:00
|
|
|
s/^ *set(CMAKE_'"${1}"'_DIR_DEFAULT *"\([^"]*\)").*$/\1/
|
|
|
|
s/${CMake_VERSION_MAJOR}/'"${cmake_version_major}"'/
|
|
|
|
s/${CMake_VERSION_MINOR}/'"${cmake_version_minor}"'/
|
|
|
|
s/${CMake_VERSION_PATCH}/'"${cmake_version_patch}"'/
|
|
|
|
p
|
|
|
|
q
|
|
|
|
}
|
2017-06-07 17:16:42 +00:00
|
|
|
' "${cmake_source_dir}/Source/CMakeInstallDestinations.cmake"
|
2013-09-26 18:13:38 +00:00
|
|
|
}
|
|
|
|
|
2011-01-10 14:32:09 +00:00
|
|
|
cmake_toupper()
|
|
|
|
{
|
2017-06-07 17:17:42 +00:00
|
|
|
echo "$1" | tr '[:lower:]' '[:upper:]'
|
2011-01-10 14:32:09 +00:00
|
|
|
}
|
|
|
|
|
2006-01-31 23:50:16 +00:00
|
|
|
# Detect system and directory information.
|
|
|
|
cmake_system=`uname`
|
2009-09-25 14:48:24 +00:00
|
|
|
cmake_source_dir=`cd "\`dirname \"$0\"\`";pwd`
|
2006-01-31 23:50:16 +00:00
|
|
|
cmake_binary_dir=`pwd`
|
2010-04-23 13:44:23 +00:00
|
|
|
|
|
|
|
# Load version information.
|
2007-11-15 02:17:53 +00:00
|
|
|
cmake_version_major="`cmake_version_component MAJOR`"
|
|
|
|
cmake_version_minor="`cmake_version_component MINOR`"
|
2010-04-23 13:44:23 +00:00
|
|
|
cmake_version_patch="`cmake_version_component PATCH`"
|
|
|
|
cmake_version="${cmake_version_major}.${cmake_version_minor}.${cmake_version_patch}"
|
2013-09-26 18:25:48 +00:00
|
|
|
cmake_version_rc="`cmake_version_component RC`"
|
|
|
|
if [ "$cmake_version_rc" != "" ]; then
|
|
|
|
cmake_version="${cmake_version}-rc${cmake_version_rc}"
|
|
|
|
fi
|
2010-04-23 13:44:23 +00:00
|
|
|
|
2013-11-12 20:56:36 +00:00
|
|
|
cmake_copyright="`grep '^Copyright .* Kitware' "${cmake_source_dir}/Copyright.txt"`"
|
|
|
|
|
2016-05-27 14:03:43 +00:00
|
|
|
cmake_bin_dir_keyword="OTHER"
|
2013-09-26 18:13:38 +00:00
|
|
|
cmake_data_dir_keyword="OTHER"
|
|
|
|
cmake_doc_dir_keyword="OTHER"
|
|
|
|
cmake_man_dir_keyword="OTHER"
|
2015-12-21 15:02:11 +00:00
|
|
|
cmake_xdgdata_dir_keyword="OTHER"
|
2016-05-27 14:03:43 +00:00
|
|
|
cmake_bin_dir=""
|
2013-09-26 18:13:38 +00:00
|
|
|
cmake_data_dir=""
|
|
|
|
cmake_doc_dir=""
|
|
|
|
cmake_man_dir=""
|
2015-12-21 15:02:11 +00:00
|
|
|
cmake_xdgdata_dir=""
|
2006-01-31 23:50:16 +00:00
|
|
|
cmake_init_file=""
|
2006-10-19 19:17:58 +00:00
|
|
|
cmake_bootstrap_system_libs=""
|
2008-02-13 19:47:03 +00:00
|
|
|
cmake_bootstrap_qt_gui=""
|
|
|
|
cmake_bootstrap_qt_qmake=""
|
2013-09-17 20:08:05 +00:00
|
|
|
cmake_sphinx_man=""
|
|
|
|
cmake_sphinx_html=""
|
2015-02-07 22:23:28 +00:00
|
|
|
cmake_sphinx_qthelp=""
|
2013-09-17 20:08:05 +00:00
|
|
|
cmake_sphinx_build=""
|
2015-04-30 13:30:14 +00:00
|
|
|
cmake_sphinx_flags=""
|
2006-01-31 23:50:16 +00:00
|
|
|
|
2009-05-27 15:33:37 +00:00
|
|
|
# Determine whether this is a Cygwin environment.
|
2017-08-16 15:06:40 +00:00
|
|
|
if echo "${cmake_system}" | grep CYGWIN >/dev/null 2>&1; then
|
2009-05-27 15:33:37 +00:00
|
|
|
cmake_system_cygwin=true
|
2013-09-26 18:13:38 +00:00
|
|
|
cmake_doc_dir_keyword="CYGWIN"
|
|
|
|
cmake_man_dir_keyword="CYGWIN"
|
2009-05-27 15:33:37 +00:00
|
|
|
else
|
|
|
|
cmake_system_cygwin=false
|
|
|
|
fi
|
|
|
|
|
2006-01-31 23:50:16 +00:00
|
|
|
# Determine whether this is a MinGW environment.
|
2017-08-16 15:06:40 +00:00
|
|
|
if echo "${cmake_system}" | grep 'MINGW\|MSYS' >/dev/null 2>&1; then
|
2006-01-31 23:50:16 +00:00
|
|
|
cmake_system_mingw=true
|
|
|
|
else
|
|
|
|
cmake_system_mingw=false
|
|
|
|
fi
|
|
|
|
|
2006-04-13 15:00:52 +00:00
|
|
|
# Determine whether this is OS X
|
2017-08-16 15:06:40 +00:00
|
|
|
if echo "${cmake_system}" | grep Darwin >/dev/null 2>&1; then
|
2006-04-13 15:00:52 +00:00
|
|
|
cmake_system_darwin=true
|
|
|
|
else
|
|
|
|
cmake_system_darwin=false
|
|
|
|
fi
|
|
|
|
|
2012-07-07 17:57:40 +00:00
|
|
|
# Determine whether this is BeOS
|
2017-08-16 15:06:40 +00:00
|
|
|
if echo "${cmake_system}" | grep BeOS >/dev/null 2>&1; then
|
2006-12-04 22:26:41 +00:00
|
|
|
cmake_system_beos=true
|
2013-09-26 18:13:38 +00:00
|
|
|
cmake_doc_dir_keyword="HAIKU"
|
|
|
|
cmake_man_dir_keyword="HAIKU"
|
2006-12-04 22:26:41 +00:00
|
|
|
else
|
|
|
|
cmake_system_beos=false
|
|
|
|
fi
|
|
|
|
|
2012-07-07 17:57:40 +00:00
|
|
|
# Determine whether this is Haiku
|
2017-08-16 15:06:40 +00:00
|
|
|
if echo "${cmake_system}" | grep Haiku >/dev/null 2>&1; then
|
2008-09-15 21:53:28 +00:00
|
|
|
cmake_system_haiku=true
|
2013-09-26 18:13:38 +00:00
|
|
|
cmake_doc_dir_keyword="HAIKU"
|
|
|
|
cmake_man_dir_keyword="HAIKU"
|
2008-09-15 21:53:28 +00:00
|
|
|
else
|
|
|
|
cmake_system_haiku=false
|
|
|
|
fi
|
|
|
|
|
2009-06-10 17:04:25 +00:00
|
|
|
# Determine whether this is OpenVMS
|
2017-08-16 15:06:40 +00:00
|
|
|
if echo "${cmake_system}" | grep OpenVMS >/dev/null 2>&1; then
|
2009-06-10 17:04:25 +00:00
|
|
|
cmake_system_openvms=true
|
|
|
|
else
|
|
|
|
cmake_system_openvms=false
|
|
|
|
fi
|
|
|
|
|
2014-11-04 16:01:56 +00:00
|
|
|
# Determine whether this is HP-UX
|
2017-08-16 15:06:40 +00:00
|
|
|
if echo "${cmake_system}" | grep HP-UX >/dev/null 2>&1; then
|
2017-08-04 13:49:04 +00:00
|
|
|
die 'CMake no longer compiles on HP-UX. See
|
|
|
|
|
|
|
|
https://gitlab.kitware.com/cmake/cmake/issues/17137
|
|
|
|
|
|
|
|
Use CMake 3.9 or lower instead.'
|
2014-11-04 16:01:56 +00:00
|
|
|
cmake_system_hpux=true
|
|
|
|
else
|
|
|
|
cmake_system_hpux=false
|
|
|
|
fi
|
|
|
|
|
2012-10-28 22:23:29 +00:00
|
|
|
# Determine whether this is Linux
|
2017-08-16 15:06:40 +00:00
|
|
|
if echo "${cmake_system}" | grep Linux >/dev/null 2>&1; then
|
2012-10-28 22:23:29 +00:00
|
|
|
cmake_system_linux=true
|
2014-11-04 16:01:56 +00:00
|
|
|
else
|
|
|
|
cmake_system_linux=false
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Determine whether this is a PA-RISC machine
|
|
|
|
# This only works for Linux or HP-UX, not other PA-RISC OSs (BSD maybe?). Also
|
|
|
|
# may falsely detect parisc on HP-UX m68k
|
|
|
|
cmake_machine_parisc=false
|
|
|
|
if ${cmake_system_linux}; then
|
2017-08-16 15:06:40 +00:00
|
|
|
if uname -m | grep parisc >/dev/null 2>&1; then
|
2012-10-28 22:23:29 +00:00
|
|
|
cmake_machine_parisc=true
|
|
|
|
fi
|
2014-11-04 16:01:56 +00:00
|
|
|
elif ${cmake_system_hpux}; then
|
2017-08-16 15:06:40 +00:00
|
|
|
if uname -m | grep ia64 >/dev/null 2>&1; then : ; else
|
2014-11-04 16:01:56 +00:00
|
|
|
cmake_machine_parisc=true
|
|
|
|
fi
|
2012-10-28 22:23:29 +00:00
|
|
|
fi
|
|
|
|
|
2006-01-31 23:50:16 +00: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
|
|
|
|
|
2009-06-10 17:04:25 +00:00
|
|
|
# Choose tools and extensions for this platform.
|
|
|
|
if ${cmake_system_openvms}; then
|
|
|
|
_tmp="_tmp"
|
|
|
|
_cmk="_cmk"
|
|
|
|
_diff=`which diff`
|
|
|
|
else
|
|
|
|
_tmp=".tmp"
|
|
|
|
_cmk=".cmk"
|
|
|
|
_diff="diff"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Construct bootstrap directory name.
|
|
|
|
cmake_bootstrap_dir="${cmake_binary_dir}/Bootstrap${_cmk}"
|
|
|
|
|
2006-02-17 01:13:54 +00:00
|
|
|
# Helper function to fix windows paths.
|
2012-02-29 19:29:16 +00:00
|
|
|
case "${cmake_system}" in
|
|
|
|
*MINGW*)
|
|
|
|
cmake_fix_slashes()
|
|
|
|
{
|
|
|
|
cmd //c echo "$(echo "$1" | sed 's/\\/\//g')" | sed 's/^"//;s/" *$//'
|
|
|
|
}
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
cmake_fix_slashes()
|
|
|
|
{
|
|
|
|
echo "$1" | sed 's/\\/\//g'
|
|
|
|
}
|
|
|
|
;;
|
|
|
|
esac
|
2006-02-17 01:13:54 +00:00
|
|
|
|
|
|
|
# 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
|
2009-09-30 12:31:53 +00:00
|
|
|
elif ${cmake_system_haiku}; then
|
2013-01-07 20:09:18 +00:00
|
|
|
cmake_default_prefix=`finddir B_COMMON_DIRECTORY`
|
2006-02-17 01:13:54 +00:00
|
|
|
else
|
|
|
|
cmake_default_prefix="/usr/local"
|
|
|
|
fi
|
|
|
|
|
2013-09-26 18:13:38 +00:00
|
|
|
# Lookup default install destinations.
|
2016-05-27 14:03:43 +00:00
|
|
|
cmake_bin_dir_default="`cmake_install_dest_default BIN ${cmake_bin_dir_keyword}`"
|
2013-09-26 18:13:38 +00:00
|
|
|
cmake_data_dir_default="`cmake_install_dest_default DATA ${cmake_data_dir_keyword}`"
|
|
|
|
cmake_doc_dir_default="`cmake_install_dest_default DOC ${cmake_doc_dir_keyword}`"
|
|
|
|
cmake_man_dir_default="`cmake_install_dest_default MAN ${cmake_man_dir_keyword}`"
|
2015-12-21 15:02:11 +00:00
|
|
|
cmake_xdgdata_dir_default="`cmake_install_dest_default XDGDATA ${cmake_xdgdata_dir_keyword}`"
|
2013-09-26 18:13:38 +00:00
|
|
|
|
2018-02-05 10:26:15 +00:00
|
|
|
CMAKE_KNOWN_C_COMPILERS="cc gcc clang xlc icc tcc"
|
|
|
|
CMAKE_KNOWN_CXX_COMPILERS="aCC xlC CC g++ clang++ c++ icc como "
|
2004-10-19 18:51:25 +00:00
|
|
|
CMAKE_KNOWN_MAKE_PROCESSORS="gmake make"
|
2003-03-27 20:29:38 +00:00
|
|
|
|
2004-10-18 15:34:02 +00:00
|
|
|
CMAKE_PROBLEMATIC_FILES="\
|
|
|
|
CMakeCache.txt \
|
|
|
|
CMakeSystem.cmake \
|
|
|
|
CMakeCCompiler.cmake \
|
|
|
|
CMakeCXXCompiler.cmake \
|
2012-08-24 12:48:59 +00:00
|
|
|
*/CMakeSystem.cmake \
|
|
|
|
*/CMakeCCompiler.cmake \
|
|
|
|
*/CMakeCXXCompiler.cmake \
|
2004-10-18 15:34:02 +00:00
|
|
|
Source/cmConfigure.h \
|
|
|
|
Source/CTest/Curl/config.h \
|
|
|
|
Utilities/cmexpat/expatConfig.h \
|
|
|
|
Utilities/cmexpat/expatDllConfig.h \
|
|
|
|
"
|
|
|
|
|
2006-03-22 14:58:11 +00:00
|
|
|
CMAKE_UNUSED_SOURCES="\
|
|
|
|
cmGlobalXCodeGenerator \
|
|
|
|
cmLocalXCodeGenerator \
|
|
|
|
cmXCodeObject \
|
|
|
|
cmXCode21Object \
|
|
|
|
cmSourceGroup \
|
|
|
|
"
|
|
|
|
|
2003-12-08 19:11:58 +00:00
|
|
|
CMAKE_CXX_SOURCES="\
|
2016-10-19 19:59:14 +00:00
|
|
|
cmAddCustomCommandCommand \
|
|
|
|
cmAddCustomTargetCommand \
|
|
|
|
cmAddDefinitionsCommand \
|
|
|
|
cmAddDependenciesCommand \
|
|
|
|
cmAddExecutableCommand \
|
|
|
|
cmAddLibraryCommand \
|
|
|
|
cmAddSubDirectoryCommand \
|
|
|
|
cmAddTestCommand \
|
|
|
|
cmBreakCommand \
|
|
|
|
cmBuildCommand \
|
|
|
|
cmCMakeMinimumRequired \
|
|
|
|
cmCMakePolicyCommand \
|
2016-10-19 21:19:41 +00:00
|
|
|
cmCPackPropertiesGenerator \
|
|
|
|
cmCacheManager \
|
2016-10-19 22:29:18 +00:00
|
|
|
cmCommand \
|
2016-10-19 21:19:41 +00:00
|
|
|
cmCommandArgumentParserHelper \
|
2016-10-19 19:59:14 +00:00
|
|
|
cmCommandArgumentsHelper \
|
2016-10-19 21:19:41 +00:00
|
|
|
cmCommands \
|
|
|
|
cmCommonTargetGenerator \
|
|
|
|
cmComputeComponentGraph \
|
|
|
|
cmComputeLinkDepends \
|
|
|
|
cmComputeLinkInformation \
|
|
|
|
cmComputeTargetDepends \
|
|
|
|
cmConditionEvaluator \
|
2016-10-19 19:59:14 +00:00
|
|
|
cmConfigureFileCommand \
|
|
|
|
cmContinueCommand \
|
|
|
|
cmCoreTryCompile \
|
|
|
|
cmCreateTestSourceList \
|
2016-10-19 21:19:41 +00:00
|
|
|
cmCustomCommand \
|
|
|
|
cmCustomCommandGenerator \
|
2016-10-19 19:59:14 +00:00
|
|
|
cmDefinePropertyCommand \
|
2016-10-19 21:19:41 +00:00
|
|
|
cmDefinitions \
|
|
|
|
cmDepends \
|
|
|
|
cmDependsC \
|
2017-05-10 19:05:29 +00:00
|
|
|
cmDisallowedCommand \
|
2016-10-19 21:19:41 +00:00
|
|
|
cmDocumentationFormatter \
|
2016-10-19 19:59:14 +00:00
|
|
|
cmEnableLanguageCommand \
|
|
|
|
cmEnableTestingCommand \
|
|
|
|
cmExecProgramCommand \
|
|
|
|
cmExecuteProcessCommand \
|
2016-10-19 21:19:41 +00:00
|
|
|
cmExpandedCommandArgument \
|
|
|
|
cmExportBuildFileGenerator \
|
|
|
|
cmExportFileGenerator \
|
|
|
|
cmExportInstallFileGenerator \
|
|
|
|
cmExportSet \
|
|
|
|
cmExportSetMap \
|
|
|
|
cmExportTryCompileFileGenerator \
|
|
|
|
cmExprParserHelper \
|
|
|
|
cmExternalMakefileProjectGenerator \
|
2016-10-19 19:59:14 +00:00
|
|
|
cmFileCommand \
|
2016-10-19 21:19:41 +00:00
|
|
|
cmFileTimeComparison \
|
2016-10-19 19:59:14 +00:00
|
|
|
cmFindBase \
|
|
|
|
cmFindCommon \
|
|
|
|
cmFindFileCommand \
|
|
|
|
cmFindLibraryCommand \
|
|
|
|
cmFindPackageCommand \
|
|
|
|
cmFindPathCommand \
|
|
|
|
cmFindProgramCommand \
|
|
|
|
cmForEachCommand \
|
|
|
|
cmFunctionCommand \
|
2017-11-02 20:42:18 +00:00
|
|
|
cmFSPermissions \
|
2016-10-19 21:19:41 +00:00
|
|
|
cmGeneratedFileStream \
|
|
|
|
cmGeneratorExpression \
|
|
|
|
cmGeneratorExpressionContext \
|
|
|
|
cmGeneratorExpressionDAGChecker \
|
|
|
|
cmGeneratorExpressionEvaluationFile \
|
|
|
|
cmGeneratorExpressionEvaluator \
|
|
|
|
cmGeneratorExpressionLexer \
|
|
|
|
cmGeneratorExpressionNode \
|
|
|
|
cmGeneratorExpressionParser \
|
|
|
|
cmGeneratorTarget \
|
2016-10-19 20:30:58 +00:00
|
|
|
cmGetCMakePropertyCommand \
|
|
|
|
cmGetDirectoryPropertyCommand \
|
|
|
|
cmGetFilenameComponentCommand \
|
|
|
|
cmGetPropertyCommand \
|
|
|
|
cmGetSourceFilePropertyCommand \
|
|
|
|
cmGetTargetPropertyCommand \
|
|
|
|
cmGetTestPropertyCommand \
|
2016-10-19 21:19:41 +00:00
|
|
|
cmGlobalCommonGenerator \
|
|
|
|
cmGlobalGenerator \
|
|
|
|
cmGlobalUnixMakefileGenerator3 \
|
2016-10-19 20:30:58 +00:00
|
|
|
cmHexFileConverter \
|
|
|
|
cmIfCommand \
|
|
|
|
cmIncludeCommand \
|
2017-06-22 07:53:42 +00:00
|
|
|
cmIncludeGuardCommand \
|
2016-10-19 20:30:58 +00:00
|
|
|
cmIncludeDirectoryCommand \
|
|
|
|
cmIncludeRegularExpressionCommand \
|
|
|
|
cmInstallCommand \
|
|
|
|
cmInstallCommandArguments \
|
2016-10-19 21:19:41 +00:00
|
|
|
cmInstallDirectoryGenerator \
|
|
|
|
cmInstallExportGenerator \
|
2016-10-19 20:30:58 +00:00
|
|
|
cmInstallFilesCommand \
|
2016-10-19 21:19:41 +00:00
|
|
|
cmInstallFilesGenerator \
|
|
|
|
cmInstallGenerator \
|
|
|
|
cmInstallScriptGenerator \
|
|
|
|
cmInstallTargetGenerator \
|
2016-10-19 20:30:58 +00:00
|
|
|
cmInstallTargetsCommand \
|
2016-10-19 21:19:41 +00:00
|
|
|
cmInstalledFile \
|
2016-10-19 20:30:58 +00:00
|
|
|
cmLinkDirectoriesCommand \
|
2016-10-19 21:19:41 +00:00
|
|
|
cmLinkLineComputer \
|
2016-10-19 20:30:58 +00:00
|
|
|
cmListCommand \
|
2016-10-19 21:19:41 +00:00
|
|
|
cmListFileCache \
|
|
|
|
cmLocalCommonGenerator \
|
|
|
|
cmLocalGenerator \
|
|
|
|
cmLocalUnixMakefileGenerator3 \
|
|
|
|
cmMSVC60LinkLineComputer \
|
2016-10-19 20:30:58 +00:00
|
|
|
cmMacroCommand \
|
|
|
|
cmMakeDirectoryCommand \
|
2016-10-19 21:19:41 +00:00
|
|
|
cmMakefile \
|
|
|
|
cmMakefileExecutableTargetGenerator \
|
|
|
|
cmMakefileLibraryTargetGenerator \
|
|
|
|
cmMakefileTargetGenerator \
|
|
|
|
cmMakefileUtilityTargetGenerator \
|
2016-10-19 20:30:58 +00:00
|
|
|
cmMarkAsAdvancedCommand \
|
|
|
|
cmMathCommand \
|
|
|
|
cmMessageCommand \
|
2016-10-19 21:19:41 +00:00
|
|
|
cmMessenger \
|
|
|
|
cmNewLineStyle \
|
|
|
|
cmOSXBundleGenerator \
|
2016-10-19 20:30:58 +00:00
|
|
|
cmOptionCommand \
|
2016-10-19 21:19:41 +00:00
|
|
|
cmOrderDirectories \
|
|
|
|
cmOutputConverter \
|
|
|
|
cmParseArgumentsCommand \
|
|
|
|
cmPathLabel \
|
|
|
|
cmPolicies \
|
2016-11-01 18:04:20 +00:00
|
|
|
cmProcessOutput \
|
2016-10-19 20:30:58 +00:00
|
|
|
cmProjectCommand \
|
2016-10-19 21:19:41 +00:00
|
|
|
cmProperty \
|
|
|
|
cmPropertyDefinition \
|
|
|
|
cmPropertyDefinitionMap \
|
|
|
|
cmPropertyMap \
|
2016-10-19 20:30:58 +00:00
|
|
|
cmReturnCommand \
|
2016-10-19 21:19:41 +00:00
|
|
|
cmRulePlaceholderExpander \
|
|
|
|
cmScriptGenerator \
|
|
|
|
cmSearchPath \
|
2016-10-19 20:30:58 +00:00
|
|
|
cmSeparateArgumentsCommand \
|
|
|
|
cmSetCommand \
|
|
|
|
cmSetDirectoryPropertiesCommand \
|
|
|
|
cmSetPropertyCommand \
|
|
|
|
cmSetSourceFilesPropertiesCommand \
|
|
|
|
cmSetTargetPropertiesCommand \
|
|
|
|
cmSetTestsPropertiesCommand \
|
|
|
|
cmSiteNameCommand \
|
2016-10-19 21:19:41 +00:00
|
|
|
cmSourceFile \
|
|
|
|
cmSourceFileLocation \
|
|
|
|
cmState \
|
|
|
|
cmStateDirectory \
|
|
|
|
cmStateSnapshot \
|
2016-10-19 20:30:58 +00:00
|
|
|
cmStringCommand \
|
|
|
|
cmSubdirCommand \
|
2016-10-19 21:19:41 +00:00
|
|
|
cmSystemTools \
|
|
|
|
cmTarget \
|
2017-08-18 19:48:14 +00:00
|
|
|
cmTargetCompileDefinitionsCommand \
|
|
|
|
cmTargetCompileFeaturesCommand \
|
|
|
|
cmTargetCompileOptionsCommand \
|
|
|
|
cmTargetIncludeDirectoriesCommand \
|
2016-10-19 20:30:58 +00:00
|
|
|
cmTargetLinkLibrariesCommand \
|
2017-08-18 19:48:14 +00:00
|
|
|
cmTargetPropCommandBase \
|
2016-10-19 21:19:41 +00:00
|
|
|
cmTargetPropertyComputer \
|
2017-08-18 19:48:14 +00:00
|
|
|
cmTargetSourcesCommand \
|
2016-10-19 21:19:41 +00:00
|
|
|
cmTest \
|
|
|
|
cmTestGenerator \
|
2016-10-19 20:30:58 +00:00
|
|
|
cmTimestamp \
|
|
|
|
cmTryCompileCommand \
|
|
|
|
cmTryRunCommand \
|
2016-11-27 19:38:57 +00:00
|
|
|
cmUnexpectedCommand \
|
2016-10-19 20:30:58 +00:00
|
|
|
cmUnsetCommand \
|
2017-11-30 16:11:54 +00:00
|
|
|
cmUVHandlePtr \
|
2016-10-19 21:19:41 +00:00
|
|
|
cmVersion \
|
2016-10-19 20:30:58 +00:00
|
|
|
cmWhileCommand \
|
2017-03-01 18:40:22 +00:00
|
|
|
cmWorkingDirectory \
|
2016-10-19 21:19:41 +00:00
|
|
|
cmake \
|
|
|
|
cmakemain \
|
|
|
|
cmcmd \
|
2006-03-22 14:58:11 +00:00
|
|
|
"
|
2003-03-27 20:29:38 +00:00
|
|
|
|
2006-01-31 23:50:16 +00:00
|
|
|
if ${cmake_system_mingw}; then
|
|
|
|
CMAKE_CXX_SOURCES="${CMAKE_CXX_SOURCES}\
|
|
|
|
cmGlobalMSYSMakefileGenerator \
|
2013-10-18 20:22:45 +00:00
|
|
|
cmGlobalMinGWMakefileGenerator"
|
2006-01-31 23:50:16 +00:00
|
|
|
fi
|
|
|
|
|
2017-05-11 19:53:14 +00:00
|
|
|
LexerParser_CXX_SOURCES="\
|
|
|
|
cmCommandArgumentLexer \
|
|
|
|
cmCommandArgumentParser \
|
|
|
|
cmExprLexer \
|
|
|
|
cmExprParser \
|
|
|
|
"
|
|
|
|
|
|
|
|
LexerParser_C_SOURCES="\
|
|
|
|
cmListFileLexer \
|
|
|
|
"
|
2003-12-08 19:11:58 +00:00
|
|
|
|
2006-01-31 23:50:16 +00:00
|
|
|
if ${cmake_system_mingw}; then
|
|
|
|
KWSYS_C_SOURCES="\
|
2013-11-25 16:30:52 +00:00
|
|
|
EncodingC \
|
2006-09-21 17:47:54 +00:00
|
|
|
ProcessWin32 \
|
2008-01-17 15:35:32 +00:00
|
|
|
String \
|
2015-02-05 21:29:59 +00:00
|
|
|
System \
|
|
|
|
Terminal"
|
2006-01-31 23:50:16 +00:00
|
|
|
else
|
|
|
|
KWSYS_C_SOURCES="\
|
2013-11-25 16:30:52 +00:00
|
|
|
EncodingC \
|
2006-09-21 17:47:54 +00:00
|
|
|
ProcessUNIX \
|
2008-01-17 15:35:32 +00:00
|
|
|
String \
|
2015-02-05 21:29:59 +00:00
|
|
|
System \
|
|
|
|
Terminal"
|
2006-01-31 23:50:16 +00:00
|
|
|
fi
|
2003-07-07 21:52:53 +00:00
|
|
|
|
|
|
|
KWSYS_CXX_SOURCES="\
|
2003-06-23 12:58:58 +00:00
|
|
|
Directory \
|
2013-11-25 16:30:52 +00:00
|
|
|
EncodingCXX \
|
2014-03-07 05:55:07 +00:00
|
|
|
FStream \
|
2005-10-18 18:08:55 +00:00
|
|
|
Glob \
|
2003-06-23 12:58:58 +00:00
|
|
|
RegularExpression \
|
|
|
|
SystemTools"
|
|
|
|
|
|
|
|
KWSYS_FILES="\
|
|
|
|
Directory.hxx \
|
2013-11-25 16:30:52 +00:00
|
|
|
Encoding.h \
|
|
|
|
Encoding.hxx \
|
|
|
|
FStream.hxx \
|
2005-10-18 18:08:55 +00:00
|
|
|
Glob.hxx \
|
2003-06-23 12:58:58 +00:00
|
|
|
Process.h \
|
|
|
|
RegularExpression.hxx \
|
2008-01-17 15:35:32 +00:00
|
|
|
String.h \
|
2006-02-07 15:11:40 +00:00
|
|
|
String.hxx \
|
2006-09-21 17:47:54 +00:00
|
|
|
System.h \
|
2015-02-05 21:29:59 +00:00
|
|
|
SystemTools.hxx \
|
|
|
|
Terminal.h"
|
2003-06-23 12:58:58 +00:00
|
|
|
|
2017-09-13 18:33:38 +00:00
|
|
|
if ${cmake_system_mingw}; then
|
|
|
|
LIBUV_C_SOURCES="\
|
|
|
|
src/fs-poll.c \
|
|
|
|
src/inet.c \
|
|
|
|
src/threadpool.c \
|
|
|
|
src/uv-common.c \
|
|
|
|
src/win/async.c \
|
|
|
|
src/win/core.c \
|
|
|
|
src/win/detect-wakeup.c \
|
|
|
|
src/win/dl.c \
|
|
|
|
src/win/error.c \
|
|
|
|
src/win/fs-event.c \
|
|
|
|
src/win/fs.c \
|
|
|
|
src/win/getaddrinfo.c \
|
|
|
|
src/win/getnameinfo.c \
|
|
|
|
src/win/handle.c \
|
|
|
|
src/win/loop-watcher.c \
|
|
|
|
src/win/pipe.c \
|
|
|
|
src/win/poll.c \
|
|
|
|
src/win/process-stdio.c \
|
|
|
|
src/win/process.c \
|
|
|
|
src/win/req.c \
|
|
|
|
src/win/signal.c \
|
|
|
|
src/win/stream.c \
|
|
|
|
src/win/tcp.c \
|
|
|
|
src/win/thread.c \
|
|
|
|
src/win/timer.c \
|
|
|
|
src/win/tty.c \
|
|
|
|
src/win/udp.c \
|
|
|
|
src/win/util.c \
|
|
|
|
src/win/winapi.c \
|
|
|
|
src/win/winsock.c \
|
|
|
|
"
|
|
|
|
else
|
|
|
|
LIBUV_C_SOURCES="\
|
|
|
|
src/uv-common.c \
|
|
|
|
src/unix/cmake-bootstrap.c \
|
|
|
|
src/unix/core.c \
|
|
|
|
src/unix/fs.c \
|
|
|
|
src/unix/loop.c \
|
|
|
|
src/unix/loop-watcher.c \
|
|
|
|
src/unix/no-fsevents.c \
|
|
|
|
src/unix/pipe.c \
|
|
|
|
src/unix/poll.c \
|
|
|
|
src/unix/posix-hrtime.c \
|
|
|
|
src/unix/posix-poll.c \
|
|
|
|
src/unix/process.c \
|
|
|
|
src/unix/signal.c \
|
|
|
|
src/unix/stream.c \
|
|
|
|
src/unix/timer.c \
|
|
|
|
"
|
|
|
|
fi
|
|
|
|
|
2003-05-15 13:35:16 +00:00
|
|
|
# Display CMake bootstrap usage
|
2003-03-27 20:29:38 +00:00
|
|
|
cmake_usage()
|
|
|
|
{
|
2009-06-10 17:04:25 +00:00
|
|
|
echo '
|
2011-12-16 16:29:26 +00:00
|
|
|
Usage: '"$0"' [<options>...] [-- <cmake-options>...]
|
2003-03-27 20:29:38 +00:00
|
|
|
Options: [defaults in brackets after descriptions]
|
|
|
|
Configuration:
|
|
|
|
--help print this message
|
2003-05-15 13:35:16 +00:00
|
|
|
--version only print version information
|
2003-03-27 20:29:38 +00:00
|
|
|
--verbose display more information
|
2003-05-15 13:35:16 +00:00
|
|
|
--parallel=n bootstrap cmake in parallel, where n is
|
|
|
|
number of nodes [1]
|
2011-01-17 13:57:38 +00:00
|
|
|
--enable-ccache Enable ccache when building cmake
|
2011-01-10 14:38:42 +00:00
|
|
|
--init=FILE load FILE as script to populate cache
|
2011-01-10 14:32:09 +00:00
|
|
|
--system-libs use all system-installed third-party libraries
|
2006-10-19 19:17:58 +00:00
|
|
|
(for use only by package maintainers)
|
2011-01-10 14:32:09 +00:00
|
|
|
--no-system-libs use all cmake-provided third-party libraries
|
2006-10-19 19:17:58 +00:00
|
|
|
(default)
|
2011-01-10 14:32:09 +00:00
|
|
|
--system-curl use system-installed curl library
|
|
|
|
--no-system-curl use cmake-provided curl library (default)
|
|
|
|
--system-expat use system-installed expat library
|
|
|
|
--no-system-expat use cmake-provided expat library (default)
|
2015-02-20 13:28:03 +00:00
|
|
|
--system-jsoncpp use system-installed jsoncpp library
|
|
|
|
--no-system-jsoncpp use cmake-provided jsoncpp library (default)
|
2011-01-10 14:32:09 +00:00
|
|
|
--system-zlib use system-installed zlib library
|
|
|
|
--no-system-zlib use cmake-provided zlib library (default)
|
|
|
|
--system-bzip2 use system-installed bzip2 library
|
|
|
|
--no-system-bzip2 use cmake-provided bzip2 library (default)
|
2016-01-13 19:27:02 +00:00
|
|
|
--system-liblzma use system-installed liblzma library
|
|
|
|
--no-system-liblzma use cmake-provided liblzma library (default)
|
2011-01-10 14:32:09 +00:00
|
|
|
--system-libarchive use system-installed libarchive library
|
|
|
|
--no-system-libarchive use cmake-provided libarchive library (default)
|
2016-11-03 17:31:33 +00:00
|
|
|
--system-librhash use system-installed librhash library
|
|
|
|
--no-system-librhash use cmake-provided librhash library (default)
|
2011-01-10 14:32:09 +00:00
|
|
|
|
2008-02-13 19:47:03 +00: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 13:35:16 +00:00
|
|
|
|
2013-09-17 20:08:05 +00:00
|
|
|
--sphinx-man build man pages with Sphinx
|
|
|
|
--sphinx-html build html help with Sphinx
|
2015-02-07 22:23:28 +00:00
|
|
|
--sphinx-qthelp build qch help with Sphinx
|
2013-09-17 20:08:05 +00:00
|
|
|
--sphinx-build=<sb> use <sb> as the sphinx-build executable
|
2015-04-30 13:30:14 +00:00
|
|
|
--sphinx-flags=<flags> pass <flags> to sphinx-build executable
|
2013-09-17 20:08:05 +00:00
|
|
|
|
2003-03-27 20:29:38 +00:00
|
|
|
Directory and file names:
|
2003-07-21 20:38:53 +00:00
|
|
|
--prefix=PREFIX install files in tree rooted at PREFIX
|
2013-08-26 15:50:08 +00:00
|
|
|
['"${cmake_default_prefix}"']
|
2016-05-27 14:03:43 +00:00
|
|
|
--bindir=DIR install binaries in PREFIX/DIR
|
|
|
|
['"${cmake_bin_dir_default}"']
|
2003-07-21 20:38:53 +00:00
|
|
|
--datadir=DIR install data files in PREFIX/DIR
|
2013-09-26 18:13:38 +00:00
|
|
|
['"${cmake_data_dir_default}"']
|
2003-07-21 20:38:53 +00:00
|
|
|
--docdir=DIR install documentation files in PREFIX/DIR
|
2013-09-26 18:13:38 +00:00
|
|
|
['"${cmake_doc_dir_default}"']
|
2003-07-21 20:38:53 +00:00
|
|
|
--mandir=DIR install man pages files in PREFIX/DIR/manN
|
2013-09-26 18:13:38 +00:00
|
|
|
['"${cmake_man_dir_default}"']
|
2015-12-21 15:02:11 +00:00
|
|
|
--xdgdatadir=DIR install XDG specific files in PREFIX/DIR
|
|
|
|
['"${cmake_xdgdata_dir_default}"']
|
2009-06-10 17:04:25 +00:00
|
|
|
'
|
2003-03-27 20:29:38 +00:00
|
|
|
exit 10
|
|
|
|
}
|
|
|
|
|
2003-05-15 13:35:16 +00:00
|
|
|
# Display CMake bootstrap usage
|
2008-01-23 22:43:08 +00:00
|
|
|
cmake_version_display()
|
2003-05-15 13:35:16 +00:00
|
|
|
{
|
2013-11-12 20:56:36 +00:00
|
|
|
echo "CMake ${cmake_version}, ${cmake_copyright}"
|
2003-05-15 13:35:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Display CMake bootstrap error, display the log file and exit
|
2003-05-14 13:19:12 +00:00
|
|
|
cmake_error()
|
|
|
|
{
|
2003-12-23 16:03:38 +00:00
|
|
|
res=$1
|
|
|
|
shift 1
|
2003-03-27 20:29:38 +00:00
|
|
|
echo "---------------------------------------------"
|
2012-07-07 17:57:40 +00:00
|
|
|
echo "Error when bootstrapping CMake:"
|
2003-05-14 13:19:12 +00:00
|
|
|
echo "$*"
|
|
|
|
echo "---------------------------------------------"
|
|
|
|
if [ -f cmake_bootstrap.log ]; then
|
2003-12-23 16:03:38 +00:00
|
|
|
echo "Log of errors: `pwd`/cmake_bootstrap.log"
|
|
|
|
#cat cmake_bootstrap.log
|
2003-05-14 13:19:12 +00:00
|
|
|
echo "---------------------------------------------"
|
|
|
|
fi
|
2003-12-23 16:03:38 +00:00
|
|
|
exit ${res}
|
2003-05-14 13:19:12 +00:00
|
|
|
}
|
2003-03-27 20:29:38 +00:00
|
|
|
|
2015-12-18 14:57:55 +00:00
|
|
|
cmake_generate_file ()
|
|
|
|
{
|
|
|
|
OUTFILE="$1"
|
|
|
|
CONTENT="$2"
|
|
|
|
echo "$CONTENT" > "$OUTFILE.tmp"
|
|
|
|
if "${_diff}" "$OUTFILE.tmp" "$OUTFILE" > /dev/null 2> /dev/null ; then
|
|
|
|
rm -f "$OUTFILE.tmp"
|
|
|
|
else
|
|
|
|
mv -f "$OUTFILE.tmp" "$OUTFILE"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2003-06-21 15:57:13 +00:00
|
|
|
# Replace KWSYS_NAMESPACE with cmsys
|
|
|
|
cmake_replace_string ()
|
|
|
|
{
|
|
|
|
INFILE="$1"
|
|
|
|
OUTFILE="$2"
|
|
|
|
SEARCHFOR="$3"
|
|
|
|
REPLACEWITH="$4"
|
2009-06-10 17:04:25 +00:00
|
|
|
if [ -f "${INFILE}" ] || ${cmake_system_openvms}; then
|
2017-06-07 17:16:42 +00:00
|
|
|
sed "s/\@${SEARCHFOR}\@/${REPLACEWITH}/g" "${INFILE}" > "${OUTFILE}${_tmp}"
|
2009-06-10 17:04:25 +00:00
|
|
|
if [ -f "${OUTFILE}${_tmp}" ]; then
|
|
|
|
if "${_diff}" "${OUTFILE}" "${OUTFILE}${_tmp}" > /dev/null 2> /dev/null ; then
|
2003-06-21 15:57:13 +00:00
|
|
|
#echo "Files are the same"
|
2009-06-10 17:04:25 +00:00
|
|
|
rm -f "${OUTFILE}${_tmp}"
|
2003-06-21 15:57:13 +00:00
|
|
|
else
|
2009-06-10 17:04:25 +00:00
|
|
|
mv -f "${OUTFILE}${_tmp}" "${OUTFILE}"
|
2003-06-21 15:57:13 +00:00
|
|
|
fi
|
|
|
|
fi
|
2003-06-23 12:58:58 +00:00
|
|
|
else
|
2003-12-23 16:03:38 +00:00
|
|
|
cmake_error 1 "Cannot find file ${INFILE}"
|
2003-06-21 15:57:13 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2003-12-23 16:03:38 +00:00
|
|
|
cmake_kwsys_config_replace_string ()
|
|
|
|
{
|
|
|
|
INFILE="$1"
|
|
|
|
OUTFILE="$2"
|
|
|
|
shift 2
|
|
|
|
APPEND="$*"
|
2009-06-10 17:04:25 +00:00
|
|
|
if [ -f "${INFILE}" ] || ${cmake_system_openvms}; then
|
|
|
|
echo "${APPEND}" > "${OUTFILE}${_tmp}"
|
2017-06-07 17:16:42 +00:00
|
|
|
sed "/./ {s/\@KWSYS_NAMESPACE\@/cmsys/g;
|
|
|
|
s/@KWSYS_BUILD_SHARED@/${KWSYS_BUILD_SHARED}/g;
|
|
|
|
s/@KWSYS_LFS_AVAILABLE@/${KWSYS_LFS_AVAILABLE}/g;
|
|
|
|
s/@KWSYS_LFS_REQUESTED@/${KWSYS_LFS_REQUESTED}/g;
|
|
|
|
s/@KWSYS_NAME_IS_KWSYS@/${KWSYS_NAME_IS_KWSYS}/g;
|
|
|
|
s/@KWSYS_STL_HAS_WSTRING@/${KWSYS_STL_HAS_WSTRING}/g;
|
|
|
|
s/@KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H@/${KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H}/g;
|
|
|
|
}" "${INFILE}" >> "${OUTFILE}${_tmp}"
|
2009-06-10 17:04:25 +00:00
|
|
|
if [ -f "${OUTFILE}${_tmp}" ]; then
|
|
|
|
if "${_diff}" "${OUTFILE}" "${OUTFILE}${_tmp}" > /dev/null 2> /dev/null ; then
|
2003-12-23 16:03:38 +00:00
|
|
|
#echo "Files are the same"
|
2009-06-10 17:04:25 +00:00
|
|
|
rm -f "${OUTFILE}${_tmp}"
|
2003-12-23 16:03:38 +00:00
|
|
|
else
|
2009-06-10 17:04:25 +00:00
|
|
|
mv -f "${OUTFILE}${_tmp}" "${OUTFILE}"
|
2003-12-23 16:03:38 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
cmake_error 2 "Cannot find file ${INFILE}"
|
|
|
|
fi
|
|
|
|
}
|
2003-05-15 13:35:16 +00:00
|
|
|
# Write string into a file
|
2003-03-27 20:29:38 +00:00
|
|
|
cmake_report ()
|
|
|
|
{
|
|
|
|
FILE=$1
|
|
|
|
shift
|
|
|
|
echo "$*" >> ${FILE}
|
|
|
|
}
|
|
|
|
|
2003-05-15 13:35:16 +00:00
|
|
|
# Escape spaces in strings
|
2003-03-27 20:29:38 +00:00
|
|
|
cmake_escape ()
|
|
|
|
{
|
|
|
|
echo $1 | sed "s/ /\\\\ /g"
|
|
|
|
}
|
|
|
|
|
2017-09-13 18:33:38 +00:00
|
|
|
# Encode object file names.
|
|
|
|
cmake_obj ()
|
|
|
|
{
|
|
|
|
echo $1 | sed 's/\//-/g' | sed 's/$/\.o/'
|
|
|
|
}
|
|
|
|
|
2012-05-08 13:43:19 +00:00
|
|
|
# Strip prefix from argument
|
|
|
|
cmake_arg ()
|
|
|
|
{
|
|
|
|
echo "$1" | sed "s/^${2-[^=]*=}//"
|
|
|
|
}
|
|
|
|
|
2003-05-15 13:35:16 +00:00
|
|
|
# Write message to the log
|
2003-03-27 20:29:38 +00:00
|
|
|
cmake_log ()
|
|
|
|
{
|
|
|
|
echo "$*" >> cmake_bootstrap.log
|
|
|
|
}
|
|
|
|
|
2003-05-15 13:35:16 +00:00
|
|
|
# Return temp file
|
2003-03-27 20:29:38 +00:00
|
|
|
cmake_tmp_file ()
|
|
|
|
{
|
2009-06-10 17:04:25 +00:00
|
|
|
echo "cmake_bootstrap_$$_test"
|
2003-03-27 20:29:38 +00:00
|
|
|
}
|
|
|
|
|
2003-05-15 13:35:16 +00: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 20:29:38 +00: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 13:56:33 +00:00
|
|
|
echo "Line: ${COMPILER} ${FLAGS} ${TESTFILE} -o ${TMPFILE}"
|
|
|
|
echo "---------- file -----------------------"
|
2005-04-13 18:13:35 +00:00
|
|
|
cat "${TESTFILE}"
|
2003-06-30 13:56:33 +00:00
|
|
|
echo "------------------------------------------"
|
2003-03-27 20:29:38 +00:00
|
|
|
"${COMPILER}" ${FLAGS} "${TESTFILE}" -o "${TMPFILE}"
|
|
|
|
RES=$?
|
|
|
|
if [ "${RES}" -ne "0" ]; then
|
2003-12-23 16:03:38 +00:00
|
|
|
echo "Test failed to compile"
|
|
|
|
return 1
|
2003-03-27 20:29:38 +00:00
|
|
|
fi
|
|
|
|
if [ ! -f "${TMPFILE}" ] && [ ! -f "${TMPFILE}.exe" ]; then
|
2003-12-23 16:03:38 +00:00
|
|
|
echo "Test failed to produce executable"
|
2003-03-27 20:29:38 +00:00
|
|
|
return 2
|
|
|
|
fi
|
|
|
|
./${TMPFILE}
|
|
|
|
RES=$?
|
|
|
|
rm -f "${TMPFILE}"
|
|
|
|
if [ "${RES}" -ne "0" ]; then
|
2003-12-23 16:03:38 +00:00
|
|
|
echo "Test produced non-zero return code"
|
2003-03-27 20:29:38 +00:00
|
|
|
return 3
|
|
|
|
fi
|
2015-10-06 01:42:19 +00:00
|
|
|
echo "Test succeeded"
|
2003-03-27 20:29:38 +00:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2003-05-15 13:35:16 +00:00
|
|
|
# Run a make test. First argument is the make interpreter.
|
2003-03-27 20:29:38 +00:00
|
|
|
cmake_try_make ()
|
|
|
|
{
|
2003-08-22 13:52:05 +00:00
|
|
|
MAKE_PROC="$1"
|
|
|
|
MAKE_FLAGS="$2"
|
2003-03-27 20:29:38 +00:00
|
|
|
echo "Try: ${MAKE_PROC}"
|
2003-08-22 13:52:05 +00:00
|
|
|
"${MAKE_PROC}" ${MAKE_FLAGS}
|
2003-03-27 20:29:38 +00:00
|
|
|
RES=$?
|
|
|
|
if [ "${RES}" -ne "0" ]; then
|
2003-08-22 13:52:05 +00:00
|
|
|
echo "${MAKE_PROC} does not work"
|
|
|
|
return 1
|
2003-03-27 20:29:38 +00: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 13:35:16 +00:00
|
|
|
# Parse arguments
|
2003-05-14 13:19:12 +00:00
|
|
|
cmake_verbose=
|
2003-05-14 13:27:39 +00:00
|
|
|
cmake_parallel_make=
|
2011-01-17 13:57:38 +00:00
|
|
|
cmake_ccache_enabled=
|
2006-02-17 01:13:54 +00:00
|
|
|
cmake_prefix_dir="${cmake_default_prefix}"
|
2011-12-16 15:56:47 +00:00
|
|
|
while test $# != 0; do
|
|
|
|
case "$1" in
|
2012-05-08 13:43:19 +00:00
|
|
|
--prefix=*) dir=`cmake_arg "$1"`
|
|
|
|
cmake_prefix_dir=`cmake_fix_slashes "$dir"` ;;
|
|
|
|
--parallel=*) cmake_parallel_make=`cmake_arg "$1"` ;;
|
2016-05-27 14:03:43 +00:00
|
|
|
--bindir=*) cmake_bin_dir=`cmake_arg "$1"` ;;
|
2012-05-08 13:43:19 +00:00
|
|
|
--datadir=*) cmake_data_dir=`cmake_arg "$1"` ;;
|
|
|
|
--docdir=*) cmake_doc_dir=`cmake_arg "$1"` ;;
|
|
|
|
--mandir=*) cmake_man_dir=`cmake_arg "$1"` ;;
|
2015-12-21 15:02:11 +00:00
|
|
|
--xdgdatadir=*) cmake_xdgdata_dir=`cmake_arg "$1"` ;;
|
2012-05-08 13:43:19 +00:00
|
|
|
--init=*) cmake_init_file=`cmake_arg "$1"` ;;
|
2011-12-16 15:56:47 +00:00
|
|
|
--system-libs) cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARIES=1" ;;
|
|
|
|
--no-system-libs) cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARIES=0" ;;
|
2016-11-03 17:31:33 +00:00
|
|
|
--system-bzip2|--system-curl|--system-expat|--system-jsoncpp|--system-libarchive|--system-librhash|--system-zlib|--system-liblzma)
|
2012-05-08 13:43:19 +00:00
|
|
|
lib=`cmake_arg "$1" "--system-"`
|
|
|
|
cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARY_`cmake_toupper $lib`=1" ;;
|
2016-11-03 17:31:33 +00:00
|
|
|
--no-system-bzip2|--no-system-curl|--no-system-expat|--no-system-jsoncpp|--no-system-libarchive|--no-system-librhash|--no-system-zlib|--no-system-liblzma)
|
2012-05-08 13:43:19 +00:00
|
|
|
lib=`cmake_arg "$1" "--no-system-"`
|
|
|
|
cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARY_`cmake_toupper $lib`=0" ;;
|
2011-12-16 15:56:47 +00:00
|
|
|
--qt-gui) cmake_bootstrap_qt_gui="1" ;;
|
|
|
|
--no-qt-gui) cmake_bootstrap_qt_gui="0" ;;
|
2012-05-08 13:43:19 +00:00
|
|
|
--qt-qmake=*) cmake_bootstrap_qt_qmake=`cmake_arg "$1"` ;;
|
2013-09-17 20:08:05 +00:00
|
|
|
--sphinx-man) cmake_sphinx_man="1" ;;
|
|
|
|
--sphinx-html) cmake_sphinx_html="1" ;;
|
2015-02-07 22:23:28 +00:00
|
|
|
--sphinx-qthelp) cmake_sphinx_qthelp="1" ;;
|
2013-09-17 20:08:05 +00:00
|
|
|
--sphinx-build=*) cmake_sphinx_build=`cmake_arg "$1"` ;;
|
2015-04-30 13:30:14 +00:00
|
|
|
--sphinx-flags=*) cmake_sphinx_flags=`cmake_arg "$1"` ;;
|
2011-12-16 15:56:47 +00:00
|
|
|
--help) cmake_usage ;;
|
|
|
|
--version) cmake_version_display ; exit 2 ;;
|
|
|
|
--verbose) cmake_verbose=TRUE ;;
|
|
|
|
--enable-ccache) cmake_ccache_enabled=TRUE ;;
|
2018-03-20 05:34:42 +00:00
|
|
|
CC=*) CC=`cmake_arg "$1"` ;;
|
|
|
|
CXX=*) CXX=`cmake_arg "$1"` ;;
|
|
|
|
CFLAGS=*) CFLAGS=`cmake_arg "$1"` ;;
|
|
|
|
CXXFLAGS=*) CXXFLAGS=`cmake_arg "$1"` ;;
|
|
|
|
LDFLAGS=*) LDFLAGS=`cmake_arg "$1"` ;;
|
2011-12-16 16:29:26 +00:00
|
|
|
--) shift; break ;;
|
2011-12-16 15:56:47 +00:00
|
|
|
*) die "Unknown option: $1" ;;
|
|
|
|
esac
|
|
|
|
shift
|
2003-05-14 13:19:12 +00:00
|
|
|
done
|
|
|
|
|
2003-05-15 13:35:16 +00:00
|
|
|
# If verbose, display some information about bootstrap
|
2003-05-14 13:19:12 +00: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 13:27:39 +00:00
|
|
|
if [ "x${cmake_parallel_make}" != "x" ]; then
|
|
|
|
echo "Doing parallel make: ${cmake_parallel_make}"
|
|
|
|
fi
|
|
|
|
echo ""
|
2003-05-14 13:19:12 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "---------------------------------------------"
|
2003-05-15 13:35:16 +00:00
|
|
|
# Get CMake version
|
2008-01-23 22:43:08 +00:00
|
|
|
echo "`cmake_version_display`"
|
2003-05-14 13:19:12 +00:00
|
|
|
|
2004-10-18 15:34:02 +00: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?
|
2009-06-10 17:04:25 +00:00
|
|
|
if [ -d "${cmake_source_dir}/Bootstrap${_cmk}" ]; then
|
|
|
|
cmake_error 10 "Found directory \"${cmake_source_dir}/Bootstrap${_cmk}\".
|
2004-10-18 15:34:02 +00:00
|
|
|
Looks like somebody did bootstrap CMake in the source tree, but now you are
|
2009-06-10 17:04:25 +00:00
|
|
|
trying to do bootstrap in the binary tree. Please remove Bootstrap${_cmk}
|
2004-10-18 15:34:02 +00:00
|
|
|
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-18 22:11:42 +00:00
|
|
|
if [ -f "${cmake_source_dir}/${cmake_problematic_file}" ]; then
|
2004-10-18 15:34:02 +00: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 13:35:16 +00:00
|
|
|
# Make bootstrap directory
|
2003-05-14 13:19:12 +00:00
|
|
|
[ -d "${cmake_bootstrap_dir}" ] || mkdir "${cmake_bootstrap_dir}"
|
|
|
|
if [ ! -d "${cmake_bootstrap_dir}" ]; then
|
2003-12-23 16:03:38 +00:00
|
|
|
cmake_error 3 "Cannot create directory ${cmake_bootstrap_dir} to bootstrap CMake."
|
2003-05-14 13:19:12 +00:00
|
|
|
fi
|
|
|
|
cd "${cmake_bootstrap_dir}"
|
|
|
|
|
2003-06-23 12:58:58 +00:00
|
|
|
[ -d "cmsys" ] || mkdir "cmsys"
|
|
|
|
if [ ! -d "cmsys" ]; then
|
2003-12-23 16:03:38 +00:00
|
|
|
cmake_error 4 "Cannot create directory ${cmake_bootstrap_dir}/cmsys"
|
2003-06-23 12:58:58 +00:00
|
|
|
fi
|
|
|
|
|
2003-05-15 13:35:16 +00:00
|
|
|
# Delete all the bootstrap files
|
2003-05-14 13:19:12 +00:00
|
|
|
rm -f "${cmake_bootstrap_dir}/cmake_bootstrap.log"
|
2009-06-10 17:04:25 +00:00
|
|
|
rm -f "${cmake_bootstrap_dir}/cmConfigure.h${_tmp}"
|
|
|
|
rm -f "${cmake_bootstrap_dir}/cmVersionConfig.h${_tmp}"
|
2003-05-14 13:19:12 +00:00
|
|
|
|
2017-09-13 14:32:56 +00:00
|
|
|
# If building in-source, remove any cmConfigure.h that may
|
|
|
|
# have been created by a previous run of the bootstrap cmake.
|
|
|
|
if [ -n "${cmake_in_source_build}" ]; then
|
|
|
|
rm -f "${cmake_source_dir}/Source/cmConfigure.h"
|
|
|
|
fi
|
|
|
|
|
2003-05-15 13:35:16 +00:00
|
|
|
# If exist compiler flags, set them
|
2003-03-27 20:29:38 +00:00
|
|
|
cmake_c_flags=${CFLAGS}
|
|
|
|
cmake_cxx_flags=${CXXFLAGS}
|
2006-12-05 13:47:06 +00:00
|
|
|
cmake_ld_flags=${LDFLAGS}
|
2003-03-27 20:29:38 +00:00
|
|
|
|
2009-05-27 15:33:37 +00:00
|
|
|
# Add Cygwin-specific flags
|
|
|
|
if ${cmake_system_cygwin}; then
|
|
|
|
cmake_ld_flags="${LDFLAGS} -Wl,--enable-auto-import"
|
|
|
|
fi
|
|
|
|
|
2010-08-17 20:11:33 +00:00
|
|
|
# Add CoreFoundation framework on Darwin
|
2006-04-13 15:00:52 +00:00
|
|
|
if ${cmake_system_darwin}; then
|
2010-08-17 20:11:33 +00:00
|
|
|
cmake_ld_flags="${LDFLAGS} -framework CoreFoundation"
|
2006-04-13 15:00:52 +00:00
|
|
|
fi
|
|
|
|
|
2006-12-04 22:26:41 +00:00
|
|
|
# Add BeOS toolkits...
|
|
|
|
if ${cmake_system_beos}; then
|
|
|
|
cmake_ld_flags="${LDFLAGS} -lroot -lbe"
|
|
|
|
fi
|
|
|
|
|
2008-09-15 21:53:28 +00:00
|
|
|
# Add Haiku toolkits...
|
|
|
|
if ${cmake_system_haiku}; then
|
|
|
|
cmake_ld_flags="${LDFLAGS} -lroot -lbe"
|
|
|
|
fi
|
|
|
|
|
2010-06-30 14:50:28 +00:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Detect known toolchains on some platforms.
|
|
|
|
cmake_toolchains=''
|
|
|
|
case "${cmake_system}" in
|
|
|
|
*AIX*) cmake_toolchains='XL GNU' ;;
|
|
|
|
*CYGWIN*) cmake_toolchains='GNU' ;;
|
2017-05-18 16:29:29 +00:00
|
|
|
*Darwin*) cmake_toolchains='Clang GNU' ;;
|
2010-06-30 14:50:28 +00:00
|
|
|
*Linux*) cmake_toolchains='GNU Clang XL PGI PathScale' ;;
|
|
|
|
*MINGW*) cmake_toolchains='GNU' ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# Toolchain compiler name table.
|
|
|
|
cmake_toolchain_Clang_CC='clang'
|
|
|
|
cmake_toolchain_Clang_CXX='clang++'
|
|
|
|
cmake_toolchain_GNU_CC='gcc'
|
|
|
|
cmake_toolchain_GNU_CXX='g++'
|
|
|
|
cmake_toolchain_PGI_CC='pgcc'
|
|
|
|
cmake_toolchain_PGI_CXX='pgCC'
|
|
|
|
cmake_toolchain_PathScale_CC='pathcc'
|
|
|
|
cmake_toolchain_PathScale_CXX='pathCC'
|
|
|
|
cmake_toolchain_XL_CC='xlc'
|
|
|
|
cmake_toolchain_XL_CXX='xlC'
|
|
|
|
|
|
|
|
cmake_toolchain_try()
|
|
|
|
{
|
|
|
|
tc="$1"
|
|
|
|
TMPFILE=`cmake_tmp_file`
|
|
|
|
|
|
|
|
eval "tc_CC=\${cmake_toolchain_${tc}_CC}"
|
|
|
|
echo 'int main() { return 0; }' > "${TMPFILE}.c"
|
|
|
|
cmake_try_run "$tc_CC" "" "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1
|
|
|
|
tc_result_CC="$?"
|
|
|
|
rm -f "${TMPFILE}.c"
|
|
|
|
test "${tc_result_CC}" = "0" || return 1
|
|
|
|
|
|
|
|
eval "tc_CXX=\${cmake_toolchain_${tc}_CXX}"
|
|
|
|
echo 'int main() { return 0; }' > "${TMPFILE}.cpp"
|
|
|
|
cmake_try_run "$tc_CXX" "" "${TMPFILE}.cpp" >> cmake_bootstrap.log 2>&1
|
|
|
|
tc_result_CXX="$?"
|
|
|
|
rm -f "${TMPFILE}.cpp"
|
|
|
|
test "${tc_result_CXX}" = "0" || return 1
|
|
|
|
|
|
|
|
cmake_toolchain="$tc"
|
|
|
|
}
|
|
|
|
|
|
|
|
cmake_toolchain_detect()
|
|
|
|
{
|
|
|
|
cmake_toolchain=
|
|
|
|
for tc in ${cmake_toolchains}; do
|
|
|
|
echo "Checking for $tc toolchain" >> cmake_bootstrap.log 2>&1
|
|
|
|
cmake_toolchain_try "$tc" &&
|
|
|
|
echo "Found $tc toolchain" &&
|
|
|
|
break
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ -z "${CC}" -a -z "${CXX}" ]; then
|
|
|
|
cmake_toolchain_detect
|
|
|
|
fi
|
|
|
|
|
2017-11-28 16:22:46 +00:00
|
|
|
thread_flags=''
|
2017-11-28 16:24:26 +00:00
|
|
|
case "${cmake_system}" in
|
|
|
|
*AIX*) thread_flags='-pthread' ;;
|
|
|
|
esac
|
2017-11-28 16:22:46 +00:00
|
|
|
|
2010-06-30 14:50:28 +00:00
|
|
|
#-----------------------------------------------------------------------------
|
2003-03-27 20:29:38 +00:00
|
|
|
# Test C compiler
|
|
|
|
cmake_c_compiler=
|
|
|
|
|
2003-05-15 13:35:16 +00:00
|
|
|
# If CC is set, use that for compiler, otherwise use list of known compilers
|
2010-06-30 14:50:28 +00:00
|
|
|
if [ -n "${cmake_toolchain}" ]; then
|
|
|
|
eval cmake_c_compilers="\${cmake_toolchain_${cmake_toolchain}_CC}"
|
|
|
|
elif [ -n "${CC}" ]; then
|
2003-03-27 20:29:38 +00:00
|
|
|
cmake_c_compilers="${CC}"
|
|
|
|
else
|
|
|
|
cmake_c_compilers="${CMAKE_KNOWN_C_COMPILERS}"
|
|
|
|
fi
|
|
|
|
|
2003-05-15 13:35:16 +00:00
|
|
|
# Check if C compiler works
|
2003-03-27 20:29:38 +00:00
|
|
|
TMPFILE=`cmake_tmp_file`
|
2009-06-10 17:04:25 +00:00
|
|
|
echo '
|
2006-07-26 18:10:14 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
# error "The CMAKE_C_COMPILER is set to a C++ compiler"
|
2006-07-26 15:46:22 +00:00
|
|
|
#endif
|
|
|
|
|
2017-11-28 16:24:26 +00:00
|
|
|
#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
|
|
|
|
#error "On AIX with GNU we need the -pthread flag."
|
|
|
|
#endif
|
|
|
|
|
2017-09-17 15:06:13 +00:00
|
|
|
#if defined(__sun) && __STDC_VERSION__ < 199901L
|
|
|
|
#error "On Solaris we need C99."
|
|
|
|
#endif
|
|
|
|
|
2017-08-15 19:59:06 +00:00
|
|
|
#include <stdio.h>
|
2006-07-26 18:10:14 +00:00
|
|
|
|
2006-07-25 15:00:10 +00:00
|
|
|
int main(int argc, char* argv[])
|
2003-03-27 20:29:38 +00:00
|
|
|
{
|
2009-06-10 17:39:40 +00:00
|
|
|
printf("%d%c", (argv != 0), (char)0x0a);
|
2017-08-15 19:59:06 +00:00
|
|
|
return argc - 1;
|
2003-03-27 20:29:38 +00:00
|
|
|
}
|
2009-06-10 17:04:25 +00:00
|
|
|
' > "${TMPFILE}.c"
|
2017-05-14 17:41:55 +00:00
|
|
|
for std in 11 99 90; do
|
2017-11-28 16:22:46 +00:00
|
|
|
std_flags="`cmake_extract_standard_flags \"${cmake_toolchain}\" C \"${std}\"`"
|
2017-08-15 19:59:06 +00:00
|
|
|
for compiler in ${cmake_c_compilers}; do
|
2017-11-28 16:22:46 +00:00
|
|
|
for std_flag in '' $std_flags; do
|
|
|
|
for thread_flag in '' $thread_flags; do
|
|
|
|
echo "Checking whether '${compiler} ${cmake_c_flags} ${std_flag} ${thread_flag}' works." >> cmake_bootstrap.log 2>&1
|
|
|
|
if cmake_try_run "${compiler}" "${cmake_c_flags} ${std_flag} ${thread_flag}" \
|
|
|
|
"${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then
|
|
|
|
cmake_c_compiler="${compiler}"
|
|
|
|
cmake_c_flags="${cmake_c_flags} ${std_flag} ${thread_flag}"
|
|
|
|
break 3
|
|
|
|
fi
|
|
|
|
done
|
2017-08-15 19:59:06 +00:00
|
|
|
done
|
2017-05-14 17:41:55 +00:00
|
|
|
done
|
|
|
|
done
|
2003-03-27 20:29:38 +00:00
|
|
|
rm -f "${TMPFILE}.c"
|
|
|
|
|
|
|
|
if [ -z "${cmake_c_compiler}" ]; then
|
2003-12-23 16:03:38 +00:00
|
|
|
cmake_error 6 "Cannot find appropriate C compiler on this system.
|
2004-10-12 14:57:24 +00:00
|
|
|
Please specify one using environment variable CC.
|
|
|
|
See cmake_bootstrap.log for compilers attempted.
|
|
|
|
"
|
2003-03-27 20:29:38 +00:00
|
|
|
fi
|
|
|
|
echo "C compiler on this system is: ${cmake_c_compiler} ${cmake_c_flags}"
|
|
|
|
|
2010-06-30 14:50:28 +00:00
|
|
|
#-----------------------------------------------------------------------------
|
2003-03-27 20:29:38 +00:00
|
|
|
# Test CXX compiler
|
|
|
|
cmake_cxx_compiler=
|
2003-05-15 13:35:16 +00:00
|
|
|
|
2003-06-30 13:56:33 +00:00
|
|
|
# On Mac OSX, CC is the same as cc, so make sure not to try CC as c++ compiler.
|
|
|
|
|
2003-05-15 13:35:16 +00:00
|
|
|
# If CC is set, use that for compiler, otherwise use list of known compilers
|
2010-06-30 14:50:28 +00:00
|
|
|
if [ -n "${cmake_toolchain}" ]; then
|
|
|
|
eval cmake_cxx_compilers="\${cmake_toolchain_${cmake_toolchain}_CXX}"
|
|
|
|
elif [ -n "${CXX}" ]; then
|
2003-03-27 20:29:38 +00:00
|
|
|
cmake_cxx_compilers="${CXX}"
|
|
|
|
else
|
|
|
|
cmake_cxx_compilers="${CMAKE_KNOWN_CXX_COMPILERS}"
|
|
|
|
fi
|
|
|
|
|
2003-05-15 13:35:16 +00:00
|
|
|
# Check if C++ compiler works
|
2003-03-27 20:29:38 +00:00
|
|
|
TMPFILE=`cmake_tmp_file`
|
2009-06-10 17:04:25 +00:00
|
|
|
echo '
|
2017-08-11 17:19:05 +00:00
|
|
|
#include <iostream>
|
|
|
|
#include <memory>
|
2017-11-30 18:57:12 +00:00
|
|
|
#include <unordered_map>
|
2003-12-23 16:03:38 +00:00
|
|
|
|
2017-08-28 19:15:30 +00:00
|
|
|
#if __cplusplus < 201103L
|
|
|
|
#error "Compiler is not in a mode aware of C++11."
|
|
|
|
#endif
|
|
|
|
|
2017-11-28 16:24:26 +00:00
|
|
|
#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
|
|
|
|
#error "On AIX with GNU we need the -pthread flag."
|
|
|
|
#endif
|
|
|
|
|
2017-08-28 19:15:30 +00:00
|
|
|
#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
|
|
|
|
#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
|
2017-05-14 17:41:55 +00:00
|
|
|
#endif
|
|
|
|
|
2017-08-11 17:19:05 +00:00
|
|
|
class Class
|
2003-06-30 13:56:33 +00:00
|
|
|
{
|
|
|
|
public:
|
2017-08-11 17:19:05 +00:00
|
|
|
int Get() const { return this->Member; }
|
2003-06-30 13:56:33 +00:00
|
|
|
private:
|
2017-08-11 17:19:05 +00:00
|
|
|
int Member = 1;
|
2003-06-30 13:56:33 +00:00
|
|
|
};
|
2003-03-27 20:29:38 +00:00
|
|
|
int main()
|
|
|
|
{
|
2017-08-11 17:19:05 +00:00
|
|
|
auto const c = std::unique_ptr<Class>(new Class);
|
|
|
|
std::cout << c->Get() << std::endl;
|
2003-03-27 20:29:38 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2009-06-10 17:04:25 +00:00
|
|
|
' > "${TMPFILE}.cxx"
|
2017-08-11 17:19:05 +00:00
|
|
|
for std in 17 14 11; do
|
2017-11-28 16:22:46 +00:00
|
|
|
std_flags="`cmake_extract_standard_flags \"${cmake_toolchain}\" CXX \"${std}\"`"
|
2017-08-11 17:19:05 +00:00
|
|
|
for compiler in ${cmake_cxx_compilers}; do
|
2017-11-28 16:22:46 +00:00
|
|
|
for std_flag in '' $std_flags; do
|
|
|
|
for thread_flag in '' $thread_flags; do
|
|
|
|
echo "Checking whether '${compiler} ${cmake_cxx_flags} ${std_flag} ${thread_flag}' works." >> cmake_bootstrap.log 2>&1
|
|
|
|
if cmake_try_run "${compiler}" "${cmake_cxx_flags} ${std_flag} ${thread_flag}" \
|
|
|
|
"${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
|
|
|
|
cmake_cxx_compiler="${compiler}"
|
|
|
|
cmake_cxx_flags="${cmake_cxx_flags} ${std_flag} ${thread_flag} "
|
|
|
|
break 3
|
|
|
|
fi
|
|
|
|
done
|
2017-08-11 17:19:05 +00:00
|
|
|
done
|
2017-05-14 17:41:55 +00:00
|
|
|
done
|
|
|
|
done
|
2003-03-27 20:29:38 +00:00
|
|
|
rm -f "${TMPFILE}.cxx"
|
|
|
|
|
|
|
|
if [ -z "${cmake_cxx_compiler}" ]; then
|
2018-03-14 04:10:54 +00:00
|
|
|
cmake_error 7 "Cannot find a C++ compiler that supports both C++11 and the specified C++ flags.
|
2004-10-12 14:57:24 +00:00
|
|
|
Please specify one using environment variable CXX.
|
2018-03-14 04:10:54 +00:00
|
|
|
The C++ flags are \"$cmake_cxx_flags\".
|
|
|
|
They can be changed using the environment variable CXXFLAGS.
|
2004-10-12 14:57:24 +00:00
|
|
|
See cmake_bootstrap.log for compilers attempted."
|
2003-03-27 20:29:38 +00:00
|
|
|
fi
|
|
|
|
echo "C++ compiler on this system is: ${cmake_cxx_compiler} ${cmake_cxx_flags}"
|
|
|
|
|
2010-06-30 14:50:28 +00:00
|
|
|
#-----------------------------------------------------------------------------
|
2003-03-27 20:29:38 +00:00
|
|
|
# Test Make
|
|
|
|
|
|
|
|
cmake_make_processor=
|
2003-08-22 13:52:05 +00:00
|
|
|
cmake_make_flags=
|
2003-05-15 13:35:16 +00:00
|
|
|
|
|
|
|
# If MAKE is set, use that for make processor, otherwise use list of known make
|
2003-03-27 20:29:38 +00: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}"
|
2009-06-10 17:04:25 +00:00
|
|
|
echo '
|
2003-03-27 20:29:38 +00:00
|
|
|
test: test.c
|
2010-09-10 15:39:43 +00:00
|
|
|
"'"${cmake_c_compiler}"'" '"${cmake_ld_flags} ${cmake_c_flags}"' -o test test.c
|
2009-06-10 17:04:25 +00:00
|
|
|
'>"Makefile"
|
|
|
|
echo '
|
2003-03-27 20:29:38 +00:00
|
|
|
#include <stdio.h>
|
2009-06-10 17:39:40 +00:00
|
|
|
int main(){ printf("1%c", (char)0x0a); return 0; }
|
2009-06-10 17:04:25 +00:00
|
|
|
' > "test.c"
|
2004-09-23 11:53:42 +00:00
|
|
|
cmake_original_make_flags="${cmake_make_flags}"
|
2003-08-22 13:52:05 +00:00
|
|
|
if [ "x${cmake_parallel_make}" != "x" ]; then
|
|
|
|
cmake_make_flags="${cmake_make_flags} -j ${cmake_parallel_make}"
|
|
|
|
fi
|
2003-03-27 20:29:38 +00:00
|
|
|
for a in ${cmake_make_processors}; do
|
2010-04-13 13:28:16 +00:00
|
|
|
if [ -z "${cmake_make_processor}" ] && cmake_try_make "${a}" "${cmake_make_flags}" >> ../cmake_bootstrap.log 2>&1; then
|
2003-03-27 20:29:38 +00:00
|
|
|
cmake_make_processor="${a}"
|
|
|
|
fi
|
|
|
|
done
|
2004-09-23 11:53:42 +00: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
|
2010-04-13 13:28:16 +00:00
|
|
|
if [ -z "${cmake_make_processor}" ] && cmake_try_make "${a}" "${cmake_make_flags}" >> ../cmake_bootstrap.log 2>&1; then
|
2004-09-23 11:53:42 +00:00
|
|
|
cmake_make_processor="${a}"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
fi
|
2003-03-27 20:29:38 +00:00
|
|
|
cd "${cmake_bootstrap_dir}"
|
|
|
|
|
2003-08-11 21:53:10 +00:00
|
|
|
if [ -z "${cmake_make_processor}" ]; then
|
2003-12-23 16:03:38 +00:00
|
|
|
cmake_error 8 "Cannot find appropriate Makefile processor on this system.
|
2003-08-11 21:53:10 +00:00
|
|
|
Please specify one using environment variable MAKE."
|
|
|
|
fi
|
2010-04-13 13:28:16 +00:00
|
|
|
rm -rf "${cmake_bootstrap_dir}/${TMPFILE}"
|
2004-09-23 11:53:42 +00: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 20:29:38 +00:00
|
|
|
|
2003-12-23 16:03:38 +00:00
|
|
|
# Test for kwsys features
|
|
|
|
KWSYS_NAME_IS_KWSYS=0
|
|
|
|
KWSYS_BUILD_SHARED=0
|
2006-08-26 00:52:37 +00:00
|
|
|
KWSYS_LFS_AVAILABLE=0
|
|
|
|
KWSYS_LFS_REQUESTED=0
|
2013-11-25 16:30:52 +00:00
|
|
|
KWSYS_STL_HAS_WSTRING=0
|
2016-07-17 00:22:10 +00:00
|
|
|
KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H=0
|
2012-04-26 14:36:53 +00:00
|
|
|
KWSYS_CXX_HAS_SETENV=0
|
|
|
|
KWSYS_CXX_HAS_UNSETENV=0
|
|
|
|
KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=0
|
2013-06-03 14:34:35 +00:00
|
|
|
KWSYS_CXX_HAS_UTIMENSAT=0
|
|
|
|
KWSYS_CXX_HAS_UTIMES=0
|
2005-03-29 13:20:08 +00:00
|
|
|
|
2012-04-26 14:36:53 +00:00
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
|
|
|
"${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_SETENV" \
|
|
|
|
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
|
|
|
|
KWSYS_CXX_HAS_SETENV=1
|
|
|
|
echo "${cmake_cxx_compiler} has setenv"
|
|
|
|
else
|
|
|
|
echo "${cmake_cxx_compiler} does not have setenv"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
|
|
|
"${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_UNSETENV" \
|
|
|
|
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
|
|
|
|
KWSYS_CXX_HAS_UNSETENV=1
|
|
|
|
echo "${cmake_cxx_compiler} has unsetenv"
|
|
|
|
else
|
|
|
|
echo "${cmake_cxx_compiler} does not have unsetenv"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
|
|
|
"${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H" \
|
|
|
|
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
|
|
|
|
KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=1
|
|
|
|
echo "${cmake_cxx_compiler} has environ in stdlib.h"
|
|
|
|
else
|
|
|
|
echo "${cmake_cxx_compiler} does not have environ in stdlib.h"
|
|
|
|
fi
|
|
|
|
|
2003-12-23 16:03:38 +00:00
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
2015-09-02 14:31:13 +00:00
|
|
|
"${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_WSTRING" \
|
2013-11-25 16:30:52 +00:00
|
|
|
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
|
|
|
|
KWSYS_STL_HAS_WSTRING=1
|
|
|
|
echo "${cmake_cxx_compiler} has stl wstring"
|
|
|
|
else
|
|
|
|
echo "${cmake_cxx_compiler} does not have stl wstring"
|
|
|
|
fi
|
|
|
|
|
2016-07-17 00:22:10 +00:00
|
|
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
|
|
|
"${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H" \
|
|
|
|
"${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
|
|
|
|
KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H=1
|
|
|
|
echo "${cmake_cxx_compiler} has <ext/stdio_filebuf.h>"
|
|
|
|
else
|
|
|
|
echo "${cmake_cxx_compiler} does not have <ext/stdio_filebuf.h>"
|
|
|
|
fi
|
|
|
|
|
2003-06-21 15:57:13 +00:00
|
|
|
# Just to be safe, let us store compiler and flags to the header file
|
|
|
|
|
2003-12-23 16:03:38 +00: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}
|
2017-05-11 19:53:14 +00:00
|
|
|
* LexerParser Sources:
|
|
|
|
* ${LexerParser_CXX_SOURCES} ${LexerParser_C_SOURCES}
|
2003-12-23 16:03:38 +00:00
|
|
|
* kwSys Sources:
|
2012-12-19 14:00:55 +00:00
|
|
|
* ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES}
|
2017-09-13 18:33:38 +00:00
|
|
|
* libuv Sources:
|
|
|
|
* ${LIBUV_C_SOURCES}
|
2003-12-23 16:03:38 +00:00
|
|
|
*/
|
|
|
|
"
|
|
|
|
|
2009-06-10 17:04:25 +00:00
|
|
|
cmake_report cmConfigure.h${_tmp} "${cmake_compiler_settings_comment}"
|
2003-12-23 16:03:38 +00:00
|
|
|
|
2006-02-10 16:19:19 +00:00
|
|
|
# When bootstrapping on MinGW with MSYS we must convert the source
|
|
|
|
# directory to a windows path.
|
|
|
|
if ${cmake_system_mingw}; then
|
2014-06-25 17:32:48 +00:00
|
|
|
CMAKE_BOOTSTRAP_SOURCE_DIR=`cd "${cmake_source_dir}"; pwd -W`
|
2014-06-25 17:34:15 +00:00
|
|
|
CMAKE_BOOTSTRAP_BINARY_DIR=`cd "${cmake_binary_dir}"; pwd -W`
|
2006-02-10 16:19:19 +00:00
|
|
|
else
|
2014-06-25 17:32:48 +00:00
|
|
|
CMAKE_BOOTSTRAP_SOURCE_DIR="${cmake_source_dir}"
|
2014-06-25 17:34:15 +00:00
|
|
|
CMAKE_BOOTSTRAP_BINARY_DIR="${cmake_binary_dir}"
|
2006-02-10 16:19:19 +00:00
|
|
|
fi
|
|
|
|
|
2003-05-15 13:35:16 +00:00
|
|
|
# Write CMake version
|
2009-06-10 17:04:25 +00:00
|
|
|
cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_MAJOR ${cmake_version_major}"
|
|
|
|
cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_MINOR ${cmake_version_minor}"
|
|
|
|
cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_PATCH ${cmake_version_patch}"
|
2010-04-23 13:44:23 +00:00
|
|
|
cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION \"${cmake_version}\""
|
2014-06-25 17:32:48 +00:00
|
|
|
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP_SOURCE_DIR \"${CMAKE_BOOTSTRAP_SOURCE_DIR}\""
|
2014-06-25 17:34:15 +00:00
|
|
|
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP_BINARY_DIR \"${CMAKE_BOOTSTRAP_BINARY_DIR}\""
|
2016-05-27 14:03:43 +00:00
|
|
|
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BIN_DIR \"/bootstrap-not-insalled\""
|
2013-09-26 18:13:38 +00:00
|
|
|
cmake_report cmConfigure.h${_tmp} "#define CMAKE_DATA_DIR \"/bootstrap-not-insalled\""
|
2009-06-10 17:04:25 +00:00
|
|
|
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP"
|
2017-06-02 18:32:58 +00:00
|
|
|
cmake_report cmConfigure.h${_tmp} "#define CM_FALLTHROUGH"
|
2017-04-22 08:09:41 +00:00
|
|
|
cmake_report cmConfigure.h${_tmp} "#define CM_DISABLE_COPY(Class)"
|
2003-06-21 15:57:13 +00:00
|
|
|
|
2009-03-05 20:17:07 +00:00
|
|
|
# Regenerate configured headers
|
|
|
|
for h in Configure VersionConfig; do
|
2009-06-10 17:04:25 +00:00
|
|
|
if "${_diff}" cm${h}.h cm${h}.h${_tmp} > /dev/null 2> /dev/null; then
|
|
|
|
rm -f cm${h}.h${_tmp}
|
2009-03-05 20:17:07 +00:00
|
|
|
else
|
2009-06-10 17:04:25 +00:00
|
|
|
mv -f cm${h}.h${_tmp} cm${h}.h
|
2009-03-05 20:17:07 +00:00
|
|
|
fi
|
|
|
|
done
|
2003-03-27 20:29:38 +00:00
|
|
|
|
2003-06-23 12:58:58 +00:00
|
|
|
# Prepare KWSYS
|
2003-12-23 16:03:38 +00: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}"
|
|
|
|
|
2012-07-07 17:57:40 +00:00
|
|
|
for a in ${KWSYS_FILES}; do
|
2003-06-23 12:58:58 +00:00
|
|
|
cmake_replace_string "${cmake_source_dir}/Source/kwsys/${a}.in" \
|
|
|
|
"${cmake_bootstrap_dir}/cmsys/${a}" KWSYS_NAMESPACE cmsys
|
|
|
|
done
|
2003-12-23 16:03:38 +00:00
|
|
|
|
2015-12-18 14:57:55 +00:00
|
|
|
cmake_generate_file "${cmake_bootstrap_dir}/cmThirdParty.h" ""
|
|
|
|
|
2003-03-27 20:29:38 +00:00
|
|
|
# Generate Makefile
|
2006-03-06 20:41:56 +00:00
|
|
|
dep="cmConfigure.h cmsys/*.hxx cmsys/*.h `cmake_escape \"${cmake_source_dir}\"`/Source/*.h"
|
2003-03-27 20:29:38 +00:00
|
|
|
objs=""
|
2017-05-11 19:53:14 +00:00
|
|
|
for a in ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES} ${LexerParser_CXX_SOURCES} ${LexerParser_C_SOURCES} ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES}; do
|
2003-03-27 20:29:38 +00:00
|
|
|
objs="${objs} ${a}.o"
|
|
|
|
done
|
2017-09-13 18:33:38 +00:00
|
|
|
for a in ${LIBUV_C_SOURCES}; do
|
|
|
|
objs="${objs} uv-`cmake_obj ${a}`"
|
|
|
|
done
|
|
|
|
|
|
|
|
libs=""
|
|
|
|
|
|
|
|
uv_c_flags=""
|
|
|
|
if ${cmake_system_mingw}; then
|
|
|
|
uv_c_flags="${uv_c_flags} -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0600"
|
|
|
|
libs="${libs} -lws2_32 -lpsapi -liphlpapi -lshell32 -luserenv"
|
|
|
|
else
|
|
|
|
uv_c_flags="${uv_c_flags} -DCMAKE_BOOTSTRAP"
|
|
|
|
case "${cmake_system}" in
|
|
|
|
*AIX*)
|
2017-11-28 16:24:26 +00:00
|
|
|
uv_c_flags="${uv_c_flags} -D_ALL_SOURCE -D_XOPEN_SOURCE=500 -D_LINUX_SOURCE_COMPAT"
|
2017-09-13 18:33:38 +00:00
|
|
|
libs="${libs} -lperfstat"
|
|
|
|
;;
|
|
|
|
*Darwin*)
|
|
|
|
uv_c_flags="${uv_c_flags} -D_DARWIN_USE_64_BIT_INODE=1 -D_DARWIN_UNLIMITED_SELECT=1"
|
|
|
|
;;
|
|
|
|
*Linux*)
|
|
|
|
uv_c_flags="${uv_c_flags} -D_GNU_SOURCE"
|
|
|
|
libs="${libs} -ldl -lrt"
|
|
|
|
;;
|
|
|
|
*BSD*)
|
|
|
|
libs="${libs} -lkvm"
|
|
|
|
;;
|
|
|
|
*SunOS*)
|
|
|
|
# Normally libuv uses '-D_XOPEN_SOURCE=500 -std=c90' on Solaris 5.10,
|
|
|
|
# but we do not need to do that because we bootstrap using POSIX APIs.
|
|
|
|
uv_c_flags="${uv_c_flags} -D__EXTENSIONS__ -D_XOPEN_SOURCE=600"
|
|
|
|
libs="${libs} -lkstat -lnsl -lsendfile -lsocket -lrt"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
uv_c_flags="${uv_c_flags} `cmake_escape "-I${cmake_source_dir}/Utilities/cmlibuv/include"`"
|
|
|
|
if ${cmake_system_mingw}; then
|
|
|
|
uv_c_flags="${uv_c_flags} `cmake_escape "-I${cmake_source_dir}/Utilities/cmlibuv/src/win"`"
|
|
|
|
else
|
|
|
|
uv_c_flags="${uv_c_flags} `cmake_escape "-I${cmake_source_dir}/Utilities/cmlibuv/src/unix"`"
|
|
|
|
fi
|
|
|
|
uv_c_flags="${uv_c_flags} `cmake_escape "-I${cmake_source_dir}/Utilities/cmlibuv/src"`"
|
2003-06-21 15:57:13 +00:00
|
|
|
|
|
|
|
if [ "x${cmake_ansi_cxx_flags}" != "x" ]; then
|
|
|
|
cmake_cxx_flags="${cmake_ansi_cxx_flags} ${cmake_cxx_flags}"
|
|
|
|
fi
|
|
|
|
|
2003-09-02 17:27:58 +00:00
|
|
|
if [ "x${cmake_c_flags}" != "x" ]; then
|
|
|
|
cmake_c_flags="${cmake_c_flags} "
|
|
|
|
fi
|
|
|
|
|
2003-06-21 15:57:13 +00:00
|
|
|
if [ "x${cmake_cxx_flags}" != "x" ]; then
|
|
|
|
cmake_cxx_flags="${cmake_cxx_flags} "
|
|
|
|
fi
|
|
|
|
|
2009-06-10 15:46:06 +00:00
|
|
|
cmake_c_flags_String="-DKWSYS_STRING_C"
|
2013-11-25 16:30:52 +00:00
|
|
|
if ${cmake_system_mingw}; then
|
|
|
|
cmake_c_flags_EncodingC="-DKWSYS_ENCODING_DEFAULT_CODEPAGE=CP_ACP"
|
2017-05-13 19:14:55 +00:00
|
|
|
cmake_cxx_flags_EncodingCXX="${cmake_c_flags_EncodingC}"
|
2016-11-01 18:04:20 +00:00
|
|
|
cmake_cxx_flags_cmProcessOutput="${cmake_c_flags_EncodingC}"
|
2013-11-25 16:30:52 +00:00
|
|
|
fi
|
2013-06-03 14:34:35 +00:00
|
|
|
cmake_cxx_flags_SystemTools="
|
|
|
|
-DKWSYS_CXX_HAS_SETENV=${KWSYS_CXX_HAS_SETENV}
|
|
|
|
-DKWSYS_CXX_HAS_UNSETENV=${KWSYS_CXX_HAS_UNSETENV}
|
|
|
|
-DKWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=${KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H}
|
|
|
|
-DKWSYS_CXX_HAS_UTIMENSAT=${KWSYS_CXX_HAS_UTIMENSAT}
|
|
|
|
-DKWSYS_CXX_HAS_UTIMES=${KWSYS_CXX_HAS_UTIMES}
|
|
|
|
"
|
2017-04-28 18:26:55 +00:00
|
|
|
cmake_c_flags="${cmake_c_flags} \
|
|
|
|
-I`cmake_escape \"${cmake_bootstrap_dir}\"` \
|
|
|
|
-I`cmake_escape \"${cmake_source_dir}/Source\"` \
|
|
|
|
-I`cmake_escape \"${cmake_source_dir}/Source/LexerParser\"` \
|
2015-12-17 20:03:42 +00:00
|
|
|
-I`cmake_escape \"${cmake_source_dir}/Utilities\"`"
|
2017-04-28 18:26:55 +00:00
|
|
|
cmake_cxx_flags="${cmake_cxx_flags} \
|
|
|
|
-I`cmake_escape \"${cmake_bootstrap_dir}\"` \
|
|
|
|
-I`cmake_escape \"${cmake_source_dir}/Source\"` \
|
|
|
|
-I`cmake_escape \"${cmake_source_dir}/Source/LexerParser\"` \
|
2015-12-17 20:03:42 +00:00
|
|
|
-I`cmake_escape \"${cmake_source_dir}/Utilities\"`"
|
2003-03-27 20:29:38 +00:00
|
|
|
echo "cmake: ${objs}" > "${cmake_bootstrap_dir}/Makefile"
|
2017-09-13 18:33:38 +00:00
|
|
|
echo " ${cmake_cxx_compiler} ${cmake_ld_flags} ${cmake_cxx_flags} ${objs} ${libs} -o cmake" >> "${cmake_bootstrap_dir}/Makefile"
|
2003-12-08 19:11:58 +00:00
|
|
|
for a in ${CMAKE_CXX_SOURCES}; do
|
2003-03-27 20:29:38 +00:00
|
|
|
src=`cmake_escape "${cmake_source_dir}/Source/${a}.cxx"`
|
2016-11-01 18:04:20 +00:00
|
|
|
src_flags=`eval echo \\${cmake_cxx_flags_\${a}}`
|
2003-03-27 20:29:38 +00:00
|
|
|
echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
|
2016-11-01 18:04:20 +00:00
|
|
|
echo " ${cmake_cxx_compiler} ${cmake_cxx_flags} ${src_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
|
2003-03-27 20:29:38 +00:00
|
|
|
done
|
2003-12-08 19:11:58 +00: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"
|
2017-05-11 19:53:14 +00:00
|
|
|
done
|
|
|
|
for a in ${LexerParser_CXX_SOURCES}; do
|
|
|
|
src=`cmake_escape "${cmake_source_dir}/Source/LexerParser/${a}.cxx"`
|
|
|
|
src_flags=`eval echo \\${cmake_cxx_flags_\${a}}`
|
|
|
|
echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
|
|
|
|
echo " ${cmake_cxx_compiler} ${cmake_cxx_flags} ${src_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
|
|
|
|
done
|
|
|
|
for a in ${LexerParser_C_SOURCES}; do
|
|
|
|
src=`cmake_escape "${cmake_source_dir}/Source/LexerParser/${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"
|
2003-12-08 19:11:58 +00:00
|
|
|
done
|
2012-12-19 14:00:55 +00:00
|
|
|
for a in ${KWSYS_C_SOURCES}; do
|
2003-07-07 21:52:53 +00:00
|
|
|
src=`cmake_escape "${cmake_source_dir}/Source/kwsys/${a}.c"`
|
2009-06-10 15:46:06 +00:00
|
|
|
src_flags=`eval echo \\${cmake_c_flags_\${a}}`
|
2003-07-07 21:52:53 +00:00
|
|
|
echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
|
2009-06-10 15:46:06 +00:00
|
|
|
echo " ${cmake_c_compiler} ${cmake_c_flags} -DKWSYS_NAMESPACE=cmsys ${src_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
|
2003-07-07 21:52:53 +00:00
|
|
|
done
|
|
|
|
for a in ${KWSYS_CXX_SOURCES}; do
|
2003-06-23 12:58:58 +00:00
|
|
|
src=`cmake_escape "${cmake_source_dir}/Source/kwsys/${a}.cxx"`
|
2012-04-26 14:36:53 +00:00
|
|
|
src_flags=`eval echo \\${cmake_cxx_flags_\${a}}`
|
2003-06-23 12:58:58 +00:00
|
|
|
echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
|
2012-04-26 14:36:53 +00:00
|
|
|
echo " ${cmake_cxx_compiler} ${cmake_cxx_flags} -DKWSYS_NAMESPACE=cmsys ${src_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
|
2003-06-23 12:58:58 +00:00
|
|
|
done
|
2017-09-13 18:33:38 +00:00
|
|
|
for a in ${LIBUV_C_SOURCES}; do
|
|
|
|
src=`cmake_escape "${cmake_source_dir}/Utilities/cmlibuv/${a}"`
|
|
|
|
echo "uv-`cmake_obj ${a}` : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
|
|
|
|
echo " ${cmake_c_compiler} ${cmake_c_flags} ${uv_c_flags} -c ${src} -o uv-`cmake_obj ${a}`" >> "${cmake_bootstrap_dir}/Makefile"
|
|
|
|
done
|
2009-06-10 17:04:25 +00:00
|
|
|
echo '
|
2003-08-06 21:52:16 +00:00
|
|
|
rebuild_cache:
|
|
|
|
cd "${cmake_binary_dir}" && "${cmake_source_dir}/bootstrap"
|
2009-06-10 17:04:25 +00:00
|
|
|
' >> "${cmake_bootstrap_dir}/Makefile"
|
2003-03-27 20:29:38 +00:00
|
|
|
|
2009-06-10 17:04:25 +00:00
|
|
|
# Write our default settings to Bootstrap${_cmk}/InitialCacheFlags.cmake.
|
|
|
|
echo '
|
|
|
|
# Generated by '"${cmake_source_dir}"'/bootstrap
|
2003-07-23 12:37:44 +00:00
|
|
|
# Default cmake settings. These may be overridden any settings below.
|
2012-08-13 17:47:32 +00:00
|
|
|
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)
|
2016-05-27 14:03:43 +00:00
|
|
|
set (CMAKE_BIN_DIR "'"${cmake_bin_dir}"'" CACHE PATH "Install location for binaries (relative to prefix)." FORCE)
|
2012-08-13 17:47:32 +00:00
|
|
|
set (CMAKE_DATA_DIR "'"${cmake_data_dir}"'" CACHE PATH "Install location for data (relative to prefix)." FORCE)
|
2015-12-21 15:02:11 +00:00
|
|
|
set (CMAKE_XDGDATA_DIR "'"${cmake_xdgdata_dir}"'" CACHE PATH "Install location for XDG specific files (relative to prefix)." FORCE)
|
2009-06-10 17:04:25 +00:00
|
|
|
' > "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
|
2003-07-21 20:38:53 +00:00
|
|
|
|
2008-02-13 19:47:03 +00:00
|
|
|
# Add configuration settings given as command-line options.
|
|
|
|
if [ "x${cmake_bootstrap_qt_gui}" != "x" ]; then
|
2009-06-10 17:04:25 +00:00
|
|
|
echo '
|
2012-08-13 17:47:32 +00:00
|
|
|
set (BUILD_QtDialog '"${cmake_bootstrap_qt_gui}"' CACHE BOOL "Build Qt dialog for CMake" FORCE)
|
2009-06-10 17:04:25 +00:00
|
|
|
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
|
2008-02-13 19:47:03 +00:00
|
|
|
fi
|
|
|
|
if [ "x${cmake_bootstrap_qt_qmake}" != "x" ]; then
|
2009-06-10 17:04:25 +00:00
|
|
|
echo '
|
2012-08-13 17:47:32 +00:00
|
|
|
set (QT_QMAKE_EXECUTABLE "'"${cmake_bootstrap_qt_qmake}"'" CACHE FILEPATH "Location of Qt qmake" FORCE)
|
2009-06-10 17:04:25 +00:00
|
|
|
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
|
2008-02-13 19:47:03 +00:00
|
|
|
fi
|
2013-09-17 20:08:05 +00:00
|
|
|
if [ "x${cmake_sphinx_man}" != "x" ]; then
|
|
|
|
echo '
|
2015-04-30 13:22:43 +00:00
|
|
|
set (SPHINX_MAN "'"${cmake_sphinx_man}"'" CACHE BOOL "Build man pages with Sphinx" FORCE)
|
2013-09-17 20:08:05 +00:00
|
|
|
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
|
|
|
|
fi
|
|
|
|
if [ "x${cmake_sphinx_html}" != "x" ]; then
|
|
|
|
echo '
|
2015-04-30 13:22:43 +00:00
|
|
|
set (SPHINX_HTML "'"${cmake_sphinx_html}"'" CACHE BOOL "Build html help with Sphinx" FORCE)
|
2013-09-17 20:08:05 +00:00
|
|
|
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
|
|
|
|
fi
|
2015-02-07 22:23:28 +00:00
|
|
|
if [ "x${cmake_sphinx_qthelp}" != "x" ]; then
|
|
|
|
echo '
|
2015-04-30 13:22:43 +00:00
|
|
|
set (SPHINX_QTHELP "'"${cmake_sphinx_qthelp}"'" CACHE BOOL "Build qch help with Sphinx" FORCE)
|
2015-02-07 22:23:28 +00:00
|
|
|
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
|
|
|
|
fi
|
2013-09-17 20:08:05 +00:00
|
|
|
if [ "x${cmake_sphinx_build}" != "x" ]; then
|
|
|
|
echo '
|
|
|
|
set (SPHINX_EXECUTABLE "'"${cmake_sphinx_build}"'" CACHE FILEPATH "Location of Qt sphinx-build" FORCE)
|
|
|
|
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
|
|
|
|
fi
|
2015-04-30 13:30:14 +00:00
|
|
|
if [ "x${cmake_sphinx_flags}" != "x" ]; then
|
|
|
|
echo '
|
|
|
|
set (SPHINX_FLAGS [==['"${cmake_sphinx_flags}"']==] CACHE STRING "Flags to pass to sphinx-build" FORCE)
|
|
|
|
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
|
|
|
|
fi
|
2008-02-13 19:47:03 +00:00
|
|
|
|
2003-07-23 12:37:44 +00:00
|
|
|
# Add user-specified settings. Handle relative-path case for
|
2003-07-21 20:38:53 +00: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 20:29:38 +00:00
|
|
|
echo "---------------------------------------------"
|
|
|
|
|
2003-05-15 13:35:16 +00:00
|
|
|
# Run make to build bootstrap cmake
|
2003-05-14 13:27:39 +00:00
|
|
|
if [ "x${cmake_parallel_make}" != "x" ]; then
|
2003-08-22 13:52:05 +00:00
|
|
|
${cmake_make_processor} ${cmake_make_flags}
|
2003-05-14 13:27:39 +00:00
|
|
|
else
|
|
|
|
${cmake_make_processor}
|
|
|
|
fi
|
2003-03-27 20:29:38 +00:00
|
|
|
RES=$?
|
|
|
|
if [ "${RES}" -ne "0" ]; then
|
2003-12-23 16:03:38 +00:00
|
|
|
cmake_error 9 "Problem while running ${cmake_make_processor}"
|
2003-03-27 20:29:38 +00:00
|
|
|
fi
|
|
|
|
cd "${cmake_binary_dir}"
|
2003-05-15 13:35:16 +00: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}"
|
2011-01-17 13:57:38 +00:00
|
|
|
if [ -n "${cmake_ccache_enabled}" ]; then
|
|
|
|
CC="ccache ${CC}"
|
|
|
|
CXX="ccache ${CXX}"
|
|
|
|
fi
|
2003-05-15 13:35:16 +00:00
|
|
|
MAKE="${cmake_make_processor}"
|
|
|
|
export CC
|
|
|
|
export CXX
|
|
|
|
export MAKE
|
2018-03-20 05:34:42 +00:00
|
|
|
export CFLAGS
|
|
|
|
export CXXFLAGS
|
|
|
|
export LDFLAGS
|
2003-05-15 13:35:16 +00:00
|
|
|
|
|
|
|
# Run bootstrap CMake to configure real CMake
|
2011-01-17 13:44:04 +00:00
|
|
|
cmake_options="-DCMAKE_BOOTSTRAP=1"
|
|
|
|
if [ -n "${cmake_verbose}" ]; then
|
|
|
|
cmake_options="${cmake_options} -DCMAKE_VERBOSE_MAKEFILE=1"
|
|
|
|
fi
|
2011-12-16 16:29:26 +00:00
|
|
|
"${cmake_bootstrap_dir}/cmake" "${cmake_source_dir}" "-C${cmake_bootstrap_dir}/InitialCacheFlags.cmake" "-G${cmake_bootstrap_generator}" ${cmake_options} ${cmake_bootstrap_system_libs} "$@"
|
2005-03-04 15:03:38 +00:00
|
|
|
RES=$?
|
|
|
|
if [ "${RES}" -ne "0" ]; then
|
|
|
|
cmake_error 11 "Problem while running initial CMake"
|
|
|
|
fi
|
2003-03-27 20:29:38 +00:00
|
|
|
|
|
|
|
echo "---------------------------------------------"
|
|
|
|
|
2003-05-15 13:35:16 +00:00
|
|
|
# And we are done. Now just run make
|
2003-07-23 12:37:44 +00:00
|
|
|
echo "CMake has bootstrapped. Now run ${cmake_make_processor}."
|