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 <http://www.gnu.org/licenses/>.
17 # Check that the obsolescent idiom of setting $(ACLOCAL_AMFLAGS) in
18 # Makefile.am still works. Remove this test once support for this
19 # obsolescent idiom is removed.
23 cat >> configure.ac
<<'END'
24 MACRO_FOO || AS_EXIT([1])
29 cat > m4_
1/foo.
m4 <<'END'
30 AC_DEFUN([MACRO_FOO], [: > foo])
32 cat > m4_
2/bar.
m4 <<'END'
33 AC_DEFUN([MACRO_BAR], [: > bar])
36 cat > Makefile.am
<<'END'
37 ACLOCAL_AMFLAGS = -I m4_2 --verbose
44 $ACLOCAL -I m4_1
>output
2>&1 ||
{ cat output
; exit 1; }
46 grep 'found macro' output
&& exit 1 # Sanity check.
54 # ACLOCAL_AMFLAGS is used in rebuild rules, so trigger them.
57 sed 's/MACRO_FOO/MACRO_BAR/' configure.ac
> t
61 grep "^aclocal.*:.*found macro.*MACRO_BAR.*m4_2/bar\.m4" output
62 grep "macro.*MACRO_FOO" output
&& exit 1