Thread: Detecting readline in configure

Detecting readline in configure

From
Peter Eisentraut
Date:
Every once in a while some user complains that "the cursor keys don't work
anymore in psql".  There has even been one case where a major vendor has
shipped binaries without readline support.  While we keep telling them,
"make sure configure finds the library and the header files", this is a
rather difficult thing for users to do reliably, especially if they are
using a pre-packaged deal where no intervention is expected.

I think we should add a --with-readline option to configure, and make
configure die with an error if the option is used and no readline is
found.  If the option is not used, readline would still be used if found.

Comments?

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter



Re: Detecting readline in configure

From
Tom Lane
Date:
Peter Eisentraut <peter_e@gmx.net> writes:
> I think we should add a --with-readline option to configure, and make
> configure die with an error if the option is used and no readline is
> found.  If the option is not used, readline would still be used if found.

This would not help, unless the user was clueful enough to invoke the
option, which would likely not be true.  (AFAICT, the majority of these
complaints come from people who don't even know what libreadline is,
let alone that they have no or only a partial install of it.)

An effective but rather fascist approach would be to make the option be
--without-readline, ie, the *default* behavior of configure is to fail
unless a usable readline is found.  I do not think I like that, since
readline does not qualify as a critical component IMHO.  (And, given
the GPL-vs-every-other-license political agenda of the readline crowd,
I don't want them to think we think that either ;-))

I suggest that the behavior of configure not be changed, but that it be
tweaked to put out a slightly more obvious notice about not being able
to find readline support.  Maybe
checking for libreadline ... nochecking for libedit ... no** NOTICE: I couldn't find libreadline nor libedit.  You
will*not have history support in psql.*
 
        regards, tom lane


Re: Detecting readline in configure

From
Tom Lane
Date:
Peter Eisentraut <peter_e@gmx.net> writes:
> This may be useful as well, but it doesn't help those doing unattended
> builds, such as RPMs and *BSD ports.  In that case you need to abort to
> notify the user that things didn't go the way the package maker had
> planned.

Oh, I see: you are thinking of --with-readline as something a package
maintainer would put into a specfile.  OK, that seems like something
that might be useful to do.

> Let's do both.

Agreed.
        regards, tom lane


Re: Detecting readline in configure

From
Peter Eisentraut
Date:
Tom Lane writes:

> I suggest that the behavior of configure not be changed, but that it be
> tweaked to put out a slightly more obvious notice about not being able
> to find readline support.  Maybe
>
>     checking for libreadline ... no
>     checking for libedit ... no
>     *
>     * NOTICE: I couldn't find libreadline nor libedit.  You will
>     * not have history support in psql.
>     *

This may be useful as well, but it doesn't help those doing unattended
builds, such as RPMs and *BSD ports.  In that case you need to abort to
notify the user that things didn't go the way the package maker had
planned.

Let's do both.

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter



Re: Detecting readline in configure

From
reina@nsi.edu (Tony Reina)
Date:
peter_e@gmx.net (Peter Eisentraut) wrote in message news:<Pine.LNX.4.30.0105211728290.757-100000@peter.localdomain>...
> Every once in a while some user complains that "the cursor keys don't work
> anymore in psql".  There has even been one case where a major vendor has
> shipped binaries without readline support.  While we keep telling them,
> "make sure configure finds the library and the header files", this is a
> rather difficult thing for users to do reliably, especially if they are
> using a pre-packaged deal where no intervention is expected.

Just FYI,

On SGI IRIX, the libreadline is in /usr/freeware/lib and
/usr/freeware/include. It's no big thing to
add the --with-includes and --with-lib, but it would be nice if the
irix template were
told to look for libreadline there.

-Tony


Re: Detecting readline in configure

From
Bill Studenmund
Date:
On Mon, 21 May 2001, Peter Eisentraut wrote:

> Tom Lane writes:
> 
> >     checking for libreadline ... no
> >     checking for libedit ... no
> >     *
> >     * NOTICE: I couldn't find libreadline nor libedit.  You will
> >     * not have history support in psql.
> >     *
> 
> This may be useful as well, but it doesn't help those doing unattended
> builds, such as RPMs and *BSD ports.  In that case you need to abort to
> notify the user that things didn't go the way the package maker had
> planned.

*BSD ports/packages shouldn't have much of a problem. They can encode
dependencies, both in the binary package and in the build-from-source
process. So if the package maker did things right, the packaging system
would have either squalked, or tried to install libreadline before running
configure.

Take care,

Bill