Andrei G has uploaded this change for review.

View Change

configure: search libresolv for res_9_init

sgsnemu points the resolver at the DNS server received in the PCO by
writing to the resolver state from <resolv.h>. glibc keeps that state
in libc, so nothing extra is needed on GNU/Linux.

Darwin keeps it in libresolv and renames the interface to the BIND 9
symbols: /usr/include/resolv.h has "#define res_init res_9_init" and
"#define __res_state __res_9_state". The link of sgsnemu then fails
with

Undefined symbols for architecture arm64: "___res_9_state"

Add AC_SEARCH_LIBS([res_9_init], [resolv]) so -lresolv is picked up
where the symbol lives there. res_9_init is deliberately the name
searched for, rather than res_init: it exists only on the platforms
that carry this renaming, so on glibc the search finds nothing, LIBS
stays as it was and the link line does not change.

Change-Id: I97787b051c712c5cfdb241cb7931a214d5a87630
Signed-off-by: Andrei Gosman <andrei.gosman@gmail.com>
---
M configure.ac
1 file changed, 4 insertions(+), 0 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/84/43584/1
diff --git a/configure.ac b/configure.ac
index cbb6b66..3283aae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -152,6 +152,10 @@
# check for getopt in standard library
adl_FUNC_GETOPT_LONG

+# sgsnemu sets the resolver state (_res) from <resolv.h>. glibc keeps it in
+# libc; Darwin exports it from libresolv under BIND 9 names (res_9_*).
+AC_SEARCH_LIBS([res_9_init], [resolv])
+
AM_INIT_AUTOMAKE([foreign])

PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.14.2)

To view, visit change 43584. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: I97787b051c712c5cfdb241cb7931a214d5a87630
Gerrit-Change-Number: 43584
Gerrit-PatchSet: 1
Gerrit-Owner: Andrei G <andrei.gosman@gmail.com>