From 6a478cf43f647458e507de21c4c1edb70679ac74 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 6 Sep 2017 23:28:46 +0200 Subject: Pass --without-system-zlib into external/curl For (implicit) --with-zlib, curl's configure would insist on calling pkg-config and insist on using -lz to link against the zlib library. None of that fits LO's --without-system-zlib option. So make curl's configure honor any passed in ZLIB_CLFAGS/LIBS (unless --without- zlib were explicitly specified; also, ZLIB_CLFAGS/LIBS would override any explicitly specified --with-zlib=PATH, which could be considered an error, but we do never explicitly specify --with-zlib=PATH in external/curl/ExternalProject_curl.mk, anyway). Both ZLIB_CLFAGS/LIBS are set in config_host.mk, so are always set as env vars, so would already be visible to curl's configure. I nevertheless pass them into curl's configure explicitly in external/curl/ExternalProject_curl.mk, to make that more obvious. With (implicit) --with-system-zlib, LO's configure.ac will set ZLIB_LIBS and leave ZLIB_CFLAGS empty (and checks that zlib.h is indeed available without any ZLIB_CLFAGS being necessary). And with --without-system-zlib, LO's configure.ac will set both ZLIB_CFLAGS/LIBS. So curl's configure, as invoked from external/curl/ExternalProject_curl.mk, will now always go into the newly added case honoring any passed in ZLIB_CLFAGS/LIBS, which should thus always work out nicely and use the same zlib settings as configured for LO itself. (For documentation purposes, external/curl/zlib.patch.0 also contains the changes to curl's configure.ac that are reflected in the changes to curl's configure.) Change-Id: Icf5eefe44a7f9beb8a43a9af381f46e5c8b98b04 Reviewed-on: https://gerrit.libreoffice.org/42032 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- external/curl/zlib.patch.0 | 100 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 external/curl/zlib.patch.0 (limited to 'external/curl/zlib.patch.0') diff --git a/external/curl/zlib.patch.0 b/external/curl/zlib.patch.0 new file mode 100644 index 000000000000..87614c7703f7 --- /dev/null +++ b/external/curl/zlib.patch.0 @@ -0,0 +1,100 @@ +--- configure ++++ configure +@@ -937,8 +937,8 @@ + ZLIB_LIBS + HAVE_LIBZ_FALSE + HAVE_LIBZ_TRUE +-HAVE_LIBZ + PKGCONFIG ++HAVE_LIBZ + CURL_DISABLE_GOPHER + CURL_DISABLE_SMTP + CURL_DISABLE_SMB +@@ -20709,7 +20709,6 @@ + clean_CPPFLAGS=$CPPFLAGS + clean_LDFLAGS=$LDFLAGS + clean_LIBS=$LIBS +-ZLIB_LIBS="" + + # Check whether --with-zlib was given. + if test "${with_zlib+set}" = set; then : +@@ -20718,6 +20719,7 @@ + + + if test "$OPT_ZLIB" = "no" ; then ++ ZLIB_LIBS="" + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: zlib disabled" >&5 + $as_echo "$as_me: WARNING: zlib disabled" >&2;} + else +@@ -20725,6 +20725,21 @@ + OPT_ZLIB="" + fi + ++ if test -n "$ZLIB_CFLAGS$ZLIB_LIBS"; then ++ CPPFLAGS="$CPPFLAGS $ZLIB_CFLAGS" ++ LIBS="$ZLIB_LIBS $LIBS" ++ HAVE_LIBZ="1" ++ ++ ++$as_echo "#define HAVE_ZLIB_H 1" >>confdefs.h ++ ++ ++$as_echo "#define HAVE_LIBZ 1" >>confdefs.h ++ ++ AMFIXLIB="1" ++ else ++ ZLIB_LIBS="" ++ + + if test -n "$PKG_CONFIG"; then + PKGCONFIG="$PKG_CONFIG" +@@ -21005,6 +21020,7 @@ + $as_echo "$as_me: found both libz and libz.h header" >&6;} + curl_zlib_msg="enabled" + fi ++ fi + fi + + if test x"$AMFIXLIB" = x1; then +--- configure.ac ++++ configure.ac +@@ -880,19 +880,30 @@ + clean_CPPFLAGS=$CPPFLAGS + clean_LDFLAGS=$LDFLAGS + clean_LIBS=$LIBS +-ZLIB_LIBS="" + AC_ARG_WITH(zlib, + AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH]) + AC_HELP_STRING([--without-zlib],[disable use of zlib]), + [OPT_ZLIB="$withval"]) + + if test "$OPT_ZLIB" = "no" ; then ++ ZLIB_LIBS="" + AC_MSG_WARN([zlib disabled]) + else + if test "$OPT_ZLIB" = "yes" ; then + OPT_ZLIB="" + fi + ++ if test -n "$ZLIB_CFLAGS$ZLIB_LIBS"; then ++ CPPFLAGS="$CPPFLAGS $ZLIB_CFLAGS" ++ LIBS="$ZLIB_LIBS $LIBS" ++ HAVE_LIBZ="1" ++ AC_SUBST(HAVE_LIBZ) ++ AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file]) ++ AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available]) ++ AMFIXLIB="1" ++ else ++ ZLIB_LIBS="" ++ + CURL_CHECK_PKGCONFIG(zlib) + + if test "$PKGCONFIG" != "no" ; then +@@ -975,6 +986,7 @@ + AC_MSG_NOTICE([found both libz and libz.h header]) + curl_zlib_msg="enabled" + fi ++ fi + fi + + dnl set variable for use in automakefile(s) -- cgit