[Top][All Lists]

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

Re: How do I write a file to default sysconfdir to /etc?

From: Ralf Wildenhues
Subject: Re: How do I write a file to default sysconfdir to /etc?
Date: Thu, 25 Jan 2007 21:44:20 +0100

Hello Jim, Please don't top-post, if possible. Thank you.
* Jim Lynch wrote on Wed, Jan 24, 2007 at 11:17:47PM CET:
Ralf Wildenhues wrote:
> * Jim Lynch wrote on Wed, Jan 24, 2007 at 07:13:41PM CET:
>> [...] if I do a ./configure
>> --sysconfdir=/etc I get what I want.  However as I advance in age, I
>> forget more than I used to so remembering to add that parameter

Thanks for the tips.  I'd really like a way to enable this for specific
applications, not as a site default.

Well, what I'd do in your case is simply keep a build tree around for
the application; to be more precise, merely the config.status file
should be sufficient.  And when building again, I invoke
./config.status --version
to see how it was built the last time, and
./config.status --recheck && ./config.status to regenerate the configuration.
I'm assuming that there isn't a way to do it in or or some other local configuration.

There is.  You could just as well put this line in, but
after AC_INIT:
test "$sysconfdir" = '${prefix}/etc' && sysconfdir=/etc
That way, the default will be /etc but it will be overridable by the
user with an explicit --sysconfdir (but not by changing --prefix alone).
The disadvantage of this approach is that
- the documentation (./configure --help) won't match the semantics,
- your package will behave differently from other packages that use
Autoconf; this may disturb the unsuspecting user,
- `make distcheck' will fail, because your package hard-codes paths
(you can work around it and still have a halfway useful distcheck
with something like
   make distcheck DISTCHECK_CONFIGURE_FLAGS=--sysconfdir=/tmp/foo
but that's simply papering over the issue) Hope that helps.

reply via email to

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