2 # Copyright (C) 2010, 2011 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)
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'.
23 mv configure.in configure.proto
24 cat >> configure.proto << 'END'
27 %LIBOBJ-STUFF% # Will be activated later.
31 cat > Makefile.am << 'END'
32 noinst_LIBRARIES = libtu.a
34 libtu_a_LIBADD = @LIBOBJS@
36 include extra-checks.am
37 .PHONY: $(extra_checks) pre-test
40 ls -l $(srcdir) $(builddir) $(distdir)
42 $(extra_checks): pre-test
43 check-local: $(extra_checks)
46 grep dummy_maude $(srcdir)/maude.c
48 grep dummy_maude $(distdir)/maude.c
50 grep dummy_liver $(srcdir)/liver.c
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
58 $(AR) t libtu.a | grep maude
60 $(AR) t libtu.a | grep maude && exit 1; exit 0
62 $(AR) t libtu.a | grep liver
64 $(AR) t libtu.a | grep liver && exit 1; exit 0
67 cat > maude.c << 'END'
68 extern int dummy_maude;
71 cat > liver.c << 'END'
72 extern int dummy_liver;
75 sed '/%LIBOBJ-STUFF%/{
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
88 $AUTOMAKE -Wno-extra-portability
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
103 extra_checks += maude-lib liver-not-lib
105 extra_checks += maude-not-lib liver-lib
109 sed '/%LIBOBJ-STUFF%/{
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!\
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.
125 $AUTOMAKE -Wno-extra-portability
127 ./configure MAUDE=yes