commit-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Inetutils branch, master, updated. inetutils-1_8-198-g5051e7b


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_8-198-g5051e7b
Date: Tue, 13 Dec 2011 19:47:23 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  5051e7b67b04324d26186d39b1954a524e74f7d3 (commit)
      from  14059fd60135323938a926a5d6793234f179de12 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=5051e7b67b04324d26186d39b1954a524e74f7d3


commit 5051e7b67b04324d26186d39b1954a524e74f7d3
Author: Mats Erik Andersson <address@hidden>
Date:   Tue Dec 13 12:32:41 2011 +0100

    Termcap and readline portability.
    
    Refine readline and tgetent autodetection
    to achieve full support for NetBSD.

diff --git a/ChangeLog b/ChangeLog
index 4fd9ce9..3ec4e7b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
 2011-12-13  Mats Erik Andersson <address@hidden>
 
+       * am/libcurses.m4 (IU_LIB_TERMCAP): Check libtermcap before libcurses.
+       New macros HAVE_TGETENT, HAVE_TERMCAP_TGETENT, HAVE_CURSES_TGETENT,
+       and HAVE_TERMINFO_TGETENT.
+       * am/readline.m4 (gl_FUNC_READLINE): In case libreadline is absent,
+       check whether libedit is present and suffices.
+       * telnet/telnet.c [HAVE_TERMCAP_TGETENT]: Include <termcap.h>.
+       [HAVE_CURSES_TGETENT]: Include <curses.h> and <term.h>.
+       (init_term) [HAVE_TGETENT]: Replace HAVE_READLINE by HAVE_TGETENT.
+       * telnetd/utility.c [HAVE_TERMCAP_TGETENT]: Likewise.
+       [HAVE_CURSES_TGETENT]: Likewise.
+       (terminaltypeok) [HAVE_TGETENT]: Likewise.
+
+2011-12-13  Mats Erik Andersson <address@hidden>
+
        * tests/ftp-localhost.sh: Check presence of directory `~ftp'.
 
 2011-12-13  Mats Erik Andersson <address@hidden>
diff --git a/am/libcurses.m4 b/am/libcurses.m4
index 3dd1259..fe09781 100644
--- a/am/libcurses.m4
+++ b/am/libcurses.m4
@@ -88,19 +88,37 @@ AC_DEFUN([IU_LIB_TERMCAP], [
   if test "$LIBNCURSES"; then
     LIBTERMCAP="$LIBNCURSES"
   else
-    AC_CHECK_LIB(curses, tgetent, LIBTERMCAP=-lcurses)
-    if test "$ac_cv_lib_curses_tgetent" = no; then
-      AC_CHECK_LIB(termcap, tgetent, LIBTERMCAP=-ltermcap)
+    AC_CHECK_LIB(termcap, tgetent, LIBTERMCAP=-ltermcap)
+    AC_CHECK_HEADERS([termcap.h])
+    if test "$ac_cv_lib_termcap_tgetent" = yes \
+       || test "$ac_cv_header_termcap_h" = yes; then
+      AC_DEFINE([HAVE_TERMCAP_TGETENT], 1,
+               [Define to 1 if tgetent() exists in <termcap.h>.])
+    else
+      AC_CHECK_LIB(curses, tgetent, LIBTERMCAP=-lcurses)
     fi
-    if test "$ac_cv_lib_termcap_tgetent" = no; then
+    if test "$ac_cv_lib_curses_tgetent" = yes \
+       && test "$ac_cv_lib_termcap_tgetent" = no; then
+      AC_DEFINE([HAVE_CURSES_TGETENT], 1,
+               [Define to 1 if tgetent() exists in <curses.h>.])
+    fi
+    if test "$ac_cv_lib_curses_tgetent" = no \
+       && test "$ac_cv_lib_termcap_tgetent" = no; then
       AC_CHECK_LIB(termlib, tgetent, LIBTERMCAP=-ltermlib)
+      if "$ac_cv_lib_termlib_tgetent" = yes; then
+       AC_DEFINE([HAVE_TERMINFO_TGETENT], 1,
+                 [Define to 1 if tgetent() exists in libterminfo.])
+      fi
+    fi
+    if test -n "$LIBTERMCAP"; then
+      AC_DEFINE([HAVE_TGETENT], 1, [Define to 1 if tgetent() exists.])
     fi
   fi
   AC_SUBST(LIBTERMCAP)])dnl
 
-dnl IU_LIB_CURSES -- checke for curses, and associated libraries
+dnl IU_LIB_CURSES -- check for curses, and associated libraries
 dnl
-dnl Checks for varions libraries implementing the curses interface, and if
+dnl Checks for various libraries implementing the curses interface, and if
 dnl found, defines LIBCURSES to be the appropriate linker specification,
 dnl *including* any termcap libraries if needed (some versions of curses
 dnl don't need termcap).
diff --git a/am/readline.m4 b/am/readline.m4
index b7ce9e4..1279c00 100644
--- a/am/readline.m4
+++ b/am/readline.m4
@@ -53,6 +53,20 @@ AC_DEFUN([gl_FUNC_READLINE],
     LIBS="$am_save_LIBS"
   ])
 
+  dnl In case of failure, examine whether libedit can act
+  dnl as replacement. Small NetBSD systems use editline
+  dnl as wrapper for readline.
+  if test "$gl_cv_lib_readline" = no; then
+    am_save_LIBS="$LIBS"
+    LIBS="$am_save_LIBS -ledit"
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
+#include <readline/readline.h>]],
+        [[readline((char*)0);]])],
+      [gl_cv_lib_readline="yes"])
+    LIBS="$am_save_LIBS"
+    LIBREADLINE=-ledit
+  fi
+
   if test "$gl_cv_lib_readline" != no; then
     AC_DEFINE([HAVE_READLINE], [1], [Define if you have the readline library.])
     extra_lib=`echo "$gl_cv_lib_readline" | sed -n -e 's/yes, requires //p'`
diff --git a/telnet/telnet.c b/telnet/telnet.c
index c5b4b19..d0e33d3 100644
--- a/telnet/telnet.c
+++ b/telnet/telnet.c
@@ -73,7 +73,9 @@
 #include "types.h"
 #include "general.h"
 
-#ifdef HAVE_READLINE
+#ifdef HAVE_TERMCAP_TGETENT
+# include <termcap.h>
+#elif defined HAVE_CURSES_TGETENT
 # include <curses.h>
 # include <term.h>
 #endif
@@ -729,7 +731,7 @@ int
 init_term (char *tname, int fd, int *errp)
 {
   int err = -1;
-#ifdef HAVE_READLINE
+#ifdef HAVE_TGETENT
   err = tgetent (termbuf, tname);
 #endif
   if (err == 1)
diff --git a/telnetd/utility.c b/telnetd/utility.c
index c9dbeeb..0101331 100644
--- a/telnetd/utility.c
+++ b/telnetd/utility.c
@@ -37,7 +37,9 @@
 # define NET_ENCRYPT()
 #endif
 
-#ifdef HAVE_READLINE
+#ifdef HAVE_TERMCAP_TGETENT
+# include <termcap.h>
+#elif defined HAVE_CURSES_TGETENT
 # include <curses.h>
 # include <term.h>
 #endif
@@ -830,7 +832,7 @@ terminaltypeok (char *s)
   if (terminaltype == NULL)
     return 1;
 
-#ifdef HAVE_READLINE
+#ifdef HAVE_TGETENT
   if (tgetent (buf, s) == 0)
 #endif
     return 0;

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog         |   14 ++++++++++++++
 am/libcurses.m4   |   30 ++++++++++++++++++++++++------
 am/readline.m4    |   14 ++++++++++++++
 telnet/telnet.c   |    6 ++++--
 telnetd/utility.c |    6 ++++--
 5 files changed, 60 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]