]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
compat: restore AM_PROG_MKDIR, again
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 14 Jan 2013 19:43:24 +0000 (20:43 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 16 Jan 2013 12:19:11 +0000 (13:19 +0100)
OK, this is getting ridiculous, but we cannot remove this macro yet
(and, yes, the fault for this mess lies entirely on me; let's not
dwell on that, thank you very much).

Gettext (so far the greatest "offender" in the use of AM_PROG_MKDIR), in
its latest release 0.18.2, has removed all the uses of that macro still
present in its code base.  So I thought we could finally and safely
remove it.  Wrong.  If a package's 'configure.ac' contains a call like:

   AM_GNU_GETTEXT_VERSION([0.18])

then the 'autopoint' script will bring the data files from the Gettext
release *1.18* into the package's tree -- yes, even even if the developer
has installed *and is using* Gettext 1.18.2!  Now, these data files
comprise m4 files (that will be seen by subsequent aclocal and autoconf
calls), and of course, the pre-0.18.2 version of some of these files
still contains occurrences of AM_PROG_MKDIR_P -- so Automake 1.13 errors
out, and we lose.  This has already happened in practice:

  <http://lists.gnu.org/archive/html/bug-grep/2013-01/msg00003.html>

Moreover, while we might see it as not unreasonable to ask a developer
using Automake 1.14 to also update Gettext to 1.18.2, that would not
be enough; in order for gettext to use the correct data files, our
developer would have to update his configure.ac to read:

   AM_GNU_GETTEXT_VERSION([0.18.2])

thus requiring *all* of his co-developers to install Gettext 1.18.2,
even if they are still using, say, Automake 1.13.  Bad.

So we re-instate this macro as a simple alias for AC_PROG_MKDIR (plus
a non-fatal runtime warning in the 'obsolete' category), and drop any
plan to remove it (see how much good those plans have done us so far).

Note that NEWS is not yet adjusted, since we'll have to adjust it in
maint before (to minimize spurious merge conflicts).

* doc/automake.texi: Update.
* PLANS/obsolete-removed/am-prog-mkdir-p.txt: Likewise.
* t/gettext-macros.sh: Adjust.
* t/am-prog-mkdir-p.sh: New test.
* t/mkdir_p.sh: Remove, folded into the new one.
* t/am-prog-mkdir-p-no-more: Remove as superseded.
* t/list-of-tests.mk: Adjust.
* t/obsolete-err.m4: Re-instate AM_PROG_MKDIR_P as a working
alias for AC_PROG_MKDIR_P (albeit giving runtime warnings, and
calling AC_SUBST on 'mkdir_p' too).
* m4/init.m4 (AM_INIT_AUTOMAKE): No longer call AC_SUBST for
'mkdir_p', as that is once again AM_PROG_MKDIR_P's business.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
PLANS/obsolete-removed/am-prog-mkdir-p.txt
doc/automake.texi
m4/init.m4
m4/obsolete-err.m4
t/am-prog-mkdir-p-no-more.sh [deleted file]
t/am-prog-mkdir-p.sh [moved from t/mkdir_p.sh with 56% similarity]
t/gettext-macros.sh
t/list-of-tests.mk

index b096ecece96ad3a35bd99082ff4f4fbba4e2f44d..4143fac85c4f6bf7ac5cd3ab6311ddf2e9cfaabf 100644 (file)
@@ -1,67 +1,9 @@
-In Automake 1.13.x
-------------------
+We have dropped any plan to remove the obsolescent macro AM_PROG_MKDIR_P,
+(today just an alias for the Autoconf-provided macro AC_PROG_MKDIR_P), as
+well as the related $(mkdir_p) make variable and the @mkdir_p@ configure
+substitution.
 
-We had already scheduled the removal of the long-deprecated AM_PROG_MKDR_P
-macro (superseded by the autoconf-provided one AC_PROG_MKDIR_P) for
-Automake 1.13 -- see commit 'v1.12-20-g8a1c64f'.
+That planned removal has already proven source of countless headaches and
+backward-compatibility issues, which vastly outweigh any "clean-up benefit"
+we would get from the removal of that obsolescent but unobtrusive cruft.
 
-Alas, it turned out the latest Gettext version at the time (0.18.1.1) was
-still using that macro:
-
-  <http://lists.gnu.org/archive/html/automake/2012-09/msg00010.html>
-
-And since the maintenance of Gettext was stalled, we couldn't get a fix
-committed and released in time for the appearance of automake 1.13:
-
-  <http://lists.gnu.org/archive/html/bug-gettext/2012-04/msg00018.html>
-  <http://lists.gnu.org/archive/html/bug-gettext/2012-06/msg00012.html>
-  <http://lists.gnu.org/archive/html/bug-gettext/2012-10/msg00001.html>
-
-So, on a strong advice by Jim Meyering, in commit 'v1.12.4-158-gdf23daf'
-we re-introduced AM_PROG_MKDIR_P in Automake.  That has been an
-unfortunate necessity (thanks to Jim for having convinced me of that in
-time!)
-
-
-For Automake 1.14
------------------
-
-Finally, AM_PROG_MKDR_P we'll be fully obsolete in in Automake 1.14 (see
-commit 'v1.12.4-174-g5a28948', merged in master by 'v1.13-5-gb373ad9'),
-while still offering a clear error message for the moment (see follow-up
-commit 'v1.13-30-gd01834b').
-
-We can finally do so because Gettext has got a maintainer in the meantime,
-and a new release has been made that no longer uses AM_PROG_MKDIR_P:
-
-  <http://lists.gnu.org/archive/html/bug-gettext/2012-12/msg00064.html>
-
-We still keep the obsolete '@mkdir_p@' substitution and '$(mkdir_p)'
-variable around though, since they are still used by 'Makefile.in.in'
-template from gettext:
-
-  $ cd ~/src/gettext
-  $ git checkout master
-  $ git describe
-  v0.18.2-4-g3188bbf
-  $ grep mkdir_p gettext-runtime/po/Makefile.in.in | grep -v '^#'
-  mkdir_p = @mkdir_p@
-       $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
-       $(mkdir_p) $(DESTDIR)$$dir; \
-       $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
-       $(mkdir_p) $(DESTDIR)$$dir; \
-
-(see also Automake commit v1.12.1-112-g2551021).
-
-More to the point, it's almost impossible to diagnose usages of those
-macro and substitution using the existing Automake parsing and warning
-infrastructure; it's much easier to just keep them around for a while.
-
-
-The future
-----------
-
-We want to finally remove '@mkdir_p@' and '$(mkdir_p)' as well some
-day.  It would be nice if we could do so with some kind of deprecation,
-but that is not worth too much work.  Anyway, no hurry an no high
-priority for this removal.
index 6ec14b09c8a0ad6716d6c98d428dd5ff9911454f..5eaa2773986a53241454f82cf8e3e46ec0cb075c 100644 (file)
@@ -4050,10 +4050,10 @@ define @code{WITH_DMALLOC} and add @option{-ldmalloc} to @code{LIBS}.
 @cindex obsolete macros
 
 Although using some of the following macros was required in past
