<short summary of the patch>
authorCamm Maguire <camm@debian.org>
Thu, 11 Aug 2022 17:16:42 +0000 (18:16 +0100)
committerCamm Maguire <camm@debian.org>
Thu, 11 Aug 2022 17:16:42 +0000 (18:16 +0100)
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
configure.in
h/gclincl.h.in
o/error.c
o/main.c
o/prelink.c

index eeb4f7990c83b1299f384b254c3a9a68460066ba..c4c9fccd00babd906bf49cc35a5c77128a998979 100755 (executable)
--- 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; }
index dc24d5e6947a665ed9d080ac81db9a9ef1558331..c61ce2101f5742323bef47d4e58c028ef41e5017 100644 (file)
@@ -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])
index 7960206d9d5b1088757095d89096b4bd268c0145..5465febd7df041456def9abe34e5beac9e6f7c26 100644 (file)
 /* system pagewidth */
 #undef PAGEWIDTH
 
+/* readline is editline */
+#undef READLINE_IS_EDITLINE
+
 /* asm string to set the stack pointer */
 #undef SET_STACK_POINTER
 
index 81861f9513d740b03836dfa587b1e27b649f9b95..87f1ca45fa522d7705fff580c6228db37bfe5e9b 100755 (executable)
--- 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);
+
 }
 
 /*
index 96b0fbd2cfba7ca47932bc2ee2de7c458ead20e3..15ff44bbbb4f70f3c5c51ab3dad2108c2890fc1b 100755 (executable)
--- 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) 
index 6d53a4bd658b7a3edcaa84024f3784ceb14b774d..ab01e5286d68f8d8757818be518c7640e58e62bb 100644 (file)
@@ -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