Merge branch 'yacc-quote-fix'
[automake.git] / tests / libobj16b.test
blobfbb9bd7b3fed5a7886bd83ce57a63226cf74df68
1 #! /bin/sh
2 # Copyright (C) 2010-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)
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 <http://www.gnu.org/licenses/>.
17 # Make sure AC_LIBOBJ and friends work.
18 # Please keep this in sync with sister test `libobj16a.test'.
20 required=cc
21 . ./defs || Exit 1
23 mv configure.in configure.proto
24 cat >> configure.proto << 'END'
25 AC_PROG_CC
26 AC_PROG_RANLIB
27 %LIBOBJ-STUFF% # Will be activated later.
28 AC_OUTPUT
29 END
31 cat > Makefile.am << 'END'
32 noinst_LIBRARIES = libtu.a
33 libtu_a_SOURCES =
34 libtu_a_LIBADD = @LIBOBJS@
36 include extra-checks.am
37 .PHONY: $(extra_checks) pre-test
39 pre-test: distdir
40 ls -l $(srcdir) $(builddir) $(distdir)
41 $(AR) tv libtu.a
42 $(extra_checks): pre-test
43 check-local: $(extra_checks)
45 maude-src:
46 grep dummy_maude $(srcdir)/maude.c
47 maude-dist:
48 grep dummy_maude $(distdir)/maude.c
49 liver-src:
50 grep dummy_liver $(srcdir)/liver.c
51 liver-dist:
52 grep dummy_liver $(distdir)/liver.c
53 liver-not-dist: distdir
54 test ! -r $(distdir)/liver.c
55 maude-not-dist: distdir
56 test ! -r $(distdir)/maude.c
57 maude-lib:
58 $(AR) t libtu.a | grep maude
59 maude-not-lib:
60 $(AR) t libtu.a | grep maude && exit 1; exit 0
61 liver-lib:
62 $(AR) t libtu.a | grep liver
63 liver-not-lib:
64 $(AR) t libtu.a | grep liver && exit 1; exit 0
65 END
67 cat > maude.c << 'END'
68 extern int dummy_maude;
69 END
71 cat > liver.c << 'END'
72 extern int dummy_liver;
73 END
75 sed '/%LIBOBJ-STUFF%/{
76 s/.*//
78 AC_LIBOBJ(maude) dnl: do not quote this!
79 }' configure.proto > configure.in
80 cat configure.in # For debugging.
82 cat > extra-checks.am << 'END'
83 extra_checks = maude-src maude-dist maude-lib liver-not-dist
84 END
86 $ACLOCAL
87 $AUTOCONF
88 $AUTOMAKE -Wno-extra-portability
90 ./configure
92 $MAKE
93 $MAKE check
94 $MAKE distcheck
95 $MAKE distclean
97 # Avoid timestamp-related differences.
98 rm -rf autom4te*.cache
100 cat > extra-checks.am << 'END'
101 extra_checks = maude-src maude-dist liver-src liver-dist
102 if MAUDE_COND
103 extra_checks += maude-lib liver-not-lib
104 else
105 extra_checks += maude-not-lib liver-lib
106 endif
109 sed '/%LIBOBJ-STUFF%/{
110 s/.*//
112 AM_CONDITIONAL([MAUDE_COND], [test x"$MAUDE" = x"yes"])\
113 if test x"$MAUDE" = x"yes"; then\
114 AC_LIBOBJ(maude) dnl: do not quote this!\
115 else\
116 AC_LIBOBJ(liver) dnl: do not quote this!\
118 AC_LIBSOURCE(maude.c) dnl: do not quote this!\
119 AC_LIBSOURCE(liver.c) dnl: do not quote this!
120 }' configure.proto > configure.in
121 cat configure.in # For debugging.
123 $ACLOCAL
124 $AUTOCONF
125 $AUTOMAKE -Wno-extra-portability
127 ./configure MAUDE=yes
128 $MAKE
129 $MAKE check
130 $MAKE distcheck
131 $MAKE distclean
133 ./configure MAUDE=no
134 $MAKE
135 $MAKE check
136 $MAKE distcheck
137 $MAKE distclean