2 # Copyright (C) 2010, 2011 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.
23 # A trick to make the test run muuuch faster, by avoiding repeated
24 # runs of aclocal (one order of magnitude improvement in speed!).
25 echo 'AC_INIT(x,0) AM_INIT_AUTOMAKE' > configure.
in
27 rm -rf configure.
in autom4te.
*
29 cat > config.h.
in <<'END'
34 for am_arg3
in ':' 'false' '#' ' '; do
35 unindent
> configure.
in <<END
37 AC_CONFIG_HEADERS([config.h])
38 AM_INIT_AUTOMAKE([pkgname], [pkgversion], [$am_arg3])
41 cat configure.
in # For debugging.
44 cat config.h
# For debugging.
45 # The non-empty third argument should prevent PACKAGE and VERSION
46 # from being AC_DEFINE'd.
47 $EGREP 'pkg(name|version)' config.h
&& Exit
1
48 # This is required because even relatively-recent versions of the
49 # BSD shell wrongly exit when the `errexit' shell flag is active if
50 # the last command of a compound statement fails, even if it should
51 # be protected by the use of "&&".
55 for am_extra_args
in '' ',' ', []'; do
56 unindent
> configure.
in <<END
58 AC_CONFIG_HEADERS([config.h])
59 AM_INIT_AUTOMAKE([pkgname], [pkgversion]$am_extra_args)
62 cat configure.
in # For debugging.
65 cat config.h
# For debugging.
66 grep '^ *# *define *PACKAGE *"pkgname" *$' config.h
67 grep '^ *# *define *VERSION *"pkgversion" *$' config.h