2 # Copyright (C) 2010-2015 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 # Make sure that, if AC_CONFIG_AUX_DIR is not specified, Automake tries
18 # to use '.', '..' and '../..', in precisely that order.
26 cat >>configure.ac
<< END
27 AM_MISSING_PROG([NONESUCH],[$nil])
36 echo 'echo %%d3%% $*' > d
3/missing
38 echo 'echo %%d2%% $*' > d
3/d
2/missing
39 chmod +x d
3/d
2/missing
40 echo 'echo %%d1%% $*' > d
3/d
2/d
1/missing
41 chmod +x d
3/d
2/d
1/missing
42 echo 'echo %%d0%% $*' > d
3/d
2/d
1/d
0/missing
43 chmod +x d
3/d
2/d
1/d
0/missing
45 mv configure.ac d
3/d
2/d
1/d
0/
49 cat > Makefile.am
<< 'EOF'
58 # ------------------------------------------- #
59 : We must end up with AC_CONFIG_AUX_DIR
= .
#
60 # ------------------------------------------- #
67 grep "%%d0%%.*$nil" out0
68 grep '%%d[123]' out0
&& exit 1
70 rm -f missing install-sh
72 # -------------------------------------------- #
73 : We must end up with AC_CONFIG_AUX_DIR
= ..
#
74 # -------------------------------------------- #
76 # Automake finds 'install-sh' in '.', so it assumes that auxdir is '.';
77 # but it won't find 'missing' in '.', so it will fail.
80 grep 'required file.*[^.]\./missing.*not found' stderr
83 # Now things should work.
89 grep "%%d1%%.*$nil" out1
90 grep '%%d[023]' out1
&& exit 1
92 rm -f ..
/missing ..
/install-sh
94 # ----------------------------------------------- #
95 : We must end up with AC_CONFIG_AUX_DIR
= ..
/..
#
96 # ----------------------------------------------- #
98 # Automake finds 'install-sh' in '.', so it assumes that auxdir is '.';
99 # but it won't find 'missing' in '.', so it will fail.
102 grep 'required file.*[^.]\./missing.*not found' stderr
105 # Automake finds 'install-sh' in '..', so it assumes that auxdir is '..';
106 # but it won't find 'missing' in '.', so it will fail.
109 grep 'required file.*[^.]\.\./missing.*not found' stderr
112 # Now things should work.
118 grep "%%d2%%.*$nil" out2
119 grep '%%d[013]' out2
&& exit 1
121 rm -f ..
/..
/missing ..
/..
/install-sh
123 # --------------------------------------------------------- #
124 : AC_CONFIG_AUX_DIR will not be found
: Automake must fail
#
125 # --------------------------------------------------------- #
128 grep 'required file.*missing.*not found' stderr