1 # old-m4-iface.at -- exercise old m4 interface to libtool -*- Autotest -*-
3 # Copyright (C) 2005, 2008, 2009 Free Software Foundation, Inc.
4 # Written by Gary V. Vaughan, 2005
6 # This file is part of GNU Libtool.
8 # GNU Libtool is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License as
10 # published by the Free Software Foundation; either version 2 of
11 # the License, or (at your option) any later version.
13 # GNU Libtool is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with GNU Libtool; see the file COPYING. If not, a copy
20 # can be downloaded from http://www.gnu.org/licenses/gpl.html,
21 # or obtained by writing to the Free Software Foundation, Inc.,
22 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 AT_BANNER([Support for older m4 interface.])
28 ########################################################################
31 ## test all the interfaces currently supported by AU_DEFUN/AU_ALIAS
32 ## test autoupdate on all of those tests' configure.in
34 ########################################################################
36 ## -------------------------------------------------------- ##
37 ## An overtly simple old-school AM_PROG_LIBTOOL invocation. ##
38 ## -------------------------------------------------------- ##
40 AT_SETUP([AM_PROG_LIBTOOL])
42 AT_DATA([configure.in],
45 AC_SUBST([LIBTOOL_DEPS])
49 AT_DATA([Makefile.in],
50 [[COMPILE = @CC@ @CPPFLAGS@ @CFLAGS@
51 LINK = @CC@ @CFLAGS@ @LDFLAGS@ -o $@
53 LIBTOOL_DEPS = @LIBTOOL_DEPS@
55 all: libtool old@EXEEXT@
57 old@EXEEXT@: old.@OBJEXT@
61 .SUFFIXES: .c .@OBJEXT@
66 libtool: $(LIBTOOL_DEPS)
67 $(SHELL) ./config.status --recheck
76 printf ("Hello, World!");
81 LT_AT_LIBTOOLIZE([--install])
83 # This is slightly bogus, since only libtool.m4 was required in aclocal.m4
84 # with libtool-1.5x...
85 AT_CHECK([test -f aclocal.m4 ||
86 cat "$tst_aclocaldir/libtool.m4" "$tst_aclocaldir/ltoptions.m4" \
87 "$tst_aclocaldir/ltsugar.m4" "$tst_aclocaldir/ltversion.m4" \
88 "$tst_aclocaldir/lt~obsolete.m4" > aclocal.m4])
90 LT_AT_BOOTSTRAP([ignore], [ignore], [ignore], [ignore], [--force])
92 LT_AT_EXEC_CHECK([./old], 0, [Hello, World!])
94 # Now, test that libtoolize doesn't mistakenly think the user called
95 # any libtool macros if in fact she didn't.
96 sed '/AM_PROG_LIBTOOL/d' configure.in >configure.int
97 mv -f configure.int configure.in
98 AT_CHECK([$LIBTOOLIZE -n], [0], [stdout], [stderr])
99 # ensure no shell errors:
100 AT_CHECK([grep -v "^libtoolize: " stderr], [1])
101 AT_CHECK([grep "Remember to add.*LT_INIT.*to configure.in" stdout], [0], [ignore])
102 AT_CHECK([grep "Consider adding.*LT_WITH_LTDL" stdout], [1])
103 AT_CHECK([grep "Remember to add.*LT_CONFIG_LTDL_DIR" stdout], [1])
108 ## --------------------------- ##
109 ## An old style libltdl build. ##
110 ## --------------------------- ##
112 AT_SETUP([AC_WITH_LTDL])
116 AT_DATA([configure.in],
126 AT_DATA([Makefile.in],
129 COMPILE = @CC@ @INCLTDL@ @CPPFLAGS@ @CFLAGS@
130 LTCOMPILE = @LIBTOOL@ --mode=compile $(COMPILE)
131 LTLINK = @LIBTOOL@ --mode=link @CC@ -no-undefined @CFLAGS@ @LDFLAGS@ -o $@
135 TARGETS = libltdl/libltdlc.la module.la ltdldemo@EXEEXT@
140 cd libltdl && $(MAKE)
143 $(LTLINK) module.lo -module -avoid-version -rpath /dev/null
145 ltdldemo@EXEEXT@: main.@OBJEXT@ module.la libltdl/libltdlc.la
146 $(LTLINK) main.@OBJEXT@ -dlopen module.la @LIBLTDL@ @LIBS@
149 .SUFFIXES: .c .@OBJEXT@ .lo
155 $(LTCOMPILE) -c -o $@ $<
158 # Be sure to use the in-tree libltdl, somebody might have removed
159 # an installed libltdl.la file.
160 LT_AT_BOOTSTRAP([--ltdl --install], [-I libltdl/m4], [ignore], [ignore],
161 [--force], [--with-included-ltdl])
163 LT_AT_EXEC_CHECK([./ltdldemo], 0, [ignore])