From 969e29fcc33f09f9882fddaf1067ec79ee243341 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 29 Nov 2008 12:09:14 +0000 Subject: improved curses detection --- configure.in | 64 +++++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 46 insertions(+), 18 deletions(-) (limited to 'configure.in') diff --git a/configure.in b/configure.in index 7f2f285..42d801d 100644 --- a/configure.in +++ b/configure.in @@ -74,6 +74,7 @@ AC_DEFUN([KDE_FIND_PATH], dnl ---------------------------------------------------------------- dnl HOST dependend variables dnl + AC_MSG_CHECKING([host type]) case "$host" in *-*-mingw*) @@ -102,6 +103,7 @@ AC_SUBST(ICON_SERVER) dnl ---------------------------------------------------------------- dnl enable compiler warnings or not dnl + AC_MSG_CHECKING(whether to abort on compiler warnings) WARN_CFLAGS="" AC_ARG_ENABLE(warn, @@ -117,6 +119,7 @@ AC_SUBST(WARN_CFLAGS) dnl ---------------------------------------------------------------- dnl enable DEBUG messages or not dnl + AC_MSG_CHECKING(whether to include debug messages) AC_ARG_ENABLE(debug_messages, AC_HELP_STRING( @@ -128,44 +131,65 @@ AC_ARG_ENABLE(debug_messages, ) dnl ---------------------------------------------------------------- -dnl check for ncurses +dnl curses dnl HAVE_CURSES=no -AC_ARG_WITH(ncurses, - AC_HELP_STRING([--without-ncurses], - [don't include ncurses support] +AC_ARG_WITH(curses, + AC_HELP_STRING([--without-curses], + [do not include curses support] ) ) -if test "x${with_ncurses}" != "xno"; then +if test "x${with_curses}" != "xno"; then save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $CURSES_CFLAGS" - AC_CHECK_HEADER(ncurses.h, - HAVE_CURSES=ncurses - AC_DEFINE_UNQUOTED(HAVE_CURSES, 1, [Define this if you have the curses library]) - CURSES_LIBS="$NCURSES_LIBS -lncurses", - HAVE_CURSES=no - ) + AC_CHECK_HEADER(curses.h, + HAVE_CURSES="maybe", + HAVE_CURSES="no" + ) - if test "x${HAVE_CURSES}" = "xno"; then - AC_CHECK_HEADER(curses.h, - HAVE_CURSES=curses - AC_DEFINE_UNQUOTED(HAVE_CURSES, 1, [Define this if you have the curses library]) - CURSES_LIBS="$NCURSES_LIBS -lpdcurses", - HAVE_CURSES=no + if test "x${HAVE_CURSES}" = "xmaybe"; then + AC_CHECK_LIB(ncurses, initscr, + HAVE_CURSES="ncurses" + AC_DEFINE(HAVE_CURSES, ncurses, [Define this if you have the curses library]) + CURSES_LIBS="$CURSES_LIBS -lncurses", + HAVE_CURSES="maybe" ) fi + if test "x${HAVE_CURSES}" = "xmaybe"; then + AC_CHECK_LIB(pdcurses, initscr, + HAVE_CURSES="pdcurses" + AC_DEFINE(HAVE_CURSES, pdcurses, [Define this if you have the curses library]) + CURSES_LIBS="$CURSES_LIBS -lpdcurses", + HAVE_CURSES="maybe" + ) + fi + + if test "x${HAVE_CURSES}" = "xmaybe"; then + AC_CHECK_LIB(curses, initscr, + HAVE_CURSES="curses" + AC_DEFINE(HAVE_CURSES, curses, [Define this if you have the curses library]) + CURSES_LIBS="$CURSES_LIBS -lcurses", + HAVE_CURSES="maybe" + ) + fi + + + if test "x${HAVE_CURSES}" = "xmaybe"; then + HAVE_CURSES=no + fi + CPPFLAGS="$save_CPPFLAGS" fi AC_SUBST(CURSES_CFLAGS) AC_SUBST(CURSES_LIBS) dnl ---------------------------------------------------------------- -dnl check for ncurses +dnl zlib dnl AC_CHECK_HEADER(zlib.h, @@ -256,6 +280,10 @@ else LIBJPG_LIBS="-ljpeg" AC_SUBST(LIBJPG_LIBS) + dnl --------------------------------------------------------------- + dnl SDL + dnl + AC_MSG_CHECKING([looking for SDL]) KDE_FIND_PATH(sdl-config, LIBSDL_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin], [ AC_MSG_ERROR([SDL not found]) -- cgit v1.2.3