test: protect more yacc declarations against C vs. C++ linkage.
[automake.git] / t / aclocal-install-mkdir.sh
blob933754771b07e81d342a77691ec6336eecd9ef86
1 #! /bin/sh
2 # Copyright (C) 2012-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 # Check that "aclocal --install" creates the local m4 directory if
18 # necessary.
19 # FIXME: this is a good candidate for a conversion to TAP.
21 am_create_testdir=empty
22 . test-init.sh
24 cat > configure.ac <<END
25 AC_INIT([$me], [1.0])
26 MY_MACRO
27 END
29 mkdir sys-acdir
30 cat > sys-acdir/my-defs.m4 <<END
31 AC_DEFUN([MY_MACRO], [:])
32 END
34 ACLOCAL="$ACLOCAL --system-acdir=sys-acdir"
36 $ACLOCAL -I foo --install
37 test -f foo/my-defs.m4
39 $ACLOCAL --install -I "$(pwd)/bar"
40 test -f bar/my-defs.m4
42 $ACLOCAL --install -I baz/sub/sub2
43 test -f baz/sub/sub2/my-defs.m4
45 # What should happen:
46 # * zardoz1 should be created, and required m4 files copied into there.
47 # * zardoz2 shouldn't be preferred to quux, even if the former exists
48 # while the latter does not.
49 mkdir zardoz2
50 $ACLOCAL --install -I zardoz1 -I zardoz2
51 test -d zardoz1
52 grep MY_MACRO zardoz1/my-defs.m4
53 ls zardoz2 | grep . && exit 1
55 # Directories in ACLOCAL_PATH should never be created if they don't
56 # exist.
57 ACLOCAL_PATH="$(pwd)/none:$(pwd)/none2" $ACLOCAL --install && exit 1
58 test ! -e none
59 test ! -e none2
60 ACLOCAL_PATH="$(pwd)/none:$(pwd)/none2" $ACLOCAL --install -I x
61 test -f x/my-defs.m4
62 test ! -e none
63 test ! -e none2
65 # It's better if aclocal doesn't create the first include dir on failure.
66 $ACLOCAL --install -I none -I none2 && exit 1
67 test ! -e none
68 test ! -e none2