[meta-networking] addcli: check for ns_get16 and ns_get32

Submitted by Khem Raj on July 31, 2021, 4:06 p.m. | Patch ID: 180016

Details

Message ID 20210731160650.3544476-1-raj.khem@gmail.com
State New
Headers show

Commit Message

Khem Raj July 31, 2021, 4:06 p.m.
Fixes build with glibc 2.34+

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../recipes-connectivity/adcli/adcli_0.9.0.bb |  3 +-
 ...ck-for-ns_get16-and-ns_get32-as-well.patch | 39 +++++++++++++++++++
 2 files changed, 41 insertions(+), 1 deletion(-)
 create mode 100644 meta-networking/recipes-connectivity/adcli/files/0001-configure-check-for-ns_get16-and-ns_get32-as-well.patch

--
2.32.0
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#92417): https://lists.openembedded.org/g/openembedded-devel/message/92417
Mute This Topic: https://lists.openembedded.org/mt/84573046/3617530
Group Owner: openembedded-devel+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-

Patch hide | download patch | download mbox

diff --git a/meta-networking/recipes-connectivity/adcli/adcli_0.9.0.bb b/meta-networking/recipes-connectivity/adcli/adcli_0.9.0.bb
index 76df27851b..074292b43b 100644
--- a/meta-networking/recipes-connectivity/adcli/adcli_0.9.0.bb
+++ b/meta-networking/recipes-connectivity/adcli/adcli_0.9.0.bb
@@ -8,6 +8,7 @@  SRCREV = "1b1528038e084a9f81ea108cffca9c2707623b9c"

 SRC_URI = "git://gitlab.freedesktop.org/realmd/adcli;branch=master \
            file://Fixed-build-error-on-musl.patch \
+           file://0001-configure-check-for-ns_get16-and-ns_get32-as-well.patch \
 	   "

 S = "${WORKDIR}/git"
@@ -15,7 +16,7 @@  S = "${WORKDIR}/git"
 LICENSE = "LGPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=23c2a5e0106b99d75238986559bb5fc6"

-inherit autotools xmlcatalog
+inherit autotools xmlcatalog

 DEPENDS += "virtual/crypt krb5 openldap gettext libxslt xmlto libxml2-native \
             cyrus-sasl libxslt-native xmlto-native coreutils-native\
diff --git a/meta-networking/recipes-connectivity/adcli/files/0001-configure-check-for-ns_get16-and-ns_get32-as-well.patch b/meta-networking/recipes-connectivity/adcli/files/0001-configure-check-for-ns_get16-and-ns_get32-as-well.patch
new file mode 100644
index 0000000000..8cc859318c
--- /dev/null
+++ b/meta-networking/recipes-connectivity/adcli/files/0001-configure-check-for-ns_get16-and-ns_get32-as-well.patch
@@ -0,0 +1,39 @@ 
+From 98660f57a98f45dbf55414cfde46338019adcc33 Mon Sep 17 00:00:00 2001
+From: Sumit Bose <sbose@redhat.com>
+Date: Wed, 28 Jul 2021 12:55:16 +0200
+Subject: [PATCH] configure: check for ns_get16 and ns_get32 as well
+
+With newer versions of glibc res_query() might ba already available in
+glibc with ns_get16() and ns_get32() still requires libresolv.
+
+Upstream-Status: Backport [https://gitlab.freedesktop.org/realmd/adcli/-/commit/e841ba7513f3f8b6393183d2dea9adcbf7ba2e44]
+Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1984891
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index ebc6cb4..e8775d0 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -98,13 +98,15 @@ AC_SUBST(LDAP_CFLAGS)
+ # -------------------------------------------------------------------
+ # resolv
+
+-AC_MSG_CHECKING(for which library has res_query)
++AC_MSG_CHECKING([for which library has res_query, ns_get16 and ns_get32])
+ for lib in "" "-lresolv"; do
+ 	saved_LIBS="$LIBS"
+ 	LIBS="$LIBS $lib"
+ 	AC_LINK_IFELSE([
+ 		AC_LANG_PROGRAM([#include <resolv.h>],
+-		                [res_query (0, 0, 0, 0, 0)])
++		                [res_query (0, 0, 0, 0, 0);
++		                 ns_get32 (NULL);
++		                 ns_get16 (NULL);])
+ 	],
+ 	[ AC_MSG_RESULT(${lib:-libc}); have_res_query="yes"; break; ],
+ 	[ LIBS="$saved_LIBS" ])
+--
+2.32.0