2010-08-19 06:01:43 +00:00
|
|
|
AC_ARG_ENABLE(curses,
|
|
|
|
[ --disable-curses disable curses support]
|
|
|
|
)
|
|
|
|
if test "x$enable_curses" != "xno"; then
|
2021-03-27 11:09:37 +00:00
|
|
|
if test "x$PKG_CONFIG" != "x"; then
|
|
|
|
PKG_CHECK_MODULES([NCURSES], [ncurses], HAVE_NCURSES=yes, HAVE_NCURSES=no)
|
|
|
|
else
|
|
|
|
AC_CHECK_HEADER([curses.h], [],
|
|
|
|
[AC_CHECK_HEADER([ncurses/curses.h],
|
|
|
|
[NCURSES_CFLAGS=-I${prefix}/include/ncurses])])
|
2010-08-19 06:01:43 +00:00
|
|
|
AC_CHECK_LIB(ncurses, initscr,
|
2021-03-27 11:09:37 +00:00
|
|
|
NCURSES_LIBS=-lncurses,
|
2010-08-19 06:01:43 +00:00
|
|
|
AC_CHECK_LIB(pdcurses, initscr,
|
2021-03-27 11:09:37 +00:00
|
|
|
NCURSES_LIBS=-lpdcurses,
|
2010-08-19 06:01:43 +00:00
|
|
|
AC_CHECK_LIB(curses, initscr,
|
2021-03-27 11:09:37 +00:00
|
|
|
NCURSES_LIBS=-lcurses,
|
|
|
|
NCURSES_LIBS=
|
2010-08-19 06:01:43 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2021-03-27 11:09:37 +00:00
|
|
|
if test "x$NCURSES_LIBS" != "x"; then
|
2021-03-29 08:54:39 +00:00
|
|
|
HAVE_NCURSES=yes
|
2020-02-26 13:10:59 +00:00
|
|
|
else
|
2021-03-29 08:54:39 +00:00
|
|
|
HAVE_NCURSES=no
|
2020-02-26 13:10:59 +00:00
|
|
|
fi
|
2021-03-27 11:09:37 +00:00
|
|
|
fi
|
2010-08-19 06:01:43 +00:00
|
|
|
else
|
2021-03-29 08:54:39 +00:00
|
|
|
HAVE_NCURSES=no
|
2021-03-27 11:09:37 +00:00
|
|
|
NCURSES_LIBS=
|
2010-08-19 06:01:43 +00:00
|
|
|
fi
|
2021-03-27 11:09:37 +00:00
|
|
|
AC_SUBST(NCURSES_LIBS)
|
2020-02-26 13:10:59 +00:00
|
|
|
|
2021-03-27 11:09:37 +00:00
|
|
|
if test "x$HAVE_NCURSES" == "xyes"; then
|
2021-03-29 08:54:39 +00:00
|
|
|
AC_DEFINE(HAVE_NCURSES, 1, [Define if you have the ncurses library])
|
2021-03-27 11:09:37 +00:00
|
|
|
if test "x$PKG_CONFIG" != "x"; then
|
|
|
|
PKG_CHECK_MODULES([PANEL], [panel], HAVE_PANEL=yes, HAVE_PANEL=no)
|
|
|
|
else
|
|
|
|
AC_CHECK_HEADER(panel.h,
|
|
|
|
[AC_CHECK_LIB(panel, new_panel,
|
|
|
|
[AC_DEFINE(HAVE_PANEL, 1,
|
|
|
|
[Define if you have the ncurses panel library])
|
|
|
|
PANEL_LIBS=-lpanel
|
|
|
|
HAVE_PANEL=yes],
|
|
|
|
[HAVE_PANEL=no],
|
|
|
|
$NCURSES_LIBS
|
|
|
|
)],
|
2020-02-26 13:10:59 +00:00
|
|
|
[HAVE_PANEL=no],
|
2021-03-27 11:09:37 +00:00
|
|
|
[$NCURSES_CFLAGS]
|
|
|
|
)
|
|
|
|
fi
|
2020-02-26 13:10:59 +00:00
|
|
|
else
|
|
|
|
PANEL_LIBS=
|
|
|
|
fi
|
|
|
|
AC_SUBST(PANEL_LIBS)
|