Clarify overriding of `*_DEPENDENCIES' in LIBOBJS node.
[automake/ericb.git] / tests / ansi5.test
blob4be0f7939ed64239bd2ee616afc63ceb9aad7d2c
1 #! /bin/sh
2 # Copyright (C) 2001, 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 3, 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 # Test for ansi2knr in another directory.
19 required=gcc
20 . ./defs || Exit 1
22 cat > configure.in << 'END'
23 AC_INIT(one/joe.c)
24 AM_INIT_AUTOMAKE(liver, 0.23)
25 AC_PROG_CC
26 AM_C_PROTOTYPES
27 AC_OUTPUT(Makefile one/Makefile two/Makefile)
28 END
30 cat > Makefile.am << 'END'
31 SUBDIRS = one two
32 END
34 mkdir one two
36 cat > one/Makefile.am << 'END'
37 AUTOMAKE_OPTIONS = ansi2knr
38 bin_PROGRAMS = joe
39 END
41 cat > two/Makefile.am << 'END'
42 AUTOMAKE_OPTIONS = ../one/ansi2knr
43 bin_PROGRAMS = maude
44 END
46 cat > one/joe.c << 'END'
47 #include <stdio.h>
48 int
49 main (int argc, char *argv[])
51 printf ("joe\n");
52 return 0;
54 END
56 cat > two/maude.c << 'END'
57 #include <stdio.h>
58 int
59 main (int argc, char *argv[])
61 printf ("maude\n");
62 return 0;
64 END
66 set -e
68 $ACLOCAL
69 $AUTOCONF
70 $AUTOMAKE -a
71 # Ignore user CFLAGS.
72 CFLAGS=
73 export CFLAGS
74 CC=gcc ./configure
76 # This is ugly! If we set U at make time then the "wrong" file gets
77 # included.
78 find . -name '*.Po' -print \
79 | while read file; do
80 base="`echo $file | sed -e 's/\.Po//'`"
81 mv $file ${base}_.Po
82 done
84 # So is this! If we set ANSI2KNR on the make command line then the
85 # wrong value is passed to two's Makefile.
86 mv one/Makefile one/Makefile.old
87 sed -e 's,ANSI2KNR =,ANSI2KNR = ./ansi2knr,' < one/Makefile.old > one/Makefile
89 U=_ $MAKE -e
90 ./one/joe
91 ./two/maude