2 # Copyright (C) 2010-2017 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.sh'.
23 mv configure.ac configure.proto
24 cat >> configure.proto
<< 'END'
28 %LIBOBJ-STUFF
% # Will be activated later.
32 cat > Makefile.am
<< 'END'
33 noinst_LIBRARIES
= libtu.a
35 libtu_a_LIBADD
= @LIBOBJS@
37 include extra-checks.am
38 .PHONY
: $
(extra_checks
) pre-test
41 ls -l $
(srcdir
) $
(builddir
) $
(distdir
)
43 $
(extra_checks
): pre-test
44 check-local
: $
(extra_checks
)
47 grep dummy_maude $
(srcdir
)/maude.c
49 grep dummy_maude $
(distdir
)/maude.c
51 grep dummy_liver $
(srcdir
)/liver.c
53 grep dummy_liver $
(distdir
)/liver.c
54 liver-not-dist
: distdir
55 test ! -r $
(distdir
)/liver.c
56 maude-not-dist
: distdir
57 test ! -r $
(distdir
)/maude.c
59 $
(AR
) t libtu.a |
grep maude
61 $
(AR
) t libtu.a |
grep maude
&& exit 1; exit 0
63 $
(AR
) t libtu.a |
grep liver
65 $
(AR
) t libtu.a |
grep liver
&& exit 1; exit 0
68 cat > maude.c
<< 'END'
69 extern int dummy_maude
;
72 cat > liver.c
<< 'END'
73 extern int dummy_liver
;
76 sed '/%LIBOBJ-STUFF%/{
79 AC_LIBOBJ(maude) dnl: do not quote this!
80 }' configure.proto
> configure.ac
81 cat configure.ac
# For debugging.
83 cat > extra-checks.am
<< 'END'
84 extra_checks
= maude-src maude-dist maude-lib liver-not-dist
89 $AUTOMAKE --add-missing
98 # Avoid timestamp-related differences.
99 rm -rf autom4te
*.cache
101 cat > extra-checks.am
<< 'END'
102 extra_checks
= maude-src maude-dist liver-src liver-dist
104 extra_checks
+= maude-lib liver-not-lib
106 extra_checks
+= maude-not-lib liver-lib
110 sed '/%LIBOBJ-STUFF%/{
113 AM_CONDITIONAL([MAUDE_COND], [test x"$MAUDE" = x"yes"])\
114 if test x"$MAUDE" = x"yes"; then\
115 AC_LIBOBJ(maude) dnl: do not quote this!\
117 AC_LIBOBJ(liver) dnl: do not quote this!\
119 AC_LIBSOURCE(maude.c) dnl: do not quote this!\
120 AC_LIBSOURCE(liver.c) dnl: do not quote this!
121 }' configure.proto
> configure.ac
122 cat configure.ac
# For debugging.
128 .
/configure MAUDE
=yes