From 5eee959617b4bdc9849613bb9045984aaee665ef Mon Sep 17 00:00:00 2001 From: des Date: Tue, 8 Aug 2006 14:00:28 +0000 Subject: [PATCH] Autodetect the need to link against libdl for dlopen(). git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@774 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/Makefile.am | 7 ++++++- varnish-cache/configure.ac | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/varnish-cache/bin/varnishd/Makefile.am b/varnish-cache/bin/varnishd/Makefile.am index 0c72bd88..72e82c7f 100644 --- a/varnish-cache/bin/varnishd/Makefile.am +++ b/varnish-cache/bin/varnishd/Makefile.am @@ -52,7 +52,7 @@ noinst_HEADERS = \ varnishd_CFLAGS = -include config.h -varnishd_LDFLAGS = -export-dynamic +varnishd_LDFLAGS = -export-dynamic varnishd_LDADD = \ $(top_builddir)/lib/libcompat/libcompat.a \ @@ -60,9 +60,14 @@ varnishd_LDADD = \ $(top_builddir)/lib/libvcl/libvcl.la \ -lpthread +if NEED_LIBDL +varnishd_LDADD += -ldl +endif + if NEED_LIBMD varnishd_LDADD += -lmd endif + if NEED_LIBRT varnishd_LDADD += -lrt endif diff --git a/varnish-cache/configure.ac b/varnish-cache/configure.ac index e5833bdd..172c37d2 100644 --- a/varnish-cache/configure.ac +++ b/varnish-cache/configure.ac @@ -77,6 +77,10 @@ AC_CHECK_FUNCS([vis strvis strvisx]) AC_CHECK_LIB(rt, clock_gettime, need_librt=yes) AM_CONDITIONAL(NEED_LIBRT, test x$need_librt = xyes) +# Check if dlopen() requires libdl +AC_CHECK_LIB(dl, dlopen, need_libdl=yes) +AM_CONDITIONAL(NEED_LIBDL, test x$need_libdl = xyes) + # Check for the presence of RSA's MD5 implementation (libmd on *BSD) AC_CHECK_HEADERS([md5.h]) if test x$ac_cv_header_md5_h = xyes ; then -- 2.39.5