From: Matthias Runge Date: Fri, 11 Oct 2019 07:54:28 +0000 (+0200) Subject: Merge pull request #3291 from dago/issue3220 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=59f7ce924ed63ed08e8f0775d0ff0832335525dd;hp=90d514946634caca37c409233513c14ffb0d98e0 Merge pull request #3291 from dago/issue3220 Link to libnsl.so if needed for inet_ntop() --- diff --git a/Makefile.am b/Makefile.am index f8353d4c..bdb95a1b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/configure.ac b/configure.ac index c190784d..4e585bd2 100644 --- a/configure.ac +++ b/configure.ac @@ -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"],