2 # Copyright (C) 2012-2017 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
17 # Check that the AM_PROG_MKDIR_P macro is deprecated, but still works.
18 # We should should also still define $(mkdir_p), for backward
23 cat >> configure.ac
<<'END'
24 AC_CONFIG_FILES([sub/Makefile])
29 cat > Makefile.am
<< 'END'
47 cat > sub
/Makefile.am
<< 'END'
48 # Even '$(mkdir_p)' should continue to work also in subdir makefiles.
50 $
(MKDIR_P
) .. ..
/dir
5/d
51 $
(mkdir_p
) .. ..
/dir
5/e
52 @MKDIR_P@ .. ..
/dir
5/f
53 @mkdir_p@ .. ..
/dir
5/g
57 $AUTOCONF -Wnone -Wobsolete -Werror 2>stderr
&& { cat stderr
>&2; exit 1; }
59 grep "^configure\\.ac:5:.*'AM_PROG_MKDIR_P'.*deprecated" stderr
60 grep "[Aa]utoconf-provided 'AC_PROG_MKDIR_P'.* instead" stderr
61 grep "'\$(MKDIR_P)' instead of '\$(mkdir_p)'" stderr
63 $AUTOCONF -Wno-obsolete
70 # Now try using AC_PROG_MKDIR_P, but keeping the occurrences of
71 # $(mkdir_p) and @mkdir_p@. This is to check against a regression
72 # that hit us with Gettext 0.18.2.
73 $MAKE maintainer-clean
74 rm -rf autom4te
*.cache
76 sed 's/AM_PROG_MKDIR/AC_PROG_MKDIR/' configure.ac
> t
77 diff configure.ac t
&& fatal_
"failed to edit configure.ac"
81 && $AUTOCONF -Wall -Werror 2>>stderr \
83 ||
{ cat stderr
>&2; exit 1; }