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

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

automake 1.7.9

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 autoconf; 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
27
28cat >>configure.in <<END
29AC_CONFIG_FILES([sub/Makefile])
30AC_OUTPUT
31END
32
33mkdir sub
34
35# These two Makefile contain the same errors, but have different
36# warnings disabled.
37
38cat >Makefile.am <<END
39AUTOMAKE_OPTIONS = -Wno-obsolete
40INCLUDES = -Ifoo
41foo_SOURCES = unused
42SUBDIRS = sub
43END
44
45cat >sub/Makefile.am <<END
46AUTOMAKE_OPTIONS = -Wno-syntax
47INCLUDES = -Ifoo
48foo_SOURCES = unused
49END
50
51$ACLOCAL
52$AUTOMAKE 2>stderr && exit 1
53cat stderr
54# The expected diagnostic is
55# Makefile.am:3: unused variable: `foo_SOURCES'
56# sub/Makefile.am:2: `INCLUDES' is the old name for `AM_CPPFLAGS'
57grep '^Makefile.am:.*foo_SOURCES' stderr
58grep '^sub/Makefile.am:.*INCLUDES' stderr
59grep '^sub/Makefile.am:.*foo_SOURCES' stderr && exit 1
60grep '^Makefile.am:.*INCLUDES' stderr && exit 1
61# Only two lines of warnings.
62test `wc -l < stderr` = 2
63
64# On fast machines the autom4te.cache created during the above run of
65# $AUTOMAKE is likely to have the same time stamp as the configure.in
66# created below; thus causing traces for the old configure.in to be
67# used. We could do `$sleep', but it's faster to erase the
68# directory. (Erase autom4te*.cache, not autom4te.cache, because some
69# bogus installations of Autoconf use a versioned cache.)
70rm -rf autom4te*.cache
71
72# If we add a global -Wnone, all warnings should disappear.
73cat >configure.in <<END
74AC_INIT([warnopts], [1.0])
75AM_INIT_AUTOMAKE([-Wnone])
76AC_CONFIG_FILES([Makefile sub/Makefile])
77AC_OUTPUT
78END
79$ACLOCAL
80$AUTOMAKE
Note: See TracBrowser for help on using the repository browser.