Make --disable-sys-libs configure option less drastic

Only disable using the system libraries when a built-in version is
available, otherwise still use the system library as this seems more
useful than disabling the use of only some system libraries (liblzma and
libcurl), while still possibly depending on dozens more via GTK.

Update the documentation and remove the now unnecessary --with-libcurl
from the CI script.

Closes https://github.com/wxWidgets/wxWidgets/pull/2208
This commit is contained in:
Vadim Zeitlin
2021-02-01 21:14:31 +01:00
parent a291e1c004
commit a81f91114b
4 changed files with 41 additions and 64 deletions

View File

@@ -402,7 +402,7 @@ if test "x$VENDOR" = "x"; then
fi
WX_ARG_DISABLE(all-features,[ --disable-all-features disable all optional features to build minimal library], wxUSE_ALL_FEATURES)
WX_ARG_DISABLE(sys-libs, [ --disable-sys-libs disable all use of system libraries, use only built-in ones], wxUSE_SYS_LIBS)
WX_ARG_DISABLE(sys-libs, [ --disable-sys-libs disable use of system libraries for which built-in versions are available], wxUSE_SYS_LIBS)
WX_ARG_DISABLE(tests, [ --disable-tests disable building tests], wxUSE_TESTS_SUBDIR)
if test "$wxUSE_ALL_FEATURES" = "no"; then
@@ -2712,19 +2712,15 @@ dnl Check for lzma library
dnl ------------------------------------------------------------------------
if test "$wxUSE_LIBLZMA" != "no"; then
dnl We shouldn't depend on the external liblzma if system libraries are
dnl explicitly disabled.
if test "$wxUSE_SYS_LIBS" != "no"; then
AC_CHECK_HEADER(lzma.h,,,[])
AC_CHECK_HEADER(lzma.h,,,[])
if test "$ac_cv_header_lzma_h" = "yes"; then
AC_CHECK_LIB(lzma, lzma_code,
[
LZMA_LINK="-llzma"
LIBS="$LZMA_LINK $LIBS"
AC_DEFINE(wxUSE_LIBLZMA)
])
fi
if test "$ac_cv_header_lzma_h" = "yes"; then
AC_CHECK_LIB(lzma, lzma_code,
[
LZMA_LINK="-llzma"
LIBS="$LZMA_LINK $LIBS"
AC_DEFINE(wxUSE_LIBLZMA)
])
fi
if test -z "$LZMA_LINK"; then
@@ -2946,28 +2942,17 @@ dnl Check for libcurl
dnl ------------------------------------------------------------------------
if test "$wxUSE_WEBREQUEST" = "yes" -a "$wxUSE_LIBCURL" != "no"; then
dnl We shouldn't depend on the external libcurl if system libraries are
dnl explicitly disabled, unless it is explicitly requested.
if test "$wxUSE_SYS_LIBS" != "no" -o "$wxUSE_LIBCURL" = "yes"; then
PKG_CHECK_MODULES(LIBCURL, [libcurl],
[
wxUSE_LIBCURL=yes
CXXFLAGS="$LIBCURL_CFLAGS $CXXFLAGS"
LIBS="$LIBCURL_LIBS $LIBS"
],
[
wxUSE_LIBCURL=no
AC_MSG_RESULT([not found])
]
)
else
dnl Under Win32/macOS we have other backends for wxWebRequest, but
dnl under Unix it will be disabled without libcurl, so warn about it as
dnl this could be an unexpected consequence of disabling sys libs.
if test "$USE_WIN32" != 1 -a "$USE_DARWIN" != 1; then
AC_MSG_WARN([Support for libcurl disabled due to --disable-sys-libs, use --with-libcurl explicitly if necessary])
fi
fi
PKG_CHECK_MODULES(LIBCURL, [libcurl],
[
wxUSE_LIBCURL=yes
CXXFLAGS="$LIBCURL_CFLAGS $CXXFLAGS"
LIBS="$LIBCURL_LIBS $LIBS"
],
[
wxUSE_LIBCURL=no
AC_MSG_RESULT([not found])
]
)
fi
dnl ----------------------------------------------------------------