Clarify overriding of `*_DEPENDENCIES' in LIBOBJS node.
[automake/ericb.git] / tests / cond15.test
blob3010c288a4c1bf3a222a67b3c1d48416d79415aa
1 #! /bin/sh
2 # Copyright (C) 2001, 2002 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 # Regression test for conditionally defined overriding of automatic rules.
19 . ./defs || Exit 1
21 cat >> configure.in << 'END'
22 AC_PROG_CC
23 AM_CONDITIONAL(COND1, true)
24 AM_CONDITIONAL(COND2, true)
25 END
27 cat > Makefile.am << 'END'
29 if COND1
30 if COND2
31 bin_SCRIPTS = helldl
32 helldl$(EXEEXT):
33 rm -f $@
34 echo '#! /bin/sh' > $@
35 echo '-dlopen is unsupported' >> $@
36 chmod +x $@
37 endif
38 else
39 if COND2
40 else
41 bin_SCRIPTS = helldl
42 helldl$(EXEEXT):
43 rm -f $@
44 echo '#! /bin/sh' > $@
45 echo '-dlopen is unsupported' >> $@
46 chmod +x $@
47 endif
48 endif
50 bin_PROGRAMS = helldl
51 END
53 $ACLOCAL || Exit 1
54 $AUTOMAKE || Exit 1
56 num1=`grep 'helldl$(EXEEXT):' Makefile.in | wc -l`
57 num2=`grep '@COND1_FALSE@@COND2_TRUE@helldl$(EXEEXT):' Makefile.in | wc -l`
58 test $num1 -eq 4 || Exit 1
59 test $num2 -eq 1 || Exit 1