-releases, you should not use any of them in new code.  Also, all
-these macros will be @emph{removed in some future Automake version},
-so you should consider updating your @file{configure.ac} to avoid
-problems in the future.
+releases, you should not use any of them in new code.  Also, most
+of these macros will probably be @emph{removed in some future Automake
+version}, so you should consider updating your @file{configure.ac}
+to avoid problems in the future.
 
 @table @code
 
@@ -4064,6 +4064,25 @@ This is an @emph{obsolete wrapper} around @code{AC_PROG_CC_C_O}.  New
 code needs not to use this macro.  It will be deprecated, and then
 removed, in future Automake versions.
 
+@item AM_PROG_MKDIR_P
+@acindex AM_PROG_MKDIR_P
+@cindex @code{mkdir -p}, macro check
+@vindex MKDIR_P
+@vindex mkdir_p
+
+From Automake 1.8 to 1.9.6 this macro used to define the output
+variable @code{mkdir_p} to one of @code{mkdir -p}, @code{install-sh
+-d}, or @code{mkinstalldirs}.
+
+Nowadays Autoconf provides a similar functionality with
+@code{AC_PROG_MKDIR_P} (@pxref{Particular Programs, , Particular
+Program Checks, autoconf, The Autoconf Manual}), however this defines
+the output variable @code{MKDIR_P} instead.  In case you are still
+using the @code{AM_PROG_MKDIR_P} macro in your @file{configure.ac},
+or its provided variable @code{$(mkdir_p)} in your @file{Makefile.am},
+you are advised to switch ASAP to the more modern Autoconf-provided
+interface instead.
+
 @end table
 
 @node Private Macros
