From: Stefano Lattarini Date: Sun, 30 Dec 2012 10:57:02 +0000 (+0100) Subject: obsolete: better error message if AM_PROG_MKDIR_P is used X-Git-Tag: v1.16~144 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d01834bc91bff6773dcd73d70158974c45d9d8e5;p=thirdparty%2Fautomake.git obsolete: better error message if AM_PROG_MKDIR_P is used In Automake 1.14, the long-deprecated macro AM_PROG_MKDIR_P will be removed. Instead of simply dropping the macro definition, which would cause unclear error messages in aclocal and autoconf: configure.ac:4: warning: macro 'AM_PROG_MKDIR_P' not found in library configure.ac:4: error: possibly undefined macro: AM_PROG_MKDIR_P If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. we re-add an AM_PROG_MKDIR_P definition that simply raises a *clear* error message when the macro is used. See also recent similar commits 'v1.13-5-g9c07d89' and 'v1.13-4-g8e921bf' * t/am-prog-mkdir-p-no-more.sh: New test. * t/list-of-tests.mk: Add it. * m4/obsolete-err.m4: Add the new "error-raising" definition for AM_PROG_MKDIR_P. Signed-off-by: Stefano Lattarini --- diff --git a/m4/obsolete-err.m4 b/m4/obsolete-err.m4 index 2d7c518b7..39262f62b 100644 --- a/m4/obsolete-err.m4 +++ b/m4/obsolete-err.m4 @@ -18,6 +18,12 @@ AU_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'.])]) +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.])]) + AC_DEFUN([AM_C_PROTOTYPES], [AC_FATAL([automatic de-ANSI-fication support has been removed])]) AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) diff --git a/t/am-prog-mkdir-p-no-more.sh b/t/am-prog-mkdir-p-no-more.sh new file mode 100755 index 000000000..4a2e6150c --- /dev/null +++ b/t/am-prog-mkdir-p-no-more.sh @@ -0,0 +1,44 @@ +#! /bin/sh +# Copyright (C) 2012 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 . + +# 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 + +: diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk index 7e62e6af6..cd41e6aca 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -133,6 +133,7 @@ t/aminit-moreargs-deprecation.sh \ t/amassign.sh \ t/am-config-header-no-more.sh \ t/am-prog-cc-stdc-no-more.sh \ +t/am-prog-mkdir-p-no-more.sh \ t/am-macro-not-found.sh \ t/amopt.sh \ t/amopts-location.sh \