aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampus <campus@ntop.org>2016-11-24 10:07:10 +0100
committerCampus <campus@ntop.org>2016-11-24 10:07:10 +0100
commit098812d3cc9fa53b436a473a79457e464afa1194 (patch)
treed8f03758e8cc44d6c88f848b377bc1af71531671
parent797eb2c3ca69654c5e1926f626882dcd9a5a1c0b (diff)
parent4eb5297a799d2256f9bc2417b6cbca0caf173ce8 (diff)
Merge branch 'mgigante-dev_libdl' into dev
-rw-r--r--configure.ac6
-rw-r--r--example/Makefile.am2
2 files changed, 7 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 70e3f1888..0e46e15aa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -50,6 +50,11 @@ if test -f $PCAP_HOME/libpcap/libpcap.a; then :
AC_CHECK_LIB([rt], [clock_gettime], [PCAP_LIB="$PCAP_LIB -lrt"])
AC_CHECK_LIB([nl], [nl_handle_alloc], [PCAP_LIB="$PCAP_LIB -lnl"])
+ # The dlopen() function is in libdl on GLIBC-based systems
+ # and in the C library for *BSD systems
+ AC_CHECK_LIB([dl], [dlopen, dlsym], [DL_LIB="-ldl"],
+ [AC_CHECK_LIB([c], [dlopen, dlsym], [DL_LIB="-lc"],
+ [AC_MSG_ERROR([unable to find the dlopen(), dlsym() functions]) ]) ])
else
AC_CHECK_LIB([pcap], [pcap_open_live], [PCAP_LIB="-lpcap"])
@@ -94,6 +99,7 @@ AC_SUBST(SVN_DATE)
AC_SUBST(JSON_C_LIB)
AC_SUBST(PCAP_INC)
AC_SUBST(PCAP_LIB)
+AC_SUBST(DL_LIB)
AC_SUBST(HAVE_PTHREAD_SETAFFINITY_NP)
AC_OUTPUT
diff --git a/example/Makefile.am b/example/Makefile.am
index c1eee8496..921fa46a8 100644
--- a/example/Makefile.am
+++ b/example/Makefile.am
@@ -4,7 +4,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/include @PCAP_INC@
AM_CFLAGS = @PTHREAD_CFLAGS@
LDADD = $(top_builddir)/src/lib/libndpi.la @JSON_C_LIB@ @PTHREAD_LIBS@ @PCAP_LIB@
-AM_LDFLAGS = -static -ldl
+AM_LDFLAGS = -static @DL_LIB@
ndpiReader_SOURCES = ndpiReader.c ndpi_util.c ndpi_util.h