From 5b627d5629772d1de45c78986bf8fb2966b315c2 Mon Sep 17 00:00:00 2001 From: des Date: Wed, 20 Sep 2006 08:37:35 +0000 Subject: [PATCH] Trust autoconf to dtrt wrt libraries. Prefer libthr to libpthread if it's available (i.e. on FreeBSD 6 and newer) git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1098 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/Makefile.am | 15 +-------------- varnish-cache/bin/varnishncsa/Makefile.am | 4 ---- varnish-cache/bin/varnishstat/Makefile.am | 6 +----- varnish-cache/configure.ac | 19 ++++--------------- 4 files changed, 6 insertions(+), 38 deletions(-) diff --git a/varnish-cache/bin/varnishd/Makefile.am b/varnish-cache/bin/varnishd/Makefile.am index da69bcb2..685ba275 100644 --- a/varnish-cache/bin/varnishd/Makefile.am +++ b/varnish-cache/bin/varnishd/Makefile.am @@ -62,17 +62,4 @@ varnishd_LDFLAGS = -export-dynamic varnishd_LDADD = \ $(top_builddir)/lib/libcompat/libcompat.a \ $(top_builddir)/lib/libvarnish/libvarnish.la \ - $(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 + $(top_builddir)/lib/libvcl/libvcl.la diff --git a/varnish-cache/bin/varnishncsa/Makefile.am b/varnish-cache/bin/varnishncsa/Makefile.am index 660a4613..e123a354 100644 --- a/varnish-cache/bin/varnishncsa/Makefile.am +++ b/varnish-cache/bin/varnishncsa/Makefile.am @@ -14,7 +14,3 @@ varnishncsa_LDADD = \ $(top_builddir)/lib/libcompat/libcompat.a \ $(top_builddir)/lib/libvarnish/libvarnish.la \ $(top_builddir)/lib/libvarnishapi/libvarnishapi.la - -if NEED_LIBRT -varnishncsa_LDADD += -lrt -endif diff --git a/varnish-cache/bin/varnishstat/Makefile.am b/varnish-cache/bin/varnishstat/Makefile.am index 97cd6461..6b4a6eba 100644 --- a/varnish-cache/bin/varnishstat/Makefile.am +++ b/varnish-cache/bin/varnishstat/Makefile.am @@ -13,9 +13,5 @@ varnishstat_CFLAGS = -include config.h varnishstat_LDADD = \ $(top_builddir)/lib/libcompat/libcompat.a \ $(top_builddir)/lib/libvarnish/libvarnish.la \ - $(top_builddir)/lib/libvarnishapi/libvarnishapi.la \ + $(top_builddir)/lib/libvarnishapi/libvarnishapi.la \ -lcurses - -if NEED_LIBRT -varnishstat_LDADD += -lrt -endif diff --git a/varnish-cache/configure.ac b/varnish-cache/configure.ac index feaaa6f9..dbd80f14 100644 --- a/varnish-cache/configure.ac +++ b/varnish-cache/configure.ac @@ -35,6 +35,10 @@ AC_PROG_LIBTOOL AC_PROG_MAKE_SET # Checks for libraries. +AC_CHECK_LIB(rt, clock_gettime) +AC_CHECK_LIB(dl, dlopen) +#AC_SEARCH_LIBS(initscr, [curses ncurses]) +AC_SEARCH_LIBS(pthread_create, [thr pthread c_r]) # Checks for header files. AC_HEADER_STDC @@ -75,21 +79,6 @@ AC_CHECK_FUNCS([strlcat strlcpy]) AC_CHECK_FUNCS([strndup]) AC_CHECK_FUNCS([vis strvis strvisx]) -# On some systems, clock_gettime is in librt rather than libc -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 - AC_CHECK_LIB(md, MD5Init, need_libmd=yes) -fi -AM_CONDITIONAL(NEED_LIBMD, test x$need_libmd = xyes) - # Check which mechanism to use for the acceptor AC_CHECK_FUNCS([kqueue]) AC_CHECK_FUNCS([epoll_ctl]) -- 2.39.5