vte r2316 - in trunk: . src
- From: chpe svn gnome org
- To: svn-commits-list gnome org
- Subject: vte r2316 - in trunk: . src
- Date: Tue, 2 Dec 2008 22:10:19 +0000 (UTC)
Author: chpe
Date: Tue Dec 2 22:10:19 2008
New Revision: 2316
URL: http://svn.gnome.org/viewvc/vte?rev=2316&view=rev
Log:
Bug 552096 â Detect tgetent if provided by libtinfo
* configure.in: Rewrote tgetent checks to be more readable. Also check
for tgetent in libtinfo.
* src/keymap.c: (_vte_keymap_map), (_vte_keymap_key_is_modifier):
* src/ssfe.c: Adjust includes accordingly.
Modified:
trunk/ChangeLog
trunk/configure.in
trunk/src/keymap.c
trunk/src/ssfe.c
Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in (original)
+++ trunk/configure.in Tue Dec 2 22:10:19 2008
@@ -289,21 +289,42 @@
AC_CHECK_FUNC(floor,,AC_CHECK_LIB(m,floor,LIBS=["$LIBS -lm"]))
AC_CHECK_FUNCS([ceil floor])
-# Look for ncurses or curses or termcap.
-AC_CHECK_HEADER(ncurses.h,[AC_CHECK_HEADER(term.h,[AC_CHECK_LIB(ncurses,tgetent,[LIBS="-lncurses $LIBS";AC_DEFINE(HAVE_NCURSES,1,[Define if you have ncurses.h and libncurses])])])])
-if test x$ac_cv_lib_ncurses_tgetent != xyes ; then
- AC_CHECK_HEADER(ncurses/curses.h,[AC_CHECK_HEADER(ncurses/term.h,[AC_CHECK_LIB(ncurses,tgetent,[LIBS="-lncurses $LIBS";AC_DEFINE(HAVE_NCURSES_CURSES,1,[Define if you have ncurses/curses.h and libncurses])])])])
- if test x$ac_cv_lib_ncurses_tgetent != xyes ; then
- AC_CHECK_HEADER(curses.h,[AC_CHECK_HEADER(term.h,[AC_CHECK_LIB(curses,tgetent,[LIBS="-lcurses $LIBS";AC_DEFINE(HAVE_CURSES,1,[Define if you have curses.h and libcurses])])])])
- if test x$ac_cv_lib_curses_tgetent != xyes ; then
- AC_CHECK_HEADER(termcap.h,[AC_CHECK_LIB(termcap,tgetent,[LIBS="-ltermcap $LIBS";AC_DEFINE(HAVE_TERMCAP,1,[Define if you have termcap.h and libtermcap])])])
- if test x$ac_cv_header_termcap_h != xyes ; then
- AC_MSG_ERROR([You must have at least one of ncurses, curses, or libtermcap installed to build vte.])
- fi
- fi
- fi
-fi
+# Look for tgetent
+AC_CHECK_FUNC([tgetent],[vte_cv_termcap_lib=libc],
+ [AC_CHECK_LIB([ncurses],[tgetent],[vte_cv_termcap_lib=libncurses],
+ [AC_CHECK_LIB([tinfo],[tgetent],[vte_cv_termcap_lib=libtinfo],
+ [AC_CHECK_LIB([curses],[tgetent],[vte_cv_termcap_lib=libcurses],
+ [AC_CHECK_LIB([termcap],[tgetent],[vte_cv_termcap_lib=libtermcap],
+ [vte_cv_termcap_lib=])])])])])
+
+case "$vte_cv_termcap_lib" in
+ libc) # FIXME: which headers to include here?
+ ;;
+ libncurses) # We need ncurses.h and term.h, or ncurses/curses.h and ncurses/term.h
+ AC_CHECK_HEADERS([ncurses.h term.h],[],
+ [AC_CHECK_HEADERS([ncuses/curses.h ncurses/term.h],[],
+ [AC_MSG_ERROR([ncurses headers not found])])])
+ LIBS="-lncurses $LIBS"
+ ;;
+ libtinfo) # Need ncurses/curses.h and ncurses/term.h
+ AC_CHECK_HEADERS([ncurses.h term.h],[],
+ [AC_CHECK_HEADERS([ncuses/curses.h ncurses/term.h],[],
+ [AC_MSG_ERROR([ncurses headers not found])])])
+ LIBS="-ltinfo $LIBS"
+ ;;
+ libcurses) # Need curses.h and term.h
+ AC_CHECK_HEADERS([curses.h term.h],[],
+ [AC_MSG_ERROR([curses headers not found])])
+ LIBS="-lncurses $LIBS"
+ ;;
+ libtermcap) # Need termcap.h
+ AC_CHECK_HEADERS([termcap.h],[],
+ [AC_MSG_ERROR([termcap headers not found])])
+ LIBS="-ltermcap $LIBS"
+ ;;
+ *) AC_MSG_ERROR([tgetent not found in any library]) ;;
+esac
# Search for the required modules.
VTE_PKGS="glib-2.0 >= $GLIB_REQUIRED gobject-2.0 pango >= $PANGO_REQUIRED gtk+-2.0 >= $GTK_REQUIRED"
Modified: trunk/src/keymap.c
==============================================================================
--- trunk/src/keymap.c (original)
+++ trunk/src/keymap.c Tue Dec 2 22:10:19 2008
@@ -27,25 +27,24 @@
#include "debug.h"
#include "keymap.h"
#include "vtetc.h"
-#ifdef HAVE_NCURSES
+
+#if defined(HAVE_NCURSES_H) && defined(HAVE_TERM_H)
#include <ncurses.h>
#include <term.h>
-#define HAVE_CURSES
-#else
-#ifdef HAVE_NCURSES_CURSES
+#define VTE_TERMCAP_NAME "ncurses"
+#elif defined(HAVE_NCURSES_CURSES_H) && defined(HAVE_NCURSES_TERM_H)
#include <ncurses/curses.h>
#include <ncurses/term.h>
-#define HAVE_CURSES
-#else
-#ifdef HAVE_CURSES
+#define VTE_TERMCAP_NAME "ncurses"
+#elif defined(HAVE_CURSES_H) && defined(HAVE_TERM_H)
#include <curses.h>
#include <term.h>
-#else
-#ifdef HAVE_TERMCAP
+#define VTE_TERMCAP_NAME "curses"
+#elif defined(HAVE_TERMCAP_H)
#include <termcap.h>
-#endif
-#endif
-#endif
+#define VTE_TERMCAP_NAME "termcap"
+#else
+#error No termcap??
#endif
#ifdef VTE_DEBUG
@@ -1009,10 +1008,8 @@
enum _vte_fkey_mode fkey_mode;
char *cap, *tmp;
const char *termcap_special = NULL;
-#if defined(HAVE_CURSES) || defined(HAVE_TERMCAP)
char ncurses_buffer[4096];
char ncurses_area[512];
-#endif
g_return_if_fail(normal != NULL);
g_return_if_fail(normal_length != NULL);
@@ -1167,7 +1164,6 @@
}
}
}
-#if defined(HAVE_CURSES) || defined(HAVE_TERMCAP)
if (termcap_special != NULL) {
tmp = g_strdup(terminal);
cap = NULL;
@@ -1191,13 +1187,7 @@
#ifdef VTE_DEBUG
if (_vte_debug_on(VTE_DEBUG_KEYBOARD)) {
int j;
-#ifdef HAVE_CURSES
- g_printerr(" via ncurses to '");
-#else
-#ifdef HAVE_TERMCAP
- g_printerr(" via termcap to '");
-#endif
-#endif
+ g_printerr(" via " VTE_TERMCAP_NAME " to '");
for (j = 0; j < *normal_length; j++) {
if (((*normal)[j] < 32) ||
((*normal)[j] >= 127)) {
@@ -1214,7 +1204,6 @@
return;
}
}
-#endif
_vte_debug_print(VTE_DEBUG_KEYBOARD,
" (ignoring, no match for modifier state).\n");
Modified: trunk/src/ssfe.c
==============================================================================
--- trunk/src/ssfe.c (original)
+++ trunk/src/ssfe.c Tue Dec 2 22:10:19 2008
@@ -22,25 +22,23 @@
#include <stdarg.h>
-#ifdef HAVE_NCURSES
+#if defined(HAVE_NCURSES_H) && defined(HAVE_TERM_H)
#include <ncurses.h>
#include <term.h>
-#define HAVE_CURSES
-#else
-#ifdef HAVE_NCURSES_CURSES
+#define VTE_TERMCAP_NAME "ncurses"
+#elif defined(HAVE_NCURSES_CURSES_H) && defined(HAVE_NCURSES_TERM_H)
#include <ncurses/curses.h>
#include <ncurses/term.h>
-#define HAVE_CURSES
-#else
-#ifdef HAVE_CURSES
+#define VTE_TERMCAP_NAME "ncurses"
+#elif defined(HAVE_CURSES_H) && defined(HAVE_TERM_H)
#include <curses.h>
#include <term.h>
-#else
-#ifdef HAVE_TERMCAP
+#define VTE_TERMCAP_NAME "curses"
+#elif defined(HAVE_TERMCAP_H)
#include <termcap.h>
-#endif
-#endif
-#endif
+#define VTE_TERMCAP_NAME "termcap"
+#else
+#error No termcap??
#endif
#include <sys/types.h>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]