test: protect more yacc declarations against C vs. C++ linkage.
[automake.git] / t / backcompat.sh
blob85dffc1921554345afe3932272d2c16fc39c7c1b
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 # Test usage of AM_INIT_AUTOMAKE with two or three arguments, for
18 # backward-compatibility.
20 . test-init.sh
22 cat > Makefile.am <<'END'
23 .PHONY: test display
25 ## Might be useful for debugging.
26 display:
27 ## The following should be substituted by AM_INIT_AUTOMAKE.
28 @echo PACKAGE = $(PACKAGE)
29 @echo VERSION = $(VERSION)
30 ## The following should not be substituted, as we used the
31 ## old form of AC_INIT.
32 @echo PACKAGE_NAME = $(PACKAGE_NAME)
33 @echo PACKAGE_VERSION = $(PACKAGE_VERSION)
34 @echo PACKAGE_TARNAME = $(PACKAGE_TARNAME)
35 @echo PACKAGE_STRING = $(PACKAGE_STRING)
37 test: display
38 test x'$(PACKAGE)' = x'FooBar'
39 test x'$(VERSION)' = x'0.7.1'
40 test x'$(PACKAGE_NAME)' = x
41 test x'$(PACKAGE_VERSION)' = x
42 test x'$(PACKAGE_TARNAME)' = x
43 test x'$(PACKAGE_STRING)' = x
45 .NOTPARALLEL:
46 END
48 for ac_init in 'AC_INIT' 'AC_INIT([Makefile.am])'; do
49 for am_extra_args in '' ', []' ', [:]' ', [false]'; do
50 rm -rf autom4te*.cache config* Makefile.in Makefile
51 unindent > configure.ac <<END
52 $ac_init
53 AM_INIT_AUTOMAKE([FooBar], [0.7.1]$am_extra_args)
54 AC_CONFIG_FILES([Makefile])
55 AC_OUTPUT
56 END
57 cat configure.ac # For debugging.
58 $ACLOCAL
59 $AUTOCONF
60 $AUTOMAKE -Wno-obsolete
61 ./configure
62 $MAKE test
63 done
64 done