Respect --disabled-sys-libs when checking for libcurl

Don't use system libcurl if --disabled-sys-libs was used, but warn about
it as this could be unexpected.

We could consider including libcurl as submodule, and use the built-in
version as a fallback, but it's a relatively big repository (100MiB+),
so it's not clear if it would be a good idea to do it.
This commit is contained in:
Vadim Zeitlin
2021-01-10 20:07:51 +01:00
parent abcc31c6b2
commit 7d1a7ef942
2 changed files with 39 additions and 17 deletions

21
configure vendored
View File

@@ -4098,6 +4098,7 @@ DEFAULT_wxUSE_STD_IOSTREAM=$DEFAULT_STD_FLAG
DEFAULT_wxUSE_STD_STRING=$DEFAULT_STD_FLAG
DEFAULT_wxUSE_DMALLOC=no
DEFAULT_wxUSE_LIBCURL=auto
DEFAULT_wxUSE_LIBGNOMEVFS=no
DEFAULT_wxUSE_LIBMSPACK=no
DEFAULT_wxUSE_LIBSDL=no
@@ -23012,6 +23013,7 @@ fi
if test "$wxUSE_WEBREQUEST" = "yes" -a "$wxUSE_LIBCURL" != "no"; then
if test "$wxUSE_SYS_LIBS" != "no" -o "$wxUSE_LIBCURL" = "yes"; then
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBCURL" >&5
@@ -23072,15 +23074,15 @@ fi
echo "$LIBCURL_PKG_ERRORS" >&5
wxUSE_LIBCURL=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
wxUSE_LIBCURL=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
$as_echo "not found" >&6; }
elif test $pkg_failed = untried; then
wxUSE_LIBCURL=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
wxUSE_LIBCURL=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
$as_echo "not found" >&6; }
@@ -23090,10 +23092,17 @@ else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
CXXFLAGS="$LIBCURL_CFLAGS $CXXFLAGS"
LIBS="$LIBCURL_LIBS $LIBS"
wxUSE_LIBCURL=yes
CXXFLAGS="$LIBCURL_CFLAGS $CXXFLAGS"
LIBS="$LIBCURL_LIBS $LIBS"
fi
else
if test "$USE_WIN32" != 1 -a "$USE_DARWIN" != 1; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Support for libcurl disabled due to --disable-sys-libs, use --with-libcurl explicitly if necessary" >&5
$as_echo "$as_me: WARNING: Support for libcurl disabled due to --disable-sys-libs, use --with-libcurl explicitly if necessary" >&2;}
fi
fi
fi

View File

@@ -333,8 +333,9 @@ DEFAULT_wxUSE_STD_CONTAINERS_COMPATIBLY=$DEFAULT_STD_FLAG
DEFAULT_wxUSE_STD_IOSTREAM=$DEFAULT_STD_FLAG
DEFAULT_wxUSE_STD_STRING=$DEFAULT_STD_FLAG
dnl libraries disabled by default
dnl libraries disabled by default or requiring some special handling
DEFAULT_wxUSE_DMALLOC=no
DEFAULT_wxUSE_LIBCURL=auto
DEFAULT_wxUSE_LIBGNOMEVFS=no
DEFAULT_wxUSE_LIBMSPACK=no
DEFAULT_wxUSE_LIBSDL=no
@@ -2946,16 +2947,28 @@ dnl Check for libcurl
dnl ------------------------------------------------------------------------
if test "$wxUSE_WEBREQUEST" = "yes" -a "$wxUSE_LIBCURL" != "no"; then
PKG_CHECK_MODULES(LIBCURL, [libcurl],
[
CXXFLAGS="$LIBCURL_CFLAGS $CXXFLAGS"
LIBS="$LIBCURL_LIBS $LIBS"
],
[
wxUSE_LIBCURL=no
AC_MSG_RESULT([not found])
]
)
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
fi
dnl ----------------------------------------------------------------