maint: Update copyright years to 2018
[automake.git] / t / libobj7.sh
blob84b71f7c79320cd70f9c1ed680f48a166d589212
1 #! /bin/sh
2 # Copyright (C) 1997-2018 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)
7 # any later version.
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 <https://www.gnu.org/licenses/>.
17 # Test for multiple replacement functions.
19 required=cc
20 . test-init.sh
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
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
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
62 $ACLOCAL
63 $AUTOCONF
64 $AUTOMAKE --add-missing
66 ./configure
68 $MAKE
69 $MAKE check
70 $MAKE distcheck