Hi Jens,
Makefile.am | 2 +-
configure.ac | 24 +++++++++++++++++-------
2 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index bebcb90..178def4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -28,7 +28,7 @@ src_mmsd_SOURCES = $(gdbus_sources) $(gweb_sources) $(builtin_sources)
\
src/push.h src/push.c src/store.h src/store.c \
src/wsputil.h src/wsputil.c src/mmsutil.h src/mmsutil.c
-src_mmsd_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@ -lresolv -ldl
+src_mmsd_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@
src_mmsd_LDFLAGS = -Wl,--export-dynamic
diff --git a/configure.ac b/configure.ac
index d82569b..883b59c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -64,15 +64,25 @@ dnl be different for different compiler flags (known issue on AIX)
LT_INIT([dlopen,disable-static])
AC_SUBST([LIBTOOL_DEPS])
+dnl check how we can use the resolver. while resolv.h comes with bind,
+dnl it's probably reasonable to use a combined search macro like
+dnl smart-snmpd's ACX_CHECK_LIB_FLAGS
AC_CHECK_HEADERS(resolv.h, dummy=yes,
AC_MSG_ERROR(resolver header files are required))
-AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [
- AC_CHECK_LIB(resolv, __ns_initparse, dummy=yes,
- AC_MSG_ERROR(resolver library support is required))
-])
-
-AC_CHECK_LIB(dl, dlopen, dummy=yes,
- AC_MSG_ERROR(dynamic linking loader is required))
+dnl ns_initparse is libresolv internal use only - limited usage intended?
+AC_SEARCH_LIBS(ns_initparse, resolv, ,
+ AC_MSG_ERROR(resolver support is required))
+dnl AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [
+dnl AC_CHECK_LIB(resolv, __ns_initparse, dummy=yes,
+dnl AC_MSG_ERROR(resolver library support is required))
+dnl ])
+
+dnl search how we can load dynamic libraries
+dnl TODO use libltdl, which would work on BeOS (Haiku), Darwin (MacOS X) or
+dnl for debugging purposes with libtool's dlpreopen
+AC_SEARCH_LIBS(dlopen, dl, , AC_MSG_ERROR(dynamic linking loader is required))
+dnl AC_CHECK_LIB(dl, dlopen, dummy=yes,
+dnl AC_MSG_ERROR(dynamic linking loader is required))
what is this actually fixing. And all the dnl with dead code need to go
away.
Regards
Marcel