+1999-02-13 Thomas Tanner <tanner@gmx.de>
+
+ * syncronized with HEAD
+ * depdemo/Makefile.am: merged rest of my ILD patch
+ * ltmain.in: export shlibpath before linking libraries,
+ create the .lai file in link mode
+
1999-02-12 Gary V. Vaughan <gvaughan@oranda.demon.co.uk>
* ltmain.in (deplib): The cygwin environment doesn't actually have
# Do line number substitution, as well as PACKAGE, VERSION and TIMESTAMP.
# Line numbering transliterated from a section in autoconf (Autoconf 2.12).
-$(srcdir)/ltconfig: $(srcdir)/ltconfig.in $(top_srcdir)/configure.in $(TSDEPS)
+@srcdir@/ltconfig: $(srcdir)/ltconfig.in $(top_srcdir)/configure.in $(TSDEPS)
rm -f ltconfig.T
date=`$(SHELL) $(srcdir)/mkstamp < $(srcdir)/ChangeLog` && \
$(AWK) '/@LINENO@/ { printf "%d:", NR } { print }' $(srcdir)/ltconfig.in | \
mv -f ltconfig.T $@ || \
(rm -f $@ && cp ltconfig.T $@ && rm -f ltconfig.T)
-$(srcdir)/ltmain.sh: $(srcdir)/ltmain.in $(top_srcdir)/configure.in $(TSDEPS)
+@srcdir@/ltmain.sh: $(srcdir)/ltmain.in $(top_srcdir)/configure.in $(TSDEPS)
rm -f ltmain.shT
date=`$(SHELL) $(srcdir)/mkstamp < $(srcdir)/ChangeLog` && \
sed -e 's/@''PACKAGE@/@PACKAGE@/' -e 's/@''VERSION@/@VERSION@/' \
# Create and install libltdl.tar.gz
install-data-hook: libltdl/Makefile
- if (cd libltdl && $(MAKE) distdir distdir=libltdl && \
+ @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; \
+ echo "Warning: without gzip, libtool cannot install libltdl.tar.gz"; \
fi; \
rm -rf libltdl/libltdl libltdl/libltdl.tar libltdl/libltdl.tar.gz
New in 1.2e: CVS version:
* Support -R for specifying run-time path of programs and library dependencies
* Support for BeOS
-* Improved support for Win32, aix3, aix4, SysV 4.3, BSD/OS 4.x and NetBSD
+* Improved support for aix3, aix4, SysV 4.3, BSD/OS 4.x and NetBSD
* New -avoid-version option to avoid versioning for libraries
* Various bugfixes
these people:
Everybody who was kind enough to spend time testing libtool, use it in
-their packages and report bugs.
+their packages and report bugs, who are too numerous to mention here.
+Many people who have kindly submitted bug reports and small patches
+are credited for their contributions in the ChangeLogs.
The following people made especially gracious contributions of their
time and energy in helping to track down bugs, port to new systems,
Akim Demaille <demaille@inf.enst.fr>
Andrey Slepuhin <pooh@msu.ru>
-Axel Thimm <Axel.Thimm@physik.fu-berlin.de>
Bruno Haible <haible@ilog.fr>
Carl D. Roth <roth@cse.ucsc.edu>
-Charles S. Kerr <cskerr@delenn.jccbi.gov>
-Chris Laas <golem@MIT.EDU>
Chris P. Ross <cross@eng.us.uu.net>
Edouard G. Parmelan <Edouard.Parmelan@France.NCR.COM>
Eric Estievenart <eric@via.ecp.fr>
Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
H.J. Lu <hjl@gnu.org>
Ian Lance Taylor <ian@cygnus.com>
-Joel Cannon <cannon@alpha.centenary.edu>
-Joel Klecker <espy@debian.org>
Joel N. Weber II <devnull@gnu.org>
Joseph Beckenbach III <jrb3@best.com>
-Karl Berry <kb@cs.umb.edu>
Kenneth Albanowski <kjahds@kjahds.com>
Kurt D. Zeilenga <Kurt@OpenLDAP.Org>
Manfred Weichel <Manfred.Weichel@pdb.siemens.de>
Marc J. Fraioli <fraioli@dg-rtp.dg.com>
-Mark Elbrecht <snowball3@usa.net>
Mark Kettenis <kettenis@phys.uva.nl>
-Mimi Burbank <mimi@scri.fsu.edu>
-Oliver Guntermann <og@informatik.uni-hannover.de>
-Raffaele Sena <raff@aromatic.com>
-Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-Ron O'Hara <rono@sentuny.com.au>
Sebastian Wilhelmi <wilhelmi@ira.uka.de>
Stephan Kulow <coolo@kde.org>
Steven M. Schultz <sms@wlv.iipo.gtegsc.com>
-Thomas Esser <te@informatik.uni-hannover.de>
Todd Vierling <tv@pobox.com>
Tom Tromey <tromey@cygnus.com>
Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
-Vladimir Kushnir <kushn@mail.kar.net>
-Volker Kuhlmann <kuhlmav@elec.canterbury.ac.nz>
rm -f acinclude.m4
cp ../libtool.m4 acinclude.m4
aclocal
+ autoheader
automake --gnits --add-missing
autoconf
cd ..
#! /bin/sh
-# commit version 0.9.1
+# commit version 0.9.2
# Copyright (C) 1999, Free Software Foundation
$update && \
if echo "$name: checking for conflicts..." >&2
- (cvs $cvsopt -n update $updateopt ${1+"$@"} 2>/dev/null\
+ (cvs $cvsopt -q -n update $updateopt ${1+"$@"} 2>/dev/null \
| while read line; do
echo "$line"
echo "$line" >&3
case "$line" in
"--- ChangeLog"*) :;;
"-"*)
- echo "$name: the following line in ChangeLog diff is suspicious:" >&2
+ echo "$name: *** Warning: the following line in ChangeLog diff is suspicious:" >&2
echo "$line" | sed 's/^.//' >&2;;
"+ "*)
- echo "$name: lines should start with tabs, not spaces; ignoring line:" >&2
+ echo "$name: *** Warning: lines should start with tabs, not spaces; ignoring line:" >&2
echo "$line" | sed 's/^.//' >&2;;
"+") echo;;
"+ "*) echo "$line";;
fi
if grep '^$' < "$log_file" > /dev/null; then
- echo "$name: blank lines should not appear within a commit messages" >&2
- echo "$name: they should be used to separate distinct commits" >&2
+ echo "$name: *** Warning: blank lines should not appear within a commit messages." >&2
+ echo "$name: *** They should be used to separate distinct commits." >&2
fi
${PAGER-more} "$log_file" || break
BUILD_helldl =
endif
-bin_PROGRAMS = hell hell.debug $(BUILD_helldl)
+bin_PROGRAMS = hell hell.static $(BUILD_helldl)
# Build hell from main.c and libhello.la
hell_SOURCES = main.c
-hell_LDADD = -lhello
+hell_LDADD = libhello.la
-# Create an easier-to-debug version of hell.
-hell_debug_SOURCES = main.c
-hell_debug_LDADD = -lhello
-hell_debug_LDFLAGS = $(STATIC)
+# Create a statically linked version of hell.
+hell_static_SOURCES = main.c
+hell_static_LDADD = libhello.la
+hell_static_LDFLAGS = $(STATIC)
if BINARY_HELLDL
libl4_la_SOURCES = l4.c l4.h sysdep.h
libl4_la_LIBADD = libl3.la $(LIBADD_M)
-bin_PROGRAMS = depdemo.static depdemo
+bin_PROGRAMS = depdemo depdemo.static
depdemo_SOURCES = main.c
depdemo_LDADD = libl1.la libl2.la libl4.la
depdemo_static_SOURCES = $(depdemo_SOURCES)
depdemo_static_LDADD = $(depdemo_LDADD)
depdemo_static_DEPENDENCIES = $(depdemo_DEPENDENCIES)
-depdemo_static_LDFLAGS = -static
-
+depdemo_static_LDFLAGS = $(STATIC)
i686-pc-linux-gnu gcc 1.2e ok
i686-pc-linux-gnu egcs 1.2e ok egcs 1.1.1
i686-pc-linux-gnulibc1 gcc 1.2e ok
-i686-pc-cygwin32 egcs 1.2e ok
m68k-next-nextstep3 gcc 1.2e ok static
m68k-sun-sunos4.1.1 gcc 1.2e NS
m88k-dg-dguxR4.12TMU01** gcc 1.2 ok
restriction is only necessary to preserve compatibility with static
library systems and simple dynamic library systems.
-Some platforms, such as AIX and Windows 95, do not even allow you this
+Some platforms, such as AIX, do not even allow you this
flexibility. In order to build a shared library, it must be entirely
self-contained (that is, have references only to symbols that are found
in the @samp{.lo} files or the specified @samp{-l} libraries), and you
@deftypefun lt_dlhandle lt_dlopen (const char *@var{filename})
Open the module with the file name @var{filename} and return a
handle for it. @code{lt_dlopen} is able to open libtool dynamic
-modules, preloaded static modules and native dynamic libraries.
+modules, preloaded static modules, the program itself and
+native dynamic libraries.
Unresolved symbols in the module are resolved using its dependency
libraries and previously dlopened modules. If the executable using this
module. Libltdl tries to resolve the symbols immediately and returns
@code{NULL} if that fails.
+If @var{filename} is NULL @code{lt_dlopen} will return a handle
+for the program itself, which can be used to access its symbols
+if it was linked with @code{-export-dynamic}.
+
If libltdl cannot find the library and the file name @var{filename} does
not have a directory component it will additionally search in the
following search paths for the module (in the order as follows):
The @file{mdemo} subdirectory contains a demonstration of a package that
uses libtool and the system independent dlopen wrapper @file{libltdl} to
load modules. The library @file{libltdl} provides an experimental
-dlopen wrapper for various platforms (Linux, Solaris, HP/UX, Win32 etc.)
+dlopen wrapper for various platforms (Linux, Solaris, HP/UX etc.)
including support for dlpreopened modules (@pxref{Dlpreopening}).
The tests @file{mdemo-make.test}, @file{mdemo-exec.test},
libtool
*.lo
*.la
+stamp-h*
LTDL_VERSION = -version-info 1:1:1
if INSTALL_LTDL
-LTDL_FLAGS = $(LTDL_VERSION) -rpath $(libdir)
include_HEADERS = ltdl.h
else
-LTDL_FLAGS =
noinst_HEADERS = ltdl.h
endif
-EXTRA_LTLIBRARIES = libltdl.la libltdlc.la
-
-lib_LTLIBRARIES = @LIBLIBS@
-noinst_LTLIBRARIES = @NOINSTLIBS@
+noinst_LTLIBRARIES = libltdl.la
libltdl_la_SOURCES = ltdl.c
-libltdl_la_LDFLAGS = $(LTDL_FLAGS)
libltdl_la_LIBADD = $(LIBADD_DL)
-libltdlc_la_SOURCES = $(libltdl_la_SOURCES)
-libltdlc_la_LDFLAGS =
-libltdlc_la_LIBADD = $(libltdl_la_LIBADD)
+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)
libtool: $(LIBTOOL_DEPS)
$(SHELL) ./config.status --recheck
dnl Initialize the libltdl package.
AC_INIT(ltdl.c)
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=libltdl.la
- NOINSTLIBS=
+ LIBLIBS=$TOINST/libltdl.la
else
LIBLIBS=
- NOINSTLIBS=libltdl.la
fi
AC_SUBST(LIBLIBS)
-AC_SUBST(NOINSTLIBS)
AC_PROG_CC
AC_C_CONST
AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
libltdl_cv_preloaded_symbols, [dnl
- if grep '^global_symbol_pipe=..*$' ./libtool >/dev/null; then
- libltdl_cv_preloaded_symbols=yes
- else
- libltdl_cv_preloaded_symbols=no
- fi
+ (
+ rm -f conftest
+ ./libtool --config > conftest
+ . ./conftest
+ rm -f conftest
+ if test -n "$global_symbol_pipe"; then
+ echo yes > conftest
+ else
+ echo no > conftest
+ fi
+ )
+ libltdl_cv_preloaded_symbols=`cat conftest`
+ rm -f conftest
])
if test x"$libltdl_cv_preloaded_symbols" = x"yes"; then
AC_DEFINE(HAVE_PRELOADED_SYMBOLS)
LIBS="$LIBS_SAVE"
fi
-AM_SYS_SYMBOL_UNDERSCORE
+AC_SYS_SYMBOL_UNDERSCORE
if test x"$USE_SYMBOL_UNDERSCORE" = xyes; then
if test x"$ac_cv_func_dlopen" = xyes ||
test x"$ac_cv_lib_dl_dlopen" = xyes ; then
#define _LTDL_COMPILE_
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#if HAVE_STRING_H
#include <string.h>
#endif
/* This accounts for the _LTX_ separator */
#define LTDL_SYMBOL_OVERHEAD 5
-static const char *objdir = LTDL_OBJDIR;
-static const char *shlib_ext = LTDL_SHLIB_EXT;
+static const char objdir[] = LTDL_OBJDIR;
+static const char shlib_ext[] = LTDL_SHLIB_EXT;
-static const char *unknown_error = "unknown error";
-static const char *dlopen_not_supported_error = "dlopen support not available";
-static const char *file_not_found_error = "file not found";
-static const char *no_symbols_error = "no symbols defined";
-static const char *symbol_error = "symbol not found";
-static const char *memory_error = "not enough memory";
-static const char *invalid_handle_error = "invalid handle";
-static const char *buffer_overflow_error = "internal buffer overflow";
-static const char *shutdown_error = "library already shutdown";
+static const char unknown_error[] = "unknown error";
+static const char dlopen_not_supported_error[] = "dlopen support not available";
+static const char file_not_found_error[] = "file not found";
+static const char no_symbols_error[] = "no symbols defined";
+static const char symbol_error[] = "symbol not found";
+static const char memory_error[] = "not enough memory";
+static const char invalid_handle_error[] = "invalid handle";
+static const char buffer_overflow_error[] = "internal buffer overflow";
+static const char shutdown_error[] = "library already shutdown";
#ifndef HAVE_PRELOADED_SYMBOLS
/* If libtool won't define it, we'd better do */
char *name; /* module name */
int usage; /* usage */
int depcount; /* number of dependencies */
- lt_dlhandle *deps; /* dependencies */
+ lt_dlhandle *deplibs; /* dependencies */
lt_ptr_t handle; /* system handle */
lt_ptr_t system; /* system specific data */
} lt_dlhandle_t;
#undef strdup
#define strdup xstrdup
-static char *
+static inline char *
strdup(str)
const char *str;
{
if (!str)
return str;
- tmp = malloc(strlen(str)+1);
+ tmp = (char*) malloc(strlen(str)+1);
if (tmp)
strcpy(tmp, str);
return tmp;
# define strchr xstrchr
-static const char*
+static inline const char*
strchr(str, ch)
const char *str;
int ch;
# define strrchr xstrrchr
-static const char*
+static inline const char*
strrchr(str, ch)
const char *str;
int ch;
{
lt_dlsymlists_t *lists = preloaded_symbols;
- if (!filename) {
- last_error = file_not_found_error;
- return 1;
- }
if (!lists) {
last_error = no_symbols_error;
return 1;
}
+ if (!filename) {
+ if (!default_preloaded_symbols) {
+ last_error = file_not_found_error;
+ return 1;
+ } else {
+ handle->handle = (lt_ptr_t) default_preloaded_symbols;
+ return 0;
+ }
+ }
while (lists) {
const lt_dlsymlist *syms = lists->syms;
/* check whether the module was already opened */
cur = handles;
- while (cur && strcmp(cur->filename, filename))
+ while (cur) {
+ if (!cur->filename && !filename)
+ break;
+ if (cur->filename && filename &&
+ strcmp(cur->filename, filename) == 0)
+ break;
cur = cur->next;
+ }
if (cur) {
cur->usage++;
- free(*handle);
*handle = cur;
return 0;
}
cur = *handle;
- cur->filename = strdup(filename);
- if (!cur->filename) {
- last_error = memory_error;
- return 1;
- }
+ if (filename) {
+ cur->filename = strdup(filename);
+ if (!cur->filename) {
+ last_error = memory_error;
+ return 1;
+ }
+ } else
+ cur->filename = 0;
while (type) {
if (type->lib_open(cur, filename) == 0)
break;
type = type->next;
}
if (!type) {
- free(cur->filename);
+ if (cur->filename)
+ free(cur->filename);
return 1;
}
cur->type = type;
const char *old_name;
int installed;
{
- char filename[LTDL_FILENAME_MAX];
-
/* 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 */
/* try to open the dynamic library */
if (dlname) {
/* try to open the installed module */
- if (installed &&
- strlen(libdir)+1+strlen(dlname) < LTDL_FILENAME_MAX) {
+ if (installed && libdir) {
+ int ret;
+ char *filename = (char*)
+ malloc(strlen(libdir)+1+strlen(dlname)+1);
+
+ if (!filename) {
+ last_error = memory_error;
+ return 1;
+ }
strcpy(filename, libdir);
strcat(filename, "/");
strcat(filename, dlname);
- if (tryall_dlopen(handle, filename) == 0)
+ ret = tryall_dlopen(handle, filename) == 0;
+ free(filename);
+ if (ret)
return 0;
}
/* try to open the not-installed module */
- if (!installed &&
- strlen(dir)+strlen(objdir)+strlen(dlname)
- < LTDL_FILENAME_MAX) {
- strcpy(filename, dir);
+ if (!installed) {
+ int ret;
+ char *filename = (char*)
+ malloc((dir ? strlen(dir) : 0)
+ + strlen(objdir) + strlen(dlname) + 1);
+
+ if (!filename) {
+ last_error = memory_error;
+ return 1;
+ }
+ if (dir)
+ strcpy(filename, dir);
+ else
+ *filename = 0;
strcat(filename, objdir);
strcat(filename, dlname);
- if (tryall_dlopen(handle, filename) == 0)
+
+ ret = tryall_dlopen(handle, filename) == 0;
+ free(filename);
+ if (ret)
return 0;
}
- /* hmm, maybe it was moved to another directory */
- if (strlen(dir)+strlen(dlname) < LTDL_FILENAME_MAX) {
- strcpy(filename, dir);
+ /* hmm, maybe it was moved to another directory.
+ Should we really support this? */
+ {
+ int ret;
+ char *filename = (char*)
+ malloc((dir ? strlen(dir) : 0)
+ + strlen(dlname) + 1);
+ if (dir)
+ strcpy(filename, dir);
+ else
+ *filename = 0;
strcat(filename, dlname);
- if (tryall_dlopen(handle, filename) == 0)
+ ret = tryall_dlopen(handle, filename) == 0;
+ free(filename);
+ if (ret)
return 0;
}
}
find_file (basename, search_path, pdir, handle)
const char *basename;
const char *search_path;
- char *pdir;
+ char **pdir;
lt_dlhandle *handle;
{
/* when handle != NULL search a library, otherwise a file */
/* return NULL on failure, otherwise the file/handle */
- char filename[LTDL_FILENAME_MAX];
- const char *cur, *next;
- FILE *file;
- int lendir;
+ char *filename = 0;
+ int filenamesize = 0;
+ const char *next = search_path;
+ int lenbase = strlen(basename);
- if (!search_path || !strlen(search_path)) {
+ if (!next || !*next) {
last_error = file_not_found_error;
return 0;
}
- cur = search_path;
- while (cur) {
+ while (next) {
+ int lendir;
+ const char *cur = next;
+
next = strchr(cur, ':');
- if (next) {
- if (next - cur + 1 >= LTDL_FILENAME_MAX) {
- last_error = buffer_overflow_error;
- return 0;
- }
- strncpy(filename, cur, next - cur);
- filename[next - cur] = '\0';
- cur = next+1;
- } else {
- if (strlen(cur)+1 >= LTDL_FILENAME_MAX) {
- last_error = buffer_overflow_error;
+ if (!next)
+ next = cur + strlen(cur);
+ lendir = next - cur;
+ if (*next == ':')
+ ++next;
+ else
+ next = 0;
+ if (lendir == 0)
+ continue;
+ if (lendir + 1 + lenbase >= filenamesize) {
+ if (filename)
+ free(filename);
+ filenamesize = lendir + 1 + lenbase + 1;
+ filename = (char*) malloc(filenamesize);
+ if (!filename) {
+ last_error = memory_error;
return 0;
}
- strcpy(filename, cur);
- cur = 0;
}
- if (!*filename)
- continue;
- lendir = strlen(filename);
- if (filename[lendir-1] != '/') {
- strcat(filename, "/");
- lendir++;
- }
- if (lendir+strlen(basename) < LTDL_FILENAME_MAX) {
- strcat(filename, basename);
- if (handle) {
- if (tryall_dlopen(handle, filename) == 0)
- return (lt_ptr_t) handle;
- } else {
- file = fopen(filename, LTDL_READTEXT_MODE);
- if (file) {
- filename[lendir] = '\0';
- strcpy(pdir, filename);
- return (lt_ptr_t) file;
- }
+ strncpy(filename, cur, lendir);
+ if (filename[lendir-1] != '/')
+ filename[lendir++] = '/';
+ strcpy(filename+lendir, basename);
+ if (handle) {
+ if (tryall_dlopen(handle, filename) == 0) {
+ free(filename);
+ return (lt_ptr_t) handle;
+ }
+ } else {
+ FILE *file = fopen(filename, LTDL_READTEXT_MODE);
+ if (file) {
+ if (*pdir)
+ free(*pdir);
+ filename[lendir] = '\0';
+ *pdir = strdup(filename);
+ if (!*pdir) {
+ /* We could have even avoided the
+ strdup, but there would be some
+ memory overhead. */
+ *pdir = filename;
+ } else
+ free(filename);
+ return (lt_ptr_t) file;
}
}
}
+ if (filename)
+ free(filename);
last_error = file_not_found_error;
return 0;
}
{
/* FIXME: load deplibs */
handle->depcount = 0;
- handle->deps = 0;
+ handle->deplibs = 0;
return 0;
}
return 0;
}
-static int
+static inline int
trim (dest, s)
char **dest;
const char *s;
if (*dest)
free(*dest);
if (len > 3 && s[0] == '\'') {
- tmp = malloc(i - s);
+ tmp = (char*) malloc(i - s);
if (!tmp) {
last_error = memory_error;
return 1;
return 0;
}
-static int
-free_vars(dlname, oldname, libdir, deplibs)
+static inline int
+free_vars(dir, name, dlname, oldname, libdir, deplibs)
+ char *dir;
+ char *name;
char *dlname;
char *oldname;
char *libdir;
char *deplibs;
{
+ if (dir)
+ free(dir);
+ if (name)
+ free(name);
if (dlname)
free(dlname);
if (oldname)
return 0;
}
-
lt_dlhandle
lt_dlopen (filename)
const char *filename;
{
- lt_dlhandle handle;
- char dir[LTDL_FILENAME_MAX];
+ lt_dlhandle handle, newhandle;
const char *basename, *ext;
const char *saved_error = last_error;
- char *name = 0;
+ char *dir = 0, *name = 0;
if (!filename) {
- last_error = file_not_found_error;
- return 0;
+ handle = (lt_dlhandle) malloc(sizeof(lt_dlhandle_t));
+ if (!handle) {
+ last_error = memory_error;
+ return 0;
+ }
+ handle->usage = 0;
+ newhandle = handle;
+ if (tryall_dlopen(handle, 0) != 0) {
+ free(newhandle);
+ return 0;
+ }
+ if (newhandle != handle)
+ free(newhandle);
+ return handle;
}
basename = strrchr(filename, '/');
- if (basename)
+ if (basename) {
basename++;
- else
+ dir = (char*) malloc(basename - filename + 1);
+ if (!dir) {
+ last_error = memory_error;
+ return 0;
+ }
+ strncpy(dir, filename, basename - filename);
+ dir[basename - filename] = '\0';
+ } else
basename = filename;
- if (basename - filename >= LTDL_FILENAME_MAX) {
- last_error = buffer_overflow_error;
- return 0;
- }
- strncpy(dir, filename, basename - filename);
- dir[basename - filename] = '\0';
/* check whether we open a libtool module (.la extension) */
ext = strrchr(basename, '.');
if (ext && strcmp(ext, ".la") == 0) {
/* this seems to be a libtool module */
- char tmp[LTDL_FILENAME_MAX];
FILE *file;
int i;
char *dlname = 0, *old_name = 0;
int installed = 1;
/* extract the module name from the file name */
- if (strlen(basename) >= sizeof(tmp)) {
- last_error = buffer_overflow_error;
+ name = (char*) malloc(ext - basename + 1);
+ if (!name) {
+ last_error = memory_error;
+ if (dir)
+ free(dir);
return 0;
}
/* canonicalize the module name */
for (i = 0; i < ext - basename; i++)
if (isalnum(basename[i]))
- tmp[i] = basename[i];
+ name[i] = basename[i];
else
- tmp[i] = '_';
- tmp[ext - basename] = '\0';
- name = strdup(tmp);
- if (!name) {
- last_error = memory_error;
- return 0;
- }
+ name[i] = '_';
+ name[ext - basename] = '\0';
/* now try to open the .la file */
file = fopen(filename, LTDL_READTEXT_MODE);
if (!file)
last_error = file_not_found_error;
- if (!file && !*dir) {
+ if (!file && !dir) {
/* try other directories */
file = (FILE*) find_file(basename,
user_search_path,
- dir, 0);
+ &dir, 0);
if (!file)
file = (FILE*) find_file(basename,
getenv("LTDL_LIBRARY_PATH"),
- dir, 0);
+ &dir, 0);
#ifdef LTDL_SHLIBPATH_VAR
if (!file)
file = (FILE*) find_file(basename,
getenv(LTDL_SHLIBPATH_VAR),
- dir, 0);
+ &dir, 0);
#endif
}
if (!file) {
- free(name);
+ if (name)
+ free(name);
+ if (dir)
+ free(dir);
return 0;
}
/* read the .la file */
while (!feof(file)) {
- if (!fgets(tmp, sizeof(tmp), file))
+ char line[LTDL_FILENAME_MAX];
+
+ if (!fgets(line, sizeof(line), file))
break;
- if (tmp[0] == '\n' || tmp[0] == '#')
+ if (line[0] == '\n' || line[0] == '#')
continue;
- if (strncmp(tmp, "dlname=", 7) == 0)
- error = trim(&dlname, &tmp[7]);
+ if (strncmp(line, "dlname=", 7) == 0)
+ error = trim(&dlname, &line[7]);
else
- if (strncmp(tmp, "old_library=", 12) == 0)
- error = trim(&old_name, &tmp[12]);
+ if (strncmp(line, "old_library=", 12) == 0)
+ error = trim(&old_name, &line[12]);
else
- if (strncmp(tmp, "libdir=", 7) == 0)
- error = trim(&libdir, &tmp[7]);
+ if (strncmp(line, "libdir=", 7) == 0)
+ error = trim(&libdir, &line[7]);
else
- if (strncmp(tmp, "dl_dependency_libs=", 20) == 0)
- error = trim(&deplibs, &tmp[20]);
+ if (strncmp(line, "dl_dependency_libs=", 20) == 0)
+ error = trim(&deplibs, &line[20]);
else
- if (strcmp(tmp, "installed=yes\n") == 0)
+ if (strcmp(line, "installed=yes\n") == 0)
installed = 1;
else
- if (strcmp(tmp, "installed=no\n") == 0)
+ if (strcmp(line, "installed=no\n") == 0)
installed = 0;
if (error)
break;
free(handle);
if (!error)
last_error = memory_error;
- free_vars(dlname, old_name, libdir, deplibs);
- free(name);
+ free_vars(name, dir, dlname, old_name, libdir, deplibs);
return 0;
}
handle->usage = 0;
if (load_deplibs(handle, deplibs) == 0) {
- if (find_module(&handle, dir, libdir,
+ newhandle = handle;
+ /* find_module may replace newhandle */
+ if (find_module(&newhandle, dir, libdir,
dlname, old_name, installed)) {
unload_deplibs(handle);
error = 1;
error = 1;
if (error) {
free(handle);
- free_vars(dlname, old_name, libdir, deplibs);
- free(name);
+ free_vars(name, dir, dlname, old_name, libdir, deplibs);
return 0;
}
+ if (handle != newhandle) {
+ unload_deplibs(handle);
+ }
} else {
/* not a libtool module */
handle = (lt_dlhandle) malloc(sizeof(lt_dlhandle_t));
if (!handle) {
last_error = memory_error;
+ if (dir)
+ free(dir);
return 0;
}
handle->usage = 0;
- if (tryall_dlopen(&handle, filename) && (!*dir
- || (find_file(basename, user_search_path, 0, &handle)
- && find_file(basename, getenv("LTDL_LIBRARY_PATH"),
- 0, &handle)
+ /* non-libtool modules don't have dependencies */
+ handle->depcount = 0;
+ handle->deplibs = 0;
+ newhandle = handle;
+ if (tryall_dlopen(&handle, filename)
+ && (!dir
+ || (!find_file(basename, user_search_path, 0, &handle)
+ && !find_file(basename,
+ getenv("LTDL_LIBRARY_PATH"),
+ 0, &handle)
#ifdef LTDL_SHLIBPATH_VAR
- && find_file(basename, getenv(LTDL_SHLIBPATH_VAR),
- 0, &handle)
+ && !find_file(basename,
+ getenv(LTDL_SHLIBPATH_VAR),
+ 0, &handle)
#endif
- ))) {
+ ))) {
free(handle);
+ if (dir)
+ free(dir);
return 0;
}
}
+ if (newhandle != handle) {
+ free(handle);
+ handle = newhandle;
+ }
if (!handle->usage) {
handle->usage = 1;
handle->name = name;
handle->next = handles;
handles = handle;
- }
+ } else if (name)
+ free(name);
+ if (dir)
+ free(dir);
last_error = saved_error;
return handle;
}
const char *filename;
{
lt_dlhandle handle;
- char tmp[LTDL_FILENAME_MAX];
+ char *tmp;
int len;
const char *saved_error = last_error;
if (handle)
return handle;
/* try "filename.la" */
- if (len+3 >= sizeof(tmp)) {
- last_error = buffer_overflow_error;
+ tmp = (char*) malloc(len+4);
+ if (!tmp) {
+ last_error = memory_error;
return 0;
}
strcpy(tmp, filename);
handle = lt_dlopen(tmp);
if (handle) {
last_error = saved_error;
+ free(tmp);
return handle;
}
#ifdef LTDL_SHLIB_EXT
/* try "filename.EXT" */
- tmp[len] = '\0';
- if (len+strlen(shlib_ext) >= sizeof(tmp)) {
- last_error = buffer_overflow_error;
- return 0;
- }
+ if (strlen(shlib_ext) > 3) {
+ free(tmp);
+ tmp = (char*) malloc(len + strlen(shlib_ext) + 1);
+ if (!tmp) {
+ last_error = memory_error;
+ return 0;
+ }
+ strcpy(tmp, filename);
+ } else
+ tmp[len] = '\0';
strcat(tmp, shlib_ext);
handle = lt_dlopen(tmp);
if (handle) {
last_error = saved_error;
+ free(tmp);
return handle;
}
#endif
last_error = file_not_found_error;
+ free(tmp);
return 0;
}
if (lensym + LTDL_SYMBOL_OVERHEAD < LTDL_SYMBOL_LENGTH)
sym = lsym;
else
- sym = malloc(lensym + LTDL_SYMBOL_OVERHEAD + 1);
+ sym = (char*) malloc(lensym + LTDL_SYMBOL_OVERHEAD + 1);
if (!sym) {
last_error = buffer_overflow_error;
return 0;
## configuration script generated by Autoconf, you may include it under
## the same distribution terms that you use for the rest of that program.
-# serial 30 AM_PROG_LIBTOOL
-AC_DEFUN(AM_PROG_LIBTOOL,
+# serial 31 AC_PROG_LIBTOOL
+AC_DEFUN(AC_PROG_LIBTOOL,
[AC_PREREQ(2.12.2)dnl
-AC_REQUIRE([AM_ENABLE_SHARED])dnl
-AC_REQUIRE([AM_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AM_PROG_LD])dnl
-AC_REQUIRE([AM_PROG_NM])dnl
-AC_REQUIRE([AM_SYS_NM_PARSE])dnl
-AC_REQUIRE([AM_SYS_SYMBOL_UNDERSCORE])dnl
+AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+AC_REQUIRE([AC_SYS_NM_PARSE])dnl
+AC_REQUIRE([AC_SYS_SYMBOL_UNDERSCORE])dnl
AC_REQUIRE([AC_PROG_LN_S])dnl
dnl
# Always use our own libtool.
;;
*-*-cygwin32*)
- AM_SYS_LIBTOOL_CYGWIN32
+ AC_SYS_LIBTOOL_CYGWIN32
;;
esac
exec 5>>./config.log
])
-# AM_ENABLE_SHARED - implement the --enable-shared flag
-# Usage: AM_ENABLE_SHARED[(DEFAULT)]
+# AC_ENABLE_SHARED - implement the --enable-shared flag
+# Usage: AC_ENABLE_SHARED[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
-AC_DEFUN(AM_ENABLE_SHARED,
-[define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_DEFUN(AC_ENABLE_SHARED,
+[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(shared,
changequote(<<, >>)dnl
-<< --enable-shared[=PKGS] build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT],
+<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case "$enableval" in
IFS="$ac_save_ifs"
;;
esac],
-enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
+enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
])
-# AM_DISABLE_SHARED - set the default shared flag to --disable-shared
-AC_DEFUN(AM_DISABLE_SHARED,
-[AM_ENABLE_SHARED(no)])
+# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
+AC_DEFUN(AC_DISABLE_SHARED,
+[AC_ENABLE_SHARED(no)])
-# AM_DISABLE_STATIC - set the default static flag to --disable-static
-AC_DEFUN(AM_DISABLE_STATIC,
-[AM_ENABLE_STATIC(no)])
+# AC_DISABLE_STATIC - set the default static flag to --disable-static
+AC_DEFUN(AC_DISABLE_STATIC,
+[AC_ENABLE_STATIC(no)])
-# AM_ENABLE_STATIC - implement the --enable-static flag
-# Usage: AM_ENABLE_STATIC[(DEFAULT)]
+# AC_ENABLE_STATIC - implement the --enable-static flag
+# Usage: AC_ENABLE_STATIC[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
-AC_DEFUN(AM_ENABLE_STATIC,
-[define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_DEFUN(AC_ENABLE_STATIC,
+[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(static,
changequote(<<, >>)dnl
-<< --enable-static[=PKGS] build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT],
+<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case "$enableval" in
IFS="$ac_save_ifs"
;;
esac],
-enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
+enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
])
-# AM_PROG_LD - find the path to the GNU or non-GNU linker
-AC_DEFUN(AM_PROG_LD,
+# AC_PROG_LD - find the path to the GNU or non-GNU linker
+AC_DEFUN(AC_PROG_LD,
[AC_ARG_WITH(gnu-ld,
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_SUBST(LD)
-AM_PROG_LD_GNU
+AC_PROG_LD_GNU
])
-AC_DEFUN(AM_PROG_LD_GNU,
+AC_DEFUN(AC_PROG_LD_GNU,
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
fi])
])
-# AM_PROG_NM - find the path to a BSD-compatible name lister
-AC_DEFUN(AM_PROG_NM,
+# AC_PROG_NM - find the path to a BSD-compatible name lister
+AC_DEFUN(AC_PROG_NM,
[AC_MSG_CHECKING([for BSD-compatible nm])
AC_CACHE_VAL(ac_cv_path_NM,
[if test -n "$NM"; then
AC_SUBST(NM)
])
-# AM_SYS_NM_PARSE - Check for command ro grab the raw symbol name followed
+# AC_SYS_NM_PARSE - Check for command ro grab the raw symbol name followed
# by C symbol name from nm.
-AC_DEFUN(AM_SYS_NM_PARSE,
+AC_DEFUN(AC_SYS_NM_PARSE,
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AM_PROG_NM])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
# Check for command to grab the raw symbol name followed by C symbol from nm.
AC_MSG_CHECKING([command to parse $NM output])
AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe,
changequote(,)dnl
# Character class describing NM global symbol codes.
-ac_symcode='[BCDEGRSTU]'
+ac_symcode='[BCDEGRST]'
# Regexp to match symbols that can be accessed directly from C.
ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
# Define system-specific variables.
case "$host_os" in
aix*)
- ac_symcode='[BCDTU]'
+ ac_symcode='[BCDT]'
+ ;;
+cygwin32* | mingw32*)
+ ac_symcode='[ABCDGISTW]'
;;
irix*)
- # Cannot use undefined symbols on IRIX because inlined functions mess us up.
ac_symcode='[BCDEGRST]'
;;
solaris*)
- ac_symcode='[BDTU]'
+ ac_symcode='[BDT]'
;;
esac
# If we're using GNU nm, then use its standard symbol codes.
if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
- ac_symcode='[ABCDGISTUW]'
-fi
-
-case "$host_os" in
-cygwin32* | mingw32*)
- # We do not want undefined symbols on cygwin32. The user must
- # arrange to define them via -l arguments.
ac_symcode='[ABCDGISTW]'
- ;;
-esac
+fi
changequote([,])dnl
# Try without a prefix undercore, then with it.
# Write the raw and C identifiers.
# Unlike in ltconfig.in, we need $ac_symprfx before $ac_symxfrm here,
- # otherwise AM_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'"
+ # 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'"
# Check to see that the pipe works correctly.
ac_pipe_works=no
+ rm -f conftest.$ac_ext
cat > conftest.$ac_ext <<EOF
#ifdef __cplusplus
extern "C" {
#endif
int main(){nm_test_var='a';nm_test_func;return 0;}
EOF
+
if AC_TRY_EVAL(ac_compile); then
# Now try to grab the symbols.
ac_nlist=conftest.nm
# Try sorting and uniquifying the output.
if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
mv -f "$ac_nlist"T "$ac_nlist"
- ac_wcout=`wc "$ac_nlist" 2>/dev/null`
-changequote(,)dnl
- ac_count=`echo "X$ac_wcout" | sed -e 's,^X,,' -e 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
-changequote([,])dnl
- (test "$ac_count" -ge 0) 2>/dev/null || ac_count=-1
else
rm -f "$ac_nlist"T
- ac_count=-1
fi
# Make sure that we snagged all the symbols we need.
# define lt_ptr_t void *
#else
# define lt_ptr_t char *
+# define const
#endif
-/* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
-int dld_preloaded_symbol_count = $ac_count;
-
/* The mapping between symbol names and symbols. */
-struct {
- char *name;
+const struct {
+ const char *name;
lt_ptr_t address;
}
changequote(,)dnl
-dld_preloaded_symbols[] =
+lt_preloaded_symbols[] =
changequote([,])dnl
{
EOF
AC_MSG_RESULT($ac_result)
])
-# AM_SYS_LIBTOOL_CYGWIN32 - find tools needed on cygwin32
-AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN32,
+# AC_SYS_LIBTOOL_CYGWIN32 - find tools needed on cygwin32
+AC_DEFUN(AC_SYS_LIBTOOL_CYGWIN32,
[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(AS, as, false)
])
-# AM_SYS_SYMBOL_UNDERSCORE - does the compiler prefix global symbols
+# AC_SYS_SYMBOL_UNDERSCORE - does the compiler prefix global symbols
# with an underscore?
-AC_DEFUN(AM_SYS_SYMBOL_UNDERSCORE,
-[AC_REQUIRE([AM_PROG_NM])dnl
-AC_REQUIRE([AM_SYS_NM_PARSE])dnl
+AC_DEFUN(AC_SYS_SYMBOL_UNDERSCORE,
+[AC_REQUIRE([AC_PROG_NM])dnl
+AC_REQUIRE([AC_SYS_NM_PARSE])dnl
AC_MSG_CHECKING([for _ prefix in compiled symbols])
AC_CACHE_VAL(ac_cv_sys_symbol_underscore,
[ac_cv_sys_symbol_underscore=no
USE_SYMBOL_UNDERSCORE=${ac_cv_sys_symbol_underscore=no}
AC_SUBST(USE_SYMBOL_UNDERSCORE)dnl
])
+
+dnl old names
+AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
+AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
+AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
+AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
+AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
+AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
+AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
+AC_DEFUN(AM_SYS_NM_PARSE, [indir([AC_SYS_NM_PARSE])])dnl
+AC_DEFUN(AM_SYS_SYMBOL_UNDERSCORE, [indir([AC_SYS_SYMBOL_UNDERSCORE])])dnl
+AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN32, [indir([AC_SYS_LIBTOOL_CYGWIN32])])dnl
fi
if test -z "$automake"; then
- if egrep '^AM_PROG_LIBTOOL' configure.in >/dev/null 2>&1; then :
+ if egrep '^A[MC]_PROG_LIBTOOL' configure.in >/dev/null 2>&1; then :
else
echo "Remember to add \`AM_PROG_LIBTOOL' to \`configure.in'."
fi
updatemsg="add the contents of \`$libtool_m4' to \`aclocal.m4'"
fi
- if egrep '^AC_DEFUN\(AM_PROG_LIBTOOL' aclocal.m4 >/dev/null 2>&1; then
+ if egrep '^AC_DEFUN\(A[MC]_PROG_LIBTOOL' aclocal.m4 >/dev/null 2>&1; then
# Check the version number on libtool.m4 and the one used in aclocal.m4.
- instserial=`grep '^# serial ' $libtool_m4 | grep 'AM_PROG_LIBTOOL' | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'`
+ instserial=`grep '^# serial ' $libtool_m4 | grep 'A[MC]_PROG_LIBTOOL' | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'`
if test -z "$instserial"; then
echo "$progname: warning: no serial number on \`$libtool_m4'" 1>&2
else
# If the local macro has no serial number, we assume it's ancient.
- localserial=`grep '^# serial ' aclocal.m4 | grep 'AM_PROG_LIBTOOL' | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'`
+ localserial=`grep '^# serial ' aclocal.m4 | grep 'A[MC]_PROG_LIBTOOL' | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'`
test -z "$localserial" && localserial=0
exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"}
else
# Try using printf.
- echo='printf %s\n'
+ echo='printf "%s\n"'
if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
# Cool, printf works
no_undefined_flag=
need_lib_prefix=unknown
need_version=unknown
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
archive_cmds=
archive_sym_cmds=
old_archive_from_new_cmds=
export_dynamic_flag_spec=
whole_archive_flag_spec=
+thread_safe_flag_spec=
hardcode_libdir_flag_spec=
hardcode_libdir_separator=
hardcode_direct=no
;;
sunos4*)
- archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs'
+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts'
wlarc=
hardcode_direct=yes
hardcode_minus_L=yes
beos*)
if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
- archive_cmds='$CC -nostart ${wl}-soname $wl$soname -o $lib $libobjs $deplibs'
+ archive_cmds='$CC -nostart ${wl}-soname $wl$soname -o $lib $libobjs $deplibs $linkopts'
else
ld_shlibs=no
fi
(cd $objdir && $CC -c $soname-ltdll.c)~
echo EXPORTS > $objdir/$soname-def~
$DLLTOOL --export-all --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs~
- $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs~
+ $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
$DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
- $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs~
+ $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
$DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
- $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs'
+ $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts'
archive_sym_cmds='rm -f $objdir/$soname-ltdll.c~
sed -e "/^# \/\* ltdll.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
(cd $objdir && $CC -c $soname-ltdll.c)~
echo EXPORTS > $objdir/$soname-def~
cat "$export_symbols" >> $objdir/$soname-def~
- $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs~
+ $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
$DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
- $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs~
+ $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
$DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
- $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs'
+ $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts'
- old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a'
+ old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a'
;;
*)
if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
- archive_cmds='$CC -shared ${wl}-soname $wl$soname -o $lib $libobjs $deplibs'
- archive_sym_cmds='$CC -shared ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib $libobjs $deplibs'
+ archive_cmds='$CC -shared ${wl}-soname $wl$soname -o $lib $libobjs $deplibs $linkopts'
+ archive_sym_cmds='$CC -shared ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib $libobjs $deplibs $linkopts'
else
ld_shlibs=no
fi
aix3*)
allow_undefined_flag=unsupported
archive_cmds='$NM $libobjs | $global_symbol_pipe | sed '\''s/.* //'\' | sort | uniq' > $lib.exp~
- $LD -o $objdir/$soname $libobjs $deplibs -bE:$lib.exp -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
- archive_sym_cmds='$LD -o $objdir/$soname $libobjs $deplibs -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
+ $LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$lib.exp -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
+ archive_sym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
hardcode_minus_L=yes
allow_undefined_flag=
if test "$with_gcc" = yes; then
if strings `${CC} -print-prog-name=collect2` | \
- grep resolve_lib_name >/dev/null
+ grep resolve_lib_name >/dev/null
then
- # We have reworked collect2
- hardcode_direct=yes
+ # We have reworked collect2
+ hardcode_direct=yes
else
- # We have old collect2
- hardcode_direct=unsupported
+ # We have old collect2
+ hardcode_direct=unsupported
fi
- archive_cmds='$CC -shared ${wl}-bnoentry -o $objdir/$soname $libobjs $deplibs'
+ archive_cmds='$CC -shared ${wl}-bnoentry -o $objdir/$soname $libobjs $deplibs $linkopts'
else
archive_cmds='$NM $libobjs | $global_symbol_pipe | sed '\''s/.* //'\' | sort | uniq' > $lib.exp~
- $CC -o $objdir/$soname $libobjs $deplibs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry'
- archive_sym_cmds='$CC -o $objdir/$soname $libobjs $deplibs ${wl}-bE:$export_symbols ${wl}-bM:SRE ${wl}-bnoentry'
+ $CC -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry'
+ archive_sym_cmds='$CC -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bM:SRE ${wl}-bnoentry'
hardcode_direct=yes
fi
hardcode_minus_L=yes
# Tell ltmain to make .lib files, not .a files.
libext=lib
# FIXME: Setting linknames here is a bad hack.
- archive_cmds='$CC -o $lib $libobjs `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
# The linker will automatically build a .lib file if we build a DLL.
old_archive_from_new_cmds='true'
# FIXME: Should let the user specify the lib program.
# does not break anything, and helps significantly (at the cost of a little
# extra space).
freebsd2.2*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs /usr/lib/c++rt0.o'
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
hardcode_minus_L=no # verified on 2.2.6
# Unfortunately, older versions of FreeBSD 2 do not have this feature.
freebsd2*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs'
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
hardcode_direct=yes
hardcode_minus_L=yes
hardcode_shlibpath_var=no
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
freebsd*)
- archive_cmds='$CC -shared -o $lib $libobjs $deplibs'
+ archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
hardcode_minus_L=no
;;
hpux9*)
- archive_cmds='$rm $objdir/$soname~$LD -b +s +b $install_libdir -o $objdir/$soname $libobjs $deplibs~test $objdir/$soname = $lib || mv $objdir/$soname $lib'
+ archive_cmds='$rm $objdir/$soname~$LD -b +s +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib'
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_direct=yes
hardcode_minus_L=yes
;;
hpux10* | hpux11*)
- archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib $libobjs $deplibs'
+ archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib $libobjs $deplibs $linkopts'
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_direct=yes
hardcode_minus_L=yes
irix5* | irix6*)
if test "$with_gcc" = yes; then
- archive_cmds='$CC -shared -o $lib ${wl}-soname ${wl}$soname ${wl}-set_version ${wl}$verstring $libobjs $deplibs'
+ archive_cmds='$CC -shared -o $lib ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` $libobjs $deplibs $linkopts'
else
- archive_cmds='$LD -shared -o $lib -soname $soname -set_version $verstring $libobjs $deplibs'
+ archive_cmds='$LD -shared -o $lib -soname $soname `test -n "$verstring" && echo -set_version $verstring` $libobjs $deplibs $linkopts'
fi
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
;;
netbsd*)
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs' # a.out
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' # a.out
else
- archive_cmds='$LD -shared -o $lib $libobjs $deplibs' # ELF
+ archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts' # ELF
fi
hardcode_libdir_flag_spec='${wl}-R$libdir'
hardcode_direct=yes
;;
openbsd*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs'
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
hardcode_shlibpath_var=no
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
allow_undefined_flag=unsupported
- archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $objdir/$libname.def'
+ archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $linkopts $objdir/$libname.def'
old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def'
;;
osf3* | osf4*)
if test "$with_gcc" = yes; then
allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared${allow_undefined_flag} -o $lib ${wl}-soname ${wl}$soname ${wl}-set_version ${wl}$verstring $libobjs $deplibs'
+ archive_cmds='$CC -shared${allow_undefined_flag} -o $lib ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` $libobjs $deplibs $linkopts'
else
allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring $libobjs $deplibs'
+ archive_cmds='$LD -shared${allow_undefined_flag} -o $lib -soname $soname `test -n "$verstring" && echo -set_version $verstring` $libobjs $deplibs $linkopts'
fi
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
sco3.2v5*)
- archive_cmds='$LD -G -o $lib $libobjs $deplibs'
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts'
hardcode_direct=yes
;;
no_undefined_flag=' -z text'
# $CC -shared without GNU ld will not create a library from C++
# object files and a static libstdc++, better avoid it by now
- archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs'
- archive_sym_cmds='$echo "{ global:" > $lib.exp~sed $export_symbols -e "s/.*/\1;/" >> $lib.exp~$echo "local: * }" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $export_symbols -h $soname -o $lib $libobjs $deplibs~$rm $lib.exp'
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts'
+ archive_sym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_shlibpath_var=no
;;
# Why do we need -Bstatic? To avoid inter-library dependencies, maybe...
if test "$with_gcc" = yes; then
# Use -fPIC here because libgcc is multilibbed
- archive_cmds='$CC -shared ${wl}-Bstatic -fPIC -o $lib $libobjs $deplibs'
+ archive_cmds='$CC -shared ${wl}-Bstatic -fPIC -o $lib $libobjs $deplibs $linkopts'
else
- archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs'
+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts'
fi
hardcode_libdir_flag_spec='-L$libdir'
hardcode_direct=yes
;;
sysv4.3*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs'
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
hardcode_direct=no
hardcode_minus_L=no
hardcode_shlibpath_var=no
;;
uts4*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs'
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
hardcode_libdir_flag_spec='-L$libdir'
hardcode_direct=no
hardcode_minus_L=no
;;
dgux*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs'
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
hardcode_libdir_flag_spec='-L$libdir'
hardcode_direct=no
hardcode_minus_L=no
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
soname_spec='${libname}.so'
finish_cmds='PATH="$PATH:/sbin" ldconfig $libdir'
shlibpath_var=LD_LIBRARY_PATH
- check_shared_deplibs_method='file_magic ELF 32-bit LSB shared object'
+ deplibs_check_method='file_magic ELF 32-bit LSB shared object'
sys_lib_search_path="/shlib /usr/lib /usr/local/lib"
;;
# link against other versions.
dynamic_linker="$host_os dld.sl"
version_type=sunos
+ need_lib_prefix=no
+ need_version=no
shlibpath_var=SHLIB_PATH
library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
soname_spec='${libname}${release}.sl$major'
irix5*)
version_type=osf
soname_spec='${libname}${release}.so'
- library_names_spec='${libname}${release}.so$versuffix $libname.so'
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
shlibpath_var=LD_LIBRARY_PATH
+ deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" # or should it be pass_all?
+ file_magic_command=file
;;
irix6*)
version_type=osf
+ need_lib_prefix=no
+ need_version=no
soname_spec='${libname}${release}.so'
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
- shlibpath_var=LD_LIBRARYN32_PATH
+ case "$LD" in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
+ deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" # or should it be pass_all?
+ file_magic_command=file
;;
# No shared lib support for Linux oldld, aout, or coff.
openbsd*)
version_type=sunos
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ need_version=no
+ fi
library_names_spec='${libname}${release}.so$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
shlibpath_var=LD_LIBRARY_PATH
library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
shlibpath_var=LD_LIBRARY_PATH
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
need_version=yes
;;
uts4*)
version_type=linux
- library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so$major $libname.so'
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
soname_spec='${libname}${release}.so$major'
shlibpath_var=LD_LIBRARY_PATH
;;
dgux*)
version_type=linux
+ need_lib_prefix=no
+ need_version=no
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
soname_spec='${libname}${release}.so$major'
shlibpath_var=LD_LIBRARY_PATH
fi
LTSHELL="$SHELL"
+LTCONFIG_VERSION="$VERSION"
+
# Only quote variables if we're using ltmain.sh.
case "$ltmain" in
*.sh)
# Now quote all the things that may contain metacharacters.
for var in ltecho old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \
- old_LN_S old_DLLTOOL old_AS AR CC LD LN_S NM LTSHELL VERSION \
+ old_LN_S old_DLLTOOL old_AS AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \
reload_flag reload_cmds wl \
pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
- whole_archive_flag_spec libname_spec library_names_spec soname_spec \
+ thread_safe_flag_spec whole_archive_flag_spec libname_spec \
+ library_names_spec soname_spec \
RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
old_postuninstall_cmds archive_cmds archive_sym_cmds postinstall_cmds postuninstall_cmds \
file_magic_command 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 hardcode_libdir_flag_spec \
+ hardcode_libdir_separator sys_lib_search_path_spec \
compiler_c_o compiler_o_lo need_locks; do
case "$var" in
# debugging $progname, is in ./config.log if it exists.
# The version of $progname that generated this script.
-LTCONFIG_VERSION="$VERSION"
+LTCONFIG_VERSION=$LTCONFIG_VERSION
# Shell to use when invoking shell scripts.
SHELL=$LTSHELL
# Compiler flag to generate shared objects directly from archives.
whole_archive_flag_spec=$whole_archive_flag_spec
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$thread_safe_flag_spec
+
# Library versioning type.
version_type=$version_type
fi
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
- # FIXME: libraries without lib prefix require direct hardcoding
- # i.e. for need_lib_prefix=no we require hardcode_direct=yes
if test -z "$libdir"; then
# It is a libtool convenience library.
deplibs=`$echo "X$deplibs" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
fi
- # FIXME: shlibpath must be set in archive_cmds
-
# Restore the variables
link_dir=$link_dir_save
link_command=$link_command_save
eval cmds=\"$archive_cmds\"
fi
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+ if test -n "$shlibpath"; then
+ eval "export $shlibpath_var='$shlibpath\$$shlibpath_var'"
+ fi
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
# Delete the old output file.
$run $rm $output
- if test -n "$compile_shlibpath"; then
- compile_command="$shlibpath_var=\"$compile_shlibpath\$$shlibpath_var\" $compile_command"
+ if test -n "$shlibpath"; then
+ compile_command="$shlibpath_var=\"$shlibpath\$$shlibpath_var\" $compile_command"
fi
if test -n "$runpath_var"; then
link_command=\"$link_command\"
link_dir=\"$link_dir\"\
"
+
+ $rm "$output_objdir/$outputname"i
+ sed -e 's/^installed=no$/installed=yes/' \
+ -e "s%^dependency_libs=\(.*\)%dependency_libs='$newdependency_libs'%" \
+ -e 's/^link_\(.*\)//' \
+ < "$output" > "$output_objdir/$outputname"i || exit 1
fi
# Do a symbolic link so that the libtool archive can be found in
done
IFS="$save_ifs"
fi
-
+
# Replace all uninstalled libtool libraries with the installed ones
newdependency_libs=
for deplib in $dependency_libs; do
;;
esac
done
-
+
# Install the pseudo-library for information purposes.
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
instname="$dir/$name"i
- $show "Creating $instname"
- $rm "$instname"
- sed -e 's/^installed=no$/installed=yes/' \
- -e "s%^dependency_libs=\(.*\)%dependency_libs='$newdependency_libs'%" \
- -e 's/^link_\(.*\)//' "$file" > "$instname"
$show "$install_prog $instname $destdir/$name"
$run eval "$install_prog $instname $destdir/$name" || exit $?
- $show "$rm $instname"
- $rm "$instname"
# Maybe install the static library, too.
test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
noinst_HEADERS = foo.h
-bin_PROGRAMS = mdemo mdemo.debug
+bin_PROGRAMS = mdemo mdemo.static
-../libltdl/libltdlc.la: ../libtool ../libltdl/libtool \
+../libltdl/libltdl.la: ../libtool ../libltdl/libtool \
$(srcdir)/../libltdl/ltdl.c $(srcdir)/../libltdl/ltdl.h
- (cd ../libltdl; $(MAKE) libltdlc.la)
+ (cd ../libltdl; $(MAKE) libltdl.la)
# Without the following line, the check may fail if libltdl/libtool is
# removed after libltdl is configured
../libltdl/libtool:
mdemo_LDFLAGS = -export-dynamic ## FIXME: remove this when libtool and libltdl
## handle dependencies of modules
## The quotes around -dlopen below fool automake into accepting it
-mdemo_LDADD = ../libltdl/libltdlc.la "-dlopen" foo1.la "-dlopen" libfoo2.la
-mdemo_DEPENDENCIES = ../libltdl/libltdlc.la foo1.la libfoo2.la
-
-# Create an easier-to-debug version of mdemo.
-mdemo_debug_SOURCES = $(mdemo_SOURCES)
-mdemo_debug_LDFLAGS = $(STATIC) $(mdemo_LDFLAGS)
-mdemo_debug_LDADD = $(mdemo_LDADD)
-mdemo_debug_DEPENDENCIES = $(mdemo_DEPENDENCIES)
+mdemo_LDADD = ../libltdl/libltdl.la "-dlopen" foo1.la "-dlopen" libfoo2.la
+mdemo_DEPENDENCIES = ../libltdl/libltdl.la 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)
echo "Executing uninstalled programs in ../demo"
status=0
-if ../demo/hell.debug| grep 'Welcome to GNU Hell'; then :
+if ../demo/hell.static| grep 'Welcome to GNU Hell'; then :
else
- echo "$0: cannot execute ../demo/hell.debug" 1>&2
+ echo "$0: cannot execute ../demo/hell.static" 1>&2
status=1
fi
echo "= Executing installed programs"
status=0
-if $prefix/bin/hell.debug | grep 'Welcome to GNU Hell'; then :
+if $prefix/bin/hell.static | grep 'Welcome to GNU Hell'; then :
else
- echo "$0: cannot execute $prefix/bin/hell.debug" 1>&2
+ echo "$0: cannot execute $prefix/bin/hell.static" 1>&2
status=1
fi
if $prefix/bin/hell | grep 'GNU Hell'; then :
else
- echo "$0: warning: cannot execute $prefix/bin/hell" 1>&2
+ echo "$0: cannot execute $prefix/bin/hell" 1>&2
+ exit 1
fi
echo "= Running make uninstall in ../demo"
#! /bin/sh
-# mdemo-conf.test - try configuring the ../libltdl and ../mdemo subdirectories
+# mdemo-conf.test - try configuring the ../mdemo subdirectory
# Test script header.
need_prefix=yes
echo "Executing uninstalled programs in ../mdemo"
status=0
-if ../mdemo/mdemo.debug ../mdemo/foo1.la ../mdemo/libfoo2.la; then :
+if ../mdemo/mdemo.static ../mdemo/foo1.la ../mdemo/libfoo2.la; then :
else
- echo "$0: cannot execute ../mdemo/mdemo.debug" 1>&2
+ echo "$0: cannot execute ../mdemo/mdemo.static" 1>&2
status=1
fi
echo "= Executing installed programs"
status=0
-if $prefix/bin/mdemo.debug $prefix/lib/foo1.la $prefix/lib/libfoo2.la; then :
+if $prefix/bin/mdemo.static $prefix/lib/foo1.la $prefix/lib/libfoo2.la; then :
else
- echo "$0: cannot execute $prefix/bin/mdemo.debug" 1>&2
+ echo "$0: cannot execute $prefix/bin/mdemo.static" 1>&2
status=1
fi
#! /bin/sh
-# mdemo-conf.test - try configuring the ../libltdl and ../mdemo subdirectories
+# mdemo-conf.test - try configuring the ../mdemo subdirectory
# Test script header.
need_prefix=yes
#! /bin/sh
-# mdemo-conf.test - try configuring the ../libltdl and ../mdemo subdirectories
+# mdemo-conf.test - try configuring the ../mdemo subdirectory
# Test script header.
need_prefix=yes
# Try running the program.
echo "= Executing uninstalled programs"
-if ./hell.debug | grep 'GNU Hell'; then :
+if ./mdemo.static foo1.la libfoo2.la; then :
else
- echo "$0: cannot execute ./hell.debug" 1>&2
+ echo "$0: cannot execute ./mdemo.static" 1>&2
exit 1
fi
-if ./hell | grep 'GNU Hell'; then :
+if ./mdemo foo1.la libfoo2.la; then :
else
- echo "$0: cannot execute ./hell" 1>&2
+ echo "$0: cannot execute ./mdemo" 1>&2
exit 1
fi
make install || exit 1
echo "= Executing installed programs"
-if $prefix/bin/hell.debug | grep 'GNU Hell'; then :
+if $prefix/bin/mdemo.static $prefix/lib/foo1.la $prefix/lib/libfoo2.la; then :
else
- echo "$0: cannot execute $prefix/bin/hell.debug" 1>&2
+ echo "$0: cannot execute $prefix/bin/mdemo.static" 1>&2
exit 1
fi
-if $prefix/bin/hell | grep 'GNU Hell'; then :
+if $prefix/bin/mdemo $prefix/lib/foo1.la $prefix/lib/libfoo2.la; then :
else
- echo "$0: warning: cannot execute $prefix/bin/hell" 1>&2
+ echo "$0: cannot execute $prefix/bin/mdemo" 1>&2
+ exit 1
fi
echo "= Running make uninstall in ../mdemo"