]> Savannah Git Hosting - gnulib.git/commitdiff
configmake: support new --runstatedir option
authorEric Blake <eblake@redhat.com>
Thu, 12 Sep 2013 22:23:31 +0000 (16:23 -0600)
committerEric Blake <eblake@redhat.com>
Mon, 23 Sep 2013 16:08:12 +0000 (10:08 -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 <eblake@redhat.com>
ChangeLog
m4/configmake.m4
modules/configmake

index c56e64dc5466ba8b3e01b463c3330ac38ffa4272..3288c7cb319abb6b9ccb79545f2731c08fbf8d3e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-09-23  Eric Blake  <eblake@redhat.com>
+
+       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-22  Paul Eggert  <eggert@cs.ucla.edu>
 
        ctype, string: depend on extern-inline
index 823ffc0dd6424b6f928245536035188320250254..330f98da88b5b54e407c09fb252fe572df090514 100644 (file)
@@ -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 preserved.
 # gl_CONFIGMAKE_PREP
 # ------------------
 # 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).
 AC_DEFUN([gl_CONFIGMAKE_PREP],
 [
   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'])
   fi
+  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.
index 845e0f40daf682a15ae14f07b6145269e8f9be03..5a60f4f8078e157c43c9eaf878ad06ef2a14710f 100644 (file)
@@ -11,7 +11,7 @@ gl_CONFIGMAKE_PREP
 
 Makefile.am:
 # 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)"'; \