test: protect more yacc declarations against C vs. C++ linkage.
[automake.git] / t / repeated-options.sh
blob2a7c78acc9dfab9b74da7b9ee4ba4567e823c4c6
1 #! /bin/sh
2 # Copyright (C) 2010-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 automake does not complain on repeated options, nor
18 # generate broken or incorrect makefiles.
20 required='cc bzip2'
21 . test-init.sh
23 cat >configure.ac <<END
24 AC_INIT([$me], [1.0])
25 AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip no-dist-gzip dist-bzip2])
26 AC_PROG_CC
27 AC_CONFIG_FILES([Makefile])
28 AC_OUTPUT
29 END
31 cat > Makefile.am <<'END'
32 AUTOMAKE_OPTIONS = parallel-tests subdir-objects subdir-objects
33 AUTOMAKE_OPTIONS += dist-bzip2 parallel-tests
34 TESTS = foo.test
35 EXTRA_DIST = $(TESTS)
36 TESTS_ENVIRONMENT = EXEEXT='$(EXEEXT)'
37 bin_PROGRAMS = sub/foo
38 .PHONY: test-build
39 test-build:
40 ls -l . sub
41 test -f sub/foo.$(OBJEXT)
42 test -f sub/foo$(EXEEXT)
43 END
45 mkdir sub
47 cat > foo.test <<'END'
48 #!/bin/sh
49 test -f sub/foo$EXEEXT && test -x sub/foo$EXEEXT
50 END
51 chmod a+x foo.test
53 cat > sub/foo.c <<'END'
54 int main (void)
56 return 0;
58 END
60 cp "$am_scriptdir"/test-driver .
62 $ACLOCAL
63 $AUTOMAKE --foreign --foreign -Wall 2>stderr || { cat stderr >&2; exit 1; }
64 test -s stderr && { cat stderr >&2; exit 1; }
65 rm -f stderr
66 $AUTOCONF
68 ./configure
69 $MAKE
70 $MAKE test-build
71 $MAKE check
72 ls -l
73 test -f foo.log
74 test -f test-suite.log
75 $MAKE clean
76 $MAKE distcheck
77 ls -l
78 test -f $me-1.0.tar.bz2
79 test ! -e $me-1.0.tar.gz