2 # Copyright (C) 2005-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 for --install with #serial numbers.
19 am_create_testdir=empty
22 cat > configure.ac << 'END'
32 AC_DEFUN([AM_MACRO1], [:macro11:])
33 AC_DEFUN([AM_MACRO2], [:macro21:])
38 AC_DEFUN([AM_MACRO1], [:macro12:])
43 AC_DEFUN([AM_MACRO2], [:macro23:])
48 AC_DEFUN([AM_MACRO1], [:macro13:])
51 cat >4/mumble.m4 <<EOF
53 AC_DEFUN([AM_MACRO1], [:macro14:])
56 cat >5/ill-formed.m4 <<EOF
60 AC_DEFUN([AM_MACRO1], [:macro15:])
63 cat >6/after-def.m4 <<EOF
64 AC_DEFUN([AM_MACRO1], [:macro16:])
70 rm -rf aclocal.m4 configure autom4te*.cache
73 $ACLOCAL -I 1 -I 2 -I 3 -I 4
75 $FGREP ':macro11:' configure
76 $FGREP ':macro21:' configure
79 $ACLOCAL -I 1 -I 2 -I 3 -I 4 --install
81 $FGREP ':macro12:' configure
82 $FGREP ':macro23:' configure
84 cp -f aclocal.m4 aclocal-m4.sav
86 mv -f aclocal-m4.sav aclocal.m4
87 $ACLOCAL -I 4 -I 1 -I 2 -I 3 --install --dry-run
89 $FGREP ':macro12:' configure
90 $FGREP ':macro23:' configure
93 $ACLOCAL -I 4 -I 1 -I 2 -I 3 --install
95 $FGREP ':macro14:' configure
96 $FGREP ':macro23:' configure
99 $ACLOCAL -I 4 -I 1 -I 2 --install 2>stderr && { cat stderr >&2; Exit 1; }
101 grep 'macro.*AM_MACRO2.*not found' stderr
104 $ACLOCAL -I 4 -I 1 --install
106 $FGREP ':macro14:' configure
107 $FGREP ':macro21:' configure
110 ACLOCAL="$ACLOCAL --system-acdir acdir"
112 cat >acdir/m1.m4 <<EOF
114 AC_DEFUN([AM_MACRO1], [:macro1d:])
115 AC_DEFUN([AM_MACRO2], [:macro2d:])
118 $ACLOCAL -I 4 -I 1 --diff=diff >stdout 2>stderr || {
125 grep '#serial 456' stdout
127 grep 'installing.*4/m1\.m4' stderr
129 $ACLOCAL -I 5 2>stderr && { cat stderr >&2; Exit 1; }
131 test $(grep -c 'ill-formed serial' stderr) -eq 3
133 $ACLOCAL -I 6 2>stderr && { cat stderr >&2; Exit 1; }
135 grep 'serial.*before any macro definition' stderr