doc: typos in test file.
[automake.git] / t / libobj-basic.sh
blob622b81925af02b5ef50023bbe11d3164c68856f7
1 #! /bin/sh
2 # Copyright (C) 2010-2024 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 # Make sure AC_LIBSOURCE and AC_LIBSOURCES work.
19 required=cc
20 . test-init.sh
22 mv configure.ac configure.proto
23 cat >> configure.proto << 'END'
24 AC_PROG_CC
25 AM_PROG_AR
26 AC_PROG_RANLIB
27 AC_OUTPUT
28 END
30 cat > Makefile.am << 'END'
31 noinst_LIBRARIES = libtu.a
32 libtu_a_SOURCES = foo.c
33 libtu_a_LIBADD = $(LIBOBJS)
35 include extra-checks.am
36 .PHONY: $(extra_checks) pre-test
38 pre-test: distdir
39 ls -l $(srcdir) $(builddir) $(distdir)
40 $(AR) tv libtu.a
41 $(extra_checks): pre-test
42 check-local: $(extra_checks)
44 maude-src:
45 grep dummy_maude $(srcdir)/maude.c
46 maude-dist:
47 grep dummy_maude $(distdir)/maude.c
48 liver-src:
49 grep dummy_liver $(srcdir)/liver.c
50 liver-dist:
51 grep dummy_liver $(distdir)/liver.c
52 liver-not-dist:
53 test -d $(distdir)
54 test ! -r $(distdir)/liver.c
55 maude-not-dist:
56 test -d $(distdir)
57 test ! -r $(distdir)/maude.c
58 END
60 cat > foo.c << 'END'
61 extern int dummy_foo;
62 END
64 cat > maude.c << 'END'
65 extern int dummy_maude;
66 END
68 cat > liver.c << 'END'
69 extern int dummy_liver;
70 END
72 # AC_LIBSOURCE should work also if called after AC_OUTPUT.
73 cat configure.proto - > configure.ac <<END
74 AC_LIBSOURCE([maude.c])
75 END
77 cat > extra-checks.am << 'END'
78 extra_checks = maude-src maude-dist liver-not-dist
79 END
81 cp "$am_scriptdir/ar-lib" . || fatal_ "fetching auxiliary script 'ar-lib'"
83 $ACLOCAL
84 $AUTOCONF
85 $AUTOMAKE
86 ./configure
88 $MAKE check
89 $MAKE distcheck
91 $MAKE distclean
92 # Avoid timestamp-related differences.
93 rm -rf autom4te*.cache
95 cat > extra-checks.am << 'END'
96 extra_checks = maude-src maude-dist liver-src liver-dist
97 END
99 # AC_LIBSOURCES should work also if called after AC_OUTPUT.
100 cat configure.proto - > configure.ac <<END
101 AC_LIBSOURCES([maude.c, liver.c])
104 $ACLOCAL
105 $AUTOCONF
106 $AUTOMAKE
107 ./configure
109 $MAKE check
110 $MAKE distcheck