automake-patches
[Top][All Lists]
Advanced

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

[PATCH] compat: substitute '@mkdir_p@' as '$(MKDIR_P)' unconditionally


From: Stefano Lattarini
Subject: [PATCH] compat: substitute '@mkdir_p@' as '$(MKDIR_P)' unconditionally
Date: Tue, 30 Apr 2013 22:40:47 +0200

We had started to do so only when the obsolete AM_PROG_MKDIR_P variable
was used, but that has recently turned out not to be not good enough,
because Gettext 0.18.2 (the latest one at the moment of writing) is using
the modern macro AC_PROG_MKDIR_P in its '*.m4' files, but at the same time
is still using the obsolete make variable '$(mkdir_p)' in its Makefile
fragments.  This has been causing failures in real-world packages
bootstrapped with latest Gettext (0.18.2) and with bleeding-edge automake.

See for example:

  <http://lists.gnu.org/archive/html/bug-tar/2013-04/msg00009.html>

And the worst things is that those failures have been basically silent
and unnoticeable up until the final "make install" --- that is, after
the affected package had been bootstrapped, configured and built.  Yikes!

This issue has been reported to the Gettext developers:

  <http://lists.gnu.org/archive/html/bug-gettext/2013-04/msg00044.html>

But even if they will quickly fix it, Gettext 0.18.2 will remain
affected.

The fix we can implement in Automake is small and unobtrusive enough,
definitely worth having in order to save the users and developers from
having to deal with this hard-to-stop issue.

* m4/init.m4 (AM_INIT_AUTOMAKE): AC_SUBST '@mkdir_p@' to '$(MKDIR_P)'.
* t/am-prog-mkdir-p.sh: Enhance.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 m4/init.m4           |  2 ++
 t/am-prog-mkdir-p.sh | 20 ++++++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/m4/init.m4 b/m4/init.m4
index f9b0965..9c7ab2f 100644
--- a/m4/init.m4
+++ b/m4/init.m4
@@ -22,6 +22,8 @@
 # release and drop the old call support.
 AC_DEFUN([AM_INIT_AUTOMAKE],
 [AC_PREREQ([2.65])dnl
+dnl Without this, packages using Gettext 0.18.2 might break horribly.
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])dnl
 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
 dnl the ones we care about.
 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
diff --git a/t/am-prog-mkdir-p.sh b/t/am-prog-mkdir-p.sh
index ad5a810..b561bfe 100755
--- a/t/am-prog-mkdir-p.sh
+++ b/t/am-prog-mkdir-p.sh
@@ -67,4 +67,24 @@ $AUTOMAKE
 $MAKE check-local
 $MAKE distcheck
 
+# Now try using AC_PROG_MKDIR_P, but keeping the occurrences of
+# $(mkdir_p) and @address@hidden  This is to check against a regression
+# that hit us with Gettext 0.18.2.
+$MAKE maintainer-clean
+rm -rf autom4te*.cache
+
+sed 's/AM_PROG_MKDIR/AC_PROG_MKDIR/' configure.ac > t
+diff configure.ac t && fatal_ "failed to edit configure.ac"
+mv -f t configure.ac
+
+$ACLOCAL 2>stderr \
+  && $AUTOCONF -Wall -Werror 2>>stderr \
+  && test ! -s stderr \
+  || { cat stderr >&2; exit 1; }
+
+$AUTOMAKE
+./configure
+$MAKE check-local
+$MAKE distcheck
+
 :
-- 
1.8.3.rc0.19.g7e6a0cc




reply via email to

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