$sysconfdir is silently overridden with /etc when "--prefix" is not used
@pspacek pointed out to me that when you use ./configure
without --prefix
, make install
puts everything under /usr/local
... except the configuration files. I ran ./configure --help
, which yielded:
...
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[/usr/local]
...
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
...
...
So far so good. Then I checked configure.ac
and found this:
#
# Special processing of paths depending on whether --prefix,
# --sysconfdir or --localstatedir arguments were given. What's
# desired is some compatibility with the way previous versions
# of BIND built; they defaulted to /usr/local for most parts of
# the installation, but named.boot/named.conf was in /etc
# and named.pid was in /var/run.
#
# So ... if none of --prefix, --sysconfdir or --localstatedir are
# specified, set things up that way. If --prefix is given, use
# it for sysconfdir and localstatedir the way configure normally
# would. To change the prefix for everything but leave named.conf
# in /etc or named.pid in /var/run, then do this the usual configure way:
# ./configure --prefix=/somewhere --sysconfdir=/etc
# ./configure --prefix=/somewhere --localstatedir=/var
#
# To put named.conf and named.pid in /usr/local with everything else,
# set the prefix explicitly to /usr/local even though that's the default:
# ./configure --prefix=/usr/local
#
case "$prefix" in
NONE)
case "$sysconfdir" in
'${prefix}/etc')
sysconfdir=/etc
;;
esac
case "$localstatedir" in
'${prefix}/var')
localstatedir=/var
;;
esac
;;
esac
git blame
indicates that this bit was added in 2000. I think that in 2018 this is wrong and confusing, especially given that ./configure --help
claims that the default value for $sysconfdir
is PREFIX/etc
. IMHO we should at least address this in master.