Debian ships a package which provides ncurses5-config but no header files.
authorJohn Darrington <john@darrington.wattle.id.au>
Fri, 9 May 2008 11:54:55 +0000 (11:54 +0000)
committerJohn Darrington <john@darrington.wattle.id.au>
Fri, 9 May 2008 11:54:55 +0000 (11:54 +0000)
Work around this (buggy) situation.

configure.ac

index fc9524b7d9deb730b6527ee49b0f4136f11e4ef5..67ee0b7a65d2814ab370d7fdd7e6893596d4aa29 100644 (file)
@@ -139,11 +139,16 @@ if test x"$with_libncurses" != x"no" ; then
          AC_SEARCH_LIBS([tgetent], [ncurses],
              [curses_available=yes; AC_CHECK_HEADERS([term.h curses.h],,[curses_available=no])])
   else
-         curses_available=yes
-         NCURSES_CFLAGS=`$NCURSES_CONFIG --cflags`
-         NCURSES_LIBS=`$NCURSES_CONFIG --libs`
-         AC_SUBST(NCURSES_CFLAGS)
-         AC_SUBST(NCURSES_LIBS)
+          old_cflags=$CFLAGS
+          CFLAGS=$CFLAGS `$NCURSES_CONFIG --cflags`
+         AC_CHECK_HEADERS([term.h curses.h],[curses_available=yes])
+         CFLAGS=$old_cflags
+         if test x"$curses_available" = x"yes" ; then
+          NCURSES_LIBS=`$NCURSES_CONFIG --libs`
+          NCURSES_CFLAGS=`$NCURSES_CONFIG --cflags`
+          AC_SUBST(NCURSES_CFLAGS)
+          AC_SUBST(NCURSES_LIBS)
+          fi
   fi
   if test x"$curses_available" = x"yes" ; then
          AC_DEFINE([LIBNCURSES_USABLE], 1,