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_9_1_100-11-g80


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1_100-11-g804f20e
Date: Thu, 07 Nov 2013 18:46:49 +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  804f20e073d6ec39e60796ee49f1e26f82a19959 (commit)
      from  f475b43550975cf05f7a06c35b0e4d0506d47c5f (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=804f20e073d6ec39e60796ee49f1e26f82a19959


commit 804f20e073d6ec39e60796ee49f1e26f82a19959
Author: Mats Erik Andersson <address@hidden>
Date:   Tue Nov 5 19:42:51 2013 +0100

    Detection of readline.

diff --git a/ChangeLog b/ChangeLog
index d954b04..40f0f1c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2013-11-05  Mats Erik Andersson  <address@hidden>
+
+       Improve detection of readline.
+
+       * am/readline.m4 (gl_FUNC_READLINE): Check for libedit
+       with AC_LIB_LINKFLAGS_BODY and with AC_CACHE_CHECK.
+       <readline in libreadline>: Ignore <editline/readline.h>.
+       <readline in libedit>: Prefer <editline/readline.h>.
+       Define HAVE_READLINE if readline() was located in one of
+       the libraries, and if its use had not been disabled.
+       Define HAVE_LIBREADLINE and HAVE_LIBEDIT if it was found
+       in the corresponding library.
+       * ftp/Makefile.am (LDADD): Remove $(LIBGLOB), $(LIBTERMCAP).
+       The latter is handled by LIBREADLINE.
+
+       * configure.ac (ftp_PROPS): Do not add $LIBTERMCAP.
+
 2013-10-16  Mats Erik Andersson  <address@hidden>
 
        syslogd, talkd: Act on failed read_utmp.
diff --git a/am/readline.m4 b/am/readline.m4
index 56cf01a..49f1047 100644
--- a/am/readline.m4
+++ b/am/readline.m4
@@ -17,7 +17,7 @@ AC_DEFUN([gl_FUNC_READLINE],
   dnl Allow disabling the use of libreadline.
   AC_ARG_ENABLE([readline],
     AS_HELP_STRING([--disable-readline],
-                  [do not build against libreadline]), ,
+                  [do not build against libreadline or libedit]), ,
     [enable_readline=yes])
 
   dnl Readline libraries come in a handful flavours.
@@ -28,6 +28,7 @@ AC_DEFUN([gl_FUNC_READLINE],
   dnl Search for libreadline and define LIBREADLINE, LTLIBREADLINE and
   dnl INCREADLINE accordingly.
   AC_LIB_LINKFLAGS_BODY([readline])
+  AC_LIB_LINKFLAGS_BODY([edit])
 
   dnl Add $INCREADLINE to CPPFLAGS before performing the following checks,
   dnl because if the user has installed libreadline and not disabled its use
@@ -36,7 +37,7 @@ AC_DEFUN([gl_FUNC_READLINE],
   am_save_CPPFLAGS="$CPPFLAGS"
   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCREADLINE])
 
-  AC_CACHE_CHECK([for readline], [gl_cv_lib_readline], [
+  AC_CACHE_CHECK([for libreadline], [gl_cv_lib_readline], [
     gl_cv_lib_readline=no
     am_save_LIBS="$LIBS"
     dnl On some systems, -lreadline doesn't link without an additional
@@ -52,8 +53,6 @@ AC_DEFUN([gl_FUNC_READLINE],
       AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
 #ifdef HAVE_READLINE_READLINE_H
 # include <readline/readline.h>
-#elif defined HAVE_EDITLINE_READLINE_H
-# include <editline/readline.h>
 #endif]],
           [[readline((char*)0);]])],
         [if test -n "$extra_lib"; then
@@ -72,24 +71,34 @@ AC_DEFUN([gl_FUNC_READLINE],
   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
+  CPPFLAGS="$am_save_CPPFLAGS"
+  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCEDIT])
+
+  AC_CACHE_CHECK([for libedit], [gl_cv_lib_edit], [
+    gl_cv_lib_edit=no
     am_save_LIBS="$LIBS"
     LIBS="$am_save_LIBS -ledit"
     AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
-#ifdef HAVE_READLINE_READLINE_H
-# include <readline/readline.h>
-#elif defined HAVE_EDITLINE_READLINE_H
+#ifdef HAVE_EDITLINE_READLINE_H
 # include <editline/readline.h>
+#elif defined HAVE_READLINE_READLINE_H
+# include <readline/readline.h>
 #endif]],
         [[readline((char*)0);]])],
-      [gl_cv_lib_readline="yes"])
+      [gl_cv_lib_edit="yes"])
     LIBS="$am_save_LIBS"
-    LIBREADLINE=-ledit
+  ])
+
+  dnl Is the function readline() available?
+  if ( test "$gl_cv_lib_readline" != no || test "$gl_cv_lib_edit" != no ) \
+     && test "$enable_readline" = yes; then
+    AC_DEFINE([HAVE_READLINE], [1], [Define if you have a readline function.])
   fi
 
