r1364 - in trunk/varnish-cache: . bin/varnishd bin/varnishhist bin/varnishstat bin/varnishtop
des at projects.linpro.no
des at projects.linpro.no
Tue Apr 24 11:39:12 CEST 2007
Author: des
Date: 2007-04-24 11:39:12 +0200 (Tue, 24 Apr 2007)
New Revision: 1364
Modified:
trunk/varnish-cache/bin/varnishd/Makefile.am
trunk/varnish-cache/bin/varnishhist/Makefile.am
trunk/varnish-cache/bin/varnishstat/Makefile.am
trunk/varnish-cache/bin/varnishtop/Makefile.am
trunk/varnish-cache/configure.ac
Log:
Correctly detect the presence and location of all external library we use
(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.
Modified: trunk/varnish-cache/bin/varnishd/Makefile.am
===================================================================
--- trunk/varnish-cache/bin/varnishd/Makefile.am 2007-04-22 13:09:59 UTC (rev 1363)
+++ trunk/varnish-cache/bin/varnishd/Makefile.am 2007-04-24 09:39:12 UTC (rev 1364)
@@ -61,4 +61,5 @@
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}
Modified: trunk/varnish-cache/bin/varnishhist/Makefile.am
===================================================================
--- trunk/varnish-cache/bin/varnishhist/Makefile.am 2007-04-22 13:09:59 UTC (rev 1363)
+++ trunk/varnish-cache/bin/varnishhist/Makefile.am 2007-04-24 09:39:12 UTC (rev 1364)
@@ -14,4 +14,5 @@
$(top_builddir)/lib/libcompat/libcompat.a \
$(top_builddir)/lib/libvarnish/libvarnish.la \
$(top_builddir)/lib/libvarnishapi/libvarnishapi.la \
- -lm -lcurses
+ -lm \
+ ${CURSES_LIBS}
Modified: trunk/varnish-cache/bin/varnishstat/Makefile.am
===================================================================
--- trunk/varnish-cache/bin/varnishstat/Makefile.am 2007-04-22 13:09:59 UTC (rev 1363)
+++ trunk/varnish-cache/bin/varnishstat/Makefile.am 2007-04-24 09:39:12 UTC (rev 1364)
@@ -14,4 +14,4 @@
$(top_builddir)/lib/libcompat/libcompat.a \
$(top_builddir)/lib/libvarnish/libvarnish.la \
$(top_builddir)/lib/libvarnishapi/libvarnishapi.la \
- -lcurses
+ ${CURSES_LIBS} ${RT_LIBS}
Modified: trunk/varnish-cache/bin/varnishtop/Makefile.am
===================================================================
--- trunk/varnish-cache/bin/varnishtop/Makefile.am 2007-04-22 13:09:59 UTC (rev 1363)
+++ trunk/varnish-cache/bin/varnishtop/Makefile.am 2007-04-24 09:39:12 UTC (rev 1364)
@@ -14,4 +14,4 @@
$(top_builddir)/lib/libcompat/libcompat.a \
$(top_builddir)/lib/libvarnish/libvarnish.la \
$(top_builddir)/lib/libvarnishapi/libvarnishapi.la \
- -lcurses
+ ${CURSES_LIBS}
Modified: trunk/varnish-cache/configure.ac
===================================================================
--- trunk/varnish-cache/configure.ac 2007-04-22 13:09:59 UTC (rev 1363)
+++ trunk/varnish-cache/configure.ac 2007-04-24 09:39:12 UTC (rev 1364)
@@ -35,10 +35,33 @@
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([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])
More information about the varnish-commit
mailing list