Skip to content

Commit

Permalink
build-sys: set localstatedir and sysconfdir default
Browse files Browse the repository at this point in the history
Let's follow our policy for default directories and explicitly default
to localstatedir=/var and sysconfdir=/etc when the default $prefix is
used.

Reported-by: Bruce Dubbs <bruce.dubbs@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
  • Loading branch information
karelzak committed Feb 19, 2021
1 parent 4f62b0b commit 3d28996
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions configure.ac
Expand Up @@ -74,6 +74,17 @@ AS_CASE([$exec_prefix:$prefix],
]
)

# Check whether prefix=/usr
AS_CASE([$prefix],
[NONE | /usr],
[AC_MSG_NOTICE([Default --prefix detected.])
AS_CASE([$localstatedir], [NONE | '${prefix}/var' | "${prefix}"/var ],
[localstatedir=/var; AC_MSG_NOTICE([ --localstatedir defaults to /var])])
AS_CASE([$sysconfdir], [NONE | '${prefix}/etc' | "${prefix}"/etc ],
[sysconfdir=/etc; AC_MSG_NOTICE([ --sysconfdir defaults to /etc])])
]
)

# default for old versions without $runstatedir
AS_IF([test x"$runstatedir" = x], [runstatedir='${localstatedir}/run'])
Expand Down Expand Up @@ -2600,14 +2611,19 @@ AC_MSG_RESULT([
prefix: ${prefix}
exec prefix: ${exec_prefix}
runstatedir: ${runstatedir}
bindir: ${bindir}
sbindir: ${sbindir}
libdir: ${libdir}
includedir: ${includedir}
usrbin_execdir: ${usrbin_execdir}
usrsbin_execdir: ${usrsbin_execdir}
usrlib_execdir: ${usrlib_execdir}
localstatedir: ${localstatedir}
runstatedir: ${runstatedir}
includedir: ${includedir}
sysconfdir: ${sysconfdir}
sysconfstaticdir: ${sysconfstaticdir}
vendordir: ${with_vendordir}
compiler: ${CC}
Expand Down

0 comments on commit 3d28996

Please sign in to comment.