-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.
@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
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
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
# -*- 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.
#
# 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.
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])])
+++ /dev/null
-#! /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
-
-:
# 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
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.
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
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 \
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 \