1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
From: =?utf-8?q?Ferenc_W=C3=A1gner?= <wferi@debian.org>
Date: Mon, 5 Dec 2016 23:02:15 +0100
Subject: Restrict nsl lib to where it's actually needed
---
configure.ac | 5 ++++-
examples/Makefile.am | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 9c9895d..3f9efab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -111,7 +111,10 @@ AX_SAVE_FLAGS
AC_SEARCH_LIBS([socket], [socket],,[AC_MSG_ERROR([cannot find socket() function])])
AC_SUBST([socket_LIBS],[$LIBS])
AX_RESTORE_FLAGS
-AC_SEARCH_LIBS([gethostbyname], [nsl])
+AX_SAVE_FLAGS
+AC_SEARCH_LIBS([gethostbyname], [nsl],,[AC_MSG_ERROR([cannot find gethostbyname() function])])
+AC_SUBST([nsl_LIBS],[$LIBS])
+AX_RESTORE_FLAGS
# look for testing harness "check"
PKG_CHECK_MODULES([CHECK], [check >= 0.9.4],[with_check=yes],[with_check=no])
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 3ba95fb..3637d30 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -33,7 +33,7 @@ simplelog_LDADD = $(top_builddir)/lib/libqb.la
tcpclient_SOURCES = tcpclient.c $(top_builddir)/include/qb/qbloop.h
tcpclient_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include
-tcpclient_LDADD = $(top_builddir)/lib/libqb.la $(socket_LIBS)
+tcpclient_LDADD = $(top_builddir)/lib/libqb.la $(socket_LIBS) $(nsl_LIBS)
tcpserver_SOURCES = tcpserver.c $(top_builddir)/include/qb/qbloop.h
tcpserver_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include
|