2 # Copyright (C) 1999-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 '-c' works. Report from Andris Pavenis.
18 # See also the much more in-depth test 'add-missing'.
22 # We'll have to cater to systems like MSYS/MinGW where there are no
23 # true symlinks ('ln -s' behaves like 'cp -p'); see automake bug#10441.
26 if ln -s foo bar && test -h bar; then
27 is_symlink () { test -h "$1"; }
28 is_not_symlink () { test ! -h "$1"; }
30 is_symlink () { return 0; } # Avoid spurious failures.
31 is_not_symlink () { return 0; }
35 # First a simple test, where the auxdir is automatically determined
43 ls -l # For debugging.
46 is_not_symlink install-sh
48 # Let's do a couple of more elaborated tests, this time with the auxdir
49 # explicitly defined in configure.ac.
54 cat > configure.ac <<END
56 AC_CONFIG_AUX_DIR([auxdir])
59 AC_CONFIG_FILES([Makefile])
63 cat > Makefile.am <<END
69 # 'automake -a' called without '-c' should create symlinks by default,
70 # even when there is already a non-symlinked required auxiliary file.
73 echo FAKE-DEPCOMP > auxdir/depcomp
75 ls -l auxdir # For debugging.
76 test -f auxdir/install-sh
77 is_symlink auxdir/install-sh
78 test -f auxdir/depcomp
79 is_not_symlink auxdir/depcomp
80 test FAKE-DEPCOMP = "$(cat auxdir/depcomp)"
82 # 'automake -a -c' should not create symlinks, even when there are
83 # already symlinked required auxiliary files.
88 ln -s "$am_scriptdir/missing" "$am_scriptdir/install-sh" .
92 ls -l auxdir # For debugging.
93 test -f auxdir/install-sh
94 is_symlink auxdir/install-sh
95 test -f auxdir/missing
96 is_symlink auxdir/missing
97 test -f auxdir/depcomp
98 is_not_symlink auxdir/depcomp
99 diff "$am_scriptdir"/depcomp auxdir/depcomp