summaryrefslogtreecommitdiffstats
path: root/bootstrap
diff options
context:
space:
mode:
authorJulien Schueller <schueller@phimeca.com>2020-07-06 15:31:52 (GMT)
committerBrad King <brad.king@kitware.com>2020-07-06 17:00:57 (GMT)
commita32b5be56cdfcae735e42d4ce6e972180adb90f4 (patch)
tree0af8f3a40a139d34b3cf90214a4021d53a876c37 /bootstrap
parentc68c744497c0b34db15dadb9f7a80543dd2bf9f4 (diff)
downloadCMake-a32b5be56cdfcae735e42d4ce6e972180adb90f4.zip
CMake-a32b5be56cdfcae735e42d4ce6e972180adb90f4.tar.gz
CMake-a32b5be56cdfcae735e42d4ce6e972180adb90f4.tar.bz2
bootstrap: Add option to use system libuv during bootstrap
Support bootstrapping on older systems where our bundled version libuv does not compile (.e.g Centos5, see #19086 and #19311). Add a `--bootstrap-system-libuv` option to use the system-provided libuv even for the bootstrap binary itself.
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap42
1 files changed, 28 insertions, 14 deletions
diff --git a/bootstrap b/bootstrap
index 1273a46..68218d5 100755
--- a/bootstrap
+++ b/bootstrap
@@ -632,6 +632,8 @@ Configuration:
--system-libuv use system-installed libuv library
--no-system-libuv use cmake-provided libuv library (default)
+ --bootstrap-system-libuv use system-installed libuv library for boostrap
+
--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
@@ -854,6 +856,7 @@ cmake_verbose=
cmake_parallel_make=
cmake_ccache_enabled=
cmake_prefix_dir="${cmake_default_prefix}"
+bootstrap_system_libuv=
while test $# != 0; do
case "$1" in
--prefix=*) dir=`cmake_arg "$1"`
@@ -873,6 +876,7 @@ while test $# != 0; do
--no-system-bzip2|--no-system-curl|--no-system-expat|--no-system-jsoncpp|--no-system-libarchive|--no-system-librhash|--no-system-zlib|--no-system-liblzma|--no-system-zstd|--no-system-libuv)
lib=`cmake_arg "$1" "--no-system-"`
cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARY_`cmake_toupper $lib`=0" ;;
+ --bootstrap-system-libuv) bootstrap_system_libuv="1" ;;
--qt-gui) cmake_bootstrap_qt_gui="1" ;;
--no-qt-gui) cmake_bootstrap_qt_gui="0" ;;
--qt-qmake=*) cmake_bootstrap_qt_qmake=`cmake_arg "$1"` ;;
@@ -1488,9 +1492,11 @@ objs=""
for a in ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES} ${CMAKE_STD_CXX_SOURCES} ${LexerParser_CXX_SOURCES} ${LexerParser_C_SOURCES} ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES}; do
objs="${objs} ${a}.o"
done
-for a in ${LIBUV_C_SOURCES}; do
- objs="${objs} uv-`cmake_obj ${a}`"
-done
+if test "x${bootstrap_system_libuv}" = "x"; then
+ for a in ${LIBUV_C_SOURCES}; do
+ objs="${objs} uv-`cmake_obj ${a}`"
+ done
+fi
libs=""
@@ -1528,14 +1534,20 @@ else
;;
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"`"
+if test "x${bootstrap_system_libuv}" = "x"; then
+ 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"`"
else
- uv_c_flags="${uv_c_flags} `cmake_escape "-I${cmake_source_dir}/Utilities/cmlibuv/src/unix"`"
+ if test `which pkg-config`; then
+ uv_c_flags="${uv_c_flags} `pkg-config --cflags libuv`"
+ fi
+ libs="${libs} -luv"
fi
-uv_c_flags="${uv_c_flags} `cmake_escape "-I${cmake_source_dir}/Utilities/cmlibuv/src"`"
-
if test "x${cmake_ansi_cxx_flags}" != "x"; then
cmake_cxx_flags="${cmake_ansi_cxx_flags} ${cmake_cxx_flags}"
fi
@@ -1617,11 +1629,13 @@ for a in ${KWSYS_CXX_SOURCES}; do
echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
echo " ${cmake_cxx_compiler} ${cmake_cxx_flags} -DKWSYS_NAMESPACE=cmsys ${src_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
done
-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
+if test "x${bootstrap_system_libuv}" = "x"; then
+ 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
+fi
echo '
rebuild_cache:
cd "${cmake_binary_dir}" && "${cmake_source_dir}/bootstrap"