# HG changeset patch # User Gary Kramlich # Date 1157309051 0 # Node ID f3645fe3da47f5dc72663260ebb84a4b4c19aeeb # Parent 1e00e8245720494b3d03b98a91f1e25513a1fadb [gaim-migrate @ 17142] Let's find the ncurses.h we're after, without a bunch of hacking in individual files for it. This checks for some ncursesw specific stuff, and now will not build gntgaim unless we have ncursesw.h. This could be adapted to just add a define in case we want to support non ncursesw, but this is more than adequate for the time being. committer: Tailor Script diff -r 1e00e8245720 -r f3645fe3da47 configure.ac --- a/configure.ac Sun Sep 03 08:01:12 2006 +0000 +++ b/configure.ac Sun Sep 03 18:44:11 2006 +0000 @@ -810,16 +810,61 @@ dnl ####################################################################### dnl # GNT Gaim dnl ####################################################################### -GNT_LIBS= +GNT_LIBS="" +GNT_CFLAGS="" if test "x$enable_gnt" = "xyes"; then AC_CHECK_LIB(ncursesw, initscr, [GNT_LIBS="-lncursesw"], [enable_gnt=no]) AC_CHECK_LIB(panelw, update_panels, [GNT_LIBS="$GNT_LIBS -lpanelw"], [enable_gnt=no]) - # Some distros put the headers in ncursesw/, some don't - AC_CHECK_HEADER(ncursesw/ncurses.h, [AC_DEFINE(HAVE_NCURSESW_INC, 1, [Define if you have the ncursesw headers in ncursesw/])]) + LIBS_save="$LIBS" + LIBS="$LIBS $GNT_LIBS" + + dnl # Some distros put the headers in ncursesw/, some don't + found_ncurses_h=no + for f in ncurses.h ncursesw/ncurses.h + do + AC_CHECK_HEADER($f,[ + AC_MSG_CHECKING([if $f supports wide characters]) + AC_TRY_COMPILE([ + #define _XOPEN_SOURCE_EXTENDED + #include <$f> + ], [ + #ifndef get_wch + # error get_wch not found! + #endif + ], [ + dir=`dirname $f` + if test x"$dir" != x"." ; then + GNT_CFLAGS="-I $dir/" + else + GNT_CFLAGS="" + fi + + found_ncurses_h=yes + AC_MSG_RESULT([yes]) + break + ], [ + AC_MSG_RESULT([no]) + ]) + ]) + done + + LIBS="$LIBS_save" + + if test x"$found_ncurses_h" = x"no" ; then + GNT_LIBS="" + GNT_CFLAGS="" + enable_gnt=no + AC_MSG_RESULT([no]) + else + AC_MSG_RESULT([yes]) + fi fi + AC_SUBST(GNT_LIBS) +AC_SUBST(GNT_CFLAGS) AM_CONDITIONAL(ENABLE_GNT, test "x$enable_gnt" = "xyes") + AC_CHECK_FUNC(wcwidth, [AC_DEFINE([HAVE_WCWIDTH], [1], [Define to 1 if you have wcwidth function.])]) dnl ####################################################################### diff -r 1e00e8245720 -r f3645fe3da47 console/Makefile.am --- a/console/Makefile.am Sun Sep 03 08:01:12 2006 +0000 +++ b/console/Makefile.am Sun Sep 03 18:44:11 2006 +0000 @@ -61,5 +61,6 @@ $(DEBUG_CFLAGS) \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) \ - $(LIBXML_CFLAGS) + $(LIBXML_CFLAGS) \ + $(GNT_CFLAGS) endif diff -r 1e00e8245720 -r f3645fe3da47 console/libgnt/gntcolors.c --- a/console/libgnt/gntcolors.c Sun Sep 03 08:01:12 2006 +0000 +++ b/console/libgnt/gntcolors.c Sun Sep 03 18:44:11 2006 +0000 @@ -1,10 +1,6 @@ #include "config.h" -#ifdef HAVE_NCURSESW_INC -#include -#else #include -#endif #include "gntcolors.h" #include "gntstyle.h" diff -r 1e00e8245720 -r f3645fe3da47 console/libgnt/gntmain.c --- a/console/libgnt/gntmain.c Sun Sep 03 08:01:12 2006 +0000 +++ b/console/libgnt/gntmain.c Sun Sep 03 18:44:11 2006 +0000 @@ -3,11 +3,7 @@ #include "config.h" -#ifdef HAVE_NCURSESW_INC -#include -#else #include -#endif #include diff -r 1e00e8245720 -r f3645fe3da47 console/libgnt/gntwidget.h --- a/console/libgnt/gntwidget.h Sun Sep 03 08:01:12 2006 +0000 +++ b/console/libgnt/gntwidget.h Sun Sep 03 18:44:11 2006 +0000 @@ -6,11 +6,7 @@ #include #include #include -#ifdef HAVE_NCURSESW_INC -#include -#else #include -#endif #define GNT_TYPE_WIDGET (gnt_widget_get_gtype()) #define GNT_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_WIDGET, GntWidget)) diff -r 1e00e8245720 -r f3645fe3da47 console/libgnt/gntwm.h --- a/console/libgnt/gntwm.h Sun Sep 03 08:01:12 2006 +0000 +++ b/console/libgnt/gntwm.h Sun Sep 03 18:44:11 2006 +0000 @@ -1,10 +1,6 @@ #include "config.h" -#ifdef HAVE_NCURSESW_INC -#include -#else #include -#endif #include "gntwidget.h"