Commit 458d50d5 authored by Guillaume Quintard's avatar Guillaume Quintard Committed by guillaume quintard

Use pkg-config for curses, if possible

parent c1d8dbe1
......@@ -18,4 +18,4 @@ varnishhist_LDADD = \
$(top_builddir)/lib/libvarnishapi/libvarnishapi.la \
-lm \
@SAN_LDFLAGS@ \
@CURSES_LIB@ ${RT_LIBS} ${PTHREAD_LIBS}
@CURSES_LIBS@ ${RT_LIBS} ${PTHREAD_LIBS}
......@@ -18,4 +18,4 @@ varnishstat_CFLAGS = \
varnishstat_LDADD = \
$(top_builddir)/lib/libvarnishapi/libvarnishapi.la \
@SAN_LDFLAGS@ \
@CURSES_LIB@ ${RT_LIBS} ${LIBM} ${PTHREAD_LIBS}
@CURSES_LIBS@ ${RT_LIBS} ${LIBM} ${PTHREAD_LIBS}
......@@ -17,4 +17,4 @@ varnishtop_CFLAGS = \
varnishtop_LDADD = \
$(top_builddir)/lib/libvarnishapi/libvarnishapi.la \
@SAN_LDFLAGS@ \
@CURSES_LIB@ ${RT_LIBS} ${LIBM} ${PTHREAD_LIBS}
@CURSES_LIBS@ ${RT_LIBS} ${LIBM} ${PTHREAD_LIBS}
......@@ -82,11 +82,6 @@ _VARNISH_CHECK_LIB(nsl, getaddrinfo)
AC_SUBST(NET_LIBS, "${SOCKET_LIBS} ${NSL_LIBS}")
AX_WITH_CURSES
if test "x$ax_cv_curses" != xyes; then
AC_MSG_ERROR([requires an X/Open-compatible Curses library])
fi
# Userland slab allocator from Solaris, ported to other systems
AC_CHECK_HEADERS([umem.h], [_VARNISH_CHECK_LIB(umem, umem_alloc)])
......@@ -187,6 +182,21 @@ AC_CHECK_HEADERS([edit/readline/readline.h],
])
])
PKG_CHECK_MODULES([CURSES], [ncursesw], [], [
PKG_CHECK_MODULES([CURSES], [ncurses], [], [
PKG_CHECK_MODULES([CURSES], [curses], [], [
AX_WITH_CURSES
if test "x$ax_cv_curses" != xyes; then
AC_MSG_ERROR([requires an X/Open-compatible Curses library])
fi
CURSES_LIBS="$CURSES_LIB"
])
])
])
AC_SUBST([CURSES_LIBS])
AC_CHECK_HEADERS([ncursesw/curses.h ncursesw.h ncurses/curses.h ncurses.h curses.h])
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([sys/endian.h])
......
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