libtool/tests/nonrecursive.at
Gary V. Vaughan 2ebff7eea0 Move libltdl build mode options from LT_CONFIG_LTDL_DIR to
LTDL_INIT.  Accept (optional) new 'convenience' and 'installable'
options in lieu of LTDL_CONVENIENCE and LTDL_INSTALL macros. And
also, implement --with-included-ltdl, --with-ltdl-lib and
--with-ltdl-include configure-time options:

* libltdl/m4/ltoptions.m4: Associate existing option settings with
LT_INIT.
(LT_OPTION_DEFINE): Associate options 'nonrecursive', 'recursive',
'subproject', 'installable' and 'convenience' with LTDL_INIT.
(_LT_MANGLE_OPTION, _LT_SET_OPTION, _LT_IF_OPTION)
(_LT_UNLESS_OPTIONS, _LT_SET_OPTIONS): Add MACRO-NAME argument to
support options to named macros instead of hardcoding only LT_INIT
options.
* libltdl/m4/ltdl.m4 (_LTDL_CONVENIENCE): Factor common code from
LTDL_CONVENIENCE and LTDL_INIT([convenience]).
(_LTDL_INSTALLABLE): Factor out common code from LTDL_INSTALLABLE
and LTDL_INIT([installable]).
(_LTDL_SETUP): Renamed from LTDL_INIT.  Support new configure-time
options: --with-included-ltdl, --with-ltdl-lib,
--with-ltdl-include.
(LTDL_CONVENIENCE, LTDL_INSTALLABLE): Adjust.
(LT_WITH_LTDL): Removed.
(LTDL_INIT): Parse caller options.
* libltdl/m4/libtool.m4 (LT_INIT): Declare that this macro must be
expanded before LTDL_INIT, and be sure to parse caller options.
* configure.ac: Call directly into internal _LTDL_SETUP macro.
* libtoolize.m4sh (func_scan_files): Ltdl mode argument moved from
LT_CONFIG_LTDL_DIR to LT_INIT.
* tests/nonrecursive.at, tests/recursive.at: Use new interfaces.
* tests/configure-iface.at: Test it.
* Makefile.am (TESTSUITE_AT): Add configure-iface.at.
* doc/libtool.texi (Distributing libltdl): Document improved.
LTDL_INIT interfaces.
* NEWS: Updated.
2008-01-06 16:33:31 +00:00

150 lines
3.6 KiB
Plaintext

# nonrecursive.at -- test nonrecursive Automake Libltdl -*- Autotest -*-
#
# Copyright (C) 2005, 2008 Free Software Foundation, Inc.
# Written by Gary V. Vaughan, 2005
#
# This file is part of GNU Libtool.
#
# GNU Libtool 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 of
# the License, or (at your option) any later version.
#
# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
# or obtained by writing to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
####
AT_BANNER([Nonrecursive Automake Libltdl.])
# _LTDL_SETUP
# -----------
m4_pushdef([_LTDL_SETUP],
[AT_DATA([configure.ac],
[[AC_INIT([subdirectory-demo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
LT_CONFIG_LTDL_DIR([ltdl])
AC_CONFIG_AUX_DIR([ltdl/config])
AC_CONFIG_MACRO_DIR([ltdl/m4])
AC_CONFIG_LIBOBJ_DIR([ltdl])
AC_CONFIG_HEADERS([config.h:config.hin])
AM_INIT_AUTOMAKE([foreign subdir-objects])
AC_PROG_CC
AM_PROG_CC_C_O
LT_INIT
LTDL_INIT([nonrecursive])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
]])
AT_DATA([Makefile.am],
[[ACLOCAL_AMFLAGS = -I ltdl/m4
AUTOMAKE_OPTIONS = 1.7
BUILT_SOURCES =
AM_CPPFLAGS =
AM_LDFLAGS =
include_HEADERS =
noinst_LTLIBRARIES =
lib_LTLIBRARIES = foo.la
EXTRA_LTLIBRARIES =
EXTRA_DIST =
CLEANFILES =
MOSTLYCLEANFILES =
include ltdl/Makefile.inc
foo_la_LDFLAGS = -module -avoid-version
foo_la_SOURCES = foo.c
]])
echo 'int dummy = 0;' > foo.c
])# _LTDL_SETUP
## ------------------------ ##
## Softlinked libltdl tree. ##
## ------------------------ ##
AT_SETUP([compiling softlinked libltdl])
_LTDL_SETUP
LT_AT_LIBTOOLIZE([--ltdl])
AT_CHECK([if test -f ltdl/configure.ac; then false; fi])
# Support vanilla autoconf-2.59 & automake-1.9.6
for file in argz.c lt__dirent.c lt__strl.c; do
cp ltdl/$file $file
done
LT_AT_BOOTSTRAP([ignore], [-I ltdl/m4], [], [--add-missing --copy],
[], [], [all $tst_dist])
AT_CHECK([test -f ltdl/libltdlc.la])
AT_CLEANUP
## -------------------- ##
## Copied libltdl tree. ##
## -------------------- ##
AT_SETUP([compiling copied libltdl])
_LTDL_SETUP
LT_AT_LIBTOOLIZE([--copy --ltdl])
AT_CHECK([if test -f ltdl/configure.ac; then false; fi])
# Support vanilla autoconf-2.59 & automake-1.9.6
for file in argz.c lt__dirent.c lt__strl.c; do
cp ltdl/$file $file
done
LT_AT_BOOTSTRAP([ignore], [-I ltdl/m4], [], [--add-missing --copy],
[], [], [all $tst_dist])
AT_CHECK([test -f ltdl/libltdlc.la])
AT_CLEANUP
## ------------------------- ##
## Installable libltdl tree. ##
## ------------------------- ##
AT_SETUP([installable libltdl])
_LTDL_SETUP
prefix=`pwd`/_inst
LT_AT_LIBTOOLIZE([--copy --ltdl])
AT_CHECK([if test -f ltdl/configure.ac; then false; fi])
# Support vanilla autoconf-2.59 & automake-1.9.6
for file in argz.c lt__dirent.c lt__strl.c; do
cp ltdl/$file $file
done
LT_AT_BOOTSTRAP([ignore], [-I ltdl/m4], [], [--add-missing --copy],
[], [--enable-ltdl-install --prefix=$prefix], [all install $tst_dist])
AT_CHECK([test -f $prefix/lib/libltdl.la])
AT_CHECK([test -f $prefix/include/ltdl.h])
AT_CLEANUP
dnl Be careful not to let the definition leak into other tests
m4_popdef([_LTDL_SETUP])