From 390997925a3aca1b57969526c3e083761fafe7c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Tue, 20 Aug 2019 11:44:24 +0100 Subject: [PATCH] build: support customization of runstatedir variable with old autoconf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Many distros have moved /var/run to /run with the introduction of systemd. /var/run still exists as a symlink to /run, but its usage is deprecated. autoconf added a --runstatedir option back in 2013 but there's still no new release of autoconf that includes this. gnulib meanwhile added support to propagate this arg's value to configmake.h, but it falls back to $localstatedir/run for autoconf 2.69 and older, which is what every distro today has. To deal with this problem we add a --with-runstatedir arg that then sets the $runstatedir env variable that future autoconf's --runstatedir arg will also use. This finally enables $runstatedir to be pointed to /run. Reviewed-by: Michal Privoznik Signed-off-by: Daniel P. Berrangé --- configure.ac | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/configure.ac b/configure.ac index 890702a89d..7c76a9c9ec 100644 --- a/configure.ac +++ b/configure.ac @@ -129,6 +129,29 @@ if test -d $srcdir/.git && git --version >/dev/null 2>&1 ; then AB_VERSION=`cd $srcdir && git describe --match 'v[[0-9]]*' 2>/dev/null` fi +dnl autoconf 2.70 adds a --runstatedir option so that downstreams +dnl can point to /run instead of the historic /var/run, but +dnl autoconf hasn't had a release since 2012. +dnl +dnl gnulib sets configmake.h to include runstatedir, but sets +dnl it to $localstatedir/run if $runstatedir env var is not set +dnl which is useless for apps that need to use /run without +dnl waiting for autoconf 2.70 +dnl +dnl we introduce --with-runstatedir and then overwrite the +dnl value of $runstatedir so gnulib's configmake.h becomes useful +AC_ARG_WITH( + [runstatedir], + [AS_HELP_STRING( + [--with-runstatedir], + [State directory for temporary sockets, pid files, etc])]) + +if test -n "$with_runstatedir" +then + runstatedir=$with_runstatedir +fi + + gl_EARLY gl_INIT