From 880770e06f0c876a81610373c87a85ee7c738aad Mon Sep 17 00:00:00 2001 From: Camm Maguire Date: Sun, 13 Nov 2022 12:55:14 +0000 Subject: [PATCH] TODO: Put a short summary on the line above and replace this paragraph with a longer explanation of this change. Complete the meta-information with other relevant fields (see below for details). To make it easier, the information below has been extracted from the changelog. Adjust it or drop it. gcl (2.6.12-107) unstable; urgency=medium * Version_2.6.13pre103 Gbp-Pq: Name Version_2_6_13pre103 --- configure | 42 ++++++++++++++++++++++++++++++++++++++++++ configure.in | 3 ++- h/gclincl.h.in | 3 +++ o/error.c | 2 ++ o/main.c | 4 ++++ o/prelink.c | 7 ++++++- 6 files changed, 59 insertions(+), 2 deletions(-) diff --git a/configure b/configure index eeb4f79..c4c9fcc 100755 --- a/configure +++ b/configure @@ -7954,6 +7954,48 @@ if test "x$ac_cv_lib_readline_rl_initialize" = xyes; then : $as_echo "#define USE_READLINE 1" >>confdefs.h + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for el_getc in -lreadline" >&5 +$as_echo_n "checking for el_getc in -lreadline... " >&6; } +if ${ac_cv_lib_readline_el_getc+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lreadline $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char el_getc (); +int +main () +{ +return el_getc (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_readline_el_getc=yes +else + ac_cv_lib_readline_el_getc=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_el_getc" >&5 +$as_echo "$ac_cv_lib_readline_el_getc" >&6; } +if test "x$ac_cv_lib_readline_el_getc" = xyes; then : + +$as_echo "#define READLINE_IS_EDITLINE 1" >>confdefs.h + +fi + # These tests discover differences between readline 4.1 and 4.3 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_matches in -lreadline" >&5 $as_echo_n "checking for rl_completion_matches in -lreadline... " >&6; } diff --git a/configure.in b/configure.in index dc24d5e..c61ce21 100644 --- a/configure.in +++ b/configure.in @@ -1707,7 +1707,8 @@ fi if test "$enable_readline" != "no" ; then AC_CHECK_HEADERS([readline/readline.h], AC_CHECK_LIB([readline],[rl_initialize], - [AC_DEFINE(USE_READLINE,1,[use readline library]) + [AC_DEFINE(USE_READLINE,1,[use readline library]) + AC_CHECK_LIB([readline],[el_getc],AC_DEFINE(READLINE_IS_EDITLINE,1,[readline is editline])) # These tests discover differences between readline 4.1 and 4.3 AC_CHECK_LIB([readline],[rl_completion_matches], [AC_DEFINE(HAVE_DECL_RL_COMPLETION_MATCHES,1,[have readline completion matches]) diff --git a/h/gclincl.h.in b/h/gclincl.h.in index 7960206..5465feb 100644 --- a/h/gclincl.h.in +++ b/h/gclincl.h.in @@ -339,6 +339,9 @@ /* system pagewidth */ #undef PAGEWIDTH +/* readline is editline */ +#undef READLINE_IS_EDITLINE + /* asm string to set the stack pointer */ #undef SET_STACK_POINTER diff --git a/o/error.c b/o/error.c index 81861f9..87f1ca4 100755 --- a/o/error.c +++ b/o/error.c @@ -148,6 +148,8 @@ Icall_gen_error_handler(object ci,object cs,object en,object es,ufixnum n,...) { IapplyVector(sSuniversal_error_handler,n,b); + while (1); + } /* diff --git a/o/main.c b/o/main.c index 96b0fbd..15ff44b 100755 --- a/o/main.c +++ b/o/main.c @@ -1201,8 +1201,12 @@ init_main(void) { #endif #ifdef USE_READLINE +#ifdef READLINE_IS_EDITLINE + ADD_FEATURE("EDITLINE"); +#else ADD_FEATURE("READLINE"); #endif +#endif #if !defined(USE_DLOPEN) ADD_FEATURE("NATIVE-RELOC"); #if defined(HAVE_LIBBFD) diff --git a/o/prelink.c b/o/prelink.c index 6d53a4b..ab01e52 100644 --- a/o/prelink.c +++ b/o/prelink.c @@ -8,7 +8,12 @@ extern FILE *stderr __attribute__((weak)); extern FILE *stdout __attribute__((weak)); #ifdef USE_READLINE -#if RL_READLINE_VERSION < 0x0600 +#ifdef READLINE_IS_EDITLINE +#define MY_RL_VERSION 0x0600 +#else +#define MY_RL_VERSION RL_READLINE_VERSION +#endif +#if MY_RL_VERSION < 0x0600 extern Function *rl_completion_entry_function __attribute__((weak)); extern char *rl_readline_name __attribute__((weak)); #else -- 2.30.2