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

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Mar 25 02:44:08 AEDT 1999


On 25-Mar-1999, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> On 24-Mar-1999, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > On 22-Mar-1999, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> > > On 22-Mar-1999, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > > > Estimated hours taken: 10
> > > > 
> > > > Add GNU readline support to the debugger.
> > > 
> > > Just one question first -- why include readline in the source distribution?
> > 
> > Well, the idea is to make it easier for the user to install things,
> > since they only need to install one package, rather than having to install
> > two. 
> 
> They still have to install two packages, they just have to download
> and build once.

That depends on what you mean by two packages.
The total amount of stuff installed is the same, but the number
of commands required to install it is fewer.

> 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?

[Of course the autodetection might fail.  But then the choice is a
little extra disk space (about 1M, i.e. <20 cents worth?) and
installation time (a couple of minutes) v.s. the Mercury debugger being
installed without readline support, and of those two, the former is
preferable, IMHO.]

> > It does increase the size of the source distribution a bit
> > (by about 600k compressed), but that seems like a worthwhile
> > price to pay for ease of installation, I think... no?
> 
> 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.)

> 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.

> > > Readline is not exactly uncommon, I would expect it to be installed
> > > already on any system that has built their own gdb or bash for instance.
> > > 
> > > I don't really like the idea of installing readline as part of the
> > > installation of Mercury -- if you install with prefix of /usr or
> > > /usr/local you might overwrite your current installation of readline.
> > 
> > Yes, this is a potential problem.
> > What do gdb and bash do about this?
> 
> They don't install readline, they just link against it.
>
> We actually install readline as a development library (e.g. we install
> headers and all).

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.

> > 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.

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

Why?

--------------------

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.

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.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.



More information about the developers mailing list