51
|
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
|
|
44 AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
|
|
45 CURSES_LIB="-lpdcurses"
|
|
46 fi
|
|
47 fi
|
|
48 if test ! "$CURSES_LIB"
|
|
49 then
|
|
50 AC_CACHE_CHECK([for working pdcur], mp_cv_pdcur,
|
|
51 [LIBS="$mp_save_LIBS -lpdcur"
|
|
52 AC_TRY_LINK(
|
|
53 [#include <curses.h>],
|
|
54 [chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
|
|
55 mp_cv_pdcur=yes, mp_cv_pdcur=no)])
|
|
56 if test "$mp_cv_pdcur" = yes
|
|
57 then
|
|
58 AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
|
|
59 CURSES_LIB="-lpdcur"
|
|
60 fi
|
|
61 fi
|
|
62 if test ! "$CURSES_LIB"
|
|
63 then
|
|
64 AC_CACHE_CHECK([for working peer pdcurses], mp_cv_lpdcurses,
|
|
65 [LIBS="$mp_save_LIBS ../pdcurses/pdcurses.a"
|
|
66 AC_TRY_LINK(
|
|
67 [#include "../pdcurses/curses.h"],
|
|
68 [chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
|
|
69 mp_cv_lpdcurses=yes, mp_cv_lpdcurses=no)])
|
|
70 if test "$mp_cv_lpdcurses" = yes
|
|
71 then
|
|
72 AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
|
|
73 CURSES_LIB="../pdcurses/pdcurses.a"
|
|
74 RF_ADDTO(CPPFLAGS,"-I../pdcurses")
|
|
75 fi
|
|
76 fi
|
|
77 AC_CACHE_CHECK([for ESCDELAY variable],
|
|
78 [mc_cv_ncurses_escdelay],
|
|
79 [AC_TRY_LINK([], [
|
|
80 extern int ESCDELAY;
|
|
81 ESCDELAY = 0;
|
|
82 ],
|
|
83 [mc_cv_ncurses_escdelay=yes],
|
|
84 [mc_cv_ncurses_escdelay=no])
|
|
85 ])
|
|
86 if test "$mc_cv_ncurses_escdelay" = yes; then
|
|
87 AC_DEFINE(HAVE_ESCDELAY, 1,
|
|
88 [Define if ncurses has ESCDELAY variable])
|
|
89 fi
|
|
90 if test ! "$CURSES_LIB" ; then
|
|
91 LIBS="$mp_save_LIBS"
|
|
92 fi
|
|
93 ])dnl
|
|
94
|
|
95 dnl
|
|
96 dnl RF_ADDTO(variable, value)
|
|
97 dnl
|
|
98 dnl Add value to variable
|
|
99 dnl
|
|
100 AC_DEFUN([RF_ADDTO],[
|
|
101 if test "x$$1" = "x"; then
|
|
102 test "x$silent" != "xyes" && echo " setting $1 to \"$2\""
|
|
103 $1="$2"
|
|
104 else
|
|
105 apr_addto_bugger="$2"
|
|
106 for i in $apr_addto_bugger; do
|
|
107 apr_addto_duplicate="0"
|
|
108 for j in $$1; do
|
|