Ralf Wildenhues wrote:
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
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 configure.ac or
Makefile.am or some other local configuration.
There is. You could just as well put this line in configure.ac, 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.
Cheers,
Ralf
Thanks again, I'll probably use the second method since until I either
quit or die, I suspect I'll be the only one ever working with this
source. I set it up so someone could easily come in and take over in
case I died or something.
I have to occasionally have to set the --prefix and --sysconf parameters
to something other than default. When I need to build and distribute
binaries/files I have to build them in /var/root. I then chroot
/var/root and it looks like a real system and I can do my rpmbuilds from
there. I can't do it on the running system since it's usually running
development versions of the programs. Since I only have one system, I
do builds from chroot. It works OK as long as I remember to change both
the prefix and the sysconf parameters.
Jim.