tests: avoid a spurious failure on MSYS
[platform/upstream/automake.git] / t / libobj7.sh
1 #! /bin/sh
2 # Copyright (C) 1997-2013 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 for multiple replacement functions.
18
19 required=cc
20 . test-init.sh
21
22 cat >> configure.ac << 'END'
23 AC_PROG_CC
24 AM_PROG_AR
25 AC_PROG_RANLIB
26 # 'am__dummy_function' is there to ensure that at least one function is
27 # replaced, to avoid creating an empty archive which can cause problems
28 # with e.g. Solaris ar.
29 AC_REPLACE_FUNCS([basename dirname am__dummy_function])
30 AC_OUTPUT
31 END
32
33 cat > Makefile.am << 'END'
34 noinst_LIBRARIES = libtu.a
35 libtu_a_SOURCES =
36 libtu_a_LIBADD = @LIBOBJS@
37 check-local: test1 test2 test3
38 .PHONY: test1 test2 test3
39 test1: all
40         $(AR) tv libtu.a
41 test2:
42         @echo DIST_COMMON = $(DIST_COMMON)
43         echo ' ' $(DIST_COMMON) ' ' | grep '[ /]basename\.c '
44         echo ' ' $(DIST_COMMON) ' ' | grep '[ /]dirname\.c '
45         echo ' ' $(DIST_COMMON) ' ' | grep '[ /]am__dummy_function\.c '
46 test3: distdir
47         test -f $(distdir)/basename.c
48         test -f $(distdir)/dirname.c
49         test -f $(distdir)/am__dummy_function.c
50 END
51
52 cat > basename.c <<'END'
53 extern int dummy1;
54 END
55 cat > dirname.c <<'END'
56 extern int dummy2;
57 END
58 cat > am__dummy_function.c <<'END'
59 extern int dummy3;
60 END
61
62 $ACLOCAL
63 $AUTOCONF
64 $AUTOMAKE --add-missing
65
66 ./configure
67
68 $MAKE
69 $MAKE check
70 $MAKE distcheck
71
72 :