[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] configmake: support new --runstatedir option

From: Eric Blake
Subject: [PATCH] configmake: support new --runstatedir option
Date: Thu, 12 Sep 2013 16:26:37 -0600

http://lwn.net/Articles/436012/ documents that many distros
are now preferring to use /run rather than /var/run for
storage of pid files and other per-process temporary files
that must not be cleaned out during arbitrary TMPDIR sweeps.
As such, the GNU Coding Standards were recently changed to
recommend a new configure option to make it easy to choose
this directory at configure time, and autoconf 2.70 will
support the new directory by default.  This patch adds support
for propagating results of the new option (for new enough
autotools) or providing a sane default (for older autotools)
into C code.

* m4/configmake.m4 (gl_CONFIGMAKE_PREP): Substitute runstatedir
even if autoconf was too old to provide the command line option.
* modules/configmake (Makefile.am): Propagate it to .h file.

Signed-off-by: Eric Blake <address@hidden>

Just as with the autoconf patch, I'm not pushing this gnulib
patch until the make-stds.texi change goes live.

 ChangeLog          |  7 +++++++
 m4/configmake.m4   | 11 ++++++++---
 modules/configmake |  3 ++-
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0007e17..2145596 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-09-12  Eric Blake  <address@hidden>
+       configmake: support new --runstatedir option
+       * m4/configmake.m4 (gl_CONFIGMAKE_PREP): Substitute runstatedir
+       even if autoconf was too old to provide the command line option.
+       * modules/configmake (Makefile.am): Propagate it to .h file.
 2013-09-09  Eric Blake  <address@hidden>

        glob: fix compilation
diff --git a/m4/configmake.m4 b/m4/configmake.m4
index 823ffc0..330f98d 100644
--- a/m4/configmake.m4
+++ b/m4/configmake.m4
@@ -1,4 +1,4 @@
-# configmake.m4 serial 1
+# configmake.m4 serial 2
 dnl Copyright (C) 2010-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -7,8 +7,9 @@ dnl with or without modifications, as long as this notice is 
 # ------------------
 # Guarantee all of the standard directory variables, even when used with
-# autoconf 2.59 (datarootdir wasn't supported until 2.59c) or automake
-# 1.9.6 (pkglibexecdir wasn't supported until 1.10b.).
+# autoconf 2.59 (datarootdir wasn't supported until 2.59c, and runstatedir
+# in 2.70) or automake 1.9.6 (pkglibexecdir wasn't supported until 1.10b,
+# and runstatedir in 1.14.1).
   dnl Technically, datadir should default to datarootdir.  But if
@@ -43,6 +44,10 @@ AC_DEFUN([gl_CONFIGMAKE_PREP],
   if test "x$localedir" = x; then
     AC_SUBST([localedir], ['${datarootdir}/locale'])
+  dnl Added in autoconf 2.70
+  if test "x$runstatedir" = x; then
+    AC_SUBST([runstatedir], ['${localstatedir}/run'])
+  fi

   dnl Automake 1.9.6 only lacks pkglibexecdir; and since 1.11 merely
   dnl provides it without AC_SUBST, this blind use of AC_SUBST is safe.
diff --git a/modules/configmake b/modules/configmake
index 845e0f4..5a60f4f 100644
--- a/modules/configmake
+++ b/modules/configmake
@@ -11,7 +11,7 @@ gl_CONFIGMAKE_PREP

 # Listed in the same order as the GNU makefile conventions, and
-# provided by autoconf 2.59c+.
+# provided by autoconf 2.59c+ or 2.70.
 # The Automake-defined pkg* macros are appended, in the order
 # listed in the Automake 1.10a+ documentation.
 configmake.h: Makefile
@@ -27,6 +27,7 @@ configmake.h: Makefile
          echo '#define SYSCONFDIR "$(sysconfdir)"'; \
          echo '#define SHAREDSTATEDIR "$(sharedstatedir)"'; \
          echo '#define LOCALSTATEDIR "$(localstatedir)"'; \
+         echo '#define RUNSTATEDIR "$(runstatedir)"'; \
          echo '#define INCLUDEDIR "$(includedir)"'; \
          echo '#define OLDINCLUDEDIR "$(oldincludedir)"'; \
          echo '#define DOCDIR "$(docdir)"'; \

reply via email to

[Prev in Thread] Current Thread [Next in Thread]