2 # Copyright (C) 2011-2012 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 # Test aclocal's '--acdir', '--automake-acdir' and '--system-acdir'
18 # options. Also check that stuff in the automake acdir takes precedence
19 # over stuff in the system acdir.
25 cat >> configure.ac <<'END'
29 cat > am/foo.m4 <<'END'
30 AC_DEFUN([AM_INIT_AUTOMAKE], [fake--init--automake])
33 cat > sys/foo.m4 <<'END'
34 AC_DEFUN([MY_MACRO], [my--macro])
37 $ACLOCAL --automake-acdir am
39 $FGREP 'fake--init--automake' configure
40 $FGREP 'MY_MACRO' configure
42 rm -rf autom4te*.cache
44 $ACLOCAL --system-acdir sys
46 $FGREP 'am__api_version' configure
47 $FGREP 'my--macro' configure
49 rm -rf autom4te*.cache
51 $ACLOCAL --automake-acdir am --system-acdir sys
53 $FGREP 'fake--init--automake' configure
54 $FGREP 'my--macro' configure
56 rm -rf autom4te*.cache
58 $ACLOCAL --system-acdir sys --automake-acdir am
60 $FGREP 'fake--init--automake' configure
61 $FGREP 'my--macro' configure
63 rm -rf autom4te*.cache
65 # Stuff in automake acdir takes precedence over stuff in system acdir.
66 cat > am/bar.m4 <<'END'
67 AC_DEFUN([MY_MACRO], [am--macro])
69 $ACLOCAL --automake-acdir am --system-acdir sys
71 $FGREP 'fake--init--automake' configure
72 $FGREP 'am--macro' configure
73 $FGREP 'my--macro' configure && exit 1 # Just to be sure.
75 rm -rf autom4te*.cache
77 # Obsolescent '--acdir' option.
78 $ACLOCAL -Wobsolete --acdir am 2>stderr && { cat stderr >&2; exit 1; }
80 grep '.*--acdir.*deprecated' stderr
82 rm -rf autom4te*.cache
84 $ACLOCAL -Wno-obsolete --acdir am
86 $FGREP 'fake--init--automake' configure
87 $FGREP 'am--macro' configure
89 rm -rf autom4te*.cache
91 $ACLOCAL -Wno-obsolete --acdir sys 2>stderr && { cat stderr >&2; exit 1; }
93 grep 'macro .*AM_INIT_AUTOMAKE.* not found' stderr