+  dnl Identify the available implementation.
   if test "$enable_readline" = "yes" \
      && test "$gl_cv_lib_readline" != no; then
-    AC_DEFINE([HAVE_READLINE], [1], [Define if you have the readline library.])
+    AC_DEFINE([HAVE_LIBREADLINE], [1], [Define if you have the readline 
library.])
     extra_lib=`echo "$gl_cv_lib_readline" | sed -n -e 's/yes, requires //p'`
     if test -n "$extra_lib"; then
       LIBREADLINE="$LIBREADLINE $extra_lib"
@@ -97,12 +106,23 @@ AC_DEFUN([gl_FUNC_READLINE],
     fi
     AC_MSG_CHECKING([how to link with libreadline])
     AC_MSG_RESULT([$LIBREADLINE])
+  elif test "$enable_readline" = "yes" \
+     && test "$gl_cv_lib_edit" != no; then
+    AC_DEFINE([HAVE_LIBEDIT], [1], [Define if you have the edit library.])
+
+    dnl We have a working replacement for libreadline, so use it.
+    LIBREADLINE="$LIBEDIT"
+    LTLIBREADLINE="$LTLIBEDIT"
+    AC_MSG_CHECKING([how to link with libedit])
+    AC_MSG_RESULT([$LIBEDIT])
   else
     dnl If $LIBREADLINE didn't lead to a usable library, we don't
     dnl need $INCREADLINE either.
     CPPFLAGS="$am_save_CPPFLAGS"
     LIBREADLINE=
     LTLIBREADLINE=
+    LIBEDIT=
+    LTLIBEDIT=
   fi
   AC_SUBST([LIBREADLINE])
   AC_SUBST([LTLIBREADLINE])
diff --git a/configure.ac b/configure.ac
index 229f814..79a6776 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1057,7 +1057,6 @@ traceroute_PROPS="${traceroute_PROPS:+$traceroute_PROPS 
}${LIBIDN:+-lidn}"
 
 # Termcap variants.
 
-ftp_PROPS="${ftp_PROPS:+$ftp_PROPS }$LIBTERMCAP"
 telnet_PROPS="${telnet_PROPS:+$telnet_PROPS }$LIBTERMCAP"
 telnetd_PROPS="${telnetd_PROPS:+$telnetd_PROPS }$LIBTERMCAP"
 
diff --git a/ftp/Makefile.am b/ftp/Makefile.am
index 5589154..4542784 100644
--- a/ftp/Makefile.am
+++ b/ftp/Makefile.am
@@ -27,7 +27,7 @@ AM_CPPFLAGS = \
 
 LDADD = \
        $(iu_LIBRARIES) \
-       $(LIBGLOB) $(LIBREADLINE) $(LIBTERMCAP) $(LIBHISTORY) \
+       $(LIBREADLINE) $(LIBHISTORY) \
        $(LIBIDN)
 
 bin_PROGRAMS = $(ftp_BUILD)

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

Summary of changes:
 ChangeLog       |   17 +++++++++++++++++
 am/readline.m4  |   42 +++++++++++++++++++++++++++++++-----------
 configure.ac    |    1 -
 ftp/Makefile.am |    2 +-
 4 files changed, 49 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

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