]> err.no Git - varnish/commitdiff
Correctly detect the presence and location of all external library we use
authordes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 24 Apr 2007 09:39:12 +0000 (09:39 +0000)
committerdes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 24 Apr 2007 09:39:12 +0000 (09:39 +0000)
(except for the C math library, which the C standard guarantees is always
available as -lm) and more importantly, use them only where needed.

This should fix the compilation issues on SuSE.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1364 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/Makefile.am
varnish-cache/bin/varnishhist/Makefile.am
varnish-cache/bin/varnishstat/Makefile.am
varnish-cache/bin/varnishtop/Makefile.am
varnish-cache/configure.ac

index e11bbdc4f18b48e9d9efd4a5d2ac0ab7bfb13497..729e4fe78604b78c32914ca449d6ce895de9eb19 100644 (file)
@@ -61,4 +61,5 @@ varnishd_LDFLAGS = -export-dynamic
 varnishd_LDADD = \
        $(top_builddir)/lib/libcompat/libcompat.a \
        $(top_builddir)/lib/libvarnish/libvarnish.la \
-       $(top_builddir)/lib/libvcl/libvcl.la
+       $(top_builddir)/lib/libvcl/libvcl.la \
+       ${DL_LIBS} ${RT_LIBS} ${PTHREAD_LIBS}
index 152ccb62c7514a72f0af913de834b377253c368b..e0756d8e2ba2d446d3adcf8558381e0c6ef83632 100644 (file)
@@ -14,4 +14,5 @@ varnishhist_LDADD = \
        $(top_builddir)/lib/libcompat/libcompat.a \
        $(top_builddir)/lib/libvarnish/libvarnish.la \
        $(top_builddir)/lib/libvarnishapi/libvarnishapi.la \
-       -lm -lcurses
+       -lm \
+       ${CURSES_LIBS}
index 6b4a6ebad582de060df53969641e71de58af1318..a18323153e0fe78a3994705edfee645a5fb75e63 100644 (file)
@@ -14,4 +14,4 @@ varnishstat_LDADD = \
        $(top_builddir)/lib/libcompat/libcompat.a \
        $(top_builddir)/lib/libvarnish/libvarnish.la \
        $(top_builddir)/lib/libvarnishapi/libvarnishapi.la \
-       -lcurses
+       ${CURSES_LIBS} ${RT_LIBS}
index 377486d4b36e7e7a041cd63ac8e6a9be46c7d991..d9de7adb8692be6a633533ce9efdba285d7cf27e 100644 (file)
@@ -14,4 +14,4 @@ varnishtop_LDADD = \
        $(top_builddir)/lib/libcompat/libcompat.a \
        $(top_builddir)/lib/libvarnish/libvarnish.la \
        $(top_builddir)/lib/libvarnishapi/libvarnishapi.la \
-       -lcurses
+       ${CURSES_LIBS}
index 83f3926a8230f4386415924352144393ac298b3b..e051c2f5cf1b11302d1e7b2422396ad259c04fee 100644 (file)
@@ -35,10 +35,33 @@ AC_PROG_LIBTOOL
 AC_PROG_MAKE_SET
 
 # Checks for libraries.
+save_LIBS="${LIBS}"
+LIBS=""
 AC_CHECK_LIB(rt, clock_gettime)
+RT_LIBS="${LIBS}"
+LIBS="${save_LIBS}"
+AC_SUBST(RT_LIBS)
+
+save_LIBS="${LIBS}"
+LIBS=""
 AC_CHECK_LIB(dl, dlopen)
-#AC_SEARCH_LIBS(initscr, [curses ncurses])
+DL_LIBS="${LIBS}"
+LIBS="${save_LIBS}"
+AC_SUBST(DL_LIBS)
+
+save_LIBS="${LIBS}"
+LIBS=""
+AC_SEARCH_LIBS(initscr, [curses ncurses])
+CURSES_LIBS="${LIBS}"
+LIBS="${save_LIBS}"
+AC_SUBST(CURSES_LIBS)
+
+save_LIBS="${LIBS}"
+LIBS=""
 AC_SEARCH_LIBS(pthread_create, [thr pthread c_r])
+PTHREAD_LIBS="${LIBS}"
+LIBS="${save_LIBS}"
+AC_SUBST(PTHREAD_LIBS)
 
 # Checks for header files.
 AC_HEADER_STDC
@@ -79,7 +102,11 @@ AC_CHECK_FUNCS([srandomdev])
 AC_CHECK_FUNCS([strlcat strlcpy])
 AC_CHECK_FUNCS([strndup])
 AC_CHECK_FUNCS([vis strvis strvisx])
+
+save_LIBS="${LIBS}"
+LIBS="${LIBS} ${RT_LIBS}"
 AC_CHECK_FUNCS([clock_gettime])
+LIBS="${save_LIBS}"
 
 # Check which mechanism to use for the acceptor
 AC_CHECK_FUNCS([kqueue])