news: add entry about recent 'ar-lib' changes
[automake.git] / tests / ansi9.test
blobab78ddacf1dc36b5f120631a510b6fe2868d52fa
1 #! /bin/sh
2 # Copyright (C) 2002, 2003 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)
7 # any later version.
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 # Check that subdir sources, and file compiled using per-target flags
18 # can still be deansified.
19 # Report from Paul D. Smith.
21 required=gcc
22 . ./defs || Exit 1
24 set -e
26 cat >>configure.in <<EOF
27 AC_PROG_CC
28 AM_PROG_CC_C_O
29 AM_C_PROTOTYPES
30 AC_OUTPUT
31 EOF
33 cat > Makefile.am << 'END'
34 AUTOMAKE_OPTIONS = ansi2knr subdir-objects
35 noinst_PROGRAMS = loadavg sub/sub
36 loadavg_SOURCES = loadavg.c
37 loadavg_CFLAGS = -DTEST
38 sub_sub_SOURCES = sub/sub.c
39 END
41 cat > loadavg.c << 'END'
42 int
43 main ()
45 return 0;
47 END
49 mkdir sub
50 cp loadavg.c sub/sub.c
52 $ACLOCAL
53 $AUTOCONF -Wno-obsolete
54 $AUTOMAKE --add-missing -Wno-override -Wno-obsolete
56 $FGREP 'loadavg-loadavg$U.o: loadavg$U.c' Makefile.in
57 # The following rule should not exist, because the
58 # default .o.c: inference rule is enough.
59 $FGREP 'sub/sub$U.o: sub/sub$U.c' Makefile.in && Exit 1
60 # Force ansi2knr's use, regardless of the compiler.
61 ./configure ac_cv_prog_cc_stdc=no
62 $MAKE sub/sub_.c