doc: update Vala documentation
[automake.git] / t / auxdir-cc-pr15981.sh
blob514cfe73a8421ad317e435896125cf86d7f4722f
1 #! /bin/sh
2 # Copyright (C) 2014-2024 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)
7 # any later version.
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 <https://www.gnu.org/licenses/>.
17 # Test automake bug#15981: automake 1.14 may use $ac_aux_dir
18 # before it is defined, leading to error messages such as:
19 # "/bin/sh: /home/david/missing: No such file or directory"
21 required=cc
22 . test-init.sh
24 cat > configure.ac <<END
25 AC_INIT([$me], [0.0])
26 AC_USE_SYSTEM_EXTENSIONS
27 AM_INIT_AUTOMAKE([1.11 foreign])
28 AC_CONFIG_FILES([Makefile])
29 AC_SUBST([MISSING])
30 AC_OUTPUT
31 test -n "\${MISSING}"
32 END
34 echo 'int main (void) { return 0; }' > foo.c
36 cat > Makefile.am <<'END'
37 bin_PROGRAMS = foo
39 # Without quotes around '--help' and with an empty $(MISSING), make might
40 # strip the trailing '--', call Bash's 'help' builtin, and have this test
41 # succeed spuriously. Yes, that has happened in practice :-(
42 test:
43 $(MISSING) '--help'
44 END
46 $ACLOCAL
47 $AUTOCONF
48 $AUTOMAKE
50 ./configure 2>stderr || { cat stderr >&2; exit 1; }
51 cat stderr >&2
52 $FGREP "missing" stderr && exit 1
54 $MAKE all
55 $MAKE test