1 # old-m4-iface.at -- exercise old m4 interface to libtool -*- Autotest -*-
3 # Copyright (C) 2005, 2008 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],
48 AT_DATA([Makefile.in],
49 [[COMPILE = @CC@ @CPPFLAGS@ @CFLAGS@
50 LINK = @CC@ @CFLAGS@ @LDFLAGS@ -o $@
55 old@EXEEXT@: old.@OBJEXT@
59 .SUFFIXES: .c .@OBJEXT@
71 printf ("Hello, World!");
76 LT_AT_LIBTOOLIZE([--install])
78 # This is slightly bogus, since only libtool.m4 was required in aclocal.m4
79 # with libtool-1.5x...
80 AT_CHECK([test -f aclocal.m4 ||
81 cat "$tst_aclocaldir/libtool.m4" "$tst_aclocaldir/ltoptions.m4" \
82 "$tst_aclocaldir/ltsugar.m4" "$tst_aclocaldir/ltversion.m4" \
83 "$tst_aclocaldir/lt~obsolete.m4" > aclocal.m4])
85 LT_AT_BOOTSTRAP([ignore], [ignore], [ignore], [ignore], [--force])
87 LT_AT_EXEC_CHECK([./old], 0, [Hello, World!])
89 # Now, test that libtoolize doesn't mistakenly think the user called
90 # any libtool macros if in fact she didn't.
91 sed '/AM_PROG_LIBTOOL/d' configure.in >configure.int
92 mv -f configure.int configure.in
93 AT_CHECK([$LIBTOOLIZE -n], [0], [stdout], [stderr])
94 # ensure no shell errors:
95 AT_CHECK([grep -v "^libtoolize: " stderr], [1])
96 AT_CHECK([grep "Remember to add.*LT_INIT.*to configure.in" stdout], [0], [ignore])
97 AT_CHECK([grep "Consider adding.*LT_WITH_LTDL" stdout], [1])
98 AT_CHECK([grep "Remember to add.*LT_CONFIG_LTDL_DIR" stdout], [1])
103 ## --------------------------- ##
104 ## An old style libltdl build. ##
105 ## --------------------------- ##
107 AT_SETUP([AC_WITH_LTDL])
111 AT_DATA([configure.in],
121 AT_DATA([Makefile.in],
124 COMPILE = @CC@ @INCLTDL@ @CPPFLAGS@ @CFLAGS@
125 LTCOMPILE = @LIBTOOL@ --mode=compile $(COMPILE)
126 LTLINK = @LIBTOOL@ --mode=link @CC@ -no-undefined @CFLAGS@ @LDFLAGS@ -o $@
130 TARGETS = libltdl/libltdlc.la module.la ltdldemo@EXEEXT@
135 cd libltdl && $(MAKE)
138 $(LTLINK) module.lo -module -avoid-version -rpath /dev/null
140 ltdldemo@EXEEXT@: main.@OBJEXT@
141 $(LTLINK) main.@OBJEXT@ -dlopen module.la @LIBLTDL@
144 .SUFFIXES: .c .@OBJEXT@ .lo
150 $(LTCOMPILE) -c -o $@ $<
153 LT_AT_BOOTSTRAP([--ltdl --install], [-I libltdl/m4], [ignore], [ignore],
156 LT_AT_EXEC_CHECK([./ltdldemo], 0, [ignore])