tests: work around strangeness in MSYS
[automake.git] / tests / copy.test
blob8ad3f2a5e81f20962d45375bae8b8524abbb6c96
1 #! /bin/sh
2 # Copyright (C) 1999, 2001, 2002, 2010, 2011 Free Software Foundation,
3 # Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
8 # any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # Test to make sure `-c' works. Report from Andris Pavenis.
19 # See also the much more in-depth test `add-missing'.
21 . ./defs || Exit 1
23 # First a simple test, where the auxdir is automatically determined
24 # by automake.
26 : > Makefile.am
27 rm -f install-sh
29 $ACLOCAL
30 $AUTOMAKE -c -a
31 ls -l # For debugging.
33 test -f install-sh
34 test ! -h install-sh
36 # Let's do a couple of more elaborated tests, this time with the auxdir
37 # explicitly defined in configure.in.
39 mkdir sub
40 cd sub
42 cat > configure.in <<END
43 AC_INIT([$me], [1.0])
44 AC_CONFIG_AUX_DIR([auxdir])
45 AM_INIT_AUTOMAKE
46 AC_PROG_CC
47 AC_CONFIG_FILES([Makefile])
48 AC_OUTPUT
49 END
51 cat > Makefile.am <<END
52 bin_PROGRAMS = foo
53 END
55 $ACLOCAL
57 # `automake -a' called without `-c' should create symlinks by default,
58 # even when there is already a non-symlinked required auxiliary file.
60 mkdir auxdir
61 echo FAKE-DEPCOMP > auxdir/depcomp
62 $AUTOMAKE -a
63 ls -l auxdir # For debugging.
64 test -f auxdir/install-sh
65 test -h auxdir/install-sh
66 test -f auxdir/depcomp
67 test ! -h auxdir/depcomp
68 test FAKE-DEPCOMP = `cat auxdir/depcomp`
70 # `automake -a -c' should not create symlinks, even when there are
71 # already symlinked required auxiliary files.
73 rm -rf auxdir
74 mkdir auxdir
75 cd auxdir
76 ln -s "$am_scriptdir/missing" "$am_scriptdir/install-sh" .
77 cd ..
79 $AUTOMAKE -a -c
80 ls -l auxdir # For debugging.
81 test -f auxdir/install-sh
82 test -h auxdir/install-sh
83 test -f auxdir/missing
84 test -h auxdir/missing
85 test -f auxdir/depcomp
86 test ! -h auxdir/depcomp
87 diff "$am_scriptdir"/depcomp auxdir/depcomp