2 # Copyright (C) 2003-2012 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 2, or (at your option)
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 links to _identical files_ created by AC_CONFIG_LINKS get
18 # removed with 'make distclean' only if doing a VPATH build.
22 mkdir nonmk-subdir sdir sdir
/mk-subdir
27 : > sdir
/mk-subdir
/src4
29 cat >> Makefile.am
<<'EOF'
33 test -f $(distdir)/src
34 test -f $(distdir)/sdir/src2
35 test -f $(distdir)/nonmk-subdir/src3
36 test -f $(distdir)/sdir/mk-subdir/src4
39 cat >>configure.ac
<< 'EOF'
40 AC_CONFIG_FILES
([sdir
/Makefile
])
41 AC_CONFIG_LINKS
([src
:src
])
42 AC_CONFIG_LINKS
([sdir
/src2
:sdir
/src2
])
43 AC_CONFIG_LINKS
([nonmk-subdir
/src3
:nonmk-subdir
/src3
])
44 AC_CONFIG_LINKS
([sdir
/mk-subdir
/src4
:sdir
/mk-subdir
/src4
])
58 # Make sure nothing is deleted by 'make clean'
63 test -f ..
/nonmk-subdir
/src3
64 test -f ..
/sdir
/mk-subdir
/src4
66 # Make sure the links are deleted by 'make distclean' and the original files
72 test -f ..
/nonmk-subdir
/src3
73 test -f ..
/sdir
/mk-subdir
/src4
76 test -r sdir
/src2
&& exit 1
77 test -r nonmk-subdir
/src3
&& exit 1
78 test -r sdir
/mk-subdir
/src4
&& exit 1
85 # Make sure nothing is deleted by 'make distclean'
90 test -f nonmk-subdir
/src3
91 test -f sdir
/mk-subdir
/src4