Clarify overriding of `*_DEPENDENCIES' in LIBOBJS node.
[automake/ericb.git] / tests / cond31.test
blob7fcb0d049621f457d636d0ed4f1d325b8da9d5a0
1 #!/bin/sh
2 # Copyright (C) 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 # Make sure we define conditional _DEPENDENCIES correctly.
19 . ./defs
21 set -e
23 cat >>configure.in <<'EOF'
24 AC_PROG_CC
25 AM_CONDITIONAL(C1, [test -z "$two"])
26 AM_CONDITIONAL(C2, [test -n "$two"])
27 AC_OUTPUT
28 EOF
30 cat >>Makefile.am <<'EOF'
31 bin_PROGRAMS = a
32 a_LDADD = c0.o -L/some/where
33 if C1
34 a_LDADD += c1.o -llibfoo.a
35 endif
36 if C2
37 a_LDADD += c2.o -dlopen c3.la
38 endif
39 print:
40 @echo BEG: $(a_DEPENDENCIES) :END
41 EOF
43 $ACLOCAL
44 $AUTOCONF
45 $AUTOMAKE
47 ./configure
48 $MAKE -e print > stdout
49 cat stdout
50 grep 'BEG: c0.o c1.o :END' stdout
52 ./configure two=yes
53 $MAKE -e print > stdout
54 cat stdout
55 grep 'BEG: c0.o c2.o c3.la :END' stdout