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]

Re: readline patch for 1.4.0


On Sun, Sep 10, 2000 at 04:23:28PM +0200, Marius Vollmer wrote:
> Albert Chin-A-Young <china@thewrittenword.com> writes:
> 
> > Addes --with-readline=DIR option to specify readline include/library
> > in an alternate directory.
> 
> I don't think we should add this option.  In my opinion, the system
> should be set up in such a way that readline and all other needed
> libraries are automatically found.  This is much easier in the long
> run.

So you advocate people doing:
  $ CPPFLAGS="-I[path to readline include]" \
  LDFLAGS="-L[path to readline lib]" ./configure [blah]

I think it much easier to add --with-readline. Some authors use
--with-readline-includes and --with-readline-libraries to delegate things
further (I think DDD is the only app that does this though). It is not
uncomment for programs to specify an autoconf option to specify the
location of a program. Consider Glib and Gtk. I could go on an on about
other programs that do this (e.g. librep, gnuplot, fvwm, xpdf, xfce,
t1lib, oleo, mgv).

> There are some other changes in your patch that are more intersting,
> tho.
> 
> >  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
> 
> You add "curses", "terminfo", and "termlib" here.  What is the
> motivation for this?  I.e., on what systems do you need this?

On Solaris at least, readline needs the terminal libraries. The above
is stolen from Octave and has been incorporated into many programs using
the readline library (e.g. gnuplot, lftp, librep, sawfish, bc, ddd,
libxml, fvwm).

> > -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
> 
> What are the quotes needed for?

The following:
  AC_CHECK_LIB(readline,main)
does not *properly* determine whether or not you need the readline
library. What you should do is check for a function in the library to
test whether or not you need to link the library. A perfect example of
this is the nsl and socket libraries. On some systems, their
functionality is provided in libc. So, some package maintainers do:
  AC_CHECK_LIB(nsl,main)
  AC_CHECK_LIB(socket,main)
when what they should be doing is testing if nsl and socket provide
what they want like so:
  AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
  AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))

So, you test if the function you need is in libc (or really, in
$LIBS). If not, you start adding other libraries searching for the
*same* function.

-- 
albert chin (china@thewrittenword.com)

_______________________________________________
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]