Merge branch 'yacc-quote-fix'
[automake.git] / tests / backcompat.test
blobec8292c121801f5f7f67333711714e198671bf6f
1 #! /bin/sh
2 # Copyright (C) 2010-2012 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 <http://www.gnu.org/licenses/>.
17 # Test usage of AM_INIT_AUTOMAKE with two or three arguments, for
18 # backward-compatibility.
20 . ./defs || Exit 1
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
44 END
46 for ac_init in 'AC_INIT' 'AC_INIT([Makefile.am])'; do
47 for am_extra_args in '' ', []' ', [:]' ', [false]'; do
48 rm -rf autom4te*.cache config* Makefile.in Makefile
49 unindent > configure.in <<END
50 $ac_init
51 AM_INIT_AUTOMAKE([FooBar], [0.7.1]$am_extra_args)
52 AC_CONFIG_FILES([Makefile])
53 AC_OUTPUT
54 END
55 cat configure.in # For debugging.
56 $ACLOCAL
57 $AUTOCONF
58 $AUTOMAKE
59 ./configure
60 $MAKE test
61 done
62 done