]> git.wh0rd.org - dump.git/commitdiff
Make restore compile with old versions of readline library.
authorStelian Pop <stelian@popies.net>
Mon, 25 Feb 2002 13:54:52 +0000 (13:54 +0000)
committerStelian Pop <stelian@popies.net>
Mon, 25 Feb 2002 13:54:52 +0000 (13:54 +0000)
CHANGES
THANKS
config.h.in
configure
configure.in
restore/interactive.c

diff --git a/CHANGES b/CHANGES
index 574b02268e3c36c24d3780062b0ffa181e563a14..776bedf9e740ef84b6a4719cef1c85692bd65ea2 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,4 @@
-$Id: CHANGES,v 1.164 2002/02/21 14:07:14 stelian Exp $
+$Id: CHANGES,v 1.165 2002/02/25 13:54:52 stelian Exp $
 
 Changes between versions 0.4b27 and 0.4b28 (released ?????????????????)
 =======================================================================
@@ -11,6 +11,13 @@ Changes between versions 0.4b27 and 0.4b28 (released ?????????????????)
        there should be no white space between the option letter and
        the -j or -z parameter, thanks to Kenneth Porter <shiva@well.com>
 
+3.     Made restore work with older versions of the readline library,
+       by checking in configure for several extended symbols. Restore
+       can now be compiled with a readline as old as the 2.0 release
+       (though it may be a good idea to upgrade it to a more recent
+       version...). Thanks to Andrew Donkin <ard@waikato.ac.nz> for
+       reporting the build failures.
+
 Changes between versions 0.4b26 and 0.4b27 (released February 15, 2002)
 =======================================================================
 
diff --git a/THANKS b/THANKS
index 385510d5aef1b4f6a4cee775c36cb27448e97acb..5658e4cf6c3de1eaf693739a36f6c8e49a712b43 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -1,4 +1,4 @@
-$Id: THANKS,v 1.53 2002/01/25 14:59:53 stelian Exp $
+$Id: THANKS,v 1.54 2002/02/25 13:54:52 stelian Exp $
 
 Dump and restore were written by the people of the CSRG at the University
 of California, Berkeley.
@@ -35,6 +35,7 @@ Abhijit Dasgupta      abhijit@ans.net
 John R. Dennison       gerdesas@users.sourceforge.net
 Eugenio Diaz           getnito@yahoo.com
 Andreas Dilger         adilger@turbolinux.com
+Andrew Donkin          ard@waikato.ac.nz
 Bernhard Erdmann       bernhard.erdmann@gmx.de
 Jason Fearon           jasonf@netrider.org.au
 Jeremy Fitzhardinge    jeremy@goop.org
@@ -89,4 +90,4 @@ Jason Venner          jason@idiom.com
 Christian Weisgerber   naddy@mips.rhein-neckar.de
 Kim Yong-jun           loveyou@hackerslab.org
 John Yu                        jky@it.bu.edu
-Ian Zimmerman          itz@speakeasy.org>
+Ian Zimmerman          itz@speakeasy.org
index 7bb86b61a20c1be96ebffafbc77a31a6ce6fc267..9564cc51f4cb13332bad256d5413e9065bb29763 100644 (file)
@@ -73,3 +73,9 @@
 
 /* Define this if you want to include Quick File Access debugging code */
 #undef DEBUG_QFA
+
+/* Define this if your readline libs have the rl_completion_append_character variable */
+#undef HAVE_READLINE_CAC
+
+/* Define this if your readline libs have the rl_completion_matches library */
+#undef HAVE_READLINE_RLCM
index a8bc54e67743a901076389ee2ef651c678d33509..750475d6968732074c6f73d0beee2bb7dd979c54 100755 (executable)
--- a/configure
+++ b/configure
@@ -1965,19 +1965,115 @@ if test "$readline_h" = no -o "$readline_lib" = no; then
        fi
 fi
 
