From 010a940ba11f3ebbc777b40d06664a72e5e53d3d Mon Sep 17 00:00:00 2001 From: Andre McCurdy Date: Wed, 27 May 2015 11:48:49 -0700 Subject: gnutls: use pkg-config to locate zlib AC_LIB_HAVE_LINKFLAGS can sometimes find host libs and is therefore not robust when cross-compiling. Remove it for zlib and use PKG_CHECK_MODULES instead. (From OE-Core rev: 78a0e916882a747c267808c08ab8bc615198b5a8) (From OE-Core rev: aaeacca50808e12eb81a373972c802d3f01c01af) Signed-off-by: Andre McCurdy Signed-off-by: Richard Purdie --- .../gnutls/use-pkg-config-to-locate-zlib.patch | 67 ++++++++++++++++++++++ meta/recipes-support/gnutls/gnutls_3.3.12.bb | 1 + 2 files changed, 68 insertions(+) create mode 100644 meta/recipes-support/gnutls/gnutls/use-pkg-config-to-locate-zlib.patch (limited to 'meta') diff --git a/meta/recipes-support/gnutls/gnutls/use-pkg-config-to-locate-zlib.patch b/meta/recipes-support/gnutls/gnutls/use-pkg-config-to-locate-zlib.patch new file mode 100644 index 0000000000..0e1b7c8f72 --- /dev/null +++ b/meta/recipes-support/gnutls/gnutls/use-pkg-config-to-locate-zlib.patch @@ -0,0 +1,67 @@ +From cee80af1fe93f5b76765afeebfcc3b902768f5d6 Mon Sep 17 00:00:00 2001 +From: Andre McCurdy +Date: Tue, 26 May 2015 21:41:24 -0700 +Subject: [PATCH] use pkg-config to locate zlib + +AC_LIB_HAVE_LINKFLAGS can sometimes find host libs and is therefore not +robust when cross-compiling. Remove it for zlib and use PKG_CHECK_MODULES +instead. + +Removing AC_LIB_HAVE_LINKFLAGS for zlib also removes the --with-libz-prefix +configure option. If zlib support is enabled, then failure to find zlib via +pkg-config is now treated as a fatal error. + +Change based on ChromeOS gnutls 2.12.23 cross-compile fixes patch: + + https://chromium-review.googlesource.com/#/c/271661/ + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Andre McCurdy +--- + configure.ac | 24 ++++++++++-------------- + 1 file changed, 10 insertions(+), 14 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 1b561d5..0c787dc 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -508,25 +508,21 @@ AC_ARG_WITH(zlib, AS_HELP_STRING([--without-zlib], + AC_MSG_CHECKING([whether to include zlib compression support]) + if test x$ac_zlib != xno; then + AC_MSG_RESULT(yes) +- AC_LIB_HAVE_LINKFLAGS(z,, [#include ], [compress (0, 0, 0, 0);]) +- if test x$ac_cv_libz != xyes; then +- AC_MSG_WARN( +-*** +-*** ZLIB was not found. You will not be able to use ZLIB compression.) +- fi + else + AC_MSG_RESULT(no) + fi + +-PKG_CHECK_EXISTS(zlib, ZLIB_HAS_PKGCONFIG=y, ZLIB_HAS_PKGCONFIG=n) +- + if test x$ac_zlib != xno; then +- if test "$ZLIB_HAS_PKGCONFIG" = "y" ; then +- if test "x$GNUTLS_REQUIRES_PRIVATE" = x; then +- GNUTLS_REQUIRES_PRIVATE="Requires.private: zlib" +- else +- GNUTLS_REQUIRES_PRIVATE="$GNUTLS_REQUIRES_PRIVATE, zlib" +- fi ++ PKG_CHECK_MODULES(ZLIB, zlib) ++ HAVE_LIBZ=yes ++ AC_DEFINE([HAVE_LIBZ], [1], [zlib is enabled]) ++ AC_SUBST(HAVE_LIBZ) ++ LTLIBZ=$ZLIB_LIBS ++ AC_SUBST(LTLIBZ) ++ if test "x$GNUTLS_REQUIRES_PRIVATE" = x; then ++ GNUTLS_REQUIRES_PRIVATE="Requires.private: zlib" ++ else ++ GNUTLS_REQUIRES_PRIVATE="$GNUTLS_REQUIRES_PRIVATE, zlib" + fi + fi + AC_SUBST(GNUTLS_REQUIRES_PRIVATE) +-- +1.9.1 + diff --git a/meta/recipes-support/gnutls/gnutls_3.3.12.bb b/meta/recipes-support/gnutls/gnutls_3.3.12.bb index 0d6ec756e6..b310be0e58 100644 --- a/meta/recipes-support/gnutls/gnutls_3.3.12.bb +++ b/meta/recipes-support/gnutls/gnutls_3.3.12.bb @@ -2,6 +2,7 @@ require gnutls.inc SRC_URI += "file://correct_rpl_gettimeofday_signature.patch \ file://configure.ac-fix-sed-command.patch \ + file://use-pkg-config-to-locate-zlib.patch \ " SRC_URI[md5sum] = "a37b20b4352a5f542367ded904729c90" SRC_URI[sha256sum] = "67ab3e92c5d48f3323b897d7c1aa0bb2af6f3a84f5bd9931cda163a7ff32299b" -- cgit v1.2.3-54-g00ecf