Commit ae4cbb69 authored by David Lawrence's avatar David Lawrence
Browse files

[RT 17] Special handling of prefix/sysconfdir/localstatedir. If none

are given, install to /usr/local but use /etc/named.conf and
/var/run/named.pid.  If prefix is given, use it in the other two if they
are not also provided.
parent da0ecdd7
......@@ -51,7 +51,9 @@ SRCS = client.c interfacemgr.c listenlist.c \
@BIND9_MAKE_RULES@
main.@O@: main.c
${CC} ${ALL_CFLAGS} -DVERSION=\"${VERSION}\" -c ${srcdir}/main.c
${CC} ${ALL_CFLAGS} -DVERSION=\"${VERSION}\" \
-DNS_LOCALSTATEDIR=\"${localstatedir}\" \
-DNS_SYSCONFDIR=\"${sysconfdir}\" -c ${srcdir}/main.c
named: ${OBJS} ${UOBJS} ${DEPLIBS}
${LIBTOOL} ${CC} -o $@ ${OBJS} ${UOBJS} ${LIBS}
......
......@@ -66,7 +66,8 @@ EXTERN unsigned int ns_g_debuglevel INIT(0);
/*
* Current config information
*/
EXTERN const char * ns_g_conffile INIT("/etc/named.conf");
EXTERN const char * ns_g_conffile INIT(NS_SYSCONFDIR
"/named.conf");
/*
* Misc.
......@@ -75,7 +76,8 @@ EXTERN isc_boolean_t ns_g_coreok INIT(ISC_TRUE);
EXTERN const char * ns_g_chrootdir INIT(NULL);
EXTERN isc_boolean_t ns_g_foreground INIT(ISC_FALSE);
EXTERN char * ns_g_defaultpidfile INIT("/var/run/named.pid");
EXTERN char * ns_g_defaultpidfile INIT(NS_LOCALSTATEDIR
"/run/named.pid");
EXTERN const char * ns_g_username INIT(NULL);
/*
......
This diff is collapsed.
......@@ -13,7 +13,7 @@ dnl PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
dnl ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
dnl SOFTWARE.
AC_REVISION($Revision: 1.96 $)
AC_REVISION($Revision: 1.97 $)
AC_PREREQ(2.13)
......@@ -38,6 +38,41 @@ ARFLAGS="cruv"
AC_SUBST(AR)
AC_SUBST(ARFLAGS)
dnl
dnl Special processing of paths depending on whether --prefix,
dnl --sysconfdir or --localstatedir arguments were given. What's
dnl desired is some compatability with the way previous versions
dnl of BIND built; they defaulted to /usr/local for most parts of
dnl the installation, but named.boot/named.conf was in /etc
dnl and named.pid was in /var/run.
dnl
dnl So ... if none of --prefix, --sysconfdir or --localstatedir are
dnl specified, set things up that way. If --prefix is given, use
dnl it for sysconfdir and localstatedir the way configure normally
dnl would. To change the prefix for everything but leave named.conf
dnl in /etc or named.pid in /var/run, then do this the usual configure way:
dnl ./configure --prefix=/somewhere --sysconfdir=/etc
dnl ./configure --prefix=/somewhere --localstatedir=/var
dnl
dnl To put named.conf and named.pid in /usr/local with everything else,
dnl set the prefix explicitly to /usr/local even though that's the default:
dnl ./configure --prefix=/usr/local
dnl
case "$prefix" in
NONE)
case "$sysconfdir" in
'${prefix}/etc')
sysconfdir=/etc
;;
esac
case "$localstatedir" in
'${prefix}/var')
localstatedir=/var
;;
esac
;;
esac
dnl
dnl On these hosts, we really want to use cc, not gcc, even if it is
dnl found. The gcc that these systems have will not correctly handle
......
......@@ -29,6 +29,8 @@ bindir = @bindir@
sbindir = @sbindir@
includedir = @includedir@
libdir = @libdir@
sysconfdir = @sysconfdir@
localstatedir = @localstatedir@
DESTDIR =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment