mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-21 14:47:03 +01:00
Readline fix to be robust against platforms where readline has its own
dependencies. We play guess-the-depedency for a while, and try termcap, curses, and ncurses.
This commit is contained in:
parent
39b0f6e4ea
commit
005b1d7960
@ -1,3 +1,10 @@
|
|||||||
|
2004-12-18 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
|
* signal.c: Use only HAVE_LIBREADLINE to detect readline
|
||||||
|
availability.
|
||||||
|
|
||||||
|
* Makefile.am: Link with readline where necessary.
|
||||||
|
|
||||||
2004-12-17 Werner Koch <wk@g10code.com>
|
2004-12-17 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* passphrase.c (agent_get_passphrase): Define NREAD locally as
|
* passphrase.c (agent_get_passphrase): Define NREAD locally as
|
||||||
|
@ -132,7 +132,7 @@ gpgv_SOURCES = gpgv.c \
|
|||||||
# ks-db.h \
|
# ks-db.h \
|
||||||
# $(common_source)
|
# $(common_source)
|
||||||
|
|
||||||
LDADD = $(needed_libs) $(other_libs) @ZLIBS@ @W32LIBS@
|
LDADD = $(needed_libs) $(other_libs) @ZLIBS@ @W32LIBS@ @LIBREADLINE@
|
||||||
gpg_LDADD = $(LDADD) @DLLIBS@ @NETLIBS@ @LIBUSB_LIBS@
|
gpg_LDADD = $(LDADD) @DLLIBS@ @NETLIBS@ @LIBUSB_LIBS@
|
||||||
|
|
||||||
$(PROGRAMS): $(needed_libs)
|
$(PROGRAMS): $(needed_libs)
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#ifdef HAVE_READLINE_READLINE_H
|
#ifdef HAVE_LIBREADLINE
|
||||||
#include <readline/readline.h>
|
#include <readline/readline.h>
|
||||||
#include <readline/history.h>
|
#include <readline/history.h>
|
||||||
#endif
|
#endif
|
||||||
@ -83,7 +83,7 @@ got_fatal_signal( int sig )
|
|||||||
|
|
||||||
secmem_term();
|
secmem_term();
|
||||||
|
|
||||||
#if defined(HAVE_READLINE_READLINE_H) && defined(HAVE_LIBREADLINE)
|
#ifdef HAVE_LIBREADLINE
|
||||||
rl_free_line_state ();
|
rl_free_line_state ();
|
||||||
rl_cleanup_after_signal ();
|
rl_cleanup_after_signal ();
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
2004-12-18 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
|
* readline.m4: New.
|
||||||
|
|
||||||
2004-07-27 gettextize <bug-gnu-gettext@gnu.org>
|
2004-07-27 gettextize <bug-gnu-gettext@gnu.org>
|
||||||
|
|
||||||
* gettext.m4: Upgrade to gettext-0.14.1.
|
* gettext.m4: Upgrade to gettext-0.14.1.
|
||||||
|
56
m4/readline.m4
Normal file
56
m4/readline.m4
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
dnl Check for readline and dependencies
|
||||||
|
dnl Copyright (C) 2004 Free Software Foundation, Inc.
|
||||||
|
dnl
|
||||||
|
dnl This file is free software, distributed under the terms of the GNU
|
||||||
|
dnl General Public License. As a special exception to the GNU General
|
||||||
|
dnl Public License, this file may be distributed as part of a program
|
||||||
|
dnl that contains a configuration script generated by Autoconf, under
|
||||||
|
dnl the same distribution terms as the rest of that program.
|
||||||
|
dnl
|
||||||
|
dnl Defines HAVE_LIBREADLINE to 1 if a working readline setup is
|
||||||
|
dnl found, and sets @LIBREADLINE@ to the necessary libraries.
|
||||||
|
|
||||||
|
AC_DEFUN([GNUPG_CHECK_READLINE],
|
||||||
|
[
|
||||||
|
AC_ARG_WITH(readline,
|
||||||
|
AC_HELP_STRING([--with-readline=DIR],
|
||||||
|
[look for the readline library in DIR]),
|
||||||
|
[_do_readline=$withval],[_do_readline=yes])
|
||||||
|
|
||||||
|
if test "$_do_readline" != "no" ; then
|
||||||
|
if test -d "$withval" ; then
|
||||||
|
CPPFLAGS="${CPPFLAGS} -I$withval/include"
|
||||||
|
LDFLAGS="${LDFLAGS} -L$withval/lib"
|
||||||
|
fi
|
||||||
|
|
||||||
|
for _termcap in "" "-ltermcap" "-lcurses" "-lncurses" ; do
|
||||||
|
_readline_save_libs=$LIBS
|
||||||
|
_combo="-lreadline${_termcap:+ $_termcap}"
|
||||||
|
LIBS="$LIBS $_combo"
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether readline via \"$_combo\" is present and sane])
|
||||||
|
|
||||||
|
AC_LINK_IFELSE(AC_LANG_PROGRAM([
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <readline/readline.h>
|
||||||
|
#include <readline/history.h>
|
||||||
|
],[add_history("foobar");]),_found_readline=yes,_found_readline=no)
|
||||||
|
|
||||||
|
AC_MSG_RESULT([$_found_readline])
|
||||||
|
|
||||||
|
LIBS=$_readline_save_libs
|
||||||
|
|
||||||
|
if test $_found_readline = yes ; then
|
||||||
|
AC_DEFINE(HAVE_LIBREADLINE,1,
|
||||||
|
[Define to 1 if you have a fully functional readline library.])
|
||||||
|
AC_SUBST(LIBREADLINE,$_combo)
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
unset _termcap
|
||||||
|
unset _readline_save_libs
|
||||||
|
unset _combo
|
||||||
|
unset _found_readline
|
||||||
|
fi
|
||||||
|
])dnl
|
@ -1,3 +1,7 @@
|
|||||||
|
2004-12-18 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
|
* Makefile.am: Link with readline where needed.
|
||||||
|
|
||||||
2004-10-28 Werner Koch <wk@g10code.com>
|
2004-10-28 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* Makefile.am (other_libs): New. Also include LIBICONV. Noted by
|
* Makefile.am (other_libs): New. Also include LIBICONV. Noted by
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
# Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
|
# Copyright (C) 1998, 1999, 2000, 2001, 2003,
|
||||||
|
# 2004 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is part of GnuPG.
|
# This file is part of GnuPG.
|
||||||
#
|
#
|
||||||
@ -28,7 +29,7 @@ noinst_PROGRAMS = mpicalc bftest clean-sat mk-tdata shmtest
|
|||||||
|
|
||||||
gpgsplit_LDADD = $(needed_libs) $(other_libs) @ZLIBS@
|
gpgsplit_LDADD = $(needed_libs) $(other_libs) @ZLIBS@
|
||||||
mpicalc_LDADD = $(needed_libs) $(other_libs) @W32LIBS@
|
mpicalc_LDADD = $(needed_libs) $(other_libs) @W32LIBS@
|
||||||
bftest_LDADD = $(needed_libs) $(other_libs) @W32LIBS@ @DLLIBS@ @NETLIBS@
|
bftest_LDADD = $(needed_libs) $(other_libs) @W32LIBS@ @DLLIBS@ @NETLIBS@ @LIBREADLINE@
|
||||||
shmtest_LDADD = $(needed_libs) $(other_libs)
|
shmtest_LDADD = $(needed_libs) $(other_libs) @LIBREADLINE@
|
||||||
|
|
||||||
gpgsplit mpicalc bftest shmtest: $(needed_libs)
|
gpgsplit mpicalc bftest shmtest: $(needed_libs)
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2004-12-18 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
|
* ttyio.c: Use only HAVE_LIBREADLINE to detect readline
|
||||||
|
availability.
|
||||||
|
|
||||||
2004-12-16 David Shaw <dshaw@jabberwocky.com>
|
2004-12-16 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
* srv.h: Don't include arpa/nameser.h unless we have it. Include
|
* srv.h: Don't include arpa/nameser.h unless we have it. Include
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#ifdef HAVE_READLINE_READLINE_H
|
#ifdef HAVE_LIBREADLINE
|
||||||
#include <readline/readline.h>
|
#include <readline/readline.h>
|
||||||
#include <readline/history.h>
|
#include <readline/history.h>
|
||||||
#endif
|
#endif
|
||||||
@ -162,7 +162,7 @@ init_ttyfp(void)
|
|||||||
tty_get_ttyname (), strerror(errno) );
|
tty_get_ttyname (), strerror(errno) );
|
||||||
exit(2);
|
exit(2);
|
||||||
}
|
}
|
||||||
#if defined(HAVE_READLINE_READLINE_H) && defined(HAVE_LIBREADLINE)
|
#ifdef HAVE_LIBREADLINE
|
||||||
rl_catch_signals = 0;
|
rl_catch_signals = 0;
|
||||||
rl_instream = rl_outstream = ttyfp;
|
rl_instream = rl_outstream = ttyfp;
|
||||||
#endif
|
#endif
|
||||||
@ -512,7 +512,7 @@ do_get( const char *prompt, int hidden )
|
|||||||
char *
|
char *
|
||||||
tty_get( const char *prompt )
|
tty_get( const char *prompt )
|
||||||
{
|
{
|
||||||
#if defined(HAVE_READLINE_READLINE_H) && defined(HAVE_LIBREADLINE)
|
#ifdef HAVE_LIBREADLINE
|
||||||
if (!batchmode && !no_terminal) {
|
if (!batchmode && !no_terminal) {
|
||||||
char *line;
|
char *line;
|
||||||
char *buf;
|
char *buf;
|
||||||
@ -544,7 +544,7 @@ tty_get( const char *prompt )
|
|||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif /* HAVE_READLINE_READLINE_H && HAVE_LIBREADLINE */
|
#endif /* HAVE_LIBREADLINE */
|
||||||
return do_get( prompt, 0 );
|
return do_get( prompt, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user