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)
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 # Backward-compatibility test: try to build and distribute a package
18 # using obsoleted forms of AC_INIT, AM_INIT_AUTOMAKE and AC_OUTPUT.
19 # This script can also serve as mild stress-testing for Automake.
20 # See also the similar test 'backcompat5.test'.
23 am_create_testdir
=empty
26 # Anyone doing something like this in a real-life package probably
27 # deserves to be killed.
28 cat > configure.
in <<'END'
29 dnl: Everything here is *deliberately* underquoted!
31 PACKAGE=nonesuch-zardoz
33 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
40 AC_CONFIG_HEADERS(config.h:config.hin)
41 AM_CONDITIONAL(CROSS_COMPILING, test "$cross_compiling" = yes)
42 AC_OUTPUT(Makefile foo.got:foo1.in:foo2.in:foo3.in)
47 echo @three@
> foo3.
in
49 cat >config.hin
<<'END'
54 cat >> Makefile.am
<<'END'
58 test x'$(PACKAGE)' = x'nonesuch-zardoz'
59 test x'$(VERSION)' = x'nonesuch-0.1'
62 ## Do not anchor the regexps w.r.t. the end of line, because on
63 ## MinGW/MSYS, grep may assume LF line endings only, while our
64 ## 'foo' program may generate CRLF line endings.
65 ./foo | grep '^PACKAGE = nonesuch-zardoz!'
66 ./foo | echo '^VERSION = nonesuch-0\.1!'
75 printf("PACKAGE = %s!\nVERSION = %s!\n", PACKAGE, VERSION);
81 $AUTOMAKE -Wno-obsolete --add-missing
97 distdir
=nonesuch-zardoz-nonesuch-0.1
99 test -f $distdir/quux.c
100 test ! -e $distdir/foo.got