Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Romain Naour <romain.naour@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/2] package/sngrep: fix static build with gnutls
Date: Sat, 20 May 2017 18:27:51 +0200	[thread overview]
Message-ID: <20170520162751.30809-2-romain.naour@gmail.com> (raw)
In-Reply-To: <20170520162751.30809-1-romain.naour@gmail.com>

Fixes:
http://autobuild.buildroot.net/results/f7f/f7fb42d3742f6f01000a0d181e0c785640284405

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Adam Duskett <aduskett@gmail.com>
---
 ...re.ac-switch-to-pkg-config-to-find-gnutls.patch | 60 +++++++++++++++++++
 ...e-libgcrypt-config-to-link-with-gpg-error.patch | 69 ++++++++++++++++++++++
 package/sngrep/sngrep.mk                           |  3 +-
 3 files changed, 131 insertions(+), 1 deletion(-)
 create mode 100644 package/sngrep/0003-configure.ac-switch-to-pkg-config-to-find-gnutls.patch
 create mode 100644 package/sngrep/0004-use-libgcrypt-config-to-link-with-gpg-error.patch

diff --git a/package/sngrep/0003-configure.ac-switch-to-pkg-config-to-find-gnutls.patch b/package/sngrep/0003-configure.ac-switch-to-pkg-config-to-find-gnutls.patch
new file mode 100644
index 0000000..67b21a2
--- /dev/null
+++ b/package/sngrep/0003-configure.ac-switch-to-pkg-config-to-find-gnutls.patch
@@ -0,0 +1,60 @@
+From b0428b0279b03d88520b79b651f692d9aea65f8c Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@gmail.com>
+Date: Sat, 20 May 2017 15:00:16 +0200
+Subject: [PATCH] configure.ac: switch to pkg-config to find gnutls.
+
+Like for openssl in patch [1] and for the same reason,
+use pkg-config to find gnutls.
+
+gnutls can be linked with :
+    -lintl -lgmp -lunistring -lhogweed -lnettle -ltasn1 -lz
+
+Fixes:
+http://autobuild.buildroot.net/results/f7f/f7fb42d3742f6f01000a0d181e0c785640284405
+
+Upstream: pending [2]
+
+[1] 2563b016ae16cb8cd39d7181917699ae82772296
+[2] https://github.com/irontec/sngrep/pull/188
+
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+---
+ configure.ac    | 5 +++++
+ src/Makefile.am | 2 ++
+ 2 files changed, 7 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 0255ad2..09271b2 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -106,9 +106,14 @@ AC_ARG_WITH([gnutls],
+ )
+ 
+ AS_IF([test "x$WITH_GNUTLS" == "xyes"], [
++
++    m4_ifdef([PKG_CHECK_MODULES], [
++        PKG_CHECK_MODULES([LIBGNUTLS], [gnutls])
++    ], [
+ 	AC_CHECK_LIB([gnutls], [gnutls_init], [], [
+ 	    AC_MSG_ERROR([ You need to have gnutls installed to compile sngrep])
+ 	])
++    ])
+ 
+ 	AC_CHECK_LIB([gcrypt], [gcry_md_map_name], [], [
+ 	    AC_MSG_ERROR([ You need to have libgcrypt installed to compile sngrep])
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 3a471b7..e5b34fe 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -8,6 +8,8 @@ sngrep_SOURCES+=capture_eep.c
+ endif
+ if WITH_GNUTLS
+ sngrep_SOURCES+=capture_gnutls.c
++sngrep_CFLAGS+=$(LIBGNUTLS_CFLAGS)
++sngrep_LDADD+=$(LIBGNUTLS_LIBS)
+ endif
+ if WITH_OPENSSL
+ sngrep_SOURCES+=capture_openssl.c
+-- 
+2.9.4
+
diff --git a/package/sngrep/0004-use-libgcrypt-config-to-link-with-gpg-error.patch b/package/sngrep/0004-use-libgcrypt-config-to-link-with-gpg-error.patch
new file mode 100644
index 0000000..92dc8d1
--- /dev/null
+++ b/package/sngrep/0004-use-libgcrypt-config-to-link-with-gpg-error.patch
@@ -0,0 +1,69 @@
+From 654379f683bf846ace0b69a1e78864ba24462f78 Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@gmail.com>
+Date: Sat, 20 May 2017 17:00:56 +0200
+Subject: [PATCH] use libgcrypt-config to link with gpg-error
+
+gcrypt is linked with libgpg-error, use libgcrypt-config to find
+this dependency. (libgcrypt doesn't provide a .pc file)
+
+libgcrypt-config --libs
+[...] -lgcrypt -lgpg-error
+
+Upstream: pending [1]
+
+[1] https://github.com/irontec/sngrep/pull/188
+
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+---
+ configure.ac    | 18 +++++++++++++++---
+ src/Makefile.am |  4 ++--
+ 2 files changed, 17 insertions(+), 5 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 09271b2..fe28cef 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -115,10 +115,22 @@ AS_IF([test "x$WITH_GNUTLS" == "xyes"], [
+ 	])
+     ])
+ 
+-	AC_CHECK_LIB([gcrypt], [gcry_md_map_name], [], [
+-	    AC_MSG_ERROR([ You need to have libgcrypt installed to compile sngrep])
+-	])
++	AC_PATH_PROG([LIBGCRYPT_CONFIG],[libgcrypt-config],[no])
++	if test "x${LIBGCRYPT_CONFIG}" = "xno"; then
++	    AC_MSG_FAILURE([libgcrypt-config not found in PATH])
++	fi
++	AC_CHECK_LIB(
++		[gcrypt],
++		[gcry_md_map_name],
++		[LIBGCRYPT_CFLAGS="`${LIBGCRYPT_CONFIG} --cflags`"
++		LIBGCRYPT_LIBS="`${LIBGCRYPT_CONFIG} --libs`"
++		],
++		[AC_MSG_ERROR([ You need to have libgcrypt installed to compile sngrep])],
++		[`${LIBGCRYPT_CONFIG} --libs --cflags`]
++		)
+ 	AC_DEFINE([WITH_GNUTLS],[],[Compile With GnuTLS compatibility])
++	AC_SUBST(LIBGCRYPT_CFLAGS)
++	AC_SUBST(LIBGCRYPT_LIBS)
+ ], [])
+ 
+ ####
+diff --git a/src/Makefile.am b/src/Makefile.am
+index e5b34fe..b338273 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -8,8 +8,8 @@ sngrep_SOURCES+=capture_eep.c
+ endif
+ if WITH_GNUTLS
+ sngrep_SOURCES+=capture_gnutls.c
+-sngrep_CFLAGS+=$(LIBGNUTLS_CFLAGS)
+-sngrep_LDADD+=$(LIBGNUTLS_LIBS)
++sngrep_CFLAGS+=$(LIBGNUTLS_CFLAGS) $(LIBGCRYPT_CFLAGS)
++sngrep_LDADD+=$(LIBGNUTLS_LIBS) $(LIBGCRYPT_LIBS)
+ endif
+ if WITH_OPENSSL
+ sngrep_SOURCES+=capture_openssl.c
+-- 
+2.9.4
+
diff --git a/package/sngrep/sngrep.mk b/package/sngrep/sngrep.mk
index 7ae271f..809c5db 100644
--- a/package/sngrep/sngrep.mk
+++ b/package/sngrep/sngrep.mk
@@ -12,7 +12,8 @@ SNGREP_AUTORECONF = YES
 SNGREP_DEPENDENCIES = libpcap ncurses host-pkgconf
 
 SNGREP_CONF_ENV += \
-	$(if $(BR2_STATIC_LIBS),LIBS="`$(STAGING_DIR)/usr/bin/pcap-config --static --libs`")
+	$(if $(BR2_STATIC_LIBS),LIBS="`$(STAGING_DIR)/usr/bin/pcap-config --static --libs`") \
+	LIBGCRYPT_CONFIG=$(STAGING_DIR)/usr/bin/libgcrypt-config
 
 # our ncurses wchar support is not properly detected
 SNGREP_CONF_OPTS += --disable-unicode
-- 
2.9.4

  reply	other threads:[~2017-05-20 16:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-20 16:27 [Buildroot] [PATCH 1/2] package/sngrep: add libgcrypt missing dependencies Romain Naour
2017-05-20 16:27 ` Romain Naour [this message]
2017-05-23 14:27   ` [Buildroot] [PATCH 2/2] package/sngrep: fix static build with gnutls Thomas Petazzoni
2017-05-23 21:20     ` Romain Naour
2017-05-24  6:47       ` Thomas Petazzoni
2017-05-24 21:54         ` Romain Naour
2017-05-25  9:02           ` Bernd Kuhls
2017-05-25 16:32             ` Romain Naour
2017-05-23 14:19 ` [Buildroot] [PATCH 1/2] package/sngrep: add libgcrypt missing dependencies Thomas Petazzoni
2017-05-23 21:09   ` Romain Naour
2017-05-24  6:44     ` Thomas Petazzoni
2017-05-24 19:41       ` Romain Naour

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170520162751.30809-2-romain.naour@gmail.com \
    --to=romain.naour@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox