bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

readline support broken


From: Golubev I. N.
Subject: readline support broken
Date: Mon, 12 Nov 2001 14:18:11 (GMT)

bc version: 1.06
compiler: gcc 3.0.1

`LIBS' should be used in library features checks rather than
`LDFLAGS'.  Otherwise false link failures occur when desired library
features are available.  See autoconf internals for details.

With newer readline versions readline library features declarations
are not needed and even can conflict with readline headers, causing
compilation failure.  You can make some sophisticated check for
obsolete readline headers, but currently I just remove offending
decls.

--- configure.in        Mon Nov 12 16:42:01 2001
+++ configure.in        Mon Nov 12 16:38:00 2001
@@ -37,8 +37,8 @@
 AC_ARG_WITH(libedit,[  --with-libedit          support fancy BSD command input 
 editing], [
    AC_CHECK_LIB(termcap,tgetent,TERMLIB=-ltermcap)
-   LDSAVE=$LDFLAGS
-   LDFLAGS="$LDFLAGS $TERMLIB"
+   LDSAVE=$LIBS
+   LIBS="$TERMLIB $LIBS"
    AC_CHECK_LIB(edit,el_gets,
       [AC_CHECK_HEADER(histedit.h,
       READLINELIB="-ledit $TERMLIB";bcle=y)],
@@ -47,15 +47,15 @@
      echo Using the libedit library.
      AC_DEFINE(LIBEDIT,1)
    fi
-   LDFLAGS=$LDSAVE
+   LIBS=$LDSAVE
 ])
  
 bcrl=n
 AC_ARG_WITH(readline,[  --with-readline         support fancy command input 
editing], [
    AC_CHECK_LIB(ncurses,tparm,TERMLIB=-lncurses,
      AC_CHECK_LIB(termcap,tgetent,TERMLIB=-ltermcap))
-   LDSAVE=$LDFLAGS
-   LDFLAGS="$LDFLAGS $TERMLIB"
+   LDSAVE=$LIBS
+   LIBS="$TERMLIB $LIBS"
    AC_CHECK_LIB(readline,readline,
       [AC_CHECK_HEADER(readline/readline.h,
       READLINELIB="-lreadline $TERMLIB";bcrl=y)],
@@ -64,7 +64,7 @@
      echo Using the readline library.
      AC_DEFINE(READLINE,1)
    fi
-   LDFLAGS=$LDSAVE
+   LIBS=$LDSAVE
 ])
 
 if test "$LEX" = "flex" ; then
--- bc/scan.l   Mon Nov 12 16:57:32 2001
+++ bc/scan.l   Mon Nov 12 16:55:54 2001
@@ -141,10 +141,6 @@
 static char *rl_start = (char *)NULL;
 static int   rl_len = 0;
 
-/* Definitions for readline access. */
-extern FILE *rl_instream;
-_PROTOTYPE(char *readline, (char *));
-
 /* rl_input puts upto MAX characters into BUF with the number put in
    BUF placed in *RESULT.  If the yy input file is the same as
    rl_instream (stdin), use readline.  Otherwise, just read it.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]