+echo $ac_n "checking for rl_completion_matches in -lreadline""... $ac_c" 1>&6
+echo "configure:1970: checking for rl_completion_matches in -lreadline" >&5
+ac_lib_var=`echo readline'_'rl_completion_matches | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lreadline "-ltermcap" $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1978 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char rl_completion_matches();
+
+int main() {
+rl_completion_matches()
+; return 0; }
+EOF
+if { (eval echo configure:1989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  rlcm=yes
+else
+  echo "$ac_t""no" 1>&6
+rlcm=no
+fi
+
+if test "$rlcm" = yes; then
+       cat >> confdefs.h <<\EOF
+#define HAVE_READLINE_RLCM 1
+EOF
+
+fi
+
+echo $ac_n "checking for rl_completion_append_character in -lreadline""... $ac_c" 1>&6
+echo "configure:2018: checking for rl_completion_append_character in -lreadline" >&5
+ac_lib_var=`echo readline'_'rl_completion_append_character | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lreadline "-ltermcap" $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2026 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char rl_completion_append_character();
+
+int main() {
+rl_completion_append_character()
+; return 0; }
+EOF
+if { (eval echo configure:2037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  rcac=yes
+else
+  echo "$ac_t""no" 1>&6
+rcac=no
+fi
+
+if test "$rcac" = yes; then
+       cat >> confdefs.h <<\EOF
+#define HAVE_READLINE_CAC 1
+EOF
+
+fi
+
 ac_safe=`echo "zlib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for zlib.h""... $ac_c" 1>&6
-echo "configure:1971: checking for zlib.h" >&5
+echo "configure:2067: checking for zlib.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1976 "configure"
+#line 2072 "configure"
 #include "confdefs.h"
 #include <zlib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1981: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2077: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2000,7 +2096,7 @@ zlib_h=no
 fi
 
 echo $ac_n "checking for compress2 in -lz""... $ac_c" 1>&6
-echo "configure:2004: checking for compress2 in -lz" >&5
+echo "configure:2100: checking for compress2 in -lz" >&5
 ac_lib_var=`echo z'_'compress2 | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2008,7 +2104,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lz  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2012 "configure"
+#line 2108 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2019,7 +2115,7 @@ int main() {
 compress2()
 ; return 0; }
 EOF
-if { (eval echo configure:2023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2053,17 +2149,17 @@ fi
 
 ac_safe=`echo "bzlib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for bzlib.h""... $ac_c" 1>&6
-echo "configure:2057: checking for bzlib.h" >&5
+echo "configure:2153: checking for bzlib.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2062 "configure"
+#line 2158 "configure"
 #include "confdefs.h"
 #include <bzlib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2067: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2163: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2086,7 +2182,7 @@ bzlib_h=no
 fi
 
 echo $ac_n "checking for BZ2_bzBuffToBuffCompress in -lbz2""... $ac_c" 1>&6
-echo "configure:2090: checking for BZ2_bzBuffToBuffCompress in -lbz2" >&5
+echo "configure:2186: checking for BZ2_bzBuffToBuffCompress in -lbz2" >&5
 ac_lib_var=`echo bz2'_'BZ2_bzBuffToBuffCompress | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2094,7 +2190,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbz2  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2098 "configure"
+#line 2194 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2105,7 +2201,7 @@ int main() {
 BZ2_bzBuffToBuffCompress()
 ; return 0; }
 EOF
-if { (eval echo configure:2109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2140,12 +2236,12 @@ fi
 for ac_func in err errx verr verrx vwarn vwarnx warn warnx realpath lchown
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2144: checking for $ac_func" >&5
+echo "configure:2240: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2149 "configure"
+#line 2245 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2168,7 +2264,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2193,12 +2289,12 @@ fi
 done
 
 echo $ac_n "checking for glob""... $ac_c" 1>&6
-echo "configure:2197: checking for glob" >&5
+echo "configure:2293: checking for glob" >&5
 if eval "test \"`echo '$''{'ac_cv_func_glob'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2202 "configure"
+#line 2298 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char glob(); below.  */
@@ -2221,7 +2317,7 @@ glob();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_glob=yes"
 else
@@ -2242,10 +2338,10 @@ fi
 
 
 echo $ac_n "checking for extended glob routines""... $ac_c" 1>&6
-echo "configure:2246: checking for extended glob routines" >&5
+echo "configure:2342: checking for extended glob routines" >&5
 if test "$ac_cv_func_glob" = "yes"; then
        cat > conftest.$ac_ext <<EOF
-#line 2249 "configure"
+#line 2345 "configure"
 #include "confdefs.h"
 
 #      include <glob.h>
@@ -2276,12 +2372,12 @@ rm -f conftest*
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2280: checking for ANSI C header files" >&5
+echo "configure:2376: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2285 "configure"
+#line 2381 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -2289,7 +2385,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2293: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2389: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2306,7 +2402,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2310 "configure"
+#line 2406 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -2324,7 +2420,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2328 "configure"
+#line 2424 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -2345,7 +2441,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2349 "configure"
+#line 2445 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2356,7 +2452,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:2360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -2380,12 +2476,12 @@ EOF
 fi
 
 echo $ac_n "checking for quad_t""... $ac_c" 1>&6
-echo "configure:2384: checking for quad_t" >&5
+echo "configure:2480: checking for quad_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_quad_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2389 "configure"
+#line 2485 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2413,12 +2509,12 @@ EOF
 fi
 
 echo $ac_n "checking for u_quad_t""... $ac_c" 1>&6
-echo "configure:2417: checking for u_quad_t" >&5
+echo "configure:2513: checking for u_quad_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_u_quad_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2422 "configure"
+#line 2518 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
index c681be2e328493a5f3fbabe0b9842ec1ca549644..3166457ef8322b8921a23629784325c2381d2848 100644 (file)
@@ -356,6 +356,22 @@ if test "$readline_h" = no -o "$readline_lib" = no; then
        fi
 fi
 
+dnl
+dnl Check for rl_completion_matches
+dnl
+AC_CHECK_LIB(readline, rl_completion_matches, [rlcm=yes], [rlcm=no], "-ltermcap")
+if test "$rlcm" = yes; then
+       AC_DEFINE(HAVE_READLINE_RLCM)
+fi
+
+dnl
+dnl Check for rl_completion_append_character
+dnl
+AC_CHECK_LIB(readline, rl_completion_append_character, [rcac=yes], [rcac=no], "-ltermcap")
+if test "$rcac" = yes; then
+       AC_DEFINE(HAVE_READLINE_CAC)
+fi
+
 dnl
 dnl Check for zlib headers and libraries
 dnl
index 473c11301340f575b09f677805b0379c5c6e3eb2..f252fc825f065db75cdf1d2213e085c81936487f 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: interactive.c,v 1.22 2002/02/04 12:07:38 stelian Exp $";
+       "$Id: interactive.c,v 1.23 2002/02/25 13:54:53 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -836,6 +836,10 @@ onintr(int signo)
 
 #if HAVE_READLINE
 
+#if !HAVE_READLINE_RLCM
+#define rl_completion_matches completion_matches
+#endif
+
 /* A static variable for holding the line. */
 static char *line_read = NULL;
 
@@ -1024,7 +1028,9 @@ initialize_readline(void)
        rl_readline_name = "dump";
        rl_attempted_completion_function = restore_completion;
        rl_completion_entry_function = NULL;
+#if HAVE_READLINE_CAC  /* compile with readline 2.0 */
        rl_completion_append_character = '\0';
+#endif
        rl_instream = terminal;
 }