]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
Link to libnsl.so if needed for inet_ntop() 3291/head
authorDagobert Michelsen <dam@opencsw.org>
Tue, 1 Oct 2019 12:34:43 +0000 (14:34 +0200)
committerDagobert Michelsen <dam@opencsw.org>
Tue, 1 Oct 2019 12:34:43 +0000 (14:34 +0200)
Makefile.am
configure.ac

index f8353d4c58cf5b22eaef5249be207f27ac6070f8..bdb95a1b367eca87908eac31f097968769c24b68 100644 (file)
@@ -1420,6 +1420,12 @@ test_plugin_network_LDADD = \
        libplugin_mock.la \
        libmetadata.la \
        $(GCRYPT_LIBS)
+if BUILD_WITH_LIBSOCKET
+test_plugin_network_LDADD += -lsocket
+endif
+if BUILD_WITH_LIBNSL
+test_plugin_network_LDADD += -lnsl
+endif
 check_PROGRAMS += test_plugin_network
 endif
 
index c190784dcaa0deb4ef9b5c576874ebd352ce1492..4e585bd2165c2c73d0b728a56b2d0ebc38959403 100644 (file)
@@ -858,6 +858,17 @@ AC_CHECK_FUNCS([socket],
 AM_CONDITIONAL([BUILD_WITH_LIBSOCKET], [test "x$socket_needs_socket" = "xyes"])
 AM_CONDITIONAL([BUILD_WITH_GNULIB], [test "x$socket_needs_gnulib" = "xyes"])
 
+AC_CHECK_FUNCS([inet_ntop],
+  [],
+  [
+    AC_CHECK_LIB([nsl], [inet_ntop],
+      [inet_ntop_needs_nsl="yes"],
+      [AC_MSG_ERROR([cannot find inet_ntop() in libnsl])]
+    )
+  ]
+)
+AM_CONDITIONAL([BUILD_WITH_LIBNSL], [test "x$inet_ntop_needs_nsl" = "xyes"])
+
 clock_gettime_needs_posix4="no"
 AC_CHECK_FUNCS([clock_gettime],
   [have_clock_gettime="yes"],