From: Ian Jackson Date: Sun, 28 Dec 2014 16:42:06 +0000 (+0000) Subject: Build system: Use -lnsl only if inet_ntoa is not found otherwise. X-Git-Tag: v0.4.0_beta2~4 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/secnet/commitdiff_plain/ee2536e4af21ca16d5711d1b848b04d0958f481b Build system: Use -lnsl only if inet_ntoa is not found otherwise. --- diff --git a/config.h.in b/config.h.in index 5acb7fa..ebd8574 100644 --- a/config.h.in +++ b/config.h.in @@ -26,9 +26,6 @@ /* Define to 1 if you have the `gmp2' library (-lgmp2). */ #undef HAVE_LIBGMP2 -/* Define to 1 if you have the `nsl' library (-lnsl). */ -#undef HAVE_LIBNSL - /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET diff --git a/configure b/configure index 189666f..5ce013e 100755 --- a/configure +++ b/configure @@ -4522,7 +4522,14 @@ fi if test "$ac_cv_lib_fl_yywrap" != yes; then as_fn_error $? "A compatible libfl is required" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lnsl" >&5 + + + ac_fn_c_check_func "$LINENO" "inet_ntoa" "ac_cv_func_inet_ntoa" +if test "x$ac_cv_func_inet_ntoa" = xyes; then : + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lnsl" >&5 $as_echo_n "checking for inet_ntoa in -lnsl... " >&6; } if ${ac_cv_lib_nsl_inet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 @@ -4559,14 +4566,22 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_inet_ntoa" >&5 $as_echo "$ac_cv_lib_nsl_inet_ntoa" >&6; } if test "x$ac_cv_lib_nsl_inet_ntoa" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBNSL 1 -_ACEOF - LIBS="-lnsl $LIBS" + LIBS="-lnsl $LIBS"; + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: inet_ntoa is in libnsl, urgh. Must use -lnsl." >&5 +$as_echo "$as_me: WARNING: inet_ntoa is in libnsl, urgh. Must use -lnsl." >&2;} + +else + + as_fn_error $? "cannot find library function inet_ntoa" "$LINENO" 5 fi + +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 $as_echo_n "checking for socket in -lsocket... " >&6; } if ${ac_cv_lib_socket_socket+:} false; then : diff --git a/configure.in b/configure.in index 68b8eb4..76e7e12 100644 --- a/configure.in +++ b/configure.in @@ -81,7 +81,7 @@ AC_CHECK_LIB(fl,yywrap) if test "$ac_cv_lib_fl_yywrap" != yes; then AC_MSG_ERROR([A compatible libfl is required]) fi -AC_CHECK_LIB(nsl,inet_ntoa) +SECNET_C_GETFUNC(inet_ntoa,nsl) AC_CHECK_LIB(socket,socket) SECNET_C_GETFUNC(inet_aton,resolv) AC_CHECK_LIB(adns,adns_init) diff --git a/debian/changelog b/debian/changelog index b28c657..ac4e22d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,7 @@ secnet (0.4.0~beta2~) unstable; urgency=low * Fix check for . * debian/rules: Support dpkg-buildflags. * Build system: Use -lresolv only if inet_aton is not found otherwise. + * Build system: Use -lnsl only if inet_ntoa is not found otherwise. Copyright updates: * Update to GPLv3. Add missing copyright notices and credits.