From: <amc...@us...> - 2006-09-03 18:44:23
|
Revision: 17142 http://svn.sourceforge.net/gaim/?rev=17142&view=rev Author: amc_grim Date: 2006-09-03 11:44:11 -0700 (Sun, 03 Sep 2006) Log Message: ----------- 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. Modified Paths: -------------- trunk/configure.ac trunk/console/Makefile.am trunk/console/libgnt/gntcolors.c trunk/console/libgnt/gntmain.c trunk/console/libgnt/gntwidget.h trunk/console/libgnt/gntwm.h Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-09-03 18:42:04 UTC (rev 17141) +++ trunk/configure.ac 2006-09-03 18:44:11 UTC (rev 17142) @@ -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 ####################################################################### Modified: trunk/console/Makefile.am =================================================================== --- trunk/console/Makefile.am 2006-09-03 18:42:04 UTC (rev 17141) +++ trunk/console/Makefile.am 2006-09-03 18:44:11 UTC (rev 17142) @@ -61,5 +61,6 @@ $(DEBUG_CFLAGS) \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) \ - $(LIBXML_CFLAGS) + $(LIBXML_CFLAGS) \ + $(GNT_CFLAGS) endif Modified: trunk/console/libgnt/gntcolors.c =================================================================== --- trunk/console/libgnt/gntcolors.c 2006-09-03 18:42:04 UTC (rev 17141) +++ trunk/console/libgnt/gntcolors.c 2006-09-03 18:44:11 UTC (rev 17142) @@ -1,10 +1,6 @@ #include "config.h" -#ifdef HAVE_NCURSESW_INC -#include <ncursesw/ncurses.h> -#else #include <ncurses.h> -#endif #include "gntcolors.h" #include "gntstyle.h" Modified: trunk/console/libgnt/gntmain.c =================================================================== --- trunk/console/libgnt/gntmain.c 2006-09-03 18:42:04 UTC (rev 17141) +++ trunk/console/libgnt/gntmain.c 2006-09-03 18:44:11 UTC (rev 17142) @@ -3,11 +3,7 @@ #include "config.h" -#ifdef HAVE_NCURSESW_INC -#include <ncursesw/panel.h> -#else #include <panel.h> -#endif #include <gmodule.h> Modified: trunk/console/libgnt/gntwidget.h =================================================================== --- trunk/console/libgnt/gntwidget.h 2006-09-03 18:42:04 UTC (rev 17141) +++ trunk/console/libgnt/gntwidget.h 2006-09-03 18:44:11 UTC (rev 17142) @@ -6,11 +6,7 @@ #include <stdio.h> #include <glib.h> #include <glib-object.h> -#ifdef HAVE_NCURSESW_INC -#include <ncursesw/ncurses.h> -#else #include <ncurses.h> -#endif #define GNT_TYPE_WIDGET (gnt_widget_get_gtype()) #define GNT_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_WIDGET, GntWidget)) Modified: trunk/console/libgnt/gntwm.h =================================================================== --- trunk/console/libgnt/gntwm.h 2006-09-03 18:42:04 UTC (rev 17141) +++ trunk/console/libgnt/gntwm.h 2006-09-03 18:44:11 UTC (rev 17142) @@ -1,10 +1,6 @@ #include "config.h" -#ifdef HAVE_NCURSESW_INC -#include <ncursesw/panel.h> -#else #include <panel.h> -#endif #include "gntwidget.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |