From: Eric Blake Date: Thu, 12 Sep 2013 22:23:31 +0000 (-0600) Subject: configmake: support new --runstatedir option X-Git-Tag: v0.1~37 X-Git-Url: http://erislabs.net/gitweb/?p=gnulib.git;a=commitdiff_plain;h=ecac7ac53769f5363df8b98c5696cf7a40a25f82 configmake: support new --runstatedir option 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 --- diff --git a/ChangeLog b/ChangeLog index c56e64dc5..3288c7cb3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2013-09-23 Eric Blake + + 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 ctype, string: depend on extern-inline diff --git a/m4/configmake.m4 b/m4/configmake.m4 index 823ffc0dd..330f98da8 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 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. diff --git a/modules/configmake b/modules/configmake index 845e0f40d..5a60f4f80 100644 --- a/modules/configmake +++ b/modules/configmake @@ -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)"'; \