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: check that AM_INIT_AUTOMAKE with two or
18 # three arguments does AC_DEFINE the symbols PACKAGE and VERSION iff the
19 # third argument is empty or non-existent.
21 am_create_testdir
=empty
24 # A trick to make the test run muuuch faster, by avoiding repeated
25 # runs of aclocal (one order of magnitude improvement in speed!).
26 echo 'AC_INIT(x,0) AM_INIT_AUTOMAKE' > configure.ac
28 rm -rf configure.ac autom4te.
*
30 touch install-sh missing
32 cat > config.h.
in <<'END'
37 for am_arg3
in ':' 'false' '#' ' '; do
38 unindent
> configure.ac
<<END
40 AC_CONFIG_HEADERS([config.h])
41 AM_INIT_AUTOMAKE([pkgname], [pkgversion], [$am_arg3])
44 cat configure.ac
# For debugging.
47 cat config.h
# For debugging.
48 # The non-empty third argument should prevent PACKAGE and VERSION
49 # from being AC_DEFINE'd.
50 $EGREP 'pkg(name|version)' config.h
&& exit 1
51 # This is required because even relatively-recent versions of the
52 # BSD shell wrongly exit when the 'errexit' shell flag is active if
53 # the last command of a compound statement fails, even if it should
54 # be protected by the use of "&&".
58 for am_extra_args
in '' ',' ', []'; do
59 unindent
> configure.ac
<<END
61 AC_CONFIG_HEADERS([config.h])
62 AM_INIT_AUTOMAKE([pkgname], [pkgversion]$am_extra_args)
65 cat configure.ac
# For debugging.
68 cat config.h
# For debugging.
69 grep '^ *# *define *PACKAGE *"pkgname" *$' config.h
70 grep '^ *# *define *VERSION *"pkgversion" *$' config.h