index 6857c4410f802ddedee8e0785bf70795638066eb..d7d4013565a3eeda579f8efefb5ff34e2aec3c7f 100644 (file)
@@ -79,11 +79,6 @@ 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:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
-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
index a94a651bd1104c36262f885bfa1a508ca988c3e1..1ba6df35430e276f61a96e3716b3d067285e87ef 100644 (file)
@@ -1,6 +1,5 @@
 #  -*- Autoconf -*-
-# Obsolete and "removed" macros, that must however still report explicit
-# error messages when used, to smooth transition.
+# Deprecated, obsolescent or and obsolete macros.
 #
 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
 #
@@ -8,6 +7,14 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])dnl
+AC_DIAGNOSE([obsolete],
+[macro '$0' is deprecated.
+You should use the Autoconf-provided 'AC][_PROG_MKDIR_P' macro instead,
+and use '$(MKDIR_P)' instead of '$(mkdir_p)' in your Makefile.am files.])])
+
 dnl TODO: Remove in Automake 1.15.
 AC_DEFUN([AM_CONFIG_HEADER],
 [AC_FATAL(['$0': this macro is obsolete.
@@ -20,13 +27,6 @@ AC_DEFUN([AM_PROG_CC_STDC],
     Also, your code should no longer depend upon 'am_cv_prog_cc_stdc',
     but upon 'ac_cv_prog_cc_stdc'.])])
 
-dnl TODO: Remove in Automake 1.16.
-AC_DEFUN([AM_PROG_MKDIR_P],
-[AC_FATAL(['$0': this macro is obsolete.
-    You should simply use the 'AC][_PROG_MKDIR_P' macro instead, and
-    use '$(MKDIR_P)' instead of '$(mkdir_p)' in your Makefile.am
-    files.])])
-
 dnl TODO: Remove in Automake 1.14.
 AC_DEFUN([AM_C_PROTOTYPES],
          [AC_FATAL([automatic de-ANSI-fication support has been removed])])
diff --git a/t/am-prog-mkdir-p-no-more.sh b/t/am-prog-mkdir-p-no-more.sh
deleted file mode 100755 (executable)
index 78a3ef9..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2012-2013 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Check that any attempt to use the obsolete macro AM_PROG_MKDIR_P
-# elicits clear and explicit fatal errors.
-
-. test-init.sh
-
-geterr ()
-{
-    "$@" -Wnone 2>stderr && { cat stderr >&2; exit 1; }
-    cat stderr >&2
-    grep "^configure\.ac:4:.*'AM_PROG_MKDIR_P'.*obsolete" stderr
-    grep "'AC_PROG_MKDIR_P'.* instead" stderr
-    grep " use '\$(MKDIR_P)' instead of '\$(mkdir_p)'.*Makefile" stderr
-}
-
-$ACLOCAL
-mv aclocal.m4 aclocal.sav
-
-echo AM_PROG_MKDIR_P >> configure.ac
-
-geterr $ACLOCAL
-test ! -f aclocal.m4
-
-cat aclocal.sav "$am_automake_acdir"/obsolete-err.m4 > aclocal.m4
-
-geterr $AUTOCONF
-geterr $AUTOMAKE
-
-:
similarity index 56%
rename from t/mkdir_p.sh
rename to t/am-prog-mkdir-p.sh
index 2e834239af48b8302450f4662c858d1f66a24318..ad5a810f8e8d8f6c000d363bfbd264ab604a24c6 100755 (executable)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# AM_INIT_AUTOMAKE should still define $(mkdir_p), for backward
+# Check that the AM_PROG_MKDIR_P macro is deprecated, but still works.
+# We should should also still define $(mkdir_p), for backward
 # compatibility.
 
 . test-init.sh
 
-cat >> configure.ac << 'END'
+cat >> configure.ac <<'END'
 AC_CONFIG_FILES([sub/Makefile])
+AM_PROG_MKDIR_P
 AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
 SUBDIRS = sub
 all-local:
-       $(mkdir_p) . dir1/a
-       @mkdir_p@ . dir2/b
+       $(MKDIR_P) . dir1/a
+       $(mkdir_p) . dir2/b
+       @MKDIR_P@ . dir3/c
+       @mkdir_p@ . dir4/d
 check-local: all
        test -d dir1/a
        test -d dir2/b
        test -d dir3/c
-       test -d dir3/d
+       test -d dir4/d
+       test -d dir5/e
+       test -d dir5/f
+       test -d dir5/g
 END
 
 mkdir sub
 cat > sub/Makefile.am << 'END'
-# '$(mkdir_p)' should continue to work even in subdir makefiles.
+# Even '$(mkdir_p)' should continue to work also in subdir makefiles.
 all-local:
-       $(mkdir_p) .. ../dir3/c
-       @mkdir_p@ .. ../dir3/d
+       $(MKDIR_P) .. ../dir5/d
+       $(mkdir_p) .. ../dir5/e
+       @MKDIR_P@ .. ../dir5/f
+       @mkdir_p@ .. ../dir5/g
 END
 
 $ACLOCAL
-$AUTOCONF -Werror -Wall
+$AUTOCONF -Wnone -Wobsolete -Werror 2>stderr && { cat stderr >&2; exit 1; }
+cat stderr >&2
+grep "^configure\\.ac:5:.*'AM_PROG_MKDIR_P'.*deprecated" stderr
+grep "[Aa]utoconf-provided 'AC_PROG_MKDIR_P'.* instead" stderr
+grep "'\$(MKDIR_P)' instead of '\$(mkdir_p)'" stderr
+
+$AUTOCONF -Wno-obsolete
 $AUTOMAKE
 
 ./configure
index 67839b4ba9285175745247d6f19ff353acc8d1f4..5a932401250a941375a2311bf2d685825f2878a6 100755 (executable)
@@ -62,7 +62,10 @@ AM_GNU_GETTEXT
 AM_GNU_GETTEXT_VERSION([$autopoint_version])
 END
 
-if ! ($am_gettextize_command --force && test -f m4/gettext.m4); then
+if $am_gettextize_command --force && test -f m4/gettext.m4; then
+  echo "ACLOCAL_PATH='$(pwd)/m4':\$ACLOCAL_PATH" >> get.sh
+  echo "export ACLOCAL_PATH" >> get.sh
+else
   # Older versions of gettext might not have a gettextize program
   # available, but this doesn't mean the user hasn't made the gettext
   # macros available, e.g., by properly setting ACLOCAL_PATH.
@@ -76,12 +79,12 @@ if ! ($am_gettextize_command --force && test -f m4/gettext.m4); then
   fi
 fi
 
-echo "ACLOCAL_PATH='$(pwd)/m4':\$ACLOCAL_PATH" >> get.sh
-echo "export ACLOCAL_PATH" >> get.sh
-
+cat >> get.sh <<'END'
 # Even recent versions of gettext used the now-obsolete 'AM_PROG_MKDIR_P'
 # m4 macro.  So we need the following to avoid spurious errors.
-echo 'AC_DEFUN([AM_PROG_MKDIR_P], [AC_PROG_MKDIR_P([$@])])' >> m4/mk-dirp.m4
+ACLOCAL="$ACLOCAL -Wno-obsolete"
+AUTOMAKE="$AUTOMAKE -Wno-obsolete"
+END
 
 . ./get.sh
 
index d2b687689ee17e524a116200a2c064d84e514d7e..1996de6719f1793ab0dddacc1083329ec1993fc5 100644 (file)
@@ -133,7 +133,7 @@ t/amassign.sh \
 t/am-config-header-no-more.sh \
 t/am-prog-cc-c-o.sh \
 t/am-prog-cc-stdc-no-more.sh \
-t/am-prog-mkdir-p-no-more.sh \
+t/am-prog-mkdir-p.sh \
 t/am-macro-not-found.sh \
 t/amopt.sh \
 t/amopts-location.sh \
@@ -686,7 +686,6 @@ t/missing-version-mismatch.sh \
 t/missing3.sh \
 t/am-missing-prog.sh \
 t/missing-auxfile-stops-makefiles-creation.sh \
-t/mkdir_p.sh \
 t/mkinstall.sh \
 t/mkinst2.sh \
 t/mkinst3.sh \