>From bcc3baae5b6e58132d304e41db79cfa5b27d3bcc Mon Sep 17 00:00:00 2001
Message-Id:
From: Stefano Lattarini
Date: Mon, 9 Jul 2012 10:33:49 +0200
Subject: [PATCH] compat: automake should substitute @mkdir_p@, for backward
compatibility
That has been unwittingly broken by commit v1.12-19-g7a1eb9f of 2012-04-28,
"AM_PROG_MKDIR_P: deprecate, to be removed in Automake 1.13". We thought it
wasn't a big deal, but Jim Meyering reported that @mkdir_p@ is used in
gettext's Makefile.in.in template:
* lib/am/header-vars.am (mkdir_p): Don't define.
* m4/init.m4 (AM_INIT_AUTOMAKE): AC_SUBST 'mkdir_p' with $(MKDIR_P).
* t/mkdir_p.sh, t/mkdirp-deprecation.sh: Enhance.
* NEWS: Update.
Signed-off-by: Stefano Lattarini
---
NEWS | 8 ++++----
lib/am/header-vars.am | 5 -----
m4/init.m4 | 5 +++++
t/mkdir_p.sh | 12 ++++++++----
t/mkdirp-deprecation.sh | 12 ++++++++----
5 files changed, 25 insertions(+), 17 deletions(-)
diff --git a/NEWS b/NEWS
index d38554d..eaab9d1 100644
--- a/NEWS
+++ b/NEWS
@@ -6,10 +6,10 @@ New in 1.12.2:
long-deprecated 'configure.in' name for the Autoconf input file.
You are advised to use the recommended name 'configure.ac' instead.
- - The long-obsolete (since automake 1.10) @mkdir_p@ configure-time
- substitution and AM_PROG_MKDIR m4 macro will be removed in Automake
- 1.13. The $(mkdir_p) should still remain available for the moment
- though.
+ - The long-obsolete (since automake 1.10) AM_PROG_MKDIR m4 macro will
+ be removed in Automake 1.13. The $(mkdir_p) make variable and the
+ @mkdir_p@ substitution should still remain available (as aliases of
+ $(MKDIR_P)) for the moment, for better backward compatibility.
- Autoconf 2.65 or later will be required by the next major Automake
version (1.13). Until now, Automake has required Autoconf version
diff --git a/lib/am/header-vars.am b/lib/am/header-vars.am
index c65e08c..ba4aa0b 100644
--- a/lib/am/header-vars.am
+++ b/lib/am/header-vars.am
@@ -77,11 +77,6 @@ NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
-# For better backward compatibility. To be removed once Automake 1.9.x
-# dies out for good. For more background, see:
-#
-mkdir_p = $(MKDIR_P)
-
## dejagnu.am uses these variables. Some users might rely on them too.
?BUILD?build_triplet = @build@
?HOST?host_triplet = @host@
diff --git a/m4/init.m4 b/m4/init.m4
index 85228ba..cf47e76 100644
--- a/m4/init.m4
+++ b/m4/init.m4
@@ -82,6 +82,11 @@ AM_MISSING_PROG([MAKEINFO], [makeinfo])
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+#
+#
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
diff --git a/t/mkdir_p.sh b/t/mkdir_p.sh
index 624365c..2cc68a3 100755
--- a/t/mkdir_p.sh
+++ b/t/mkdir_p.sh
@@ -27,17 +27,21 @@ END
cat > Makefile.am << 'END'
SUBDIRS = sub
all-local:
- $(mkdir_p) . dir1/dir2
+ $(mkdir_p) . dir1/a
+ @mkdir_p@ . dir2/b
check-local: all
- test -d dir1/dir2
- test -d dir1/dir3
+ test -d dir1/a
+ test -d dir2/b
+ test -d dir3/c
+ test -d dir3/d
END
mkdir sub
cat > sub/Makefile.am << 'END'
# '$(mkdir_p)' should continue to work even in subdir makefiles.
all-local:
- $(mkdir_p) .. ../dir1/dir3
+ $(mkdir_p) .. ../dir3/c
+ @mkdir_p@ .. ../dir3/d
END
$ACLOCAL
diff --git a/t/mkdirp-deprecation.sh b/t/mkdirp-deprecation.sh
index 0257391..68ffa58 100755
--- a/t/mkdirp-deprecation.sh
+++ b/t/mkdirp-deprecation.sh
@@ -29,17 +29,21 @@ END
cat > Makefile.am << 'END'
SUBDIRS = sub
all-local:
- $(mkdir_p) . dir1/dir2
+ $(mkdir_p) . dir1/a
+ @mkdir_p@ . dir2/b
check-local: all
- test -d dir1/dir2
- test -d dir1/dir3
+ test -d dir1/a
+ test -d dir2/b
+ test -d dir3/c
+ test -d dir3/d
END
mkdir sub
cat > sub/Makefile.am << 'END'
# '$(mkdir_p)' should continue to work even in subdir makefiles.
all-local:
- $(mkdir_p) .. ../dir1/dir3
+ $(mkdir_p) .. ../dir3/c
+ @mkdir_p@ .. ../dir3/d
END
grep_err ()
--
1.7.9.5