1 dnl Check to find the curses headers/libraries
3 AC_DEFUN([tinc_CURSES],
5 AC_ARG_ENABLE([curses],
6 AS_HELP_STRING([--disable-curses], [disable curses support]))
7 AS_IF([test "x$enable_curses" != "xno"], [
8 AC_DEFINE(HAVE_CURSES, 1, [have curses support])
11 AS_HELP_STRING([--with-curses=DIR], [curses base directory, or:]),
13 CPPFLAGS="$CPPFLAGS -I$withval/include"
14 LDFLAGS="$LDFLAGS -L$withval/lib"]
17 AC_ARG_WITH(curses-include,
18 AS_HELP_STRING([--with-curses-include=DIR], [curses headers directory]),
19 [curses_include="$withval"
20 CPPFLAGS="$CPPFLAGS -I$withval"]
23 AC_ARG_WITH(curses-lib,
24 AS_HELP_STRING([--with-curses-lib=DIR], [curses library directory]),
25 [curses_lib="$withval"
26 LDFLAGS="$LDFLAGS -L$withval"]
29 AC_CHECK_HEADERS(curses.h,
31 [AC_MSG_ERROR("curses header files not found."); break]
34 AC_CHECK_LIB(ncurses, initscr,
35 [CURSES_LIBS="-lncurses"; AC_CHECK_LIB(tinfo, wtimeout, [CURSES_LIBS+=" -ltinfo"], [])],
36 [AC_CHECK_LIB(curses, initscr,
37 [CURSES_LIBS="-lcurses"],
38 [AC_MSG_ERROR("curses libraries not found.")]