Commit 452ea495 authored by Dag Erling Smørgrav's avatar Dag Erling Smørgrav

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.


git-svn-id: http://www.varnish-cache.org/svn/trunk@1364 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 6f183693
......@@ -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}
......@@ -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}
......@@ -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}
......@@ -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}
......@@ -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])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment