| 
99
 | 
     1 AC_DEFUN([MP_WITH_CURSES],
 | 
| 
 | 
     2   [AC_ARG_WITH(ncurses, [  --with-ncurses          Force the use of ncurses over curses],,)
 | 
| 
 | 
     3    mp_save_LIBS="$LIBS"
 | 
| 
 | 
     4    CURSES_LIB=""
 | 
| 
 | 
     5    if test "$with_ncurses" != yes
 | 
| 
 | 
     6    then
 | 
| 
 | 
     7      AC_CACHE_CHECK([for working curses], mp_cv_curses,
 | 
| 
 | 
     8        [LIBS="$LIBS -lcurses"
 | 
| 
 | 
     9         AC_TRY_LINK(
 | 
| 
 | 
    10           [#include <curses.h>],
 | 
| 
 | 
    11           [chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
 | 
| 
 | 
    12           mp_cv_curses=yes, mp_cv_curses=no)])
 | 
| 
 | 
    13      if test "$mp_cv_curses" = yes
 | 
| 
 | 
    14      then
 | 
| 
 | 
    15        AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
 | 
| 
 | 
    16        #AC_DEFINE(HAVE_CURSES_H)
 | 
| 
 | 
    17        CURSES_LIB="-lcurses"
 | 
| 
 | 
    18      fi
 | 
| 
 | 
    19    fi
 | 
| 
 | 
    20    if test ! "$CURSES_LIB"
 | 
| 
 | 
    21    then
 | 
| 
 | 
    22      AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses,
 | 
| 
 | 
    23        [LIBS="$mp_save_LIBS -lncurses"
 | 
| 
 | 
    24         AC_TRY_LINK(
 | 
| 
 | 
    25           [#include <ncurses.h>],
 | 
| 
 | 
    26           [chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
 | 
| 
 | 
    27           mp_cv_ncurses=yes, mp_cv_ncurses=no)])
 | 
| 
 | 
    28      if test "$mp_cv_ncurses" = yes
 | 
| 
 | 
    29      then
 | 
| 
 | 
    30        AC_DEFINE(HAVE_NCURSES_H, 1, [Define to 1 if libncurses is requested])
 | 
| 
 | 
    31        CURSES_LIB="-lncurses"
 | 
| 
 | 
    32      fi
 | 
| 
 | 
    33    fi
 | 
| 
 | 
    34    if test ! "$CURSES_LIB"
 | 
| 
 | 
    35    then
 | 
| 
 | 
    36      AC_CACHE_CHECK([for working pdcurses], mp_cv_pdcurses,
 | 
| 
 | 
    37        [LIBS="$mp_save_LIBS -lpdcurses"
 | 
| 
 | 
    38         AC_TRY_LINK(
 | 
| 
 | 
    39           [#include <curses.h>],
 | 
| 
 | 
    40           [chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
 | 
| 
 | 
    41           mp_cv_pdcurses=yes, mp_cv_pdcurses=no)])
 | 
| 
 | 
    42      if test "$mp_cv_pdcurses" = yes
 | 
| 
 | 
    43      then
 | 
| 
 |