Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 1/2] gnutls: use pkg-config to locate zlib
@ 2015-05-27 18:48 Andre McCurdy
  2015-05-27 18:48 ` [PATCH 2/2] gnutls: control zlib support via PACKAGECONFIG Andre McCurdy
  2015-05-30 13:16 ` [PATCH 1/2] gnutls: use pkg-config to locate zlib akuster808
  0 siblings, 2 replies; 3+ messages in thread
From: Andre McCurdy @ 2015-05-27 18:48 UTC (permalink / raw)
  To: openembedded-core

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.

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
 .../gnutls/use-pkg-config-to-locate-zlib.patch     | 67 ++++++++++++++++++++++
 meta/recipes-support/gnutls/gnutls_3.3.14.bb       |  1 +
 2 files changed, 68 insertions(+)
 create mode 100644 meta/recipes-support/gnutls/gnutls/use-pkg-config-to-locate-zlib.patch

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 0000000..0e1b7c8
--- /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 <armccurdy@gmail.com>
+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 <armccurdy@gmail.com>
+---
+ 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 <zlib.h>], [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.14.bb b/meta/recipes-support/gnutls/gnutls_3.3.14.bb
index 89057ba..f41d183 100644
--- a/meta/recipes-support/gnutls/gnutls_3.3.14.bb
+++ b/meta/recipes-support/gnutls/gnutls_3.3.14.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] = "7f4465f8c564cf9cb8f5cb38b909f7ca"
 SRC_URI[sha256sum] = "0dfa0030faad8909c1e904105198232d6bc0123cae8cf4933b2bac85ee7cec52"
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] gnutls: control zlib support via PACKAGECONFIG
  2015-05-27 18:48 [PATCH 1/2] gnutls: use pkg-config to locate zlib Andre McCurdy
@ 2015-05-27 18:48 ` Andre McCurdy
  2015-05-30 13:16 ` [PATCH 1/2] gnutls: use pkg-config to locate zlib akuster808
  1 sibling, 0 replies; 3+ messages in thread
From: Andre McCurdy @ 2015-05-27 18:48 UTC (permalink / raw)
  To: openembedded-core

Remains enabled by default, no functional change.

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
 meta/recipes-support/gnutls/gnutls.inc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-support/gnutls/gnutls.inc b/meta/recipes-support/gnutls/gnutls.inc
index 87f275a..e9b138a 100644
--- a/meta/recipes-support/gnutls/gnutls.inc
+++ b/meta/recipes-support/gnutls/gnutls.inc
@@ -1,7 +1,7 @@
 SUMMARY = "GNU Transport Layer Security Library"
 HOMEPAGE = "http://www.gnu.org/software/gnutls/"
 BUGTRACKER = "https://savannah.gnu.org/support/?group=gnutls"
-DEPENDS = "zlib nettle"
+DEPENDS = "nettle"
 
 LICENSE = "GPLv3+ & LGPLv2.1+"
 LICENSE_${PN} = "LGPLv2.1+"
@@ -34,8 +34,9 @@ do_configure_prepend() {
 	done
 }
 
-PACKAGECONFIG ??= ""
+PACKAGECONFIG ??= "zlib"
 PACKAGECONFIG[tpm] = "--with-tpm, --without-tpm, trousers"
+PACKAGECONFIG[zlib] = "--with-zlib, --without-zlib, zlib"
 
 PACKAGES =+ "${PN}-openssl ${PN}-xx"
 
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] gnutls: use pkg-config to locate zlib
  2015-05-27 18:48 [PATCH 1/2] gnutls: use pkg-config to locate zlib Andre McCurdy
  2015-05-27 18:48 ` [PATCH 2/2] gnutls: control zlib support via PACKAGECONFIG Andre McCurdy
@ 2015-05-30 13:16 ` akuster808
  1 sibling, 0 replies; 3+ messages in thread
From: akuster808 @ 2015-05-30 13:16 UTC (permalink / raw)
  To: Andre McCurdy, openembedded-core

I am updating to latest gnutls and I will include your patches when I 
submit.

- armin

On 05/27/2015 11:48 AM, Andre McCurdy wrote:
> 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.
>
> Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
> ---
>   .../gnutls/use-pkg-config-to-locate-zlib.patch     | 67 ++++++++++++++++++++++
>   meta/recipes-support/gnutls/gnutls_3.3.14.bb       |  1 +
>   2 files changed, 68 insertions(+)
>   create mode 100644 meta/recipes-support/gnutls/gnutls/use-pkg-config-to-locate-zlib.patch
>
> 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 0000000..0e1b7c8
> --- /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 <armccurdy@gmail.com>
> +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 <armccurdy@gmail.com>
> +---
> + 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 <zlib.h>], [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.14.bb b/meta/recipes-support/gnutls/gnutls_3.3.14.bb
> index 89057ba..f41d183 100644
> --- a/meta/recipes-support/gnutls/gnutls_3.3.14.bb
> +++ b/meta/recipes-support/gnutls/gnutls_3.3.14.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] = "7f4465f8c564cf9cb8f5cb38b909f7ca"
>   SRC_URI[sha256sum] = "0dfa0030faad8909c1e904105198232d6bc0123cae8cf4933b2bac85ee7cec52"
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-30 13:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-27 18:48 [PATCH 1/2] gnutls: use pkg-config to locate zlib Andre McCurdy
2015-05-27 18:48 ` [PATCH 2/2] gnutls: control zlib support via PACKAGECONFIG Andre McCurdy
2015-05-30 13:16 ` [PATCH 1/2] gnutls: use pkg-config to locate zlib akuster808

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox