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