autoconf
[Top][All Lists]
Advanced

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

Re: Fine-grained install control


From: Robert Lowe
Subject: Re: Fine-grained install control
Date: Thu, 04 May 2006 10:30:46 -0500
User-agent: Thunderbird 1.5.0.2 (Windows/20060308)

Ralf Wildenhues wrote:

Hi Ralf!

FWIW: I did not answer Robert's mail to automake yet, precisely because
it's not trivial.

* Keith MARSHALL wrote on Thu, May 04, 2006 at 04:55:02PM CEST:
Robert Lowe wrote:
I have a small project that needs to install executables under
/usr/local/<package>/, but the manpages under /usr/local/man.
If I use AC_PREFIX_DEFAULT in configure.ac to point to
/usr/local/<package>, how can I override it for manpages?

Just a simple `off the cuff' suggestion.  A quick look in configure
shows that it initialises mandir as:

  mandir='${prefix}/man'

Here it does
  mandir='${datarootdir}/man'

and that defaults to
  ${prefix}/share/man

(with Autoconf-2.59c, that is).

*before* it parses the command line arguments, where that might be
overridden by a `--mandir=...' option.  Thus, for one off use, you
could just inline the assignment:

  mandir=`echo $mandir | sed s?^${prefix}?/usr/local?`

in your configure.ac.

Which will make your package blatantly incompatible with the old version
of the GCS; and will stop working once your package uses Autoconf-2.60
which supports the newer version.

For a slightly more polished, and reusable solution, you could use
something like:

Which has the same problem.

And it looked like an elegant solution!  :-(

to achieve the effect you desire, while still leaving the user the
option to override this with `--mandir=...'.

The same macro could also be used to set an alternative default for,
say, `infodir':

  RL_AC_DEFAULT_OVERRIDE([infodir],[^${prefix}],[/usr/local])

or any of the other default paths defined in terms of ${prefix},
or even ${exec_prefix}.

Why not *just* *use* --mandir?

If everyone always read INSTALL files before just winging it, that
would be fine.

Why not a script that invokes
  configure --mandir=... $@

For the same reason as above.  :-(

for you?  If that's too much, why not add a setting to your and your
preferred users' config.site file(s), so they don't have to remember
this?

Well, it would be nice to have something that can be distributed with
the source kit.  Hmmm, kind of seems like a functional hole, but then
if others haven't asked for it, perhaps its just my hair-brained idea.

Is there anyway in configure.ac to distinguish between the 'default'
mandir, and one set by the user?  If so, wouldn't it be possible to
check, and just fail with a message explaining the mandir has to be
set on the command line?  Or a warning that without it, manpages
will not be installed and then prevent them from being put in the
wrong place?

-Robert




reply via email to

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