1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-23 10:29:58 +01:00
gnupg/m4/readline.m4
NIIBE Yutaka cdb053620a
build: Update to newer autoconf constructs.
* acinclude.m4 (GNUPG_CHECK_ENDIAN): Use AC_COMPILE_IFELSE instead of
AC_TRY_COMPILE.  Use AC_RUN_IFELSE instead of AC_TRY_RUN.
(GNUPG_BUILD_PROGRAM): Use AS_HELP_STRING instead of AC_HELP_STRING.
* configure.ac: Use AC_USE_SYSTEM_EXTENSIONS instead of AC_GNU_SOURCE.
Use AS_HELP_STRING instead of AC_HELP_STRING.
(AC_ISC_POSIX): Replace by AC_SEARCH_LIBS.
(AC_TYPE_SIGNAL): Remove.
* m4/isc-posix.m4: Remove.
* m4/codeset.m4: Update from gnulib.
* m4/gettext.m4: Update from gnulib.
* m4/lcmessage.m4: Update from gnulib.
* m4/socklen.m4: Update from gnulib.
* m4/ldap.m4: Use AS_HELP_STRING instead of AC_HELP_STRING.
Use AC_LINK_IFELSE instead of AC_TRY_LINK.
Use AC_RUN_IFELSE instead of AC_TRY_RUN.
* m4/gpg-error.m4: Update from libgpg-error.
* m4/readline.m4: Update from libgpg-error.
* m4/npth.m4: Update from npth.
* m4/libassuan.m4: Update from libassuan.
* m4/libgcrypt.m4: Update from libgcrypt.
* m4/ksba.m4: Update from libksba.
* m4/ntbtls.m4: Update from ntbtls.
* common/signal.c [!HAVE_DOSISH_SYSTEM] (init_one_signal): Replace
RETSIGTYPE to void.
[!HAVE_DOSISH_SYSTEM] (got_fatal_signal, got_usr_signal): Likewise.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
(cherry picked from commit d66fb3aa53a6c4a815fe35a15e3c61886c5df628)

Still a lot of warnings.  Need to cherry pick more stuff.
2023-08-31 10:05:32 +02:00

67 lines
2.0 KiB
Plaintext

dnl Check for readline and dependencies
dnl Copyright (C) 2004, 2005 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,
AS_HELP_STRING([--with-readline=DIR],
[look for the readline library in DIR]),
[_do_readline=$withval],[_do_readline=yes])
gnupg_cv_have_readline=no
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>
]],[[
rl_completion_func_t *completer;
add_history("foobar");
rl_catch_signals=0;
rl_inhibit_completion=0;
rl_attempted_completion_function=NULL;
rl_completion_matches(NULL,NULL);
]])],[_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)
gnupg_cv_have_readline=yes
break
fi
done
unset _termcap
unset _readline_save_libs
unset _combo
unset _found_readline
fi
])dnl