Support more C++ file extensions for MSVC in the compile script.
[platform/upstream/automake.git] / tests / conflnk3.test
1 #! /bin/sh
2 # Copyright (C) 2003, 2004, 2010 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 # Test to make sure that AC_CONFIG_LINKS using a variable source
18 # is not broken.
19
20 . ./defs || Exit 1
21
22 set -e
23
24 cat > Makefile.am << 'END'
25 SUBDIRS = sdir
26 test: distdir
27         test ! -r $(distdir)/sdir/dest3
28         test ! -r $(distdir)/sdir/dest2
29         test ! -r $(distdir)/dest3
30         test ! -r $(distdir)/dest2
31         test -f $(distdir)/src2
32 ## src3 cannot be distributed, Automake knows nothing about it
33         test ! -r $(distdir)/sdir/src3
34         test ! -r $(distdir)/src3
35 END
36
37 : > src
38 : > src2
39 mkdir sdir
40 : > sdir/Makefile.am
41 : > sdir/src3
42
43 cat >>configure.in << 'EOF'
44 AC_CONFIG_FILES(sdir/Makefile)
45 my_src_dir=sdir
46 my_dest=dest
47 AC_CONFIG_LINKS(sdir/dest2:src2 sdir/dest3:$my_src_dir/src3)
48 AC_CONFIG_LINKS($my_dest:src)
49 # the following is a link whose source is itself a link
50 AC_CONFIG_LINKS(dest4:sdir/dest2)
51 # Some package prefer to compute links.
52 cmplink='dest5:src';
53 AC_CONFIG_LINKS($cmplink)
54 AC_OUTPUT
55 EOF
56
57 $ACLOCAL
58 $AUTOCONF
59 $AUTOMAKE
60
61 # $my_src_dir and $my_dest are variables local to configure, they should
62 # not appear in Makefile.
63 grep my_src_dir Makefile.in && Exit 1
64 grep my_dest Makefile.in && Exit 1
65
66 ./configure
67 test -r sdir/dest2
68 test -r sdir/dest3
69 test -r dest
70 test -r dest4
71 test -r dest5
72 $MAKE test
73
74 $MAKE distclean
75 test ! -r sdir/dest2
76 test ! -r sdir/dest3
77 test -r dest  # Should still exist, Automake knows nothing about it.
78 test -r dest5 # ditto
79 rm -f dest dest5
80 test ! -r dest4
81
82 ## Cannot do the following, because at the time of writing Autoconf
83 ## (2.59) does not support AC_CONFIG_LINKS source in the build tree.
84 # mkdir build
85 # cd build
86 # ../configure
87 # $MAKE test