source: trunk/essentials/sys-devel/automake-1.8/tests/warnopts.test

Last change on this file was 3118, checked in by bird, 18 years ago

automake 1.8.5

File size: 2.3 KB
Line 
1#! /bin/sh
2# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
3#
4# This file is part of GNU Automake.
5#
6# GNU Automake is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2, or (at your option)
9# any later version.
10#
11# GNU Automake is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with Automake; see the file COPYING. If not, write to
18# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19# Boston, MA 02111-1307, USA.
20
21# Make sure that we can enable or disable warnings on a per-file basis.
22
23. ./defs || exit 1
24
25set -e
26
27cat >>configure.in <<END
28AC_CONFIG_FILES([sub/Makefile])
29AC_OUTPUT
30END
31
32mkdir sub
33
34# These two Makefile contain the same errors, but have different
35# warnings disabled.
36
37cat >Makefile.am <<END
38AUTOMAKE_OPTIONS = -Wno-obsolete
39INCLUDES = -Ifoo
40foo_SOURCES = unused
41SUBDIRS = sub
42END
43
44cat >sub/Makefile.am <<END
45AUTOMAKE_OPTIONS = -Wno-syntax
46INCLUDES = -Ifoo
47foo_SOURCES = unused
48END
49
50$ACLOCAL
51AUTOMAKE_fails
52# The expected diagnostic is
53# Makefile.am:3: unused variable: `foo_SOURCES'
54# sub/Makefile.am:2: `INCLUDES' is the old name for `AM_CPPFLAGS'
55grep '^Makefile.am:.*foo_SOURCES' stderr
56grep '^sub/Makefile.am:.*INCLUDES' stderr
57grep '^sub/Makefile.am:.*foo_SOURCES' stderr && exit 1
58grep '^Makefile.am:.*INCLUDES' stderr && exit 1
59# Only two lines of warnings.
60test `wc -l < stderr` = 2
61
62# On fast machines the autom4te.cache created during the above run of
63# $AUTOMAKE is likely to have the same time stamp as the configure.in
64# created below; thus causing traces for the old configure.in to be
65# used. We could do `$sleep', but it's faster to erase the
66# directory. (Erase autom4te*.cache, not autom4te.cache, because some
67# bogus installations of Autoconf use a versioned cache.)
68rm -rf autom4te*.cache
69
70# If we add a global -Wnone, all warnings should disappear.
71cat >configure.in <<END
72AC_INIT([warnopts], [1.0])
73AM_INIT_AUTOMAKE([-Wnone])
74AC_CONFIG_FILES([Makefile sub/Makefile])
75AC_OUTPUT
76END
77$ACLOCAL
78$AUTOMAKE
Note: See TracBrowser for help on using the repository browser.