binutils-gdb/readline/examples/autoconf/wi_LIB_READLINE
Jan Kratochvil cc88a640ca Imported readline 6.2, and upstream patch 001.
[patch 0/3] readline-6.2 rebase
http://sourceware.org/ml/gdb-patches/2011-05/msg00003.html
[patch 1/3] readline-6.2: Merge of already posted patches
http://sourceware.org/ml/gdb-patches/2011-05/msg00004.html
	=
	[Bug-readline] [RFC/readline] bind.c, rl_function_dumper, Free allocated
	http://lists.gnu.org/archive/html/bug-readline/2011-03/msg00000.html
	[Bug-readline] [patch] Fix underquotation in readline/examples/rlfe/conf
	http://lists.gnu.org/archive/html/bug-readline/2011-04/msg00001.html
	[Bug-readline] [patch] Makefile.in htm<->html
	http://lists.gnu.org/archive/html/bug-readline/2011-04/msg00002.html
	Re: [Bug-readline] [patch] Makefile.in dependency: callback.o: xmalloc.h
	http://lists.gnu.org/archive/html/bug-readline/2011-04/msg00004.html
	[Bug-readline] [patch] Remove . from the VPATH directive
	http://lists.gnu.org/archive/html/bug-readline/2011-04/msg00005.html
	Eli Zaretskii's __MSDOS__ / __GO32__ / __MINGW32__ / __DJGPP__ stuff:
	http://sourceware.org/ml/gdb/2011-04/msg00002.html
	Jan Kratochvil's patch for FSF GDB tree local-specific changes:
	http://sourceware.org/ml/gdb/2011-04/msg00006.html
	Preservation of existing ChangeLog.gdb files, their updates.
[patch 2/3] readline-6.2: Workaround "ask" regression
http://sourceware.org/ml/gdb-patches/2011-05/msg00005.html
[patch 3/3] readline-6.2: Revert 5.x compat., apply 6.x compat.
http://sourceware.org/ml/gdb-patches/2011-05/msg00006.html
[patch 4/3] readline-6.2: Substitute inc-hist.texinfo
http://sourceware.org/ml/gdb-patches/2011-05/msg00010.html

readline/
	Workaround gdb.base/completion.exp regression on readline-6.2.
	* complete.c (get_y_or_n): Disable the return on RL_STATE_CALLBACK.

	Imported readline 6.2, and upstream patch 001.
	* configure: Regenerate.

readline/doc/
	* hsuser.texi (Using History Interactively): Disable !BashFeatures
	@defcodeindex.  Make the `Programming with GNU History' reference
	external.
	* inc-hist.texinfo: Remove.

	Imported readline 6.2, and upstream patch 001.

readline/examples/
	Imported readline 6.2, and upstream patch 001.

readline/examples/rlfe/
	Imported readline 6.2, and upstream patch 001.

gdb/
	* config.in: Regenerate.
	* configure: Regenerate.
	* configure.ac <--with-system-readline> (for readline_echoing_p):
	Remove the test.
	* tui/tui-io.c (tui_old_readline_echoing_p): Rename to ...
	(tui_old_rl_echoing_p): ... here.
	(tui_setup_io): Rename extern declaration readline_echoing_p to
	_rl_echoing_p.  Adjust assignments for the both renames.

gdb/doc/
	* Makefile.in (GDB_DOC_SOURCE_INCLUDES): Rename inc-hist.texinfo to
	hsuser.texi.
	* gdb.texinfo <!SYSTEM_READLINE>: Rename inc-hist.texinfo inclusion and
	comment to hsuser.texi.  Change rluser.texi name in the comment.
2011-05-11 23:38:44 +00:00

77 lines
2.2 KiB
Plaintext

dnl Borut Razem
dnl
dnl This macro checks for the presence of the readline library.
dnl It works also in cross-compilation environment.
dnl
dnl To get it into the aclocal.m4 dnl file, do this:
dnl aclocal -I . --verbose
dnl
dnl The --verbose will show all of the files that are searched
dnl for .m4 macros.
AC_DEFUN([wi_LIB_READLINE], [
dnl check for the readline.h header file
AC_CHECK_HEADER(readline/readline.h)
if test "$ac_cv_header_readline_readline_h" = yes; then
dnl check the readline version
cat > conftest.$ac_ext <<EOF
#include <stdio.h>
#include <readline/readline.h>
wi_LIB_READLINE_VERSION RL_VERSION_MAJOR RL_VERSION_MINOR
EOF
wi_READLINE_VERSION=$($CPP $CPPFLAGS conftest.$ac_ext | sed -n -e "s/^wi_LIB_READLINE_VERSION *\([[0-9\]][[0-9\]]*\) *\([[0-9\]][[0-9\]]*\)$/\1.\2/p")
rm -rf conftest*
if test -n "$wi_READLINE_VERSION"; then
wi_MAJOR=$(expr $wi_READLINE_VERSION : '\([[0-9]][[0-9]]*\)\.')
wi_MINOR=$(expr $wi_READLINE_VERSION : '[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*$\)')
if test $wi_MINOR -lt 10; then
wi_MINOR=$(expr $wi_MINOR \* 10)
fi
wi_READLINE_VERSION=$(expr $wi_MAJOR \* 100 + $wi_MINOR)
else
wi_READLINE_VERSION=-1
fi
dnl check for the readline library
ac_save_LIBS="$LIBS"
# Note: $LIBCURSES is permitted to be empty.
for LIBREADLINE in "-lreadline.dll" "-lreadline" "-lreadline $LIBCURSES" "-lreadline -ltermcap" "-lreadline -lncurses" "-lreadline -lcurses"
do
AC_MSG_CHECKING([for GNU Readline library $LIBREADLINE])
LIBS="$ac_save_LIBS $LIBREADLINE"
AC_TRY_LINK([
/* includes */
#include <stdio.h>
#include <readline/readline.h>
],[
/* function-body */
int dummy = rl_completion_append_character; /* rl_completion_append_character appeared in version 2.1 */
readline(NULL);
],[
wi_cv_lib_readline=yes
AC_MSG_RESULT(yes)
],[
wi_cv_lib_readline=no
AC_MSG_RESULT(no)
])
if test "$wi_cv_lib_readline" = yes; then
AC_SUBST(LIBREADLINE)
AC_DEFINE_UNQUOTED(HAVE_LIBREADLINE, $wi_READLINE_VERSION, [Readline])
break
fi
done
LIBS="$ac_save_LIBS"
fi
])