chiark / gitweb /
Build system: Use -lnsl only if inet_ntoa is not found otherwise.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 28 Dec 2014 16:42:06 +0000 (16:42 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 28 Dec 2014 16:50:36 +0000 (16:50 +0000)
config.h.in
configure
configure.in
debian/changelog

index 5acb7fac3e06672d0805154c7264c158e514c7a4..ebd85749c3838a21f18e14a7aacd11ad64b01e2a 100644 (file)
@@ -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
 
index 189666fe7a7f0473feed612b3f82d0ed2b8955a9..5ce013e3fd3ecd00be0589b7808b84aaf01dc5fe 100755 (executable)
--- 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 :
index 68b8eb43032ce7e84344e0ee94540d1921af5ddb..76e7e12cc93b8d86d371c8deb73c9c6bfaa93c26 100644 (file)
@@ -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)
index b28c6573c2e51d096031f4171934b8dc15040463..ac4e22dd4ec7bfe4afcf88039c7016386ae8e162 100644 (file)
@@ -10,6 +10,7 @@ secnet (0.4.0~beta2~) unstable; urgency=low
   * Fix check for <linux/if_tun.h>.
   * 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.