mirror of
git://git.savannah.gnu.org/libtool.git
synced 2024-11-27 06:09:57 +08:00
07ca8d2bb8
Debian's autoconf wrapper will not cause 2.13 to barf over `--force'. Reported by Kurt Roeckx <kurt@roeckx.be>.
141 lines
3.3 KiB
Plaintext
141 lines
3.3 KiB
Plaintext
# Hand crafted tests for GNU Libtool. -*- Autotest -*-
|
|
# Copyright 2005 Free Software Foundation, Inc.
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 2, or (at your option)
|
|
# any later version.
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program; if not, write to the Free Software
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
# 02110-1301, USA.
|
|
|
|
|
|
AT_BANNER([Support for older m4 interface.])
|
|
|
|
########################################################################
|
|
##
|
|
## TODO:
|
|
## test all the interfaces currently supported by AU_DEFUN/AU_ALIAS
|
|
## test autoupdate on all of those tests' configure.in
|
|
##
|
|
########################################################################
|
|
|
|
## -------------------------------------------------------- ##
|
|
## An overtly simple old-school AM_PROG_LIBTOOL invocation. ##
|
|
## -------------------------------------------------------- ##
|
|
|
|
AT_SETUP([AM_PROG_LIBTOOL])
|
|
|
|
AT_DATA([configure.in],
|
|
[[AC_INIT(old.c)
|
|
AM_PROG_LIBTOOL
|
|
AC_OUTPUT(Makefile)
|
|
]])
|
|
|
|
AT_DATA([Makefile.in],
|
|
[[COMPILE = @CC@ @CPPFLAGS@ @CFLAGS@
|
|
LINK = @CC@ @CFLAGS@ @LDFLAGS@ -o $@
|
|
SHELL = @SHELL@
|
|
|
|
all: old@EXEEXT@
|
|
|
|
old@EXEEXT@: old.@OBJEXT@
|
|
$(LINK) old.@OBJEXT@
|
|
|
|
.SUFFIXES:
|
|
.SUFFIXES: .c .@OBJEXT@
|
|
|
|
.c.@OBJEXT@:
|
|
$(COMPILE) -c $<
|
|
]])
|
|
|
|
|
|
AT_DATA([old.c],
|
|
[[#include <stdio.h>
|
|
|
|
int main (int argc, char **argv)
|
|
{
|
|
printf ("Hello, World!");
|
|
return 0;
|
|
}
|
|
]])
|
|
|
|
LT_AT_LIBTOOLIZE([--install])
|
|
|
|
# This is slightly bogus, since only libtool.m4 was required in aclocal.m4
|
|
# with libtool-1.5x...
|
|
AT_CHECK([test -f aclocal.m4 ||
|
|
cat "$tst_aclocaldir/libtool.m4" "$tst_aclocaldir/ltoptions.m4" \
|
|
"$tst_aclocaldir/ltsugar.m4" "$tst_aclocaldir/ltversion.m4" > aclocal.m4])
|
|
|
|
LT_AT_BOOTSTRAP([ignore], [ignore], [ignore], [ignore], [--force])
|
|
|
|
LT_AT_EXEC_CHECK([./old], 0, [Hello, World!])
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
## --------------------------- ##
|
|
## An old style libltdl build. ##
|
|
## --------------------------- ##
|
|
|
|
AT_SETUP([AC_WITH_LTDL])
|
|
|
|
_LTDL_PROJECT_FILES
|
|
|
|
AT_DATA([configure.in],
|
|
[[AC_PREREQ(2.50)
|
|
AC_INIT([main.c])
|
|
AC_PROG_MAKE_SET
|
|
AC_LIBTOOL_DLOPEN
|
|
AM_PROG_LIBTOOL
|
|
AC_WITH_LTDL
|
|
AC_OUTPUT(Makefile)
|
|
]])
|
|
|
|
AT_DATA([Makefile.in],
|
|
[[top_srcdir = .
|
|
top_builddir = .
|
|
COMPILE = @CC@ @CPPFLAGS@ @INCLTDL@ @CFLAGS@
|
|
LTCOMPILE = @LIBTOOL@ --mode=compile $(COMPILE)
|
|
LTLINK = @LIBTOOL@ --mode=link @CC@ -no-undefined @CFLAGS@ @LDFLAGS@ -o $@
|
|
SHELL = @SHELL@
|
|
@SET_MAKE@
|
|
|
|
TARGETS = libltdl/libltdlc.la module.la ltdldemo@EXEEXT@
|
|
|
|
all: $(TARGETS)
|
|
|
|
libltdl/libltdlc.la:
|
|
cd libltdl && $(MAKE)
|
|
|
|
module.la: module.lo
|
|
$(LTLINK) module.lo -module -avoid-version -rpath /dev/null
|
|
|
|
ltdldemo@EXEEXT@: main.@OBJEXT@
|
|
$(LTLINK) main.@OBJEXT@ -dlopen module.la @LIBLTDL@
|
|
|
|
.SUFFIXES:
|
|
.SUFFIXES: .c .@OBJEXT@ .lo
|
|
|
|
.c.@OBJEXT@:
|
|
$(COMPILE) -c $<
|
|
|
|
.c.lo:
|
|
$(LTCOMPILE) -c -o $@ $<
|
|
]])
|
|
|
|
LT_AT_BOOTSTRAP([--ltdl --install], [-I libltdl/m4], [ignore], [ignore],
|
|
[--force])
|
|
|
|
LT_AT_EXEC_CHECK([./ltdldemo], 0, [ignore])
|
|
|
|
AT_CLEANUP
|