[m-dev.] for review: add readline support to mdb

Tyson Dowd trd at cs.mu.OZ.AU
Thu Mar 25 12:41:28 AEDT 1999


On 25-Mar-1999, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> 
> > I suspect on most systems this will end up installing a second copy
> > of readline.
> 
> The code that I posted would, yes.
> 
> But the suggestion I made of autodetecting whether readline
> is installed and only installing it if it's not already there
> should fix that, yes?

Yes.  This is a much nicer idea.

> > 
> > I don't know.  Sounds like it could cause as many problems as it solves.
> 
> You may be right.  But that's the way GNU do it.  So if we are going
> to do it differently, then I want to investigate things reasonably
> thoroughly first.  (Hence this email.)

I suspect GNU do it for historical reasons.  Once upon a time nobody had
readline so you had to include it. 

> 
> > It's not like it's difficult to find or install readline, and it's just
> > an optional feature anyway.  Almost every Linux system out there
> > has package management designed to handle just this sort of problem
> > (ease installation of library dependencies).  Every non-Linux UNIX
> > system has probably installed libreadline by hand anyway a *long* time
> > ago anyway.
> > 
> > Except for the fact the download is already so huge, 600k would seem a
> > lot to pay.
> 
> I note that the gdb-4.17 source dist is nearly 9M, so perhaps our 7.2M
> source dist (including the compiled C files), or 7.8M with readline, is
> not looking so bad ;-).  Our ~14M binary distributions are pretty big,
> though.  If we want to reduce the size of the downloads, then probably
> the best way to do that is to provide a seperate "Lite" [sic] distribution
> which doesn't include the profiler, doesn't include trailing grades of
> the libraries, and doesn't include the non-gc grades.

Agreed.
> Are you sure that gdb and bash don't install readline?
> 
> I had a look at the source code of gdb-4.17, and it sure looks to me
> like it installs readline (including headers and all).  The top-level
> makefile checks for the presence of a readline directory and invokes
> `make install' in that directory if it is present.  And at least for
> the version on archie.au, i.e. ftp.gnu.org, it is shipped with a
> readline directory.  I didn't actually try it out, but I did some
> fooling around with `make -n' and it sure looks like it installs
> libreadline.a and several readline header files.

Perhaps you're right.  I had a quick look at the Debian source for 
bash and it didn't seem to but perhaps it had been changed for Debian.

If they do both install it, I would call it broken.  Perhaps there
was a good reason for it to be broken 5 years ago, but not now.

> > > How about having the Mercury configure script check if readline is
> > > already installed and only install readline if it hasn't already been
> > > installed?  Or perhaps only if the version of readline installed
> > > is older than the one with the Mercury distribution?
> > 
> > Only if incompatible would be preferable.  If people have an older
> > readline library installed that has actually been patched to work
> > on their system, I don't particularly want to force them to upgrade
> > to a new version that may or may not work.  Often the local version
> > has bug fixes that are there for a very good reason.
> 
> OK, so you've convinced me that it shouldn't be installed if there
> is a version already installed.  But you didn't answer my first question.

I thought the second question was simply a refinement of the first.
I'm happy with this approach.

> > And when/if it does install it, it should be installed in the Mercury
> > libs directory, like we do with boehm GC.  
> 
> Why?

Because if you install Mercury in /usr/local and then readline in /usr
it's quite possible that /usr/local will shadow /usr.

We are not providing the readline library for the use of developers, it
is there for debuggable executables to be linked against.  So we should
minimize problems by making it difficult to link against unless you are
using .debug grade.

And then if bash or gdb decides to install readline in $prefix, we don't
have to worry about the Mercury version breaking.

I'm not particularly adamant about this point, because I know it's not
going to affect me.  But I don't like cluttering up the installation
area.

> 
> --------------------
> 
> Anyway, how about if I do the following for now:
> - add the hooks to install readline if it is present in the Mercury 
>   distribution but not found on the system that we're install on;
> - but don't actually include readline in the distribution?
> 
> The hooks are pretty small.

I'm happy with that, but I'd like you to reconsider installing readline
in $prefix/

> 
> Actually I would like to do the same kind of hooks for the
> other subdirectories that we already have; that way we could
> more easily split the Mercury distribution up.

I'd be interested in seeing that.  I think we need to be able to 
split things up a little more in future.

-- 
The quantum sort: 
	while (!sorted) { do_nothing(); }
Tyson Dowd   <tyson at tyse.net>   http://tyse.net/



More information about the developers mailing list