Clarify overriding of `*_DEPENDENCIES' in LIBOBJS node.
[automake/ericb.git] / tests / conflnk3.test
blob7845364cb5202d5e8fc3eb7d09d3eb1f39fc6f8e
1 #! /bin/sh
2 # Copyright (C) 2003, 2004 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 to make sure that AC_CONFIG_LINKS using a variable source
18 # is not broken.
20 . ./defs || Exit 1
22 set -e
24 # Skip platforms where `test -e' does not work. (Note that Changing
25 # all `test -e' into `test -h' will not work when AC_CONFIG_LINKS
26 # copies or hardlinks files.)
27 (test -e configure.in) >/dev/null 2>&1 || Exit 77
29 cat > Makefile.am << 'END'
30 SUBDIRS = sdir
31 test: distdir
32 test ! -e $(distdir)/sdir/dest3
33 test ! -e $(distdir)/sdir/dest2
34 test ! -e $(distdir)/dest3
35 test ! -e $(distdir)/dest2
36 test -f $(distdir)/src2
37 ## src3 cannot be distributed, Automake knows nothing about it
38 test ! -e $(distdir)/sdir/src3
39 test ! -e $(distdir)/src3
40 END
42 : > src
43 : > src2
44 mkdir sdir
45 : > sdir/Makefile.am
46 : > sdir/src3
48 cat >>configure.in << 'EOF'
49 AC_CONFIG_FILES(sdir/Makefile)
50 my_src_dir=sdir
51 my_dest=dest
52 AC_CONFIG_LINKS(sdir/dest2:src2 sdir/dest3:$my_src_dir/src3)
53 AC_CONFIG_LINKS($my_dest:src)
54 # the following is a link whose source is itself a link
55 AC_CONFIG_LINKS(dest4:sdir/dest2)
56 # Some package prefer to compute links.
57 cmplink='dest5:src';
58 AC_CONFIG_LINKS($cmplink)
59 AC_OUTPUT
60 EOF
62 $ACLOCAL
63 $AUTOCONF
64 $AUTOMAKE
66 # $my_src_dir and $my_dest are variables local to configure, they should
67 # not appear in Makefile.
68 grep my_src_dir Makefile.in && Exit 1
69 grep my_dest Makefile.in && Exit 1
71 ./configure
72 test -e sdir/dest2
73 test -e sdir/dest3
74 test -e dest
75 test -e dest4
76 test -e dest5
77 $MAKE test
79 $MAKE distclean
80 test ! -e sdir/dest2
81 test ! -e sdir/dest3
82 test -e dest # Should still exist, Automake knows nothing about it.
83 test -e dest5 # ditto
84 rm -f dest dest5
85 test ! -e dest4
87 ## Cannot do the following, because at the time of writing Autoconf
88 ## (2.59) does not support AC_CONFIG_LINKS source in the build tree.
89 # mkdir build
90 # cd build
91 # ../configure
92 # $MAKE test