1
dnl Available from the GNU Autoconf Macro Archive at:
2
dnl http://www.gnu.org/software/ac-archive/htmldoc/mp_with_curses.html
4
AC_DEFUN([MP_WITH_CURSES],
5
[AC_ARG_WITH(ncurses, [ --with-ncurses Force the use of ncurses over curses],,)
8
if test "$with_ncurses" != yes
10
AC_CACHE_CHECK([for working curses], mp_cv_curses,
11
[LIBS="$LIBS -lcurses"
13
[#include <curses.h>],
14
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
15
mp_cv_curses=yes, mp_cv_curses=no)])
16
if test "$mp_cv_curses" = yes
18
AC_DEFINE(HAVE_CURSES_H)
22
if test ! "$CURSES_LIB"
24
AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses,
25
[LIBS="$mp_save_LIBS -lncurses"
27
[#include <ncurses.h>],
28
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
29
mp_cv_ncurses=yes, mp_cv_ncurses=no)])
30
if test "$mp_cv_ncurses" = yes
32
AC_DEFINE(HAVE_NCURSES_H)
33
CURSES_LIB="-lncurses"