2 # Copyright (C) 2005, 2006, 2008, 2010, 2011, 2012 Free Software
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # Test for --install with #serial numbers.
20 am_create_testdir=empty
23 cat > configure.in << 'END'
33 AC_DEFUN([AM_MACRO1], [:macro11:])
34 AC_DEFUN([AM_MACRO2], [:macro21:])
39 AC_DEFUN([AM_MACRO1], [:macro12:])
44 AC_DEFUN([AM_MACRO2], [:macro23:])
49 AC_DEFUN([AM_MACRO1], [:macro13:])
52 cat >4/mumble.m4 <<EOF
54 AC_DEFUN([AM_MACRO1], [:macro14:])
57 cat >5/ill-formed.m4 <<EOF
61 AC_DEFUN([AM_MACRO1], [:macro15:])
64 cat >6/after-def.m4 <<EOF
65 AC_DEFUN([AM_MACRO1], [:macro16:])
71 rm -rf aclocal.m4 configure autom4te*.cache
74 $ACLOCAL -I 1 -I 2 -I 3 -I 4
76 $FGREP ':macro11:' configure
77 $FGREP ':macro21:' configure
80 $ACLOCAL -I 1 -I 2 -I 3 -I 4 --install
82 $FGREP ':macro12:' configure
83 $FGREP ':macro23:' configure
85 cp -f aclocal.m4 aclocal-m4.sav
87 mv -f aclocal-m4.sav aclocal.m4
88 $ACLOCAL -I 4 -I 1 -I 2 -I 3 --install --dry-run
90 $FGREP ':macro12:' configure
91 $FGREP ':macro23:' configure
94 $ACLOCAL -I 4 -I 1 -I 2 -I 3 --install
96 $FGREP ':macro14:' configure
97 $FGREP ':macro23:' configure
100 $ACLOCAL -I 4 -I 1 -I 2 --install 2>stderr && { cat stderr >&2; Exit 1; }
102 grep 'macro.*AM_MACRO2.*not found' stderr
105 $ACLOCAL -I 4 -I 1 --install
107 $FGREP ':macro14:' configure
108 $FGREP ':macro21:' configure
111 ACLOCAL="$ACLOCAL --system-acdir acdir"
113 cat >acdir/m1.m4 <<EOF
115 AC_DEFUN([AM_MACRO1], [:macro1d:])
116 AC_DEFUN([AM_MACRO2], [:macro2d:])
119 $ACLOCAL -I 4 -I 1 --diff=diff >stdout 2>stderr || {
126 grep '#serial 456' stdout
128 grep 'installing.*4/m1\.m4' stderr
130 $ACLOCAL -I 5 2>stderr && { cat stderr >&2; Exit 1; }
132 test `grep -c 'ill-formed serial' stderr` -eq 3
134 $ACLOCAL -I 6 2>stderr && { cat stderr >&2; Exit 1; }
136 grep 'serial.*before any macro definition' stderr