]> git.ipfire.org Git - location/libloc.git/commitdiff
libresolv: Check different functions on different platforms
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 24 Nov 2019 21:05:23 +0000 (21:05 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 24 Nov 2019 21:05:23 +0000 (21:05 +0000)
I could not find a function that is both present on Linux and
Mac OS X, so we now have to test differently.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
configure.ac

index ead5dc9ef810c9d9274572b66b38a5fc5d90a875..733a648a25f30236722c7f22aba65f42790dc0e9 100644 (file)
@@ -150,7 +150,11 @@ AC_ARG_ENABLE(perl, AS_HELP_STRING([--disable-perl], [do not build the perl modu
 AM_CONDITIONAL(ENABLE_PERL, test "$enable_perl" = "yes")
 
 dnl Checking for libresolv
-AC_CHECK_LIB(resolv, res_init, [LIBS="-lresolv $LIBS"], AC_MSG_ERROR([libresolv has not been found]), -lresolv)
+if test ${gm_platform} = "linux" ; then
+       AC_CHECK_LIB(resolv, ns_msg_getflag, [LIBS="-lresolv $LIBS"], AC_MSG_ERROR([libresolv has not been found]), -lresolv)
+else
+       AC_CHECK_LIB(resolv, res_init, [LIBS="-lresolv $LIBS"], AC_MSG_ERROR([libresolv has not been found]), -lresolv)
+fi
 RESOLV_LIBS="${LIBS}"
 
 AC_CONFIG_HEADERS(config.h)