Merge branch 'fix-pr14560' into micro
[platform/upstream/automake.git] / t / ccnoco2.sh
1 #! /bin/sh
2 # Copyright (C) 2006-2013 Free Software Foundation, Inc.
3 #
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.
8 #
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.
13 #
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/>.
16
17 # Make sure Automake requires AM_PROG_CC_C_O when either per-targets
18 # flags or subdir-objects are used.
19
20 . test-init.sh
21
22 cat >>configure.ac <<EOF
23 AC_PROG_CC
24 AC_OUTPUT
25 EOF
26
27 cat >Makefile.am <<EOF
28 bin_PROGRAMS = wish
29 wish_SOURCES = a.c
30 wish_CPPFLAGS = -DWHATEVER
31 EOF
32
33 touch a.c
34
35 $ACLOCAL
36 $AUTOCONF
37 AUTOMAKE_fails --copy --add-missing
38 grep '^Makefile\.am:2:.*per-target.*AM_PROG_CC_C_O' stderr
39
40
41 cat >Makefile.am <<EOF
42 bin_PROGRAMS = wish
43 wish_SOURCES = sub/a.c
44 EOF
45
46 mkdir sub
47 mv a.c sub
48
49 $AUTOMAKE --copy --add-missing
50
51 echo 'AUTOMAKE_OPTIONS = subdir-objects' >> Makefile.am
52 AUTOMAKE_fails --copy --add-missing
53 grep '^Makefile\.am:2:.*subdir.*AM_PROG_CC_C_O' stderr
54
55 :