+1999-03-13 Thomas Tanner <tanner@gmx.de>
+
+ * updated
+ * NEWS: next version is 1.3pre
+ * ltconfig.in: removed "must_relink" flag
+ * ltmain.in: implemented fast-install mode, fixed many bugs
+
1999-03-09 Gary V. Vaughan <gvaughan@oranda.demon.co.uk>
* ltmain.in: fixed a bug that causes archive link to fail when
AUTOMAKE_OPTIONS = 1.3e gnits readme-alpha
-BUILD_SUBDIRS = . doc tests
+BUILD_SUBDIRS = . libltdl doc tests
SUBDIRS = $(BUILD_SUBDIRS)
DIST_SUBDIRS = $(BUILD_SUBDIRS) $(CONF_SUBDIRS)
EXTRA_DIST = $(aclocal_macros) libtoolize.in ltconfig.in ltmain.in \
libtool.spec
-CLEANFILES = libtool libtoolize ltconfig.T ltmain.shT libltdl.tar.gz
+CLEANFILES = libtool libtoolize ltconfig.T ltmain.shT
# These are required by libtoolize.
pkgdata_SCRIPTS = config.guess config.sub ltconfig
libtool: $(srcdir)/ltmain.sh $(srcdir)/ltconfig
CC="$(CC)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" \
LD="$(LD)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \
- $(SHELL) $(srcdir)/ltconfig --srcdir=$(srcdir) --output=$@ \
- $(srcdir)/ltmain.sh
+ $(SHELL) $(srcdir)/ltconfig $(LIBTOOL_FLAGS) --srcdir=$(srcdir) \
+ --output=$@ $(srcdir)/ltmain.sh
# Experimental C version of libtool.
clibtool: $(srcdir)/ltmain.c $(srcdir)/ltconfig
CC="$(CC)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" \
LD="$(LD)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \
- $(SHELL) $(srcdir)/ltconfig --srcdir=$(srcdir) --output=$@ \
- $(srcdir)/ltmain.c
+ $(SHELL) $(srcdir)/ltconfig $(LIBTOOL_FLAGS) --srcdir=$(srcdir) \
+ --output=$@ $(srcdir)/ltmain.c
libtoolize: $(srcdir)/libtoolize.in $(top_builddir)/config.status
CONFIG_FILES=libtoolize CONFIG_HEADERS= $(top_builddir)/config.status
# All our rules should depend on these demo files.
all-local check-local: $(ACINCLUDE_M4_LIST) libtool
-check-local: libltdl/Makefile
@ACINCLUDE_M4_LIST@: $(srcdir)/libtool.m4
rm -f $@
abs_srcdir=`cd $(top_srcdir) && pwd`; \
(cd $$dir && $$abs_srcdir/$$dir/configure) || exit 1
-# Create and install libltdl.tar.gz
-install-data-hook: libltdl/Makefile
- @echo 'cd libltdl && $(MAKE) distdir distdir=libltdl && tar -cf libltdl.tar libltdl && gzip $(GZIP_ENV) libltdl.tar'
- @if (cd libltdl && $(MAKE) distdir distdir=libltdl && \
- tar -cf libltdl.tar libltdl && \
- gzip $(GZIP_ENV) libltdl.tar); then \
- echo "$(INSTALL_DATA) libltdl/libltdl.tar.gz $(pkgdatadir)/libltdl.tar.gz"; \
- $(INSTALL_DATA) libltdl/libltdl.tar.gz $(pkgdatadir)/libltdl.tar.gz; \
- else \
- echo "Warning: without gzip, libtool cannot install libltdl.tar.gz"; \
- fi; \
- rm -rf libltdl/libltdl libltdl/libltdl.tar libltdl/libltdl.tar.gz
+# Create and install libltdl
+install-data-hook:
+ cd libltdl && $(MAKE) distdir distdir=$(DESTDIR)$(pkgdatadir)/libltdl
################################################################
##
NEWS - list of user-visible changes between releases of GNU Libtool
-New in 1.2g: CVS version
+New in 1.3pre: CVS version; 1.3: 1999-?-?, Libtool team:
+* Complete inter-library dependencies support. It's now possible
+ to link libtool libraries against other libtool libraries.
+* Already-installed libtool libraries will be correctly found.
* Support for linking dll objects specified on the link line.
-
+* New demos and tests
+* Various bugfixes
+\f
New in 1.2e: CVS version; 1.2f: 1999-?-?, Libtool team:
-* In order for libtool to attempt to link a shared library (dll) on win32
- platforms, you must pass the -no-undefined flag to libtool in link mode.
-* The path to GNU ld now works on cygwin-b18 to cygwin-b20.2 at least.
-* Support for IRIX library versioning.
-* Improved support for DJGPP envionment.
-* Wrapper scripts now work on win32.
* libtool will correctly link uninstalled libraries into programs
and prefer uninstalled libraries to installed ones
* Library paths that are in the system search path are no longer hardcoded.
* New fast installation mode, which links the final executable
in order to avoid relinking during installation.
Programs in the build-tree are relinked when executed.
-* New AC_DISABLE_FAST_INSTALL macro to disable the fast-install mode
+* New AC_DISABLE_FAST_INSTALL macro to set the default for
+ the fast-install mode to disabled
* New -export-symbols-regex flag, to export symbols selectively by
a regular expression
+* Support -R for specifying run-time path of programs and library dependencies
+* New -avoid-version option to avoid versioning for libraries
+* libtool module names no longer need to have a "lib" prefix
+ (requires automake 1.4).
+* New -thread-safe flag, to build thread-safe libraries
* Major improvements in libltdl: API documentation, installable version,
support for module search paths, support for lt_dlopen(0),
can be embedded into packages as a tar file (libltdl.tar.gz),
dynamic buffer allocation and buffer overflow checks,
new macro LTDL_SET_PRELOADED_SYMBOLS() which must be used in the
main program, dynamic memory allocation functions are user-defineable
-* If libtool could not satisfy all dependencies of a module
- it will only build a static version of it
+* New AC_LIBLTDL_CONVENIENCE and AC_LIBLTDL_INSTALLABLE macros, to select
+ convenience and/or installable versions of libltdl.
+* libltdl is now built and installed unless --disable-ltdl-install
* New "-dlopen self" flag for dlopening the executable itself
-* dld_preloaded_symbols was renamed to lt_preloaded_symbols
* New AC_LIBTOOL_DLOPEN macro to check for dlopen support,
required if you use -dlopen or -dlpreopen
-* New -thread-safe flag, to build thread-safe libraries
-* New demos and tests
-* Improved shared library checking
-* Libtool will now accept *.dll objects on the command line, and generate
- an import library on the fly so that it will be linked correctly.
-* Support -R for specifying run-time path of programs and library dependencies
+* If libtool could not satisfy all dependencies of a module
+ it will only build a static version of it
+* dld_preloaded_symbols was renamed to lt_preloaded_symbols
* Support for BeOS
-* Improved support for aix3, aix4, SysV 4.3, BSD/OS 4.x and NetBSD
-* New -avoid-version option to avoid versioning for libraries
+* Improved support for FreeBSD, AIX, IRIX, OSF, SysV 4.3, HP/UX, DJGPP
+ BSD/OS 4.x and NetBSD
+* In order for libtool to attempt to link a shared library (dll) on win32
+ platforms, you must pass the -no-undefined flag to libtool in link mode.
+* The path to GNU ld now works on cygwin-b18 to cygwin-b20.2 at least.
+* Support for IRIX library versioning.
+* New demos and tests
* Various bugfixes
-
+\f
New in 1.2c: CVS version; 1.2d: 1998-12-16, Libtool team:
* libtool will correctly link already-installed libraries into programs.
* New -module flag, to create loadable modules.
* New libltdl, a small library for portable dlopening of modules.
-It is still undocumented, but you can already find some examples in:
+ It is still undocumented, but you can already find some examples in:
* New mdemo directory, with tests of -module and dlopening examples.
-Be aware that libltdl is only known to work on a few platforms such as
-GNU/Linux and Solaris2. Some mdemo tests are known to FAIL on several
-other platforms; please ignore these failures by now (or work to fix
-them :-).
+ Be aware that libltdl is only known to work on a few platforms such as
+ GNU/Linux and Solaris2. Some mdemo tests are known to FAIL on several
+ other platforms; please ignore these failures by now (or work to fix
+ them :-).
* Inter-library dependencies patch finally integrated, but there's
-still much porting to do. See PORTING for details (some plans for the
-future in mail/deplibs in the CVS tree).
+ still much porting to do. See PORTING for details (some plans for the
+ future in mail/deplibs in the CVS tree).
* New option -export-symbols to control symbol exporting when possible.
* Fixed -export-dynamic problem with C++ programs in egcs 1.1.
* New dlpreopen structure.
* libtool now supports `-c -o' and subdirectories in sources and
-target object names even in platforms whose compilers do not support
-this. In this case, file locking occurs to avoid problems with
-parallel builds.
+ target object names even in platforms whose compilers do not support
+ this. In this case, file locking occurs to avoid problems with
+ parallel builds.
* New `echo' variant that should fix most problems with long command
-lines and broken printf programs.
+ lines and broken printf programs.
* Support for DG/UX, UnixWare 7.x and FreeBSD 3.0, and improved
-support for Microsoft Windows
+ support for Microsoft Windows
* Various bugfixes
* We now have anonymous CVS access to GNU libtool. CVSROOT is
-:pserver:anoncvs@anoncvs.gnu.org:/gd/gnu/anoncvsroot. The password
-is empty. The directory is libtool. Check our home-page at
-http://www.gnu.org/software/libtool/libtool.html for details.
+ :pserver:anoncvs@anoncvs.gnu.org:/gd/gnu/anoncvsroot. The password
+ is empty. The directory is libtool. Check our home-page at
+ http://www.gnu.org/software/libtool/libtool.html for details.
* Alexandre Oliva, Thomas Tanner and Gary V. Vaughan have taken over
-the maintenance of libtool.
+ the maintenance of libtool.
* Arguments to ltconfig have been changed to allow creation of a
-libtool C program, totally unusable as of this release.
-
+ libtool C program, totally unusable as of this release.
+\f
New in 1.2b - 1998-07-01, Gordon Matzigkeit:
* Libtool needs a new maintainer, since Gordon Matzigkeit has quit.
-If you think you can do the job, send mail to bug-libtool@gnu.org.
+ If you think you can do the job, send mail to bug-libtool@gnu.org.
* Bug fixes.
* Support for libtool convenience archives.
-
+\f
New in 1.2a - 1998-04-19, Gordon Matzigkeit:
* Bug fixes.
* ltconfig accepts an `--output' option to specify the name of the
= Release procedure
* Fetch new versions of the files that are maintained by the FSF.
- Unfortunately you need an FSF account to do this.
+ The most important ones are available for anonymous CVS in the
+ `common' directory, sibling of the libtool CVS tree:
+ cvs -d :pserver:anoncvs@anoncvs.gnu.org:/gd/gnu/anoncvsroot checkout common
* Update NEWS.
-For next alpha release:
-***********************
-
-* Fast installation (linking on demand in the build tree)
-must be optional.
+For next public release:
+************************
* check whether the version of libtool.m4 is compatible
with ltconfig/ltmain.sh
-* libltdl is broken when configured with --enable-ltdl-install
-
* check whether the "file" command is available
-* update the NEWS file
-
-* Tom Lane adds that HP-UX's linker, at least (I've also found this on
-AIX 4), distinguishes between global function and global variable
-references. This means that we cannot declare every symbol as `extern
-char'. Find a workaround.
-
-For next public release:
-************************
-
* Inter-library dependencies should be fully tracked by libtool
and need to work for ltlibraries too. This requires looking up
installed libtool libraries for transparent support.
* Lists of exported symbols should be stored in the pseudo library
so that the size of lt_preloaded_symbols can be reduced.
+* Documentation:
+
+- libltdl documentation needs to be completed.
+
+- AC_PROG_LIBTOOL, AC_ENABLE/DISABLE_SHARED/STATIC/FAST_INSTALL,
+ AC_LIBTOOL_DLOPEN, AC_LIBLTDL_CONVENIENCE/INSTALLABLE are not documented
+
+- Purpose and usage of convenience libraries must be better documented
+
+- some new internal variables are not documented yet.
+
+In the future:
+**************
+
* Godmar Back writes:
libltdl uses such stdio functions as fopen, fgets, feof, fclose, and others.
These functions are not async-signal-safe. While this does not make
possible would greatly improve libltdl's ability to be embedded in and
used by other systems.
-* Documentation:
-
-- libltdl documentation needs to be completed.
-
-- AC_PROG_LIBTOOL, AC_ENABLE/DISABLE_SHARED/STATIC, AC_LIBTOOL_DLOPEN
- are not documented.
-
-- Purpose and usage of convenience libraries must be better documented
-
-- some new internal variables are not documented yet.
-
-In the future:
-**************
-
* Fix */demo on win32.
This may simply require resolving the item below.
cdemo_SOURCES = main.c
cdemo_LDADD = libfoo.la
+
+$(OBJECTS): libtool
+libtool: $(LIBTOOL_DEPS)
+ $(SHELL) ./config.status --recheck
AC_PROG_CC
AC_EXEEXT
AM_PROG_LIBTOOL
+AC_SUBST(LIBTOOL_DEPS)
AC_CHECK_HEADERS(math.h)
dnl For the `lineno' script (which puts line numbers into `ltconfig').
AC_PROG_AWK
+dnl Check for dlopen support
+AC_LIBTOOL_DLOPEN
+AC_LIBTOOL_SETUP
+
+LIBTOOL_FLAGS="$libtool_flags"
+AC_SUBST(LIBTOOL_FLAGS)
+
+AC_ARG_ENABLE(ltdl-install,
+[ --disable-ltdl-install do not install libltdl])
+if test x"${enable_ltdl_install+set}" != xset; then
+ enable_ltdl_install=yes
+ ac_configure_args="$ac_configure_args --enable-ltdl-install"
+fi
+AC_CONFIG_SUBDIRS(libltdl)
+
dnl all subdirectories that are configured on demand, but that must be
dnl included in the distribution
-CONF_SUBDIRS="libltdl demo mdemo cdemo depdemo"
+CONF_SUBDIRS="cdemo demo depdemo mdemo"
AC_SUBST(CONF_SUBDIRS)
-ACINCLUDE_M4_LIST="${srcdir}/acinclude.m4 "
+ACINCLUDE_M4_LIST="${srcdir}/acinclude.m4 ${srcdir}/libltdl/acinclude.m4 "
DIST_MAKEFILE_LIST=
for dir in $CONF_SUBDIRS; do
ACINCLUDE_M4_LIST="$ACINCLUDE_M4_LIST${srcdir}/$dir/acinclude.m4 "
AC_SUBST(ACINCLUDE_M4_LIST)
AC_SUBST(DIST_MAKEFILE_LIST)
+AC_OUTPUT_COMMANDS([
+ test -f ${saved_top_srcdir}/ltconfig || ${MAKE-make} ${saved_top_srcdir}/ltconfig
+ test -f ${saved_top_srcdir}/ltmain.sh || ${MAKE-make} ${saved_top_srcdir}/ltmain.sh
+], [saved_top_srcdir=${srcdir}])
AC_OUTPUT([Makefile doc/Makefile tests/Makefile])
# Local Variables:
hc-minusL: $(hell_OBJECTS) $(hell_DEPENDENCIES)
@rm -f hc-minusL
$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) -L./$(objdir) -lhello -lm
+
+$(OBJECTS): libtool
+libtool: $(LIBTOOL_DEPS)
+ $(SHELL) ./config.status --recheck
AC_PROG_CC
AC_C_CONST
AC_EXEEXT
+AC_LIBTOOL_DLOPEN
AM_PROG_LIBTOOL
+AC_SUBST(LIBTOOL_DEPS)
if ${CONFIG_SHELL} ./libtool --features | grep "enable static" >/dev/null; then
STATIC=-static
depdemo_static_LDADD = $(depdemo_LDADD)
depdemo_static_DEPENDENCIES = $(depdemo_DEPENDENCIES)
depdemo_static_LDFLAGS = $(STATIC)
+
+$(OBJECTS): libtool
+libtool: $(LIBTOOL_DEPS)
+ $(SHELL) ./config.status --recheck
AC_PROG_CC
AC_EXEEXT
AM_PROG_LIBTOOL
+AC_SUBST(LIBTOOL_DEPS)
if ${CONFIG_SHELL} ./libtool --features | grep "enable static" >/dev/null; then
STATIC=-static
libraries and previously dlopened modules. If the executable using this
module was linked with the @code{-export-dynamic} flag, then the global
symbols in the executable will also be used to resolve references in the
-module. Libltdl tries to resolve the symbols immediately and returns
-@code{NULL} if that fails.
+module.
If @var{filename} is NULL @code{lt_dlopen} will return a handle
for the program itself, which can be used to access its symbols
@itemx demo-unst.test
@itemx demo-static.test
@itemx demo-shared.test
+@itemx demo-nofast.test
@pindex demo-conf.test
@pindex demo-exec.test
@pindex demo-inst.test
@pindex demo-unst.test
@pindex demo-static.test
@pindex demo-shared.test
+@pindex demo-nofast.test
These programs check to see that the @file{demo} subdirectory of the
libtool distribution can be configured, built, installed, and
uninstalled correctly.
The @file{demo} subdirectory contains a demonstration of a trivial
-package that uses libtool. The tests @file{cdemo-make.test},
-@file{cdemo-exec.test}, @file{cdemo-inst.test} and
-@file{cdemo-unst.test} are executed three times, under three different
-libtool configurations: @file{cdemo-conf.test} configures
-@file{cdemo/libtool} to build both static and shared libraries,
-@file{cdemo-static.test} builds only static libraries
-(@samp{--disable-shared}), and @file{cdemo-shared.test} builds only
+package that uses libtool. The tests @file{demo-make.test},
+@file{demo-exec.test}, @file{demo-inst.test} and
+@file{demo-unst.test} are executed four times, under four different
+libtool configurations: @file{demo-conf.test} configures
+@file{demo/libtool} to build both static and shared libraries,
+@file{demo-static.test} builds only static libraries
+(@samp{--disable-shared}), and @file{demo-shared.test} builds only
shared libraries (@samp{--disable-static}).
+@file{demo-nofast.test} configures @file{demo/libtool} to
+disable the fast-install mode (@samp{--enable-fast-install=no}.
@item mdemo-conf.test
@itemx mdemo-exec.test
libraries (@samp{--disable-shared}), and @file{cdemo-shared.test} builds
only shared libraries (@samp{--disable-static}).
+@item build-relink.test
+@pindex build-relink.test
+Checks whether variable @var{shlibpath_overrides_runpath} is properly
+set. If the test fails and @var{VERBOSE} is set, it will indicate what
+the variable should have been set to.
+
@item hardcode.test
@pindex hardcode.test
On all systems with shared libraries, the location of the library can be
the use of @samp{old_archive_from_expsyms_cmds}.
@end defvar
+@defvar fast_install
+Determines whether libtool will privilege the installer or the
+developer. The assumption is that installers will seldom run programs
+in the build tree, and the developer will seldom install. This is only
+meaningful on platforms in which @var{shlibpath_overrides_runpath} is
+not @samp{yes}, so @var{fast_install} will be set to @samp{needless} in
+this case. If @var{fast_install} set to @samp{yes}, libtool will create
+programs that search for installed libraries, and, if a program is run
+in the build tree, a new copy will be linked on-demand to use the
+yet-to-be-installed libraries. If set to @samp{no}, libtool will create
+programs that use the yet-to-be-installed libraries, and will link
+a new copy of the program at install time. The default value is
+@samp{yes} or @samp{needless}, depending on platform and configuration
+flags, and it can be turned from @samp{yes} to @samp{no} with the
+configure flag @samp{--disable-fast-install}.
+@end defvar
+
@defvar finish_cmds
Commands to tell the dynamic linker how to find shared libraries in a
specific directory.
raw symbols followed by their C names. For example:
@example
-$ @kbd{$NM | $global_symbol_pipe}
-@var{symbol1} @var{C-symbol1}
-@var{symbol2} @var{C-symbol2}
-@var{symbol3} @var{C-symbol3}
+$ @kbd{eval "$NM progname | $global_symbol_pipe"}
+D @var{symbol1} @var{C-symbol1}
+T @var{symbol2} @var{C-symbol2}
+C @var{symbol3} @var{C-symbol3}
@dots{}
$
@end example
+
+The first column contains the symbol type (used to tell data from code
+on some platforms), but its meaning is system dependent.
+@end defvar
+
+@defvar global_symbol_to_cdecl
+A pipeline that translates the output of @var{global_symbol_pipe} into
+proper C declarations. On platforms whose linkers differentiate code
+from data, such as HP/UX, data symbols will be declared as such, and
+code symbols will be declared as functions. On platforms that don't
+care, everything is assumed to be data.
@end defvar
@defvar hardcode_action
Indicates whether it is possible to override the hard-coded library
search path of a program with an environment variable. If this is set
to no, libtool may have to create two copies of a program in the build
-tree, one to be installed and one to be run in the build tree only. The
-latter will be created on-demand, only if the program is actually run in
-the build tree. If this is set to yes, libtool will set
-@code{shlibpath_var} in the wrapper script before starting the program.
-The default value is unknown, which is equivalent to no.
+tree, one to be installed and one to be run in the build tree only.
+When each of these copies is created depends on the value of
+@code{fast_install}. The default value is @samp{unknown}, which is
+equivalent to @samp{no}.
@end defvar
@defvar shlibpath_var
#
AUTOMAKE_OPTIONS = no-dependencies foreign
-LTDL_VERSION = -version-info 1:1:1
-
if INSTALL_LTDL
include_HEADERS = ltdl.h
+lib_LTLIBRARIES = libltdl.la
else
noinst_HEADERS = ltdl.h
endif
-noinst_LTLIBRARIES = libltdl.la
+if CONVENIENCE_LTDL
+noinst_LTLIBRARIES = libltdlc.la
+endif
libltdl_la_SOURCES = ltdl.c
+libltdl_la_LDFLAGS = -version-info 1:1:1
libltdl_la_LIBADD = $(LIBADD_DL)
-lib_LTLIBRARIES = @LIBLIBS@
-EXTRA_LTLIBRARIES =
-
-@TOINST@/libltdl.la: $(libltdl_la_OBJECTS) $(libltdl_la_DEPENDENCIES)
- @test -d $(TOINST) || mkdir $(TOINST)
- $(LINK) -o $@ $(libltdl_la_OBJECTS) \
- -rpath $(libdir) $(LTDL_VERSION) $(libltdl_la_LIBADD)
-
-distclean-local:
- test -z $(TOINST) || rm -rf $(TOINST)
+libltdlc_la_SOURCES = ltdl.c
+libltdlc_la_LIBADD = $(LIBADD_DL)
+$(OBJECTS): libtool
libtool: $(LIBTOOL_DEPS)
$(SHELL) ./config.status --recheck
-Makefile: libtool
+++ /dev/null
-#undef LTDL_SHLIB_EXT
-
-#undef LTDL_SHLIBPATH_VAR
-
-#undef LTDL_OBJDIR
-
-#undef HAVE_PRELOADED_SYMBOLS
-
-#undef HAVE_LIBDL
-
-#undef HAVE_DLD
-
-#undef HAVE_SHL_LOAD
-
-#undef NEED_USCORE
dnl Process this file with autoconf to create configure.
dnl Initialize the libltdl package.
AC_INIT(ltdl.c)
+
+if test -z "$enable_ltdl_install$enable_ltdl_convenience"; then
+ if test -f ${srcdir}/ltconfig && test -f ${srcdir}/ltmain.sh; then
+ # if libltdl is libtoolized, it is assumed to be stand-alone and
+ # installed unless the command line overrides it (tested above)
+ enable_ltdl_install=yes
+ else
+ AC_MSG_WARN([*** The top-level configure must select either])
+ AC_MSG_WARN([*** [A""C_LIBLTDL_INSTALLABLE] or [A""C_LIBLTDL_CONVENIENCE].])
+ AC_MSG_ERROR([*** Maybe you want to --enable-ltdl-install?])
+ fi
+fi
+
AM_INIT_AUTOMAKE(libltdl,1.0,-)
AM_CONFIG_HEADER(config.h)
-
AM_MAINTAINER_MODE
-TOINST=toinst
-AC_SUBST(TOINST)
-
-AC_ARG_ENABLE(ltdl-install,
- [--enable-ltdl-install install libltdl])
-AM_CONDITIONAL(INSTALL_LTDL, test x$enable_ltdl_install = xyes)
-if test x$enable_ltdl_install = xyes; then
- LIBLIBS=$TOINST/libltdl.la
-else
- LIBLIBS=
-fi
-AC_SUBST(LIBLIBS)
-
AC_PROG_CC
AC_C_CONST
AC_C_INLINE
AM_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)
+AC_ARG_ENABLE(ltdl-install,
+[ --enable-ltdl-install install libltdl])
+
+AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno)
+AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)
+
AC_CACHE_CHECK([which extension is used for shared libraries],
libltdl_cv_shlibext, [dnl
(
AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
libltdl_cv_need_uscore, [dnl
AC_TRY_RUN([
+#if HAVE_DLFCN_H
#include <dlfcn.h>
+#endif
+
#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LTDL_GLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LTDL_GLOBAL DL_GLOBAL
+# else
+# define LTDL_GLOBAL 0
+# endif
+#endif
+
+/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LTDL_LAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LTDL_LAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LTDL_LAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LTDL_LAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LTDL_LAZY_OR_NOW DL_NOW
+# else
+# define LTDL_LAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
fnord() { int i=42;}
-main() { void *self, *ptr1, *ptr2; self=dlopen(0,RTLD_LAZY);
+main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
- if(ptr1 && !ptr2) exit(0); } exit(1); }
+ if(ptr1 && !ptr2) exit(0); } exit(1); }
], libltdl_cv_need_uscore=no, libltdl_cv_need_uscore=yes,
- libltdl_cv_need_uscore=no
+ libltdl_cv_need_uscore=cross
)])
fi
fi
/* max. filename length */
#ifndef LTDL_FILENAME_MAX
-# ifdef FILENAME_MAX
-# define LTDL_FILENAME_MAX FILENAME_MAX
-# else
-# define LTDL_FILENAME_MAX 1024
-# endif
+#define LTDL_FILENAME_MAX 1024
#endif
#undef LTDL_READTEXT_MODE
lt_ptr_t system; /* system specific data */
} lt_dlhandle_t;
-#if ! HAVE_STRDUP
-
#undef strdup
#define strdup xstrdup
char *tmp;
if (!str)
- return str;
+ return 0;
tmp = (char*) lt_dlmalloc(strlen(str)+1);
if (tmp)
strcpy(tmp, str);
return tmp;
}
-#endif
-
#if ! HAVE_STRCHR
# if HAVE_INDEX
const char *old_name;
int installed;
{
+ int error;
+ char *filename;
/* try to open the old library first; if it was dlpreopened,
we want the preopened version of it, even if a dlopenable
module is available */
if (dlname) {
/* try to open the installed module */
if (installed && libdir) {
- int ret;
- char *filename = (char*)
+ filename = (char*)
lt_dlmalloc(strlen(libdir)+1+strlen(dlname)+1);
-
if (!filename) {
last_error = memory_error;
return 1;
strcpy(filename, libdir);
strcat(filename, "/");
strcat(filename, dlname);
- ret = tryall_dlopen(handle, filename) == 0;
+ error = tryall_dlopen(handle, filename) == 0;
lt_dlfree(filename);
- if (ret)
+ if (error)
return 0;
}
/* try to open the not-installed module */
if (!installed) {
- int ret;
- char *filename = (char*)
+ filename = (char*)
lt_dlmalloc((dir ? strlen(dir) : 0)
+ strlen(objdir) + strlen(dlname) + 1);
-
if (!filename) {
last_error = memory_error;
return 1;
strcat(filename, objdir);
strcat(filename, dlname);
- ret = tryall_dlopen(handle, filename) == 0;
+ error = tryall_dlopen(handle, filename) == 0;
lt_dlfree(filename);
- if (ret)
+ if (error)
return 0;
}
- /* hmm, maybe it was moved to another directory.
- Should we really support this? */
+ /* hmm, maybe it was moved to another directory */
{
- int ret;
- char *filename = (char*)
+ filename = (char*)
lt_dlmalloc((dir ? strlen(dir) : 0)
+ strlen(dlname) + 1);
if (dir)
else
*filename = 0;
strcat(filename, dlname);
- ret = tryall_dlopen(handle, filename) == 0;
+ error = tryall_dlopen(handle, filename) == 0;
lt_dlfree(filename);
- if (ret)
+ if (error)
return 0;
}
}
}
static inline int
-trim (dest, s)
+trim (dest, str)
char **dest;
- const char *s;
+ const char *str;
{
+ /* remove the leading and trailing "'" from str
+ and store the result in dest */
char *tmp;
- char *i = strrchr(s, '\'');
- int len = strlen(s);
+ char *end = strrchr(str, '\'');
+ int len = strlen(str);
if (*dest)
lt_dlfree(*dest);
- if (len > 3 && s[0] == '\'') {
- tmp = (char*) lt_dlmalloc(i - s);
+ if (len > 3 && str[0] == '\'') {
+ tmp = (char*) lt_dlmalloc(end - str);
if (!tmp) {
last_error = memory_error;
return 1;
}
- strncpy(tmp, &s[1], (i - s) - 1);
+ strncpy(tmp, &str[1], (end - str) - 1);
tmp[len-3] = '\0';
*dest = tmp;
} else
int i;
char *dlname = 0, *old_name = 0;
char *libdir = 0, *deplibs = 0;
+ char *line;
int error = 0;
/* if we can't find the installed flag, it is probably an
installed libtool archive, produced with an old version
lt_dlfree(dir);
return 0;
}
+ line = (char*) lt_dlmalloc(LTDL_FILENAME_MAX);
+ if (!line) {
+ fclose(file);
+ last_error = memory_error;
+ return 0;
+ }
/* read the .la file */
while (!feof(file)) {
- char line[LTDL_FILENAME_MAX];
-
- if (!fgets(line, sizeof(line), file))
+ if (!fgets(line, LTDL_FILENAME_MAX, file))
break;
if (line[0] == '\n' || line[0] == '#')
continue;
- if (strncmp(line, "dlname=", 7) == 0)
- error = trim(&dlname, &line[7]);
+# undef STR_DLNAME
+# define STR_DLNAME "dlname="
+ if (strncmp(line, STR_DLNAME,
+ sizeof(STR_DLNAME) - 1) == 0)
+ error = trim(&dlname,
+ &line[sizeof(STR_DLNAME) - 1]);
else
- if (strncmp(line, "old_library=", 12) == 0)
- error = trim(&old_name, &line[12]);
+# undef STR_OLD_LIBRARY
+# define STR_OLD_LIBRARY "old_library="
+ if (strncmp(line, STR_OLD_LIBRARY,
+ sizeof(STR_OLD_LIBRARY) - 1) == 0)
+ error = trim(&old_name,
+ &line[sizeof(STR_OLD_LIBRARY) - 1]);
else
- if (strncmp(line, "libdir=", 7) == 0)
- error = trim(&libdir, &line[7]);
+# undef STR_LIBDIR
+# define STR_LIBDIR "libdir="
+ if (strncmp(line, STR_LIBDIR,
+ sizeof(STR_LIBDIR) - 1) == 0)
+ error = trim(&libdir,
+ &line[sizeof(STR_LIBDIR) - 1]);
else
- if (strncmp(line, "dl_dependency_libs=", 20) == 0)
- error = trim(&deplibs, &line[20]);
+# undef STR_DL_DEPLIBS
+# define STR_DL_DEPLIBS "dl_dependency_libs="
+ if (strncmp(line, STR_DL_DEPLIBS,
+ sizeof(STR_DL_DEPLIBS) - 1) == 0)
+ error = trim(&deplibs,
+ &line[sizeof(STR_DL_DEPLIBS) - 1]);
else
if (strcmp(line, "installed=yes\n") == 0)
installed = 1;
break;
}
fclose(file);
+ lt_dlfree(line);
/* allocate the handle */
handle = (lt_dlhandle) lt_dlmalloc(sizeof(lt_dlhandle_t));
if (!handle || error) {
## configuration script generated by Autoconf, you may include it under
## the same distribution terms that you use for the rest of that program.
-# serial 32 AC_PROG_LIBTOOL
+# serial 35 AC_PROG_LIBTOOL
AC_DEFUN(AC_PROG_LIBTOOL,
-[AC_PREREQ(2.12.2)dnl
+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+
+# Save cache, so that ltconfig can load it
+AC_CACHE_SAVE
+
+# Actually configure libtool. ac_aux_dir is where install-sh is found.
+CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
+DLLTOOL="$DLLTOOL" AS="$AS" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
+$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
+|| AC_MSG_ERROR([libtool configure failed])
+
+# Reload cache, that may have been modified by ltconfig
+AC_CACHE_LOAD
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+])
+
+AC_DEFUN(AC_LIBTOOL_SETUP,
+[AC_PREREQ(2.13)dnl
AC_REQUIRE([AC_ENABLE_SHARED])dnl
AC_REQUIRE([AC_ENABLE_STATIC])dnl
-AC_REQUIRE([AC_DISABLE_FAST_INSTALL])dnl
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_SYS_SYMBOL_UNDERSCORE])dnl
AC_REQUIRE([AC_PROG_LN_S])dnl
dnl
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
# Check for any special flags to pass to ltconfig.
-libtool_flags=
+libtool_flags="--cache-file=$cache_file"
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
-test "$enable_fast_install" = yes && libtool_flags="$libtool_flags --enable-fast-install"
-test "x$lt_cv_dlopen" != xno && libtool_flags="$libtool_flags --enable-dlopen"
-test "x$lt_cv_dlopen_self" = xyes && libtool_flags="$libtool_flags --enable-dlopen-self"
+test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
+test "$lt_dlopen" = yes && libtool_flags="$libtool_flags --enable-dlopen"
test "$silent" = yes && libtool_flags="$libtool_flags --silent"
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
if test x"$need_locks" = xno; then
libtool_flags="$libtool_flags --disable-lock"
fi
-
-
-# Actually configure libtool. ac_aux_dir is where install-sh is found.
-CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
-LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
-DLLTOOL="$DLLTOOL" AS="$AS" \
-${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
-$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
-|| AC_MSG_ERROR([libtool configure failed])
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
-
-# Redirect the config.log output again, so that the ltconfig log is not
-# clobbered by the next message.
-exec 5>>./config.log
])
# AC_LIBTOOL_DLOPEN - check for dlopen support
-AC_DEFUN(AC_LIBTOOL_DLOPEN,
-[AC_CACHE_VAL(lt_cv_dlopen,
-[lt_cv_dlopen=no lt_cv_dlopen_libs=
-AC_CHECK_FUNC(dlopen, [lt_cv_dlopen="dlopen"],
- [AC_CHECK_LIB(dl, dlopen, [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
- [AC_CHECK_LIB(dld, dld_link, [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"],
- [AC_CHECK_FUNC(shl_load, [lt_cv_dlopen="shl_load"],
- [AC_CHECK_FUNC(LoadLibrary, [lt_cv_dlopen="LoadLibrary"])]
- )]
- )]
- )]
-)])
-
-case "$lt_cv_dlopen" in
-dlopen)
- AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self,
- [LT_SAVE_LIBS="$LIBS"; LIBS="$lt_cv_dlopen_libs $LIBS"
- AC_TRY_RUN([
-#include <dlfcn.h>
-#include <stdio.h>
-fnord() { int i=42;}
-main() { void *self, *ptr1, *ptr2; self=dlopen(0,RTLD_LAZY);
- if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
- if(ptr1 || ptr2) exit(0); } exit(1); }
-], lt_cv_dlopen_self=no, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=cross)
- LIBS="$LT_SAVE_LIBS"])
- ;;
-# We should probably test other for NULL support in other dlopening
-# mechanisms too.
-*)
- lt_cv_dlopen_self=no
- ;;
-esac
-])
+AC_DEFUN(AC_LIBTOOL_DLOPEN, [lt_dlopen=yes])
# AC_ENABLE_SHARED - implement the --enable-shared flag
# Usage: AC_ENABLE_SHARED[(DEFAULT)]
[AC_ENABLE_STATIC(no)])
-# AC_DISABLE_FAST_INSTALL - implement the --enable-fast-install flag
-# Usage: AC_DISABLE_FAST_INSTALL[(DEFAULT)]
+# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
+# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
-AC_DEFUN(AC_DISABLE_FAST_INSTALL,
-[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, yes, no))dnl
+AC_DEFUN(AC_ENABLE_FAST_INSTALL,
+[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(fast-install,
changequote(<<, >>)dnl
<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
])
-# AC_ENABLE_FAST_INSTALL - set the default to --enable-fast-install
-AC_DEFUN(AC_ENABLE_FAST_INSTALL,
-[AC_DISABLE_FAST_INSTALL(no)])
+# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
+AC_DEFUN(AC_DISABLE_FAST_INSTALL,
+[AC_ENABLE_FAST_INSTALL(no)])
# AC_PROG_LD - find the path to the GNU or non-GNU linker
AC_MSG_RESULT(no)
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-
AC_SUBST(LD)
AC_PROG_LD_GNU
])
AC_SUBST(NM)
])
-# AC_SYS_NM_PARSE - Check for command ro grab the raw symbol name followed
+# AC_SYS_NM_PARSE - Check for command to grab the raw symbol name followed
# by C symbol name from nm.
AC_DEFUN(AC_SYS_NM_PARSE,
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
# Transform the above into a raw symbol and a C symbol.
-ac_symxfrm='\1 \1'
+ac_symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
# Define system-specific variables.
case "$host_os" in
cygwin* | mingw*)
ac_symcode='[ABCDGISTW]'
;;
+hpux*)
+ ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
+ ;;
irix*)
ac_symcode='[BCDEGRST]'
;;
# Try without a prefix undercore, then with it.
for ac_symprfx in "" "_"; do
- # Write the raw and C identifiers.
- # Unlike in ltconfig.in, we need $ac_symprfx before $ac_symxfrm here,
- # otherwise AC_SYS_SYMBOL_UNDERSCORE will always be false
- ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]$ac_symcode[ ][ ]*$ac_symprfx$ac_sympat$/$ac_symprfx$ac_symxfrm/p'"
+ ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($ac_symcode\)[ ][ ]*\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
# Check to see that the pipe works correctly.
ac_pipe_works=no
EOF
# Now generate the symbol file.
- sed 's/^.* \(.*\)$/extern char \1;/' < "$ac_nlist" >> conftest.c
+ eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
cat <<EOF >> conftest.c
#if defined (__STDC__) && __STDC__
changequote([,])dnl
{
EOF
- sed 's/^\(.*\) \(.*\)$/ {"\1", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
+ sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
cat <<\EOF >> conftest.c
{0, (lt_ptr_t) 0}
};
ac_nlist=conftest.nm
if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
# See whether the symbols have a leading underscore.
- if egrep '^_nm_test_func' "$ac_nlist" >/dev/null; then
+ if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
ac_cv_sys_symbol_underscore=yes
else
- if egrep '^nm_test_func ' "$ac_nlist" >/dev/null; then
+ if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
:
else
echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
AC_CHECK_LIB(m, cos)
])
+# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl convenience library, adds --enable-ltdl-convenience to
+# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
+# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
+# to be `${top_builddir}/libltdl'. Make sure you start DIR with
+# '${top_builddir}/' (note the single quotes!) if your package is not
+# flat, and, if you're not using automake, define top_builddir as
+# appropriate in the Makefiles.
+AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [
+ case "$enable_ltdl_convenience" in
+ no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+ "") enable_ltdl_convenience=yes
+ ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+ esac
+ LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
+])
+
+# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl installable library, and adds --enable-ltdl-install to
+# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
+# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
+# to be `${top_builddir}/libltdl'. Make sure you start DIR with
+# '${top_builddir}/' (note the single quotes!) if your package is not
+# flat, and, if you're not using automake, define top_builddir as
+# appropriate in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [
+ AC_CHECK_LIB(ltdl, main, LIBLTDL="-lltdl", [
+ case "$enable_ltdl_install" in
+ no) AC_MSG_WARN([libltdl not installed, but installation disabled]) ;;
+ "") enable_ltdl_install=yes
+ ac_configure_args="$ac_configure_args --enable-ltdl-install" ;;
+ esac
+ ])
+ if test x"$enable_ltdl_install" != x"no"; then
+ LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
+ fi
+])
+
dnl old names
AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
rm="rm -f"
ln_s="ln -s"
cp="cp -f"
+mkdir="mkdir"
# Global variables.
automake=
rm="echo $rm"
test -n "$ln_s" && ln_s="echo $ln_s"
cp="echo $cp"
+ mkdir="echo mkdir"
fi
;;
--ltdl)
ltdl=yes
- ltdl_tar=
;;
--ltdl-tar)
- ltdl=
ltdl_tar=yes
;;
exit 1
fi
files='config.guess config.sub ltconfig ltmain.sh'
-test "x$ltdl_tar" = xyes && files="$files libltdl.tar.gz"
auxdir=.
auxdirline=`egrep '^AC_CONFIG_AUX_DIR' configure.in 2>/dev/null`
fi
-# Change to the auxillary directory.
-if test "$auxdir" != .; then
- test -z "$automake" && echo "Putting files in AC_CONFIG_AUX_DIR, \`$auxdir'."
- cd $auxdir || exit 1
+if test "x$ltdl" = xyes; then
+ test -d libltdl || $mkdir libltdl
+ ltdlfiles=`cd $pkgdatadir && ls libltdl/*`
+else
+ ltdlfiles=
fi
-
-for file in $files; do
+for file in $ltdlfiles; do
if test -f "$file" && test -z "$force"; then
test -z "$automake" && echo "$progname: \`$file' exists: use \`--force' to overwrite" 1>&2
continue
fi
done
-if test "x$ltdl" = xyes; then
- if tar xzf $pkgdatadir/libltdl.tar.gz; then :
+if test "x$ltdl_tar" = x"yes"; then
+ if test "x$dry_run" = x"yes"; then
+ echo "(cd $pkgdatadir > /dev/null && tar -cf - libltdl | gzip --best) > libltdl.tar.gz"
+ elif test -f libltdl.tar.gz && test -z "$force"; then
+ test -z "$automake" && echo "$progname: \`libltdl.tar.gz' exists: use \`--force' to overwrite" 1>&2
else
- echo "$progname: cannot unpack libltdl.tar.gz" 1>&2
- status=1
+ (cd $pkgdatadir > /dev/null && tar -cf - libltdl | gzip --best) > libltdl.tar.gz
fi
fi
+# Change to the auxiliary directory.
+if test "$auxdir" != .; then
+ test -z "$automake" && echo "Putting files in AC_CONFIG_AUX_DIR, \`$auxdir'."
+ cd $auxdir || exit 1
+fi
+
+for file in $files; do
+ if test -f "$file" && test -z "$force"; then
+ test -z "$automake" && echo "$progname: \`$file' exists: use \`--force' to overwrite" 1>&2
+ continue
+ fi
+
+ $rm $file
+ if test -n "$ln_s" && $ln_s $pkgdatadir/$file $file; then :
+ elif $cp $pkgdatadir/$file $file; then :
+ else
+ echo "$progname: cannot copy \`$pkgdatadir/$file' to \`$file'" 1>&2
+ status=1
+ fi
+done
+
exit $status
# Local Variables:
enable_shared=yes
# All known linkers require a `.a' archive for static linking.
enable_static=yes
-enable_fast_install=no
+enable_fast_install=yes
enable_dlopen=unknown
-enable_dlopen_self=unknown
ltmain=
silent=
srcdir=
with_gcc=no
with_gnu_ld=no
need_locks=yes
+ac_ext=c
objext=o
libext=a
+cache_file=
old_AR="$AR"
old_CC="$CC"
--debug enable verbose shell tracing
--disable-shared do not build shared libraries
--disable-static do not build static libraries
- --enable-fast-install optimize for fast installation
+ --disable-fast-install do not optimize for fast installation
--enable-dlopen enable dlopen support
--enable-dlopen-self enable support for dlopening programs
--help display this help and exit
--with-gcc assume that the GNU C compiler will be used
--with-gnu-ld assume that the C compiler uses the GNU linker
--disable-lock disable file locking
+ --cache-file=FILE configure cache file
LTMAIN is the \`ltmain.sh' shell script fragment or \`ltmain.c' program
that provides basic libtool functionality.
--disable-static) enable_static=no ;;
- --enable-fast-install) enable_fast_install=yes ;;
+ --disable-fast-install) enable_fast_install=no ;;
--enable-dlopen) enable_dlopen=yes ;;
- --enable-dlopen-self) enable_dlopen_self=yes ;;
-
--quiet | --silent) silent=yes ;;
--srcdir) prev=srcdir ;;
--disable-lock) need_locks=no ;;
+ --cache-file=*) cache_file="$optarg" ;;
+
-*)
echo "$progname: unrecognized option \`$option'" 1>&2
echo "$help" 1>&2
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test -n "$cache_file" && test -r "$cache_file"; then
+ echo "loading cache $cache_file within ltconfig"
+ . $cache_file
+fi
+
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
- if test -f "${ac_dir}/${ac_prog}"; then
- LD="${ac_dir}/${ac_prog}"
+ if test -f "$ac_dir/$ac_prog"; then
+ LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some GNU ld's only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
# Transform the above into a raw symbol and a C symbol.
-symxfrm='\1 \1'
+symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
# Define system-specific variables.
case "$host_os" in
cygwin* | mingw*)
symcode='[ABCDGISTW]'
;;
+hpux*) # Its linker distinguishes data from code symbols
+ global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
+ ;;
irix*)
symcode='[BCDEGRST]'
;;
for ac_symprfx in "" "_"; do
# Write the raw and C identifiers.
- global_symbol_pipe="sed -n -e 's/^.*[ ]$symcode[ ][ ]*$ac_symprfx$sympat$/$symxfrm/p'"
+ global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$/$symxfrm/p'"
# Check to see that the pipe works correctly.
pipe_works=no
EOF
# Now generate the symbol file.
- sed 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> conftest.c
+ eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c'
cat <<EOF >> conftest.c
#if defined (__STDC__) && __STDC__
lt_preloaded_symbols[] =
{
EOF
- sed 's/^\(.*\) \(.*\)$/ {"\1", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c
+ sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c
cat <<\EOF >> conftest.c
{0, (lt_ptr_t) 0}
};
break
else
global_symbol_pipe=
+ global_symbol_to_cdecl=
fi
done
echo "$ac_t$pipe_works" 1>&6
deplibs_check_method='file_magic file format pei*-i386.*architecture: i386'
file_magic_cmd='objdump -f'
need_lib_prefix=no
- shlibpath_overrides_runpath=yes
# FIXME: first we should search . and the directory the executable is in
shlibpath_var=PATH
;;
# Report the final consequences.
echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
-# Check relinking.
-echo $ac_n "checking whether relinking is necessary... $ac_c" 1>&6
-must_relink=no
-if test "$hardcode_action" = relink || test "$shlibpath_overrides_runpath" != yes; then
- must_relink=yes
-fi
-echo "$ac_t$must_relink" 1>&6
-
echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
test "$can_build_shared" = "no" && enable_shared=no
echo "checking whether to build static libraries... $enable_static" 1>&6
+if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
echo $ac_n "checking for objdir... $ac_c" 1>&6
rm -f .libs 2>/dev/null
mkdir .libs 2>/dev/null
rmdir .libs 2>/dev/null
echo "$ac_t$objdir" 1>&6
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then
+ lt_cv_dlopen=no lt_cv_dlopen_libs=
+echo $ac_n "checking for dlopen""... $ac_c" 1>&6
+echo "$progname:@LINENO@: checking for dlopen" >&5
+if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line @LINENO@ "ltconfig"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char dlopen(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+dlopen();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo $progname:@LINENO@: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_dlopen=yes"
+else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_dlopen=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ lt_cv_dlopen="dlopen"
+else
+ echo "$ac_t""no" 1>&6
+echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
+echo "$progname:@LINENO@: checking for dlopen in -ldl" >&5
+ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-ldl $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line @LINENO@ "ltconfig"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen();
+
+int main() {
+dlopen()
+; return 0; }
+EOF
+if { (eval echo $progname:@LINENO@: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+ echo "$ac_t""no" 1>&6
+echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
+echo "$progname:@LINENO@: checking for dld_link in -ldld" >&5
+ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-ldld $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line @LINENO@ "ltconfig"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dld_link();
+
+int main() {
+dld_link()
+; return 0; }
+EOF
+if { (eval echo $progname:@LINENO@: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+else
+ echo "$ac_t""no" 1>&6
+echo $ac_n "checking for shl_load""... $ac_c" 1>&6
+echo "$progname:@LINENO@: checking for shl_load" >&5
+if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line @LINENO@ "ltconfig"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char shl_load(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+shl_load();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo $progname:@LINENO@: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_shl_load=yes"
+else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_shl_load=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ lt_cv_dlopen="shl_load"
+else
+ echo "$ac_t""no" 1>&6
+echo $ac_n "checking for LoadLibrary""... $ac_c" 1>&6
+echo "$progname:@LINENO@: checking for LoadLibrary" >&5
+if eval "test \"`echo '$''{'ac_cv_func_LoadLibrary'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line @LINENO@ "ltconfig"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char LoadLibrary(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char LoadLibrary();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_LoadLibrary) || defined (__stub___LoadLibrary)
+choke me
+#else
+LoadLibrary();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo $progname:@LINENO@: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_LoadLibrary=yes"
+else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_LoadLibrary=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'LoadLibrary`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ lt_cv_dlopen="LoadLibrary"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+fi
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ fi
+
+ case "$lt_cv_dlopen" in
+ dlopen)
+for ac_hdr in dlfcn.h; do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "$progname:@LINENO@: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line @LINENO@ "ltconfig"
+#include <$ac_hdr>
+int fnord = 0;
+EOF
+ac_try="$ac_compile conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo $progname:@LINENO@: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ if test "x$ac_cv_header_dlfcn_h" = xyes; then
+ CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+ fi
+ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
+echo "$progname:@LINENO@: checking whether a program can dlopen itself" >&5
+if test "${lt_cv_dlopen_self+set}" = set; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ lt_cv_dlopen_self=cross
+ else
+ cat > conftest.c <<EOF
+#line @LINENO@ "ltconfig"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LTDL_GLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LTDL_GLOBAL DL_GLOBAL
+# else
+# define LTDL_GLOBAL 0
+# endif
+#endif
+
+/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LTDL_LAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LTDL_LAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LTDL_LAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LTDL_LAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LTDL_LAZY_OR_NOW DL_NOW
+# else
+# define LTDL_LAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+fnord() { int i=42;}
+main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
+ if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
+ if(ptr1 || ptr2) exit(0); } exit(1); }
+
+EOF
+if { (eval echo $progname:@LINENO@: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+then
+ lt_cv_dlopen_self=yes
+else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ lt_cv_dlopen_self=no
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$lt_cv_dlopen_self" 1>&6
+
+ if test "$lt_cv_dlopen_self" = yes; then
+ LDFLAGS="$LDFLAGS $link_static_flag"
+ echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
+echo "$progname:@LINENO@: checking whether a statically linked program can dlopen itself" >&5
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ lt_cv_dlopen_self_static=cross
+ else
+ cat > conftest.c <<EOF
+#line @LINENO@ "ltconfig"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LTDL_GLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LTDL_GLOBAL DL_GLOBAL
+# else
+# define LTDL_GLOBAL 0
+# endif
+#endif
+
+/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LTDL_LAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LTDL_LAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LTDL_LAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LTDL_LAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LTDL_LAZY_OR_NOW DL_NOW
+# else
+# define LTDL_LAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+fnord() { int i=42;}
+main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
+ if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
+ if(ptr1 || ptr2) exit(0); } exit(1); }
+
+EOF
+if { (eval echo $progname:@LINENO@: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+then
+ lt_cv_dlopen_self_static=yes
+else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ lt_cv_dlopen_self_static=no
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
+fi
+ ;;
+ esac
+
+ case "$lt_cv_dlopen_self" in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case "$lt_cv_dlopen_self_static" in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+
# Copy echo and quote the copy, instead of the original, because it is
# used later.
ltecho="$echo"
old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \
- finish_cmds finish_eval global_symbol_pipe hardcode_libdir_flag_spec \
- hardcode_libdir_separator sys_lib_search_path_spec \
+ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
+ hardcode_libdir_flag_spec hardcode_libdir_separator \
+ sys_lib_search_path_spec \
compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
case "$var" in
# Whether dlopen of programs is supported.
dlopen_self=$enable_dlopen_self
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
# Compiler flag to prevent dynamic linking.
link_static_flag=$link_static_flag
# Take the output of nm and produce a listing of raw symbols and C names.
global_symbol_pipe=$global_symbol_pipe
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$global_symbol_to_cdecl
+
# This is the shared library runtime path variable.
runpath_var=$runpath_var
# the resulting binary.
hardcode_shlibpath_var=$hardcode_shlibpath_var
-# Whether we must relink.
-must_relink=$must_relink
-
# System search path for libraries.
sys_lib_search_path_spec=$sys_lib_search_path_spec
echo "FIXME: would compile $ltmain"
;;
esac
+
+test -n "$cache_file" || exit 0
+
+# AC_CACHE_SAVE
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
exit 0
# Local Variables:
modename="$modename: link"
relink=no
test "$mode" = "relink" && relink=yes
- link_command_save="$nonopt"
+ libtool_args="$nonopt"
C_compiler="$CC" # save it, to compile generated C sources
CC="$nonopt"
case "$host" in
;;
esac
compile_command="$CC"
+ finalize_command="$CC"
- shlibpath=
convenience=
old_convenience=
deplibs=
linkopts=
+ lib_search_path=`pwd`
avoid_version=no
dlfiles=
release=
rpath=
xrpath=
- perm_rpath=
- temp_rpath=
thread_safe=no
vinfo=
while test $# -gt 0; do
arg="$1"
shift
- link_command_save="$link_command_save $arg"
+ libtool_args="$libtool_args $arg"
# If the previous option needs an argument, assign it.
if test -n "$prev"; then
case "$prev" in
output)
compile_command="$compile_command @OUTPUT@"
+ finalize_command="$finalize_command @OUTPUT@"
;;
esac
-
+
case "$prev" in
dlfiles|dlprefiles)
if test "$preload" = no; then
# Add the symbol object into the linking commands.
compile_command="$compile_command @SYMFILE@"
+ finalize_command="$finalize_command @SYMFILE@"
preload=yes
fi
case "$arg" in
-all-static)
if test -n "$link_static_flag"; then
compile_command="$compile_command $link_static_flag"
+ finalize_command="$finalize_command $link_static_flag"
+ dlopen_self=$dlopen_self_static
fi
continue
;;
dir="$absdir"
;;
esac
- deplibs="$deplibs -L$dir"
+ case "$deplibs " in
+ *" -L$dir "*) ;;
+ *)
+ deplibs="$deplibs -L$dir"
+ lib_search_path="$lib_search_path $dir"
+ ;;
+ esac
continue
;;
# If we have no pic_flag, then this is the same as -all-static.
if test -z "$pic_flag" && test -n "$link_static_flag"; then
compile_command="$compile_command $link_static_flag"
+ finalize_command="$finalize_command $link_static_flag"
+ dlopen_self=$dlopen_self_static
fi
continue
;;
# Some other compiler flag.
-* | +*)
- # Unknown arguments in compile_command need
+ # Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later.
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
case "$arg" in
# Now actually substitute the argument into the commands.
if test -n "$arg"; then
compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
fi
done
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
libobjs_save="$libobjs"
- # Make sure deplibs and lib_search_path contain
- # only unique libraries and directories.
- lib_search_path=`pwd`
- newdeplibs=
- for deplib in $deplibs; do
- case "$newdeplibs " in
- *" $deplib "*) ;;
- *)
- newdeplibs="$newdeplibs $deplib"
- dir="`expr $deplib : '-L\(.*\)'`"
- # If this is a -L argument add it to lib_search_path
- test -n "$dir" && lib_search_path="$lib_search_path $dir"
- ;;
- esac
- done
- deplibs="$newdeplibs"
-
if test -n "$shlibpath_var"; then
# get the directories listed in $shlibpath_var
eval shlib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
lib_search_path="$lib_search_path $sys_lib_search_path $shlib_search_path"
- # Quote the link command for shipping.
- link_command_save=`$echo "X$link_command_save" | $Xsed -e "$sed_quote_subst"`
- link_dir_save=`pwd | sed -e $sed_quote_subst`
-
case "$output" in
"")
$echo "$modename: you must specify an output file" 1>&2
newdependency_libs= # all dependency libraries
uninst_path= # paths that contain uninstalled libtool libraries
rpath=
+ shlibpath=
new_lib_search_path=
for deplib in $deplibs; do
lib=
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
if test "$build_libtool_libs" = yes && test -n "$library_names"; then
- # Hardcode the library path.
- tmpdir="$libdir"
- test "$must_relink" = yes && test "$relink" = no && tmpdir="$absdir"
- # Make sure the rpath contains only unique directories.
- case "$rpath " in
- *" $tmpdir "*) ;;
- *) rpath="$rpath $tmpdir" ;;
- esac
+ if test "$hardcode_into_libs" = yes; then
+ # Hardcode the library path.
+ if test "$relink" = no && test "$absdir" != "$libdir"; then
+ case "$rpath " in
+ *" $absdir "*) ;;
+ *) rpath="$rpath $absdir" ;;
+ esac
+ fi
+ case "$rpath " in
+ *" $libdir "*) ;;
+ *) rpath="$rpath $libdir" ;;
+ esac
+ fi
if test "$relink" = no; then
lib_linked=yes
dependency_libs="$temp_xrpath $dependency_libs"
fi
- dep_rpath=
- hardcode_libdirs=
- if test -n "$rpath$xrpath" && test "$hardcode_into_libs" = yes && test -n "$hardcode_libdir_flag_spec"; then
- for dir in $rpath $xrpath; do
- libdir="$dir"
- if test -n "$hardcode_libdir_separator"; then
- if test -z "$hardcode_libdirs"; then
- # Put the magic libdir with the hardcode flag.
- hardcode_libdirs="$dir"
- libdir="@HARDCODE_LIBDIRS@"
- else
- # Just accumulate the unique libdirs.
- case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
- *"$hardcode_libdir_separator$dir$hardcode_libdir_separator"*)
- ;;
- *)
- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$dir"
- ;;
- esac
- libdir=
- fi
- fi
-
- if test -n "$libdir"; then
- eval flag=\"$hardcode_libdir_flag_spec\"
-
- dep_rpath="$dep_rpath $flag"
- fi
- done
- fi
-
- # Substitute the hardcoded libdirs into the dep_rpath.
- if test -n "$hardcode_libdir_separator"; then
- dep_rpath=`$echo "X$dep_rpath" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
- fi
- test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
-
# Restore the variables
versuffix=$versuffix_save
major=$major_save
droppeddeps=no
case "$deplibs_check_method" in
pass_all)
+ # Don't check for shared/static. Everything works.
+ # This might be a little naive. We might want to check
+ # whether the library exists or not. But this is on
+ # osf3 & osf4 and I'm not really sure... Just
+ # implementing what was already the behaviour.
newdeplibs=$deplibs
- ;; # Don't check for shared/static. Everything works.
- # This might be a little naive. We might want to check
- # whether the library exists or not. But this is on
- # osf3 & osf4 and I'm not really sure... Just
- # implementing what was already the behaviour.
+ ;;
test_compile)
# This code stresses the "libraries are programs" paradigm to its
# limits. Maybe even breaks it. We compile a program, linking it
esac
done
if eval $file_magic_cmd \"\$potlib\" \
- | sed '11,$d' \
+ | sed 10q \
| egrep "$file_magic_regex" > /dev/null; then
newdeplibs="$newdeplibs $a_deplib"
a_deplib=""
deplibs=$newdeplibs
# Done checking deplibs!
+ # Now hardcode the library paths
+ new_rpath=
+ perm_rpath=
+ if test "$hardcode_into_libs" = yes && test -n "$rpath$xrpath"; then
+ eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+ hardcode_libdirs=
+ for libdir in $rpath $xrpath; do
+ # Skip directories that are in the system search path
+ case " $sys_lib_search_path " in
+ *" $libdir "*) continue ;;
+ *) ;;
+ esac
+
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ new_rpath="$new_rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval new_rpath=\"$hardcode_libdir_flag_spec\"
+ fi
+ fi
+ test -n "$new_rpath" && deplibs="$dep_rpath $deplibs"
+
+ if test -n "$runpath_var" && test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+ fi
+ if test -n "$shlibpath"; then
+ eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+ fi
+
# Get the real and link names of the library.
eval library_names=\"$library_names_spec\"
set dummy $library_names
linkopts="$linkopts $flag"
fi
-
+
# Prepare the list of exported symbols
if test -z "$export_symbols"; then
if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
done
IFS="$save_ifs"
if test -n "$export_symbols_regex"; then
- $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"$export_symbols\"T"
- $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "$export_symbols"T'
- $show "$mv \"$export_symbols\"T \"$export_symbols\""
- $run eval '$mv "$export_symbols"T "$export_symbols"'
+ $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
+ $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ $show "$mv \"${export_symbols}T\" \"$export_symbols\""
+ $run eval '$mv "${export_symbols}T" "$export_symbols"'
fi
fi
fi
eval cmds=\"$archive_cmds\"
fi
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
- if test -n "$shlibpath"; then
- eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
- fi
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
fi
if test "$preload" = yes; then
- if test "$dlopen" = unknown || test "$dlopen_self" = unknown; then
+ if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
+ test "$dlopen_self_static" = unknown; then
$echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
fi
fi
new_lib_search_path="$new_lib_search_path `$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`"
newdeplibs="$newdeplibs $lib"
- newdependency_libs="$newdependency_libs $dependency_libs"
for deplib in $dependency_libs; do
case "$deplib" in
- -L*)
- new_lib_search_path="$new_lib_search_path `expr $deplib : '-L\(.*\)'`"
- ;;
+ -L*) new_lib_search_path="$new_lib_search_path `expr $deplib : '-L\(.*\)'`" ;;
*) ;;
esac
+ # Make sure dependency_libs contains only unique
+ # libraries and directories.
+ case "$newdependency_libs " in
+ *" $deplib "*) ;;
+ *) newdependency_libs="$newdependency_libs $deplib" ;;
+ esac
done
done
+ dependency_libs="$newdependency_libs"
# Make sure lib_search_path contains only unique directories.
lib_search_path=
done
lib_search_path="$lib_search_path $sys_lib_search_path"
- # Make sure deplibs contains only unique libraries and directories.
- deplibs=
- for deplib in $newdeplibs; do
- case "$deplibs " in
- *" $deplib "*) ;;
- *) deplibs="$deplibs $deplib" ;;
- esac
- done
-
- # Make sure dependency_libs contains only unique libraries and directories.
- dependency_libs=
- for deplib in $newdependency_libs; do
- case "$dependency_libs " in
- *" $deplib "*) ;;
- *) dependency_libs="$dependency_libs $deplib" ;;
- esac
- done
-
# Find libtool libraries and add their directories
- newdeplibs=
alldeplibs=no
linkalldeplibs=no
- if test "$build_libtool_libs" = no || test "$deplibs_check_method" = none; then
+ if test "$fast_install" = yes || test "$build_libtool_libs" = no || \
+ test "$deplibs_check_method" = none; then
linkalldeplibs=yes
fi
link_against_libtool_libs=
+ compile_rpath=
+ finalize_rpath=
+ compile_shlibpath=
+ finalize_shlibpath=
+ perm_rpath=
+ temp_rpath=
+
for deplib in $deplibs @DEPLIBS@ $dependency_libs; do
lib=
case "$deplib" in
-L*)
- newdeplibs="$newdeplibs $deplib"
+ compile_command="$compile_command $deplib"
+ case "$compile_command " in
+ *" $deplib "*) ;;
+ *) compile_command="$compile_command $deplib";;
+ esac
+ case "$finalize_command " in
+ *" $deplib "*) ;;
+ *) finalize_command="$finalize_command $deplib";;
+ esac
continue
;;
-R*)
fi
done
if test "$found" != yes; then
- newdeplibs="$newdeplibs $deplib"
+ compile_command="$compile_command $deplib"
+ finalize_command="$finalize_command $deplib"
continue
fi
;;
fi
# This is the magic to use -rpath.
- tmpdir="$libdir"
- test "$must_relink" = yes && test "$relink" = no && tmpdir="$absdir"
- # Make sure the xrpath contains only unique directories.
- case "$xrpath " in
- *" $tmpdir "*) ;;
- *) xrpath="$xrpath $tmpdir" ;;
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) compile_rpath="$compile_rpath $absdir" ;;
+ esac
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir" ;;
esac
fi
# It is a libtool convenience library, so add in its objects.
convenience="$convenience $dir/$old_library"
old_convenience="$old_convenience $dir/$old_library"
- newdeplibs="$newdeplibs $dir/$old_library"
+ compile_command="$compile_command $dir/$old_library"
+ finalize_command="$finalize_command $dir/$old_library"
continue
fi
- if test "$build_libtool_libs" = yes &&
- test -n "$library_names" &&
- test -n "$old_archive_from_expsyms_cmds"; then
-
- # figure out the soname
- set dummy $library_names
- realname="$2"
- shift; shift
- if test -n "$soname_spec"; then
- eval soname=\"$soname_spec\"
- else
- soname="$realname"
- fi
-
- # Make a new name for the extract_expsyms_cmds to use
- newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
-
- # If the library has no export list, then create one now
- if test -f "$objdir/$soname-def"; then :; else
- $show "extracting exported symbol list from \`$soname'"
- IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
- eval cmds=\"$extract_expsyms_cmds\"
- for cmd in $cmds; do
- IFS="$save_ifs"
- $show "$cmd"
- $run eval "$cmd" || exit $?
- done
- IFS="$save_ifs"
- fi
-
- # Create $newlib
- if test -f "$objdir/$newlib"; then :; else
- $show "generating import library for \`$soname'"
- IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
- eval cmds=\"$old_archive_from_expsyms_cmds\"
- for cmd in $cmds; do
- IFS="$save_ifs"
- $show "$cmd"
- $run eval "$cmd" || exit $?
- done
- IFS="$save_ifs"
- fi
- # make sure the library variables are pointing to the new library
- dir=$objdir
- linklib=$newlib
- fi
-
if test "$build_libtool_libs" = yes && test -n "$library_names"; then
link_against_libtool_libs="$link_against_libtool_libs $lib"
- if test $relink = no; then
- lib_linked=yes
- case "$hardcode_action" in
- immediate | unsupported)
- if test "$hardcode_direct" = no; then
- newdeplibs="$newdeplibs $dir/$linklib"
- elif test "$hardcode_minus_L" = no; then
- case "$host" in
- *-*-sunos*)
- shlibpath="$shlibpath$dir:"
- ;;
- esac
- newdeplibs="$newdeplibs -L$dir -l$name"
- elif test "$hardcode_shlibpath_var" = no; then
- shlibpath="$shlibpath$dir:"
- newdeplibs="$newdeplibs -l$name"
- else
- lib_linked=no
- fi
- ;;
- relink)
- if test "$hardcode_direct" = yes; then
- newdeplibs="$newdeplibs $dir/$linklib"
- elif test "$hardcode_minus_L" = yes; then
- newdeplibs="$newdeplibs -L$dir -l$name"
- elif test "$hardcode_shlibpath_var" = yes; then
- shlibpath="$shlibpath$dir:"
- newdeplibs="$newdeplibs -l$name"
- else
- lib_linked=no
- fi
- ;;
- *)
- lib_linked=no
- ;;
- esac
+ if test -n "$old_archive_from_expsyms_cmds"; then
+ # figure out the soname
+ set dummy $library_names
+ realname="$2"
+ shift; shift
+ if test -n "$soname_spec"; then
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
- if test "$lib_linked" != yes; then
- $echo "$modename: configuration error: unsupported hardcode properties"
- exit 1
+ # Make a new name for the extract_expsyms_cmds to use
+ newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
+
+ # If the library has no export list, then create one now
+ if test -f "$objdir/$soname-def"; then :
+ else
+ $show "extracting exported symbol list from \`$soname'"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+ eval cmds=\"$extract_expsyms_cmds\"
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ fi
+
+ # Create $newlib
+ if test -f "$objdir/$newlib"; then :; else
+ $show "generating import library for \`$soname'"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+ eval cmds=\"$old_archive_from_expsyms_cmds\"
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ fi
+ # make sure the library variables are pointing to the new library
+ dir=$objdir
+ linklib=$newlib
+ fi
+
+ lib_linked=yes
+ case "$hardcode_action" in
+ immediate | unsupported)
+ if test "$hardcode_direct" = no; then
+ compile_command="$compile_command $dir/$linklib"
+ elif test "$hardcode_minus_L" = no; then
+ case "$host" in
+ *-*-sunos*)
+ compile_shlibpath="$compile_shlibpath$dir:"
+ ;;
+ esac
+ case "$compile_command " in
+ *" -L$dir "*) ;;
+ *) compile_command="$compile_command -L$dir";;
+ esac
+ compile_command="$compile_command -l$name"
+ elif test "$hardcode_shlibpath_var" = no; then
+ case ":$compile_shlibpath:" in
+ *":$dir:"*) ;;
+ *) compile_shlibpath="$compile_shlibpath$dir:";;
+ esac
+ compile_command="$compile_command -l$name"
+ else
+ lib_linked=no
fi
- else
- # Install command for both is simple: just hardcode it.
+ ;;
+
+ relink)
if test "$hardcode_direct" = yes; then
- newdeplibs="$newdeplibs $libdir/$linklib"
+ compile_command="$compile_command $absdir/$linklib"
elif test "$hardcode_minus_L" = yes; then
- newdeplibs="$newdeplibs -L$libdir -l$name"
+ case "$compile_command " in
+ *" -L$absdir "*) ;;
+ *) compile_command="$compile_command -L$absdir";;
+ esac
+ compile_command="$compile_command -l$name"
elif test "$hardcode_shlibpath_var" = yes; then
- shlibpath="$shlibpath$libdir:"
- newdeplibs="$newdeplibs -l$name"
+ case ":$compile_shlibpath:" in
+ *":$absdir:"*) ;;
+ *) compile_shlibpath="$compile_shlibpath$absdir:";;
+ esac
+ compile_command="$compile_command -l$name"
else
- # We cannot seem to hardcode it, guess we'll fake it.
- newdeplibs="$newdeplibs -L$libdir -l$name"
+ lib_linked=no
fi
+ ;;
+
+ *)
+ lib_linked=no
+ ;;
+ esac
+
+ if test "$lib_linked" != yes; then
+ $echo "$modename: configuration error: unsupported hardcode properties"
+ exit 1
+ fi
+
+ # Finalize command for both is simple: just hardcode it.
+ if test "$hardcode_direct" = yes; then
+ finalize_command="$finalize_command $libdir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ case "$finalize_command " in
+ *" -L$libdir "*) ;;
+ *) finalize_command="$finalize_command -L$libdir";;
+ esac
+ finalize_command="$finalize_command -l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ case ":$finalize_shlibpath:" in
+ *":$libdir:"*) ;;
+ *) finalize_shlibpath="$finalize_shlibpath$libdir:";;
+ esac
+ finalize_command="$finalize_command -l$name"
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
+ case "$finalize_command " in
+ *" -L$dir "*) ;;
+ *) finalize_command="$finalize_command -L$libdir";;
+ esac
+ finalize_command="$finalize_command -l$name"
fi
else
# Transform directly to old archives if we don't build new libraries.
# shared platforms.
if test "$hardcode_direct" != unsupported; then
test -n "$old_library" && linklib="$old_library"
- newdeplibs="$newdeplibs $dir/$linklib"
+ compile_command="$compile_command $dir/$linklib"
+ finalize_command="$finalize_command $dir/$linklib"
else
- newdeplibs="$newdeplibs -L$dir -l$name"
+ case "$compile_command " in
+ *" -L$dir "*) ;;
+ *) compile_command="$compile_command -L$dir";;
+ esac
+ compile_command="$compile_command -l$name"
+ case "$finalize_command " in
+ *" -L$dir "*) ;;
+ *) finalize_command="$finalize_command -L$dir";;
+ esac
+ finalize_command="$finalize_command -l$name"
fi
fi
done
- deplibs="$newdeplibs"
-
- # Now hardcode the library paths
- dep_rpath=
- hardcode_libdirs=
if test -n "$rpath$xrpath"; then
# If the user specified any rpath flags, then add them.
for libdir in $rpath $xrpath; do
- if test -n "$hardcode_libdir_flag_spec"; then
- if test -n "$hardcode_libdir_separator"; then
- if test -z "$hardcode_libdirs"; then
- # Put the magic libdir with the hardcode flag.
- hardcode_libdirs="$libdir"
- libdir="@HARDCODE_LIBDIRS@"
- else
- # Just accumulate the unique libdirs.
- case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
- *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- ;;
- *)
- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
- ;;
- esac
- libdir=
- fi
- fi
-
- if test -n "$libdir"; then
- eval flag=\"$hardcode_libdir_flag_spec\"
+ # This is the magic to use -rpath.
+ case "$compile_rpath " in
+ *" $libdir "*) ;;
+ *) compile_rpath="$compile_rpath $libdir" ;;
+ esac
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir" ;;
+ esac
+ done
+ fi
- dep_rpath="$dep_rpath $flag"
+ # Now hardcode the library paths
+ eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+ rpath=
+ hardcode_libdirs=
+ for libdir in $compile_rpath $finalize_rpath; do
+ # Skip directories that are in the system search path
+ case " $sys_lib_search_path " in
+ *" $libdir "*) continue ;;
+ *) ;;
+ esac
+
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
fi
- elif test -n "$runpath_var"; then
- case "$perm_rpath " in
- *" $libdir "*) ;;
- *) perm_rpath="$perm_rpath $libdir" ;;
- esac
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ rpath="$rpath $flag"
fi
- done
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
fi
+ compile_rpath="$rpath"
- # Substitute the hardcoded libdirs into the dep_rpath.
- if test -n "$hardcode_libdir_separator"; then
- dep_rpath=`$echo "X$dep_rpath" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
+ rpath=
+ hardcode_libdirs=
+ for libdir in $finalize_rpath; do
+ # Skip directories that are in the system search path
+ case " $sys_lib_search_path " in
+ *" $libdir "*) continue ;;
+ *) ;;
+ esac
+
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ rpath="$rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$finalize_perm_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
fi
- test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+ finalize_rpath="$rpath"
- # Add in the deplibs.
- test -n "$deplibs" && compile_command="$compile_command $deplibs"
-
output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
if test "X$output_objdir" = "X$output"; then
output_objdir="$objdir"
if test -n "$libobjs" && test "$build_old_libs" = yes; then
# Transform all the library objects into standard objects.
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
fi
dlsyms=
if test -n "$dlfiles$dlprefiles" || test "$dlself" = yes; then
- if test -n "$NM" && test -n "$global_symbol_pipe"; then
+ if test -n "$NM" && test -n "$global_symbol_pipe"; then
dlsyms="${outputname}S.c"
else
$echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
nlist="$objdir/${output}.nm"
if test -d $objdir; then
- $show "$rm $nlist ${nlist}T"
- $run $rm "$nlist" "${nlist}T"
+ $show "$rm $nlist ${nlist}S ${nlist}T"
+ $run $rm "$nlist" "${nlist}S" "${nlist}T"
else
$show "$mkdir $objdir"
$run $mkdir $objdir
"
if test "$dlself" = yes; then
- if test -n "$export_symbols"; then
- $run eval 'sed -e "s/^\(.*\)/\1 \1/" < "$export_symbols" > "$nlist"'
+ $show "generating symbol list for \`$output'"
+
+ echo ': @PROGRAM@ ' > "$nlist"
+
+ # Add our own program objects to the symbol list.
+ progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ for arg in $progfiles; do
+ $show "extracting global C symbols from \`$arg'"
+ $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -n "$exclude_expsyms"; then
+ $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+ $run eval '$mv "$nlist"T "$nlist"'
+ fi
+
+ if test -n "$export_symbols_regex"; then
+ $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+ $run eval '$mv "$nlist"T "$nlist"'
+ fi
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ export_symbols="$objdir/$output.exp"
+ $run $rm $export_symbols
+ $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
else
- # Add our own program objects to the preloaded list.
- progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
- for arg in $progfiles; do
- $show "extracting global C symbols from \`$arg'"
- $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
- done
+ $run $rm $export_symbols
+ $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$objdir/$output.exp"'
+ $run eval 'grep -f "$objdir/$output.exp" < "$nlist" > "$nlist"T'
+ $run eval 'mv "$nlist"T "$nlist"'
fi
fi
for arg in $dlprefiles; do
$show "extracting global C symbols from \`$arg'"
+ name=`echo "$arg" | sed -e 's%^.*/%%'`
+ $run eval 'echo ": $name " >> "$nlist"'
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
done
test -f "$nlist" || : > "$nlist"
# Try sorting and uniquifying the output.
- if sort "$nlist" | uniq > "$nlist"T; then
- $mv "$nlist"T "$nlist"
+ if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
+ :
else
- $rm "$nlist"T
+ grep -v "^: " < "$nlist" > "$nlist"S
fi
if test -n "$exclude_expsyms"; then
- egrep -v "^($exclude_expsyms) " "$nlist" > "$nlist"T
- $mv "$nlist"T "$nlist"
+ egrep -v " ($exclude_expsyms)$" "$nlist"S > "$nlist"T
+ $mv "$nlist"T "$nlist"S
fi
- if test -f "$nlist"; then
- sed -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$output_objdir/$dlsyms"
+ if test -f "$nlist"S; then
+ eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
else
echo '/* NONE */' >> "$output_objdir/$dlsyms"
fi
{\
"
- if test "$dlself" = yes; then
- # First entry is the program itself
- echo >> "$output_objdir/$dlsyms" "\
- {\"@PROGRAM@\", (lt_ptr_t) 0},"
- if test -n "$export_symbols"; then
- sed 's/^\(.*\)/ {"\1", (lt_ptr_t) \&\1},/' < "$export_symbols" >> "$output_objdir/$dlsyms"
- else
- $rm "$nlist"
- for arg in $progfiles; do
- eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
- done
-
- if test -f "$nlist"; then
- if test -n "$exclude_expsyms"; then
- egrep -v "^($exclude_expsyms) " "$nlist" > "$nlist"T
- $mv "$nlist"T "$nlist"
- fi
-
- sed 's/^\(.*\) \(.*\)$/ {"\1", (lt_ptr_t) \&\2},/' < "$nlist" >> "$output_objdir/$dlsyms"
- else
- echo '/* NONE */' >> "$output_objdir/$dlsyms"
- fi
- fi
- fi
-
- for arg in $dlprefiles; do
- name=`echo "$arg" | sed -e 's%^.*/%%'`
- echo >> "$output_objdir/$dlsyms" "\
- {\"$name\", (lt_ptr_t) 0},"
- eval "$NM $arg | $global_symbol_pipe > '$nlist'"
-
- if test -f "$nlist"; then
- if test -n "$exclude_expsyms"; then
- egrep -v "^($exclude_expsyms) " "$nlist" > "$nlist"T
- $mv "$nlist"T "$nlist"
- fi
-
- sed 's/^\(.*\) \(.*\)$/ {"\1", (lt_ptr_t) \&\2},/' < "$nlist" >> "$output_objdir/$dlsyms"
- else
- echo '/* NONE */' >> "$output_objdir/$dlsyms"
- fi
- done
+ sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
+ -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
+ < "$nlist" >> "$output_objdir/$dlsyms"
$echo >> "$output_objdir/$dlsyms" "\
{0, (lt_ptr_t) 0}
pic_flag_for_symtable=
case "$host" in
- # compiling the symbol table file with pic_flag works around a
- # FreeBSD bug that causes programs to crash when -lm is linked
- # before any other PIC object. But we must not use pic_flag
- # when linking with -static.
- *-*-freebsd*)
+ # compiling the symbol table file with pic_flag works around
+ # a FreeBSD bug that causes programs to crash when -lm is
+ # linked before any other PIC object. But we must not use
+ # pic_flag when linking with -static. The problem exists in
+ # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+ *-*-freebsd2*|*-*-freebsd3.0*)
case "$compile_command " in
*" -static "*) ;;
*) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
# Transform the symbol file into the correct name.
compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.${objext}%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.${objext}%"`
;;
*)
$echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
# We keep going just in case the user didn't refer to
# lt_preloaded_symbols. The linker will fail if global_symbol_pipe
# really was required.
-
+
# Nullify the symbol file.
compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
fi
if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
# Replace the output file specification.
compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ link_command="$compile_command$compile_rpath"
# We have no uninstalled library dependencies, so finalize right now.
- $show "$compile_command"
- $run eval "$compile_command"
+ $show "$link_command"
+ $run eval "$link_command"
exit $?
fi
- # Replace the output file specification.
- if test $relink = no; then
- compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
- else
- compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'T%g'`
- fi
-
- # Create the binary in the object directory, then wrap it.
- if test ! -d $output_objdir; then
- $show "$mkdir $output_objdir"
- $run $mkdir $output_objdir
- status=$?
- if test $status -ne 0 && test ! -d $objdir; then
- exit $status
- fi
- fi
-
if test -n "$shlibpath_var"; then
# We should set the shlibpath_var
rpath=
temp_rpath="$rpath"
fi
- if test -n "$shlibpath"; then
- eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+ if test -n "$compile_shlibpath$finalize_shlibpath"; then
+ compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+ fi
+ if test -n "$finalize_shlibpath"; then
+ finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
fi
+ compile_var=
+ finalize_var=
if test -n "$runpath_var"; then
if test -n "$perm_rpath"; then
# We should set the runpath_var.
for dir in $perm_rpath; do
rpath="$rpath$dir:"
done
- eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+ compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ if test -n "$finalize_perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $finalize_perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
fi
fi
- if test "$must_relink" = yes && test "$relink" = no; then
+ if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+
# AGH! Flame the AIX and HP-UX people for me, will ya?
$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
$echo "$modename: \`$output' will be relinked during installation" 1>&2
+ else
+ if test "$fast_install" != no; then
+ link_command="$finalize_var$compile_command$finalize_rpath"
+ if test "$fast_install" = yes; then
+ relink_command=`echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
+ else
+ # fast_install is set to needless
+ relink_command=
+ fi
+ else
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+ fi
fi
- $show "$compile_command"
- $run eval "$compile_command" || exit $?
-
- # Exit if relinking succeeded
- test "$relink" = yes && exit 0
+ # Replace the output file specification.
+ link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+ # Create the binary in the object directory, then wrap it.
+ if test ! -d $output_objdir; then
+ $show "$mkdir $output_objdir"
+ $run $mkdir $output_objdir
+ status=$?
+ if test $status -ne 0 && test ! -d $objdir; then
+ exit $status
+ fi
+ fi
# Delete the old output file.
- $run $rm $output
+ $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+ $show "$link_command"
+ $run eval "$link_command" || exit $?
# Now create the wrapper script.
$show "creating $output"
+ # Quote the relink command for shipping.
+ if test -n "$relink_command"; then
+ relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ fi
+
# Quote $echo for shipping.
if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
case "$0" in
# if CDPATH is set.
if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
+relink_command=\"$relink_command\"
+
# This environment variable determines our operation mode.
if test \"\$libtool_install_magic\" = \"$magic\"; then
- # install mode needs the following variables:
+ # install mode needs the following variable:
link_against_libtool_libs='$link_against_libtool_libs'
- link_command=\"$link_command_save\"
- link_dir=\"$link_dir_save\"
else
# When we are sourced in execute mode, \$file and \$echo are already set.
if test \"\$libtool_execute_magic\" != \"$magic\"; then
# Try to get the absolute directory name.
absdir=\`cd \"\$thisdir\" && pwd\`
test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+ if test "$fast_install" = yes; then
+ echo >> $output "\
+ program=lt-'$outputname'
progdir=\"\$thisdir/$objdir\"
+
+ if test ! -f \"\$progdir/\$program\" || \\
+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+ file=\"\$\$-\$program\"
+
+ if test ! -d \"\$progdir\"; then
+ $mkdir \"\$progdir\"
+ else
+ $rm \"\$progdir/\$file\"
+ fi"
+
+ echo >> $output "\
+
+ # relink executable if necessary
+ if test -n \"\$relink_command\"; then
+ if (cd \"\$thisdir\" && eval \$relink_command); then :
+ else
+ $rm \"\$progdir/\$file\"
+ exit 1
+ fi
+ fi
+
+ $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+ { $rm \"\$progdir/\$program\";
+ $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+ $rm \"\$progdir/\$file\"
+ fi"
+ else
+ echo >> $output "\
program='$outputname'
+ progdir=\"\$thisdir/$objdir\"
+"
+ fi
+
+ echo >> $output "\
if test -f \"\$progdir/\$program\"; then"
# Export our shlibpath_var if we have one.
- if test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
$echo >> $output "\
# Add our own library path to $shlibpath_var
$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
test "$build_old_libs" = yes && old_library="$libname.$libext"
$show "creating $output"
+ # Quote the link command for shipping.
+ relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args"
+ relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+
# Only create the output if not a dry run.
if test -z "$run"; then
$echo > $output "\
# Directory that this library needs to be installed in:
libdir='$install_libdir'
-
-link_command=\"$link_command_save\"
-link_dir=\"$link_dir_save\"\
-"
+relink_command=\"$relink_command\""
# Replace all uninstalled libtool libraries with the installed ones
newdependency_libs=
$rm "$output_objdir/$outputname"i
sed -e 's/^installed=no$/installed=yes/' \
-e "s%^dependency_libs=\(.*\)%dependency_libs='$newdependency_libs'%" \
- -e 's/^link_\(.*\)//' \
+ -e 's/^relink_command=\(.*\)//' \
< "$output" > "$output_objdir/$outputname"i || exit 1
fi
exit 1
fi
- link_command=
- link_dir=
+ relink_command=
dependency_libs=
# If there is no directory component, then add one.
case "$file" in
esac
# Check the variables that should have been set.
- if test -z "$dependency_libs" || test -z "$link_command" || test -z "$link_dir"; then
+ if test -z "$dependency_libs" || test -z "$relink_command"; then
$echo "$modename: invalid libtool pseudo library \`$file'" 1>&2
exit 1
fi
finalize=yes
- for lib in $dependency_libs; do
+ deplibs=$dependency_libs
+ for lib in $deplibs; do
case "$lib" in
*.la)
# Check to see that each library is installed.
esac
done
- link_command=
- link_dir=
+ relink_command=
library_names=
old_library=
dependency_libs=
test "X$dir" = "X$file/" && dir=
dir="$dir$objdir"
- if test "$must_relink" = yes && test "$hardcode_into_libs" = yes; then
+ if test "$hardcode_into_libs" = yes; then
if test "$finalize" = yes; then
$echo "$modename: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2
- finalize_command="cd $link_dir; $SHELL $0 --mode=relink $link_command"
- $show "$finalize_command"
- if $run eval "$finalize_command"; then :
+ $show "$relink_command"
+ if $run eval "$relink_command"; then :
else
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
continue
shift
srcname="$realname"
- test "$must_relink" = yes && test "$hardcode_into_libs" = yes && srcname="$realname"T
+ test "$hardcode_into_libs" = yes && srcname="$realname"T
# Install the shared library and build the symlinks.
$show "$install_prog $dir/$srcname $destdir/$realname"
# Do a test to see if this is really a libtool program.
if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
- link_command=
- link_dir=
link_against_libtool_libs=
+ relink_command=
# If there is no directory component, then add one.
case "$file" in
esac
# Check the variables that should have been set.
- if test -z "$link_against_libtool_libs" || test -z "$link_command" || test -z "$link_dir"; then
+ if test -z "$link_against_libtool_libs"; then
$echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
exit 1
fi
fi
done
- link_command=
- link_dir=
- link_against_libtool_libs=
-
+ relink_command=
# If there is no directory component, then add one.
case "$file" in
*/* | *\\*) . $file ;;
*) . ./$file ;;
esac
- if test "$must_relink" = yes; then
+ outputname=
+ if test "$fast_install" = no && test -n "$relink_command"; then
if test "$finalize" = yes; then
+ outputname="/tmp/$$-$file"
+ # Replace the output file specification.
+ relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+
$echo "$modename: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2
- finalize_command="cd $link_dir; $SHELL $0 --mode=relink $link_command"
- $show "$finalize_command"
- if $run eval "$finalize_command"; then :
+ $show "$relink_command"
+ if $run eval "$relink_command"; then :
else
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
continue
fi
- file="$objdir/$file"T
+ file="$outputname"
else
- $echo "$modename: error: cannot relink \`$file' on behalf of your buggy system linker" 1>&2
- continue
+ $echo "$modename: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2
fi
else
# Install the binary that we compiled earlier.
$show "$install_prog$stripme $file $destfile"
$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
+ test -n "$outputname" && $rm $outputname
;;
esac
done
bin_PROGRAMS = mdemo mdemo.static
-../libltdl/libltdl.la: ../libtool ../libltdl/libtool \
+## use @LIBLTDL@ because some broken makes do not accept macros in targets
+## we can only do this because our LIBLTDL does not contain ${top_builddir}
+@LIBLTDL@: ../libtool ../libltdl/libtool ../libltdl/config.h \
$(srcdir)/../libltdl/ltdl.c $(srcdir)/../libltdl/ltdl.h
- (cd ../libltdl; $(MAKE) libltdl.la)
+ (cd ../libltdl; $(MAKE) `echo $(LIBLTDL) | sed 's,.*\.\./libltdl/,,g'`)
# Without the following line, the check may fail if libltdl/libtool is
# removed after libltdl is configured
-../libltdl/libtool:
+../libltdl/libtool ../libltdl/config.h:
# Create a version of mdemo that does dlopen.
mdemo_SOURCES = main.c
-mdemo_LDFLAGS = -export-dynamic ## FIXME: remove this when libtool and libltdl
-## handle dependencies of modules
+mdemo_LDFLAGS = -export-dynamic
## The quotes around -dlopen below fool automake into accepting it
-mdemo_LDADD = ../libltdl/libltdl.la "-dlopen" self \
+mdemo_LDADD = @LIBLTDL@ "-dlopen" self \
"-dlopen" foo1.la "-dlopen" libfoo2.la
-mdemo_DEPENDENCIES = ../libltdl/libltdl.la foo1.la libfoo2.la
+mdemo_DEPENDENCIES = @LIBLTDL@ foo1.la libfoo2.la
# Create a statically linked version of mdemo.
mdemo_static_SOURCES = $(mdemo_SOURCES)
mdemo_static_LDFLAGS = $(STATIC) $(mdemo_LDFLAGS)
mdemo_static_LDADD = $(mdemo_LDADD)
mdemo_static_DEPENDENCIES = $(mdemo_DEPENDENCIES)
+
+$(OBJECTS): libtool
+libtool: $(LIBTOOL_DEPS)
+ $(SHELL) ./config.status --recheck
AC_EXEEXT
AC_LIBTOOL_DLOPEN
AM_PROG_LIBTOOL
+AC_SUBST(LIBTOOL_DEPS)
+
+dnl AC_LIBLTDL_CONVENIENCE(['${top_builddir}/../libltdl'])
+dnl Since the package is flat, we need not use the line above,
+dnl and not having macros in LIBLTDL allows us to build LIBLTDL
+dnl on demand even with broken makes
+AC_LIBLTDL_CONVENIENCE(../libltdl)
+AC_SUBST(LIBLTDL)
if ${CONFIG_SHELL} ./libtool --features | grep "enable static" >/dev/null; then
STATIC=-static
int (*pfoo2)() = 0;
int (*phello)() = 0;
int *pnothing = 0;
+ int ret = 0;
handle = lt_dlopen(filename);
if (!handle) {
printf("hello is ok!\n");
}
else
- fprintf (stderr, "did not find the `hello' function\n");
+ {
+ fprintf (stderr, "did not find the `hello' function\n");
+ ret = 1;
+ }
/* Try assigning to the nothing variable. */
if (pnothing)
*pnothing = 1;
else
- fprintf (stderr, "did not find the `nothing' variable\n");
+ {
+ fprintf (stderr, "did not find the `nothing' variable\n");
+ ret = 1;
+ }
/* Just call the functions and check return values. */
if (pfoo1)
{
if ((*pfoo1) () == FOO_RET)
printf("foo1 is ok!\n");
+ else
+ ret = 1;
}
else if (pfoo2)
{
if ((*pfoo2) () == FOO_RET)
printf("foo2 is ok!\n");
+ else ret = 1;
}
else
- fprintf (stderr, "did not find the `foo' function\n");
+ {
+ fprintf (stderr, "did not find the `foo' function\n");
+ ret = 1;
+ }
lt_dlclose(handle);
- return 0;
+ return ret;
}
int
lt_dlhandle handle;
int (*pmyfunc)() = 0;
int *pmyvar = 0;
+ int ret = 0;
handle = lt_dlopen(0);
if (!handle) {
printf("myfunc is ok!\n");
}
else
- fprintf (stderr, "did not find the `myfunc' function\n");
+ {
+ fprintf (stderr, "did not find the `myfunc' function\n");
+ ret = 1;
+ }
/* Try assigning to the variable. */
if (pmyvar)
*pmyvar = 1;
else
- fprintf (stderr, "did not find the `myvar' variable\n");
+ {
+ fprintf (stderr, "did not find the `myvar' variable\n");
+ ret = 1;
+ }
lt_dlclose(handle);
- return 0;
+ return ret;
}
int
char **argv;
{
int i;
+ int ret = 0;
printf ("Welcome GNU libtool mdemo!\n");
for (i = 1; i < argc; i++)
if (test_dl(argv[i]))
- return 1;
+ ret = 1;
if (test_dlself())
- return 1;
+ ret = 1;
lt_dlexit();
- return 0;
+ return ret;
}
AUTOMAKE_OPTIONS = gnits
-TESTS = demo-static.test demo-make.test demo-exec.test \
- demo-inst.test demo-unst.test hardcode.test \
- mdemo-static.test mdemo-make.test mdemo-exec.test \
- mdemo-inst.test mdemo-unst.test \
- cdemo-static.test cdemo-make.test cdemo-exec.test \
+TESTS = cdemo-static.test cdemo-make.test cdemo-exec.test \
+ demo-static.test demo-make.test demo-exec.test \
+ demo-inst.test demo-unst.test \
depdemo-static.test depdemo-make.test depdemo-exec.test \
depdemo-inst.test depdemo-unst.test \
- demo-conf.test demo-make.test demo-exec.test \
- demo-inst.test demo-unst.test hardcode.test \
- mdemo-conf.test mdemo-make.test mdemo-exec.test \
+ mdemo-static.test mdemo-make.test mdemo-exec.test \
mdemo-inst.test mdemo-unst.test \
cdemo-conf.test cdemo-make.test cdemo-exec.test \
+ demo-conf.test demo-make.test demo-exec.test \
+ demo-inst.test demo-unst.test \
depdemo-conf.test depdemo-make.test depdemo-exec.test \
depdemo-inst.test depdemo-unst.test \
- demo-shared.test demo-make.test demo-exec.test \
- demo-inst.test demo-unst.test hardcode.test \
- mdemo-shared.test mdemo-make.test mdemo-exec.test \
+ mdemo-conf.test mdemo-make.test mdemo-exec.test \
mdemo-inst.test mdemo-unst.test \
+ demo-nofast.test demo-make.test demo-exec.test \
+ demo-inst.test demo-unst.test \
cdemo-shared.test cdemo-make.test cdemo-exec.test \
+ demo-shared.test demo-make.test demo-exec.test demo-inst.test \
+ hardcode.test build-relink.test demo-unst.test \
depdemo-shared.test depdemo-make.test depdemo-exec.test \
depdemo-inst.test depdemo-unst.test \
+ mdemo-shared.test mdemo-make.test mdemo-exec.test \
+ mdemo-inst.test mdemo-unst.test \
link.test link-2.test nomode.test \
quote.test sh.test suffix.test
# We need to remove any files that the above tests created.
clean-local:
- -test -f ../demo/Makefile && cd ../demo && $(MAKE) distclean
-test -f ../cdemo/Makefile && cd ../cdemo && $(MAKE) distclean
+ -test -f ../demo/Makefile && cd ../demo && $(MAKE) distclean
+ -test -f ../depdemo/Makefile && cd ../depdemo && $(MAKE) distclean
-test -f ../mdemo/Makefile && cd ../mdemo && $(MAKE) distclean
rm -rf _inst
# hardcode.test - check to see what the system linker hardcodes
# Test script header.
-need_prefix=no
+need_prefix=yes # otherwise it will be removed, and build-relink fails
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
test "$srcdir" = "$0" && srcdir=.