2011-05-15 10:06:21 +00:00
|
|
|
dnl Check to find the curses headers/libraries
|
|
|
|
|
|
|
|
AC_DEFUN([tinc_CURSES],
|
|
|
|
[
|
|
|
|
AC_ARG_ENABLE([curses],
|
|
|
|
AS_HELP_STRING([--disable-curses], [disable curses support]))
|
|
|
|
AS_IF([test "x$enable_curses" != "xno"], [
|
|
|
|
AC_DEFINE(HAVE_CURSES, 1, [have curses support])
|
2011-05-15 11:16:48 +00:00
|
|
|
curses=true
|
2011-05-15 10:06:21 +00:00
|
|
|
AC_ARG_WITH(curses,
|
|
|
|
AS_HELP_STRING([--with-curses=DIR], [curses base directory, or:]),
|
|
|
|
[curses="$withval"
|
|
|
|
CPPFLAGS="$CPPFLAGS -I$withval/include"
|
|
|
|
LDFLAGS="$LDFLAGS -L$withval/lib"]
|
|
|
|
)
|
|
|
|
|
|
|
|
AC_ARG_WITH(curses-include,
|
|
|
|
AS_HELP_STRING([--with-curses-include=DIR], [curses headers directory]),
|
|
|
|
[curses_include="$withval"
|
|
|
|
CPPFLAGS="$CPPFLAGS -I$withval"]
|
|
|
|
)
|
|
|
|
|
|
|
|
AC_ARG_WITH(curses-lib,
|
|
|
|
AS_HELP_STRING([--with-curses-lib=DIR], [curses library directory]),
|
|
|
|
[curses_lib="$withval"
|
|
|
|
LDFLAGS="$LDFLAGS -L$withval"]
|
|
|
|
)
|
|
|
|
|
|
|
|
AC_CHECK_HEADERS(curses.h,
|
|
|
|
[],
|
|
|
|
[AC_MSG_ERROR("curses header files not found."); break]
|
|
|
|
)
|
|
|
|
|
2013-12-07 21:59:37 +00:00
|
|
|
AC_CHECK_LIB(ncurses, initscr,
|
|
|
|
[CURSES_LIBS="-lncurses"],
|
|
|
|
[AC_CHECK_LIB(curses, initscr,
|
|
|
|
[CURSES_LIBS="-lcurses"],
|
|
|
|
[AC_MSG_ERROR("curses libraries not found.")]
|
|
|
|
)]
|
2011-05-15 10:06:21 +00:00
|
|
|
)
|
|
|
|
])
|
2011-05-15 11:16:48 +00:00
|
|
|
|
|
|
|
AC_SUBST(CURSES_LIBS)
|
2011-05-15 10:06:21 +00:00
|
|
|
])
|