Skip to content
Snippets Groups Projects
Commit a32b5be5 authored by Julien Schueller's avatar Julien Schueller Committed by Brad King
Browse files

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.
parent c68c7444
No related branches found
No related tags found
No related merge requests found
......@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment