]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
configure: Fix platform detection
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 25 Nov 2019 16:55:08 +0000 (16:55 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 25 Nov 2019 16:55:08 +0000 (16:55 +0000)
Checking for GNU platforms now instead of just Linux.

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

index 733a648a25f30236722c7f22aba65f42790dc0e9..37281b3d4e0696031824be8a164691c86f213eb0 100644 (file)
@@ -150,11 +150,14 @@ 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
-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
+case "${host}" in
+       *-gnu*)
+               AC_CHECK_LIB(resolv, ns_msg_getflag, [LIBS="-lresolv $LIBS"], AC_MSG_ERROR([libresolv has not been found]), -lresolv)
+               ;;
+       *)
+               AC_CHECK_LIB(resolv, res_init, [LIBS="-lresolv $LIBS"], AC_MSG_ERROR([libresolv has not been found]), -lresolv)
+               ;;
+esac
 RESOLV_LIBS="${LIBS}"
 
 AC_CONFIG_HEADERS(config.h)