This is the mail archive of the guile@sources.redhat.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

readline patch for 1.4.0


Addes --with-readline=DIR option to specify readline include/library
in an alternate directory.

-- 
albert chin (china@thewrittenword.com)

-- snip snip
--- guile-readline/configure.in.orig	Fri Jun 23 15:00:32 2000
+++ guile-readline/configure.in	Wed Sep  6 11:19:55 2000
@@ -8,15 +8,34 @@
 AM_PROG_LIBTOOL
 
 dnl Should we check for curses, terminfo, and termlib, too?
-for termlib in ncurses termcap ; do
-   AC_CHECK_LIB(${termlib}, tgoto, 
-                [LIBS="-l${termlib} $LIBS"; break])
+for termlib in ncurses curses termcap terminfo termlib; do
+   AC_CHECK_LIB(${termlib}, tputs, [LIBS="$LIBS -l${termlib}"; break])
 done
 
-AC_CHECK_LIB(readline, main)
-if test $ac_cv_lib_readline_main = no; then
-  AC_MSG_WARN([libreadline was not found on your system.])
-fi
+AC_ARG_WITH(readline,[
+  --with-readline=DIR     use readline include and library in DIR], [
+case "$with_readline" in
+no|yes) ;;
+*)
+  _cppflags=${CPPFLAGS}
+  _ldflags=${LDFLAGS}
+
+  CPPFLAGS="${CPPFLAGS} -I$withval/include"
+  LDFLAGS="${LDFLAGS} -L$withval/lib" ;;
+esac])
+
+AC_CHECK_HEADER(readline/readline.h,
+  AC_CHECK_LIB(readline, readline, ,
+    if test -n "$_cppflags"; then
+      CPPFLAGS=$_cppflags
+      LDFLAGS=$_ldflags
+    fi
+    AC_MSG_WARN([readline library not found on your system])),
+  if test -n "$_cppflags"; then
+    CPPFLAGS=$_cppflags
+    LDFLAGS=$_ldflags
+  fi
+  AC_MSG_WARN([readline library not found on your system]))
 
 AC_CHECK_FUNCS(siginterrupt rl_clear_signals rl_cleanup_after_signal rl_pre_input_hook)
 
@@ -71,8 +90,8 @@
   AC_DEFINE(HAVE_RL_GETC_FUNCTION)
 fi
 
-if test $ac_cv_lib_readline_main = yes \
-        -a $ac_cv_var_rl_getc_function = no; then
+if test "$ac_cv_lib_readline_readline" = yes \
+        -a "$ac_cv_var_rl_getc_function" = no; then
   AC_MSG_WARN([*** libreadline is too old on your system.])
   AC_MSG_WARN([*** You need readline version 2.1 or later.])
 fi
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]