+1999-02-25 Thomas Tanner <tanner@gmx.de>
+
+ * updated to HEAD
+ * libtool.m4: added the macros AC_ENABLE/DISABLE_FAST_INSTALL
+ for optional fast installation
+ * ltconfig.in: added new flag --enable-fast-install
+
1999-02-21 Thomas Tanner <tanner@gmx.de>
* depdemo: moved each library into a subdirectory
Bruno Haible <haible@ilog.fr>
Carl D. Roth <roth@cse.ucsc.edu>
Chris P. Ross <cross@eng.us.uu.net>
+DJ Delorie <dj@delorie.com>
Edouard G. Parmelan <Edouard.Parmelan@France.NCR.COM>
Eric Estievenart <eric@via.ecp.fr>
Erez Zadok <ezk@shekel.mcl.cs.columbia.edu>
-For next public release:
-************************
+For next alpha release:
+***********************
-* Create a new library version_type, `irix'. Janos Farkas writes:
+* Fast installation (linking on demand in the build tree)
+must be optional.
-I just realized I also have mortal access to an SGI system, and found
-this in the dso.5 page, this looks more informative :)
+* check whether the version of libtool.m4 is compatible
+with ltconfig/ltmain.sh
- Versioning of Shared Objects.
+* libltdl is broken when configured with --enable-ltdl-install
- QUICK OVERVIEW
+* check whether the "file" command is available
- For a shared object to be versioned the following needs to be done:
+* update the NEWS file
- * Version strings consist of 3 parts and a dot: The string "sgi",
- a decimal number (the major number), a dot, and a decimal number
- (the minor number).
-
- * Add the command -set_version sgi1.0 to the command to build
- the shared object (cc -shared, ld -shared, etc.).
+* 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.
- * Whenever you make a COMPATIBLE change update the minor version
- number (the one after the dot), and add the latest version string
- to colon-separated list of version strings, e.g., -set_version
- sgi1.0:sgi1.1:sgi1.3
+For next public release:
+************************
- * Whenever you make an INCOMPATIBLE change, update the
- major version number. Pass this as the version list, e.g.,
- -set_version sgi2.0. Change the filename of the OLD shared object
- by adding a dot followed by the previous major number to the filename
- of the shared object. DO NOT CHANGE the soname of the object.
- No change to the file contents are necessary or desirable. Simply
- rename the file.
+* 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.
+Thomas Tanner has a patch for this.
-* Inter-library dependencies should be fully tracked by libtool.
-Reminded by Alexandre Oliva. This requires looking up installed
-libtool libraries for transparent support.
+* Alexandre Oliva suggests that we should have an option to hardcode
+paths into libraries, as well as binaries: `... -Wl,-soname
+-Wl,/tmp/libtest.so.0 ...'. Tim Mooney wants the same thing.
-* Inter-library dependencies need to work for ltlibraries too.
-Thomas Tanner has a patch for this.
+* Lists of exported symbols should be stored in the pseudo library
+so that the size of lt_preloaded_symbols can be reduced.
-* Alexandre Oliva suggests that we hardcode paths into libraries, as
-well as binaries: `... -Wl,-soname -Wl,/tmp/libtest.so.0 ...'. Tim
-Mooney wants the same thing.
+* 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
+ libltdl unusable, it restricts its usefulness and puts an
+ unnecessary burden on the user.
-* 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.
+ As a remedy, I'd recommend to replace those functions with functions
+ that POSIX says are async-signal-safe, such as open, read, close.
+ This will require you to handle interrupted system calls and implement
+ fgets, but the former isn't hard and there's plenty of implementations
+ out from which you can steal the latter.
-* Jeff Garzik <jgarzik@pobox.com> noticed that libtool wrapper scripts do
-not always work on Linux. When running tests in a newly built package, the
-script is prone to picking up a similarly sonamed library in /usr/lib in
-preference to the newly built library in the distribution. The scripts *do*
-work under Solaris however.
+ I believe relying on async-signal-safe functions to the greatest extent
+ 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:
**************
rm -f acinclude.m4
cp ../libtool.m4 acinclude.m4
aclocal
- autoheader
+ test "$sub" = libltdl && autoheader
automake --gnits --add-missing
autoconf
cd ..
#
AUTOMAKE_OPTIONS = no-dependencies foreign
-INCLUDES = -I$(srcdir)/../libltdl
-
EXTRA_DIST = acinclude.m4
-noinst_LTLIBRARIES = libfoo1.la
+noinst_LTLIBRARIES = libfoo.la
-libfoo1_la_SOURCES = foo1.c
+libfoo_la_SOURCES = foo.c
noinst_HEADERS = foo.h
bin_PROGRAMS = cdemo
cdemo_SOURCES = main.c
-cdemo_LDADD = libfoo1.la $(LIBADD_M)
+cdemo_LDADD = libfoo.la
AC_CHECK_HEADERS(math.h)
-AC_CHECK_LIB(m, cos, LIBADD_M="-lm", LIBADD_M=)
-AC_SUBST(LIBADD_M)
+AC_CHECK_LIBM
dnl Output the makefile
AC_OUTPUT(Makefile)
-/* foo1.c -- trivial test library
+/* foo.c -- trivial test library
Copyright (C) 1998-1999 Free Software Foundation, Inc.
Originally by Thomas Tanner <tanner@gmx.de>
This file is part of GNU Libtool.
#include <math.h>
#endif
-/* exported functions */
-
int
-foo1()
+foo()
{
printf ("cos (0.0) = %g\n", (double) cos ((double) 0.0));
return FOO_RET;
int
hello()
{
- printf ("** This is foolib 1 **\n");
+ printf ("** This is libfoo **\n");
return HELLO_RET;
}
if (value == HELLO_RET)
printf("hello is ok!\n");
- if (foo1 () == FOO_RET)
- printf("foo1 is ok!\n");
+ if (foo () == FOO_RET)
+ printf("foo is ok!\n");
return 0;
}
# Build a libtool library, libhello.la for installation in libdir.
lib_LTLIBRARIES = libhello.la
libhello_la_SOURCES = hello.c foo.c
-libhello_la_LDFLAGS = -version-info 3:12:1 $(LIBADD_M)
+libhello_la_LDFLAGS = -version-info 3:12:1
include_HEADERS = foo.h
AC_CHECK_HEADERS(string.h math.h)
-AC_CHECK_LIB(m, cos, LIBADD_M="-lm", LIBADD_M=)
-AC_SUBST(LIBADD_M)
+AC_CHECK_LIBM
dnl Output the makefile
AC_OUTPUT(Makefile)
/* In an ideal world a shared lib would be able to export data */
pnothing = (int*)¬hing;
#endif
-
} else
printf ("found file: %s\n", s->name);
s ++;
AC_CHECK_HEADERS(math.h)
-AC_CHECK_LIB(m, cos, LIBADD_M="-lm", LIBADD_M=)
-AC_SUBST(LIBADD_M)
+AC_CHECK_LIBM
dnl Output the makefile
AC_OUTPUT(
Using libltdl
-* Libltdl's interface:: How to use libltdl in your programs.
+* Libltdl interface:: How to use libltdl in your programs.
* Modules for libltdl:: Creating modules that can be @code{dlopen}ed.
* Distributing libltdl:: How to distribute libltdl with your package.
@item -export-symbols @var{symfile}
Tells the linker to export only the symbols listed in @var{symfile}.
The symbol file should end in @samp{.sym} and must contain the name of one
-symbol per line. This option does not work for modules and is not
-supported on all platforms.
+symbol per line. This option has no effect on some platforms.
+By default all symbols are exported.
+
+@item -export-symbols-regex @var{regex}
+Same as @samp{-export-symbols}, except that only symbols matching
+the regular expression @var{regex} are exported.
By default all symbols are exported.
@item -L@var{libdir}
@end itemize
@menu
-* Libltdl's interface:: How to use libltdl in your programs.
+* Libltdl interface:: How to use libltdl in your programs.
* Modules for libltdl:: Creating modules that can be @code{dlopen}ed.
* Distributing libltdl:: How to distribute libltdl with your package.
@end menu
-@node Libltdl's interface
+@node Libltdl interface
@section How to use libltdl in your programs
@noindent
-Libltdl's API is similar to the dlopen interface of Solaris and Linux,
+The libltdl API is similar to the dlopen interface of Solaris and Linux,
which is very simple but powerful.
@noindent
The basic architecture is this: in @file{ltconfig.in}, the person who
writes libtool makes sure @samp{$deplibs}, or @samp{$compile_dependencylibs}
are included in @samp{$archive_cmds} somewhere and also sets the
-@samp{$deplibs_check_method}, and maybe @samp{$file_magic_command} when
+@samp{$deplibs_check_method}, and maybe @samp{$file_magic_cmd} when
@samp{deplibs_check_method} is file_magic.
@samp{deplibs_check_method} can be one of five things:
@table @samp
@item file_magic [@var{regex}]
@vindex file_magic
-@vindex file_magic_command
+@vindex file_magic_cmd
looks in the library link path for libraries that have the right
-libname. Then it runs @samp{$file_magic_command} on the library and
+libname. Then it runs @samp{$file_magic_cmd} on the library and
checks for a match against @samp{regex} using @code{egrep}.
@item test_compile
inlines the contents of @code{ltmain.sh} into the generated
@code{libtool}, which improves performance on many systems.
+The convention used for naming variables which hold shell commands for
+delayed evaluation, is to use the suffix @code{_cmd} where a single
+line of valid shell script is needed, and the suffix @code{_cmds} where
+multiple lines of shell script @strong{may} be delayed for later
+evaluation. By convention, @code{_cmds} variables delimit the
+evaluation units with the @code{~} character where necessary.
+
Here is a listing of each of the configuration variables, and how they
are used within @code{ltmain.sh}:
aren't defined in that library.
@end defvar
+@defvar always_export_symbols
+Whether libtool should automatically generate a list of exported symbols
+using @var{export_symbols_cmds} before linking an archive.
+Set to @samp{yes} or @samp{no}. Default is @samp{no}
+@end defvar
+
@defvar archive_cmds
-@defvarx archive_sym_cmds
+@defvarx archive_expsym_cmds
@defvarx old_archive_cmds
Commands used to create shared and static libraries, respectively.
-@samp{archive_sym_cmds} is used when -export-symbols was defined.
+@samp{archive_expsym_cmds} is used when -export-symbols was defined.
@end defvar
@defvar old_archive_from_new_cmds
Set to @samp{yes} or @samp{no}.
@end defvar
+@defvar dlopen
+Whether @code{dlopen} is supported on the platform.
+Set to @samp{yes} or @samp{no}.
+@end defvar
+
+@defvar dlopen_self
+Whether it is possible to @code{dlopen} the executable itself.
+Set to @samp{yes} or @samp{no}.
+@end defvar
+
@defvar echo
An @code{echo} program which does not interpret backslashes as an
escape character.
@end defvar
+@defvar exclude_expsyms
+List of symbols that should not be listed in the preloaded symbols.
+@end defvar
+
@defvar export_dynamic_flag_spec
Compiler link flag that allows a dlopened shared library to reference
symbols that are defined in the program.
@end defvar
+@defvar export_symbols_cmds
+Commands to extract exported symbols from @var{libobjs} to the
+file @var{export_symbols}.
+@end defvar
+
@defvar finish_cmds
Commands to tell the dynamic linker how to find shared libraries in a
specific directory.
the system that libtool was configured for.
@end defvar
+@defvar include_expsyms
+List of symbols that must always be exported when using @var{export_symbols}.
+@end defvar
+
@defvar libext
The standard old archive suffix (normally "a").
@end defvar
Set to @samp{yes} or @samp{no}. By default, it is @samp{unknown}, which
means the same as @samp{yes}, but documents that we are not really sure
about it.
+@samp{yes} means that it is possible both to @code{dlopen} and to
+link against a library wihthout 'lib' prefix,
+i.e. it requires @var{hardcode_direct} to be @samp{yes}.
@end defvar
@defvar need_version
hardcode in the resulting executable.
@end defvar
+@defvar shlibpath_overrides_runpath
+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.
+@end defvar
+
@defvar shlibpath_var
The environment variable that tells the dynamic linker where to find
shared libraries.
rm -f conftest
])
if test -n "$libltdl_cv_shlibext"; then
- AC_DEFINE_UNQUOTED(LTDL_SHLIB_EXT, "$libltdl_cv_shlibext")
+ AC_DEFINE_UNQUOTED(LTDL_SHLIB_EXT, "$libltdl_cv_shlibext",
+ [Define to the extension used for shared libraries, say, ".so". ])
fi
AC_CACHE_CHECK([which variable specifies run-time library path],
rm -f conftest
])
if test -n "$libltdl_cv_shlibpath_var"; then
- AC_DEFINE_UNQUOTED(LTDL_SHLIBPATH_VAR, "$libltdl_cv_shlibpath_var")
+ AC_DEFINE_UNQUOTED(LTDL_SHLIBPATH_VAR, "$libltdl_cv_shlibpath_var",
+ [Define to the name of the environment variable that determines the dynamic library search path. ])
fi
AC_CACHE_CHECK([for objdir],
rm -f conftest
])
test -z "$libltdl_cv_objdir" && libltdl_cv_objdir=".libs"
-AC_DEFINE_UNQUOTED(LTDL_OBJDIR, "$libltdl_cv_objdir/")
+AC_DEFINE_UNQUOTED(LTDL_OBJDIR, "$libltdl_cv_objdir/",
+ [Define to the sub-directory in which libtool stores uninstalled libraries. ])
AC_HEADER_STDC
-AC_CHECK_HEADERS(malloc.h memory.h stdlib.h stdio.h ctype.h dlfcn.h dl.h)
+AC_CHECK_HEADERS(malloc.h memory.h stdlib.h stdio.h ctype.h dlfcn.h dl.h dld.h)
AC_CHECK_HEADERS(string.h strings.h, break)
AC_CHECK_FUNCS(strdup strchr strrchr index rindex)
rm -f conftest
])
if test x"$libltdl_cv_preloaded_symbols" = x"yes"; then
- AC_DEFINE(HAVE_PRELOADED_SYMBOLS)
+ AC_DEFINE(HAVE_PRELOADED_SYMBOLS, 1,
+ [Define if libtool can extract symbol lists from object files. ])
fi
test_dlerror=no
LIBADD_DL=
-AC_CHECK_FUNCS(dlopen, [AC_DEFINE(HAVE_LIBDL) test_dlerror=yes],
- [AC_CHECK_LIB(dl, dlopen, [AC_DEFINE(HAVE_LIBDL) LIBADD_DL="-ldl" test_dlerror=yes],
- [AC_CHECK_LIB(dld, dld_link, [AC_DEFINE(HAVE_DLD) LIBADD_DL="-ldld"],
- [AC_CHECK_FUNCS(shl_load, AC_DEFINE(HAVE_SHL_LOAD))]
+AC_CHECK_FUNCS(dlopen, [AC_DEFINE(HAVE_LIBDL, 1,
+ [Define if you have the libdl library or equivalent. ]) test_dlerror=yes],
+ [AC_CHECK_LIB(dl, dlopen, [AC_DEFINE(HAVE_LIBDL, 1,
+ [Define if you have the libdl library. ]) dnl
+ LIBADD_DL="-ldl" test_dlerror=yes],
+ [AC_CHECK_LIB(dld, dld_link, [AC_DEFINE(HAVE_DLD, 1,
+ [Define if you have the GNU dld library. ]) dnl
+ LIBADD_DL="-ldld"],
+ [AC_CHECK_FUNCS(shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1,
+ [Define if you have the shl_load function. ])])]
)]
)]
)
fi
if test x"$libltdl_cv_need_uscore" = xyes; then
- AC_DEFINE(NEED_USCORE)
+ AC_DEFINE(NEED_USCORE, 1,
+ [Define if dlsym() requires a leading underscode in symbol names. ])
fi
dnl Output the makefile
static const char *last_error = 0;
+lt_ptr_t (*lt_dlmalloc) __P((size_t size)) = malloc;
+void (*lt_dlfree) __P((lt_ptr_t ptr)) = free;
+
typedef struct lt_dltype_t {
struct lt_dltype_t *next;
const char *sym_prefix; /* prefix for symbols */
int (*lib_open) __P((lt_dlhandle handle, const char *filename));
int (*lib_close) __P((lt_dlhandle handle));
lt_ptr_t (*find_sym) __P((lt_dlhandle handle, const char *symbol));
-} lt_dltype_t, *lt_dltype;
+} lt_dltype_t;
#define LTDL_TYPE_TOP 0
if (!str)
return str;
- tmp = (char*) malloc(strlen(str)+1);
+ tmp = (char*) lt_dlmalloc(strlen(str)+1);
if (tmp)
strcpy(tmp, str);
return tmp;
/* dynamic linking with dld */
+#if HAVE_DLD_H
+#include <dld.h>
+#endif
+
static int
dld_init ()
{
{
handle->handle = strdup(filename);
if (!handle->handle) {
- last_error = no_memory_error;
+ last_error = memory_error;
return 1;
}
if (dld_link(filename) != 0) {
last_error = unknown_error;
- free(handle->handle);
+ lt_dlfree(handle->handle);
return 1;
}
return 0;
last_error = unknown_error;
return 1;
}
- free(handle->filename);
+ lt_dlfree(handle->filename);
return 0;
}
lt_dlsymlists_t *tmp = lists;
lists = lists->next;
- free(tmp);
+ lt_dlfree(tmp);
}
preloaded_symbols = 0;
return 0;
lists = lists->next;
}
- tmp = (lt_dlsymlists_t*) malloc(sizeof(lt_dlsymlists_t));
+ tmp = (lt_dlsymlists_t*) lt_dlmalloc(sizeof(lt_dlsymlists_t));
if (!tmp) {
last_error = memory_error;
return 1;
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;
- }
- }
+ if (!filename)
+ filename = "@PROGRAM@";
while (lists) {
const lt_dlsymlist *syms = lists->syms;
syms++;
while (syms->address) {
- if (syms->address && strcmp(syms->name, symbol) == 0)
+ if (strcmp(syms->name, symbol) == 0)
return syms->address;
syms++;
}
static lt_dlhandle handles = 0;
static int initialized = 0;
-static lt_dltype types = LTDL_TYPE_TOP;
+static lt_dltype_t *types = LTDL_TYPE_TOP;
#undef LTDL_TYPE_TOP
int
lt_dlinit ()
{
/* initialize libltdl */
- lt_dltype *type = &types;
+ lt_dltype_t **type = &types;
int typecount = 0;
if (initialized) { /* Initialize only at first call. */
lt_dlexit ()
{
/* shut down libltdl */
- lt_dltype type = types;
+ lt_dltype_t *type = types;
int errors;
if (!initialized) {
const char *filename;
{
lt_dlhandle cur;
- lt_dltype type = types;
+ lt_dltype_t *type = types;
const char *saved_error = last_error;
/* check whether the module was already opened */
}
if (!type) {
if (cur->filename)
- free(cur->filename);
+ lt_dlfree(cur->filename);
return 1;
}
cur->type = type;
if (installed && libdir) {
int ret;
char *filename = (char*)
- malloc(strlen(libdir)+1+strlen(dlname)+1);
+ lt_dlmalloc(strlen(libdir)+1+strlen(dlname)+1);
if (!filename) {
last_error = memory_error;
strcat(filename, "/");
strcat(filename, dlname);
ret = tryall_dlopen(handle, filename) == 0;
- free(filename);
+ lt_dlfree(filename);
if (ret)
return 0;
}
if (!installed) {
int ret;
char *filename = (char*)
- malloc((dir ? strlen(dir) : 0)
+ lt_dlmalloc((dir ? strlen(dir) : 0)
+ strlen(objdir) + strlen(dlname) + 1);
if (!filename) {
strcat(filename, dlname);
ret = tryall_dlopen(handle, filename) == 0;
- free(filename);
+ lt_dlfree(filename);
if (ret)
return 0;
}
{
int ret;
char *filename = (char*)
- malloc((dir ? strlen(dir) : 0)
+ lt_dlmalloc((dir ? strlen(dir) : 0)
+ strlen(dlname) + 1);
if (dir)
strcpy(filename, dir);
*filename = 0;
strcat(filename, dlname);
ret = tryall_dlopen(handle, filename) == 0;
- free(filename);
+ lt_dlfree(filename);
if (ret)
return 0;
}
continue;
if (lendir + 1 + lenbase >= filenamesize) {
if (filename)
- free(filename);
+ lt_dlfree(filename);
filenamesize = lendir + 1 + lenbase + 1;
- filename = (char*) malloc(filenamesize);
+ filename = (char*) lt_dlmalloc(filenamesize);
if (!filename) {
last_error = memory_error;
return 0;
strcpy(filename+lendir, basename);
if (handle) {
if (tryall_dlopen(handle, filename) == 0) {
- free(filename);
+ lt_dlfree(filename);
return (lt_ptr_t) handle;
}
} else {
FILE *file = fopen(filename, LTDL_READTEXT_MODE);
if (file) {
if (*pdir)
- free(*pdir);
+ lt_dlfree(*pdir);
filename[lendir] = '\0';
*pdir = strdup(filename);
if (!*pdir) {
memory overhead. */
*pdir = filename;
} else
- free(filename);
+ lt_dlfree(filename);
return (lt_ptr_t) file;
}
}
}
if (filename)
- free(filename);
+ lt_dlfree(filename);
last_error = file_not_found_error;
return 0;
}
int len = strlen(s);
if (*dest)
- free(*dest);
+ lt_dlfree(*dest);
if (len > 3 && s[0] == '\'') {
- tmp = (char*) malloc(i - s);
+ tmp = (char*) lt_dlmalloc(i - s);
if (!tmp) {
last_error = memory_error;
return 1;
char *deplibs;
{
if (dir)
- free(dir);
+ lt_dlfree(dir);
if (name)
- free(name);
+ lt_dlfree(name);
if (dlname)
- free(dlname);
+ lt_dlfree(dlname);
if (oldname)
- free(oldname);
+ lt_dlfree(oldname);
if (libdir)
- free(libdir);
+ lt_dlfree(libdir);
if (deplibs)
- free(deplibs);
+ lt_dlfree(deplibs);
return 0;
}
char *dir = 0, *name = 0;
if (!filename) {
- handle = (lt_dlhandle) malloc(sizeof(lt_dlhandle_t));
+ handle = (lt_dlhandle) lt_dlmalloc(sizeof(lt_dlhandle_t));
if (!handle) {
last_error = memory_error;
return 0;
}
handle->usage = 0;
+ handle->depcount = 0;
+ handle->deplibs = 0;
newhandle = handle;
- if (tryall_dlopen(handle, 0) != 0) {
- free(newhandle);
+ if (tryall_dlopen(&newhandle, 0) != 0) {
+ lt_dlfree(handle);
return 0;
}
- if (newhandle != handle)
- free(newhandle);
- return handle;
+ goto register_handle;
}
basename = strrchr(filename, '/');
if (basename) {
basename++;
- dir = (char*) malloc(basename - filename + 1);
+ dir = (char*) lt_dlmalloc(basename - filename + 1);
if (!dir) {
last_error = memory_error;
return 0;
int installed = 1;
/* extract the module name from the file name */
- name = (char*) malloc(ext - basename + 1);
+ name = (char*) lt_dlmalloc(ext - basename + 1);
if (!name) {
last_error = memory_error;
if (dir)
- free(dir);
+ lt_dlfree(dir);
return 0;
}
/* canonicalize the module name */
}
if (!file) {
if (name)
- free(name);
+ lt_dlfree(name);
if (dir)
- free(dir);
+ lt_dlfree(dir);
return 0;
}
/* read the .la file */
}
fclose(file);
/* allocate the handle */
- handle = (lt_dlhandle) malloc(sizeof(lt_dlhandle_t));
+ handle = (lt_dlhandle) lt_dlmalloc(sizeof(lt_dlhandle_t));
if (!handle || error) {
if (handle)
- free(handle);
+ lt_dlfree(handle);
if (!error)
last_error = memory_error;
free_vars(name, dir, dlname, old_name, libdir, deplibs);
} else
error = 1;
if (error) {
- free(handle);
+ lt_dlfree(handle);
free_vars(name, dir, dlname, old_name, libdir, deplibs);
return 0;
}
}
} else {
/* not a libtool module */
- handle = (lt_dlhandle) malloc(sizeof(lt_dlhandle_t));
+ handle = (lt_dlhandle) lt_dlmalloc(sizeof(lt_dlhandle_t));
if (!handle) {
last_error = memory_error;
if (dir)
- free(dir);
+ lt_dlfree(dir);
return 0;
}
handle->usage = 0;
handle->depcount = 0;
handle->deplibs = 0;
newhandle = handle;
- if (tryall_dlopen(&handle, filename)
+ if (tryall_dlopen(&newhandle, filename)
&& (!dir
- || (!find_file(basename, user_search_path, 0, &handle)
+ || (!find_file(basename, user_search_path,
+ 0, &newhandle)
&& !find_file(basename,
getenv("LTDL_LIBRARY_PATH"),
- 0, &handle)
+ 0, &newhandle)
#ifdef LTDL_SHLIBPATH_VAR
&& !find_file(basename,
getenv(LTDL_SHLIBPATH_VAR),
- 0, &handle)
+ 0, &newhandle)
#endif
))) {
- free(handle);
+ lt_dlfree(handle);
if (dir)
- free(dir);
+ lt_dlfree(dir);
return 0;
}
}
+register_handle:
if (newhandle != handle) {
- free(handle);
+ lt_dlfree(handle);
handle = newhandle;
}
if (!handle->usage) {
handle->next = handles;
handles = handle;
} else if (name)
- free(name);
+ lt_dlfree(name);
if (dir)
- free(dir);
+ lt_dlfree(dir);
last_error = saved_error;
return handle;
}
int len;
const char *saved_error = last_error;
- if (!filename) {
- last_error = file_not_found_error;
- return 0;
- }
+ if (!filename)
+ return lt_dlopen(filename);
len = strlen(filename);
if (!len) {
last_error = file_not_found_error;
if (handle)
return handle;
/* try "filename.la" */
- tmp = (char*) malloc(len+4);
+ tmp = (char*) lt_dlmalloc(len+4);
if (!tmp) {
last_error = memory_error;
return 0;
handle = lt_dlopen(tmp);
if (handle) {
last_error = saved_error;
- free(tmp);
+ lt_dlfree(tmp);
return handle;
}
#ifdef LTDL_SHLIB_EXT
/* try "filename.EXT" */
if (strlen(shlib_ext) > 3) {
- free(tmp);
- tmp = (char*) malloc(len + strlen(shlib_ext) + 1);
+ lt_dlfree(tmp);
+ tmp = (char*) lt_dlmalloc(len + strlen(shlib_ext) + 1);
if (!tmp) {
last_error = memory_error;
return 0;
handle = lt_dlopen(tmp);
if (handle) {
last_error = saved_error;
- free(tmp);
+ lt_dlfree(tmp);
return handle;
}
#endif
last_error = file_not_found_error;
- free(tmp);
+ lt_dlfree(tmp);
return 0;
}
handles = handle->next;
error = handle->type->lib_close(handle);
error += unload_deplibs(handle);
- free(handle->filename);
+ if (handle->filename)
+ lt_dlfree(handle->filename);
if (handle->name)
- free(handle->name);
- free(handle);
+ lt_dlfree(handle->name);
+ lt_dlfree(handle);
return error;
}
return 0;
if (lensym + LTDL_SYMBOL_OVERHEAD < LTDL_SYMBOL_LENGTH)
sym = lsym;
else
- sym = (char*) malloc(lensym + LTDL_SYMBOL_OVERHEAD + 1);
+ sym = (char*) lt_dlmalloc(lensym + LTDL_SYMBOL_OVERHEAD + 1);
if (!sym) {
last_error = buffer_overflow_error;
return 0;
address = handle->type->find_sym(handle, sym);
if (address) {
if (sym != lsym)
- free(sym);
+ lt_dlfree(sym);
return address;
}
}
strcpy(sym, symbol);
address = handle->type->find_sym(handle, sym);
if (sym != lsym)
- free(sym);
+ lt_dlfree(sym);
return address;
}
}
} else {
char *new_search_path = (char*)
- malloc(strlen(user_search_path) +
+ lt_dlmalloc(strlen(user_search_path) +
strlen(search_dir) + 1);
if (!new_search_path) {
last_error = memory_error;
}
strcat(new_search_path, ":");
strcat(new_search_path, search_dir);
- free(user_search_path);
+ lt_dlfree(user_search_path);
user_search_path = new_search_path;
}
return 0;
const char *search_path;
{
if (user_search_path)
- free(user_search_path);
+ lt_dlfree(user_search_path);
user_search_path = 0; /* reset the search path */
if (!search_path || !strlen(search_path))
return 0;
#undef __P
#undef lt_ptr_t
#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(WIN32) || defined(__cplusplus)
-# define __P(protos) protos
-# define lt_ptr_t void*
+# define __P(protos) protos
+# define lt_ptr_t void*
#else
-# define __P(protos) ()
-# define lt_ptr_t char*
+# define __P(protos) ()
+# define lt_ptr_t char*
#endif
+#include <stdlib.h>
+
#ifdef _LTDL_COMPILE_
typedef struct lt_dlhandle_t *lt_dlhandle;
#else
extern const lt_dlsymlist lt_preloaded_symbols[];
#define LTDL_SET_PRELOADED_SYMBOLS() lt_dlpreload_default(lt_preloaded_symbols)
+extern lt_ptr_t (*lt_dlmalloc)__P((size_t size));
+extern void (*lt_dlfree)__P((lt_ptr_t ptr));
+
__END_DECLS
#endif /* !_LTDL_H_ */
## configuration script generated by Autoconf, you may include it under
## the same distribution terms that you use for the rest of that program.
-# serial 31 AC_PROG_LIBTOOL
+# serial 32 AC_PROG_LIBTOOL
AC_DEFUN(AC_PROG_LIBTOOL,
[AC_PREREQ(2.12.2)dnl
AC_REQUIRE([AC_ENABLE_SHARED])dnl
AC_REQUIRE([AC_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_DISABLE_FAST_INSTALL])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
libtool_flags=
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 "$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"
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_ENABLE_SHARED - implement the --enable-shared flag
# Usage: AC_ENABLE_SHARED[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
AC_DEFUN(AC_DISABLE_SHARED,
[AC_ENABLE_SHARED(no)])
-# AC_DISABLE_STATIC - set the default static flag to --disable-static
-AC_DEFUN(AC_DISABLE_STATIC,
-[AC_ENABLE_STATIC(no)])
-
# 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
enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
])
+# AC_DISABLE_STATIC - set the default static flag to --disable-static
+AC_DEFUN(AC_DISABLE_STATIC,
+[AC_ENABLE_STATIC(no)])
+
+
+# AC_DISABLE_FAST_INSTALL - implement the --enable-fast-install flag
+# Usage: AC_DISABLE_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_ARG_ENABLE(fast-install,
+changequote(<<, >>)dnl
+<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
+changequote([, ])dnl
+[p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_fast_install=yes ;;
+no) enable_fast_install=no ;;
+*)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac],
+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_PROG_LD - find the path to the GNU or non-GNU linker
AC_DEFUN(AC_PROG_LD,
AC_SUBST(USE_SYMBOL_UNDERSCORE)dnl
])
+# AC_CHECK_LIBM - check for math library
+AC_DEFUN(AC_CHECK_LIBM, [
+AC_CHECK_LIB(mw, _mwvalidcheckl)
+AC_CHECK_LIB(m, cos)
+])
+
dnl old names
AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
# Same as above, but do not quote variable references.
double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
# The name of this program.
progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
enable_shared=yes
# All known linkers require a `.a' archive for static linking.
enable_static=yes
+enable_fast_install=no
+enable_dlopen=unknown
+enable_dlopen_self=unknown
ltmain=
silent=
srcdir=
--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
+ --enable-dlopen enable dlopen support
+ --enable-dlopen-self enable support for dlopening programs
--help display this help and exit
--no-verify do not verify that HOST is a valid host type
-o, --output=FILE specify the output file [default=$default_ofile]
--disable-static) enable_static=no ;;
+ --enable-fast-install) enable_fast_install=yes ;;
+
+ --enable-dlopen) enable_dlopen=yes ;;
+
+ --enable-dlopen-self) enable_dlopen_self=yes ;;
+
--quiet | --silent) silent=yes ;;
--srcdir) prev=srcdir ;;
# 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=
+archive_expsym_cmds=
old_archive_from_new_cmds=
export_dynamic_flag_spec=
whole_archive_flag_spec=
hardcode_minus_L=no
hardcode_shlibpath_var=unsupported
runpath_var=
+always_export_symbols=no
+export_symbols_cmds='$NM $libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
+# include_expsyms should be a list of space-separated symbols to be *always*
+# included in the symbol list
+include_expsyms=
+# exclude_expsyms can be an egrep regular expression of symbols to exclude
+# it will be wrapped by `^(' and `) ', so one must not match beginning or
+# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+# as well as any symbol that contains `d'.
+exclude_expsyms=
case "$host_os" in
aix3* | aix4*)
with_gnu_ld=no
fi
;;
+
+freebsd2* | sunos4*)
+ exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+ ;;
+
esac
ld_shlibs=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 $linkopts'
+ archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
else
ld_shlibs=no
fi
# no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
allow_undefined_flag=unsupported
+ always_export_symbols=yes
- archive_cmds='rm -f $objdir/$soname-ltdll.c~
+ # Extract the symbol export list from an `--export-all' def file,
+ # then regenerate the def file from the symbol export list, so that
+ # the compiled dll only exports the symbol export list.
+ export_symbols_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~
- $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs~
+ $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs~
+ sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols'
+
+ archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~
+ _lt_hint=1;
+ for symbol in `cat $export_symbols`; do
+ echo " \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def;
+ _lt_hint=`expr 1 + \$_lt_hint`;
+ done~
$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-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_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 $linkopts~
$DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_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 $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 $linkopts~
- $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_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 $linkopts~
- $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_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 $linkopts'
+ 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 $linkopts'
- archive_sym_cmds='$CC -shared ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib $libobjs $deplibs $linkopts'
+ archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
ld_shlibs=no
fi
case "$host_os" in
aix3*)
allow_undefined_flag=unsupported
- archive_cmds='$NM $libobjs | $global_symbol_pipe | sed '\''s/.* //'\' | sort | uniq' > $lib.exp~
- $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'
+ always_export_symbols=yes
+ archive_expsym_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
fi
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 $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'
+ always_export_symbols=yes
+ archive_expsym_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
irix5* | irix6*)
if test "$with_gcc" = yes; then
- archive_cmds='$CC -shared -o $lib ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` $libobjs $deplibs $linkopts'
+ archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
else
- archive_cmds='$LD -shared -o $lib -soname $soname `test -n "$verstring" && echo -set_version $verstring` $libobjs $deplibs $linkopts'
+ archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
fi
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
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 `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` $libobjs $deplibs $linkopts'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
else
allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$LD -shared${allow_undefined_flag} -o $lib -soname $soname `test -n "$verstring" && echo -set_version $verstring` $libobjs $deplibs $linkopts'
+ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
fi
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
# $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 $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'
+ archive_expsym_cmds='$echo "{ global:" > $objdir/$lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $objdir/$lib.exp~$echo "local: *; };" >> $objdir/$lib.exp~
+ $LD -G${allow_undefined_flag} -M $objdir/$lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $objdir/$lib.exp'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_shlibpath_var=no
;;
fi
echo "$ac_t$hardcode_action" 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
reload_flag=
reload_cmds='$LD$reload_flag -o $output$reload_objs'
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-file_magic_command=
+file_magic_cmd=
deplibs_check_method='unknown'
# Need to set the preceding variable on all platforms that support
# interlibrary dependencies.
# 'pass_all' -- all dependencies passed with no checks.
# 'test_compile' -- check by making test program.
# 'file_magic [regex]' -- check by looking for files in library path
-# which responds to the $file_magic_command with a given egrep regex.
+# which responds to the $file_magic_cmd with a given egrep regex.
# If you have `file' or equivalent on your system and you're not sure
# whether `pass_all' will *always* work, you probably want this one.
echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
cygwin* | mingw*)
version_type=windows
if test "$with_gcc" = yes; then
- library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
+ library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a'
else
library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
fi
dynamic_linker='Win32 ld.exe'
deplibs_check_method='file_magic file format pei*-i386.*architecture: i386'
- file_magic_command='objdump -f'
+ file_magic_cmd='objdump -f'
need_lib_prefix=no
# FIXME: first we should search . and the directory the executable is in
shlibpath_var=PATH
case "$version_type" in
freebsd-elf*)
deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
- file_magic_command=file
+ file_magic_cmd=file
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
+ need_version=no
+ need_lib_prefix=no
;;
freebsd-*)
deplibs_check_method=unknown
+ library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
+ need_version=yes
;;
esac
- library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
- finish_cmds='PATH="$PATH:/sbin" OBJFORMAT="$objformat" ldconfig -m $libdir'
+ finish_cmds='PATH="$PATH:/sbin" OBJFORMAT="'"$objformat"'" ldconfig -m $libdir'
shlibpath_var=LD_LIBRARY_PATH
- need_version=yes
;;
gnu*)
;;
irix5*)
- version_type=osf
+ version_type=irix
soname_spec='${libname}${release}.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
+ file_magic_cmd=file
+ shlibpath_overrides_runpath=no
;;
irix6*)
- version_type=osf
+ version_type=irix
need_lib_prefix=no
need_version=no
soname_spec='${libname}${release}.so'
*) libsuff= shlibsuff= libmagic=never-match;;
esac
shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
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
+ file_magic_cmd=file
;;
# No shared lib support for Linux oldld, aout, or coff.
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
- file_magic_command=file
+ file_magic_cmd=file
if test -f /lib/ld.so.1; then
dynamic_linker='GNU ld.so'
netbsd*)
version_type=sunos
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}.so$versuffix'
+ library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
finish_cmds='PATH="$PATH:/sbin" ldconfig -m $libdir'
dynamic_linker='NetBSD (a.out) ld.so'
else
- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so'
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
soname_spec='${libname}${release}.so$major'
dynamic_linker='NetBSD ld.elf_so'
fi
need_lib_prefix=no
need_version=no
fi
- library_names_spec='${libname}${release}.so$versuffix'
+ library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
shlibpath_var=LD_LIBRARY_PATH
;;
# ldd complains unless libraries are executable
postinstall_cmds='chmod +x $lib'
deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib"
- file_magic_command="file"
+ file_magic_cmd="file"
;;
sunos4*)
# 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
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 \
+ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_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 \
- compiler_c_o compiler_o_lo need_locks; do
+ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
case "$var" in
reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
old_postinstall_cmds | old_postuninstall_cmds | \
- archive_cmds | archive_sym_cmds | \
+ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
postinstall_cmds | postuninstall_cmds | \
finish_cmds | sys_lib_search_path_spec)
# Double-quote double-evaled strings.
- eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\"\`\\\""
+ eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
;;
*)
eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
# Whether or not to build static libraries.
build_old_libs=$enable_static
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
# The host system.
host_alias=$host_alias
host=$host
# Do we need a version for libraries?
need_version=$need_version
+# Whether dlopen is supported.
+dlopen=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
# Compiler flag to prevent dynamic linking.
link_static_flag=$link_static_flag
# Commands used to build and install a shared archive.
archive_cmds=$archive_cmds
-archive_sym_cmds=$archive_sym_cmds
+archive_expsym_cmds=$archive_expsym_cmds
postinstall_cmds=$postinstall_cmds
postuninstall_cmds=$postuninstall_cmds
deplibs_check_method=$deplibs_check_method
# Command to use when deplibs_check_method == file_magic
-file_magic_command=$file_magic_command
+file_magic_cmd=$file_magic_cmd
# Flag that allows shared libraries with undefined symbols to be built.
allow_undefined_flag=$allow_undefined_flag
# Fix the shell variable \$srcfile for the compiler.
fix_srcfile_path="$fix_srcfile_path"
+
+# Set to yes if exported symbols are required
+always_export_symbols=$always_export_symbols
+
+# The command to extract exported symbols
+export_symbols_cmds=$export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols
+exclude_expsyms=$exclude_expsyms
+
+# Symbols that must always be exported
+include_expsyms=$include_expsyms
+
EOF
case "$ltmain" in
avoid_version=no
dlfiles=
dlprefiles=
+ dlself=no
export_dynamic=no
export_symbols=
+ export_symbols_regex=
generated=
- hardcode_libdirs=
libobjs=
ltlibs=
module=no
fi
case "$arg" in
*.la | *.lo) ;; # We handle these cases below.
+ self)
+ if test "$prev" = dlprefiles; then
+ dlself=yes
+ elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+ dlself=yes
+ fi
+ prev=
+ continue
+ ;;
*)
dlprefiles="$dlprefiles $arg"
test "$prev" = dlfiles && dlfiles="$dlfiles $arg"
;;
esac
;;
- exportsyms)
+ expsyms)
export_symbols="$arg"
if test ! -f "$arg"; then
$echo "$modename: symbol file \`$arg' does not exist"
prev=
continue
;;
+ expsyms_regex)
+ export_symbols_regex="$arg"
+ prev=
+ continue
+ ;;
release)
release="-$arg"
prev=
else
arg=
fi
- if test "$preload" = no; then
- # Add the symbol object into the linking commands.
- compile_command="$compile_command @SYMFILE@"
- preload=yes
- fi
fi
;;
- -export-symbols)
- if test -n "$export_symbols"; then
+ -export-symbols | -export-symbols-regex)
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
$echo "$modename: cannot have more than one -exported-symbols"
exit 1
fi
- prev=exportsyms
+ if test "$arg" = "-export-symbols"; then
+ prev=expsyms
+ else
+ prev=expsyms_regex
+ fi
continue
;;
# A library object.
if test "$prev" = dlfiles; then
dlfiles="$dlfiles $arg"
- if test "$build_libtool_libs" = yes; then
+ if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
prev=
continue
else
# This library was specified with -dlopen.
if test "$prev" = dlfiles; then
dlfiles="$dlfiles $arg"
- if test -z "$dlname" || test "$build_libtool_libs" = no; then
- # If there is no dlname or we're linking statically,
+ if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlname, no dlopen support or we're linking statically,
# we need to preload.
prev=dlprefiles
else
exit 1
fi
- if test -n "$export_symbols" && test "$module" = yes; then
- $echo "$modename: \`-export-symbols' is not supported for modules"
- exit 1
- fi
-
oldlibs=
# calculate the name of the file, without its directory
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
case "$version_type" in
none) ;;
+ irix)
+ major=`expr $current - $age + 1`
+ versuffix="$major.$revision"
+ verstring="sgi$major.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$revision
+ while test $loop != 0; do
+ iface=`expr $revision - $loop`
+ loop=`expr $loop - 1`
+ verstring="sgi$major.$iface:$verstring"
+ done
+ ;;
+
linux)
major=.`expr $current - $age`
versuffix="$major.$age.$revision"
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"
| $Xsed -e 's,[^/]*$,,'`"$potliblink";;
esac
done
- if eval $file_magic_command \"\$potlib\" \
+ if eval $file_magic_cmd \"\$potlib\" \
| sed '11,$d' \
| egrep "$file_magic_regex" > /dev/null; then
newdeplibs="$newdeplibs $a_deplib"
done
fi
+ if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+ eval flag=\"$thread_safe_flag_spec\"
+
+ 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
+ $show "generating symbol list for \`$libname.la'"
+ export_symbols="$objdir/$libname.exp"
+ $run $rm $export_symbols
+ eval cmds=\"$export_symbols_cmds\"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ 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"'
+ fi
+ fi
+ fi
+
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
+ fi
+
# Make a backup of the uninstalled library when relinking
if test "$relink" = yes && test "$hardcode_into_libs" = yes ; then
$run eval '(cd $output_objdir && $rm "$realname"U && $mv $realname "$realname"U)' || exit $?
fi
# Do each of the archive commands.
- if test -n "$export_symbols" && test -n "$archive_sym_cmds"; then
- eval cmds=\"$archive_sym_cmds\"
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval cmds=\"$archive_expsym_cmds\"
else
eval cmds=\"$archive_cmds\"
fi
$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
fi
+ if test "$preload" = yes; then
+ if test "$dlopen" = unknown || test "$dlopen_self" = unknown; then
+ $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
+ fi
+ fi
+
+ if test "$dlself" = yes && test "$export_dynamic" = no; then
+ $echo "$modename: error: \`-dlopen self' requires \`-export-dynamic'" 1>&2
+ exit 1
+ fi
+
# Find libtool libraries and add their dependencies/rpaths
newdeplibs=
newdependency_libs=
done
deplibs="$newdeplibs"
- dep_rpath=
# 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
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
fi
- if test "$export_dynamic" = yes || test -n "$dlfiles$dlprefiles" && test -n "$NM" && test -n "$global_symbol_pipe"; then
- dlsyms="${outputname}S.c"
- else
- dlsyms=
+ dlsyms=
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" = yes; 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
+ fi
fi
if test -n "$dlsyms"; then
/* External symbol declarations for the compiler. */\
"
- if test "$export_dynamic" = yes; then
+ if test "$dlself" = yes; then
if test -n "$export_symbols"; then
$run eval 'sed -e "s/^\(.*\)/\1 \1/" < "$export_symbols" > "$nlist"'
else
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
- mv -f "$nlist"T "$nlist"
+ $mv "$nlist"T "$nlist"
else
$rm "$nlist"T
fi
+ if test -n "$exclude_expsyms"; then
+ egrep -v "^($exclude_expsyms) " "$nlist" > "$nlist"T
+ $mv "$nlist"T "$nlist"
+ fi
+
if test -f "$nlist"; then
sed -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$output_objdir/$dlsyms"
else
{\
"
- # First entry is always the program itself
- echo >> "$output_objdir/$dlsyms" "\
- {\"${output}\", (lt_ptr_t) 0},"
-
- if test "$export_dynamic" = yes; then
+ 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
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"
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"
# 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.
- if test -n "$dlfiles$dlprefiles"; then
- $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
- fi
-
+
# Nullify the symbol file.
compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
fi
+++ /dev/null
-From Janos.Farkas-nouce/priv-#5HYEEI07/9C6uVbFUutOXk6szqe@lk9qw.mail.eon.ml.org Tue Mar 31 15:39:15 1998
-X-From-Line: Janos.Farkas-nouce/priv-#5HYEEI07/9C6uVbFUutOXk6szqe@lk9qw.mail.eon.ml.org Tue Mar 31 15:39:15 1998
-Return-Path: <Janos.Farkas-nouce/priv-#5HYEEI07/9C6uVbFUutOXk6szqe@lk9qw.mail.eon.ml.org>
-Delivered-To: gord@trick.profitpress.com
-Received: (qmail 903 invoked from network); 31 Mar 1998 15:39:14 -0000
-Received: from unknown (HELO bambam.m-tech.ab.ca) (127.0.0.1)
- by 127.0.0.1 with SMTP; 31 Mar 1998 15:39:14 -0000
-Received: from mi5.satimex.tvnet.hu (gateway.m-tech.ab.ca [10.0.0.1]) by bambam.m-tech.ab.ca (8.8.5/8.6.9) with SMTP id DAA25302 for <gord@m-tech.ab.ca>; Mon, 30 Mar 1998 03:28:54 -0700
-Received: (qmail 3288 invoked by uid 2001); 30 Mar 1998 10:36:04 -0000
-Date: Mon, 30 Mar 1998 12:36:04 +0200
-From: Janos Farkas <Janos.Farkas-nouce/priv-#UiTVSa/OAc8mBkHH9CeLgE.uMWK@lk9qw.mail.eon.ml.org>
-To: Ian Lance Taylor <ian@cygnus.com>, gord@m-tech.ab.ca
-Cc: bug-libtool@gnu.org, tiemann@cygnus.com
-Subject: Re: Irix shared libraries
-Mail-Followup-To: Ian Lance Taylor <ian@cygnus.com>, gord@m-tech.ab.ca,
- bug-libtool@gnu.org, tiemann@cygnus.com
-Message-ID: <19980330123604.03725@lk9qw.mail.eon.ml.org>
-References: <86hg4h59tw.fsf@trick.profitpress.com> <199803300034.TAA16378@subrogation.cygnus.com>
-Mime-Version: 1.0
-Content-Type: text/plain; charset=us-ascii
-In-Reply-To: <199803300034.TAA16378@subrogation.cygnus.com>; from Ian Lance Taylor on Sun, Mar 29, 1998 at 07:34:01PM -0500
-Errors-To: Janos Farkas <Janos.Farkas-sys/priv-#5zJlUoBBccl/-errors@lk9qw.mail.eon.ml.org>
-Xref: trick.profitpress.com mail.libtool:1249
-Lines: 44
-X-Gnus-Article-Number: 1 Wed Nov 4 08:02:28 1998
-
-On 1998-03-29 at 19:34:01, Ian Lance Taylor wrote:
-> From: Gordon Matzigkeit <gord@m-tech.ab.ca>
-> Date: 29 Mar 1998 16:57:47 -0700
->
-> Do you have access to the IRIX ld man pages? I don't know why it's
-> complaining about `non-sgi' interface versions. I was under the
-> impression that any colon-separated list of strings would do.
->
-> Here is the entire ld man page, but it does not appear particularly
-> helpful.
-
-I just realized I also have mortal access to an SGI system, and found
-this in the dso.5 page, this looks more informative :)
-
- Versioning of Shared Objects.
-
- QUICK OVERVIEW
-
- For a shared object to be versioned
- the following needs to be done:
-
- * Version strings consist of 3 parts and a dot: The string "sgi",
- a decimal number (the major number), a dot, and a decimal number
- (the minor number).
-
- * Add the command -set_version sgi1.0 to the command to build
- the shared object (cc -shared, ld -shared, etc.).
-
- * Whenever you make a COMPATIBLE change update the minor version
- number (the one after the dot), and add the latest version string
- to colon-separated list of version strings, e.g., -set_version
- sgi1.0:sgi1.1:sgi1.3
-
- * Whenever you make an INCOMPATIBLE change, update the
- major version number. Pass this as the version list, e.g.,
- -set_version sgi2.0. Change the filename of the OLD shared object
- by adding a dot followed by the previous major number to the filename
- of the shared object. DO NOT CHANGE the soname of the object.
- No change to the file contents are necessary or desirable. Simply
- rename the file.
-
---
-Janos - Don't worry, my address is real. I'm just bored of spam.
-
-From nobody Wed Oct 14 16:54:11 1998
-X-From-Line: gord@gnu.org Fri Jul 03 02:26:01 1998
-Return-Path: <gord@gnu.org>
-Delivered-To: gord@trick.fig.org
-Received: (qmail 9753 invoked from network); 3 Jul 1998 02:25:59 -0000
-Received: from unknown (HELO bambam.m-tech.ab.ca) (127.0.0.1)
- by 127.0.0.1 with SMTP; 3 Jul 1998 02:25:59 -0000
-Received: from mescaline.gnu.org (gateway [10.0.0.1]) by bambam.m-tech.ab.ca (8.8.5/8.6.9) with ESMTP id SAA13535 for <gord@m-tech.ab.ca>; Thu, 2 Jul 1998 18:34:06 -0600
-Received: from platinum.math.arizona.edu by mescaline.gnu.org (8.8.5/8.6.12GNU) with ESMTP id UAA09573 for <bug-libtool@gnu.org>; Thu, 2 Jul 1998 20:41:52 -0400
-Date: Fri, 3 Jul 1998 00:40:12 GMT
-Message-Id: <199807030040.AAA16739@platinum.math.arizona.edu>
-Received: by platinum.math.arizona.edu; Fri, 3 Jul 1998 00:40:12 GMT
-From: "Robert S. Maier" <rsm@math.arizona.edu>
-To: bug-libtool@gnu.org
-Subject: misc. libtool bugs
-Phase-of-Moon: Waxing Gibbous (62% of Full)
-Organization: Mathematics Department, University of Arizona
-Xref: trick.fig.org mail.libtool:1516
-Lines: 46
-X-Gnus-Article-Number: 2 Wed Nov 4 08:02:28 1998
-
-Through installing the plotutils package on several platforms, I've turned
-up a few additional bugs in libtool-1.2. Here they are...
-
-1. The plotutils package uses libtool to link together a shared library,
-`libplot'. It also compiles several executables, each in its own
-subdirectory, and links them with `libplot'. It then runs tests on the
-executables.
-
-By looking at the test output I figured out that the version of libplot
-that gets linked with the executables is by default the previously
-installed version (if any), rather than the one that that's just been
-built. This happens under IRIX 5.3 and 6.4, when compiling with both cc
-and gcc. Probably on other platforms as well.
-
-I assume there's something wrong with LD_LIBRARY_PATH. But the shell
-scripts that libtool generates (i.e., the pseudo-executables) contain the
-lines
-
- # Add our own library path to LD_LIBRARY_PATH
- LD_LIBRARY_PATH="$thisdir/../libplot/.libs:$LD_LIBRARY_PATH"
-
- # Some systems cannot cope with colon-terminated LD_LIBRARY_PATH
- LD_LIBRARY_PATH=`$echo "X$LD_LIBRARY_PATH" | $Xsed -e 's/:*$//'`
-
-which certainly look right.
-
-A workaround here is to do `rm -f /usr/local/lib/libplot.*' before
-installing the package. But that's a pretty drastic workaround.
-
-2. At least on those IRIX platforms, there's something buggy about the
-option "-set_version 1.1.2:0.0:1.0" that libtool-1.2 passes to ld. If
-I compile a version of my `graph' utility that is meant to be linked with
--lXm instead of -lXaw (the default), as well as -lplot, I get the following
-when I go to its subdirectory and try to run it without installing it:
-
- cosmo$ echo 0 0 1 1 2 0 | graph -TX -C
- 4352:graph: rld: Warning: version search suppressed because object libplot.so in liblist has non-sgi interface version (1.0)
- 4352:graph: rld: Fatal Error: cannot map soname 'libplot.so' using any of the filenames /usr/local/lib/libplot.so:/lib/libplot.so:/usr/lib/libplot.so:/usr/local/ivtools/lib/SGI/libplot.so:/lib/cmplrs/cc/libplot.so:/usr/lib/cmplrs/cc/libplot.so: -- either the file does not exist or the file is not mappable (with reason indicated in previous msg)
-
-Not sure what's going on here. If I do a `make install', the installed
-version of `graph' functions perfectly. It's only the uninstalled one,
-built specially to be linked with -lXm, that gives error messages about SGI
-version numbering for -lplot.
-
---Robert
-
lib_LTLIBRARIES = foo1.la libfoo2.la
foo1_la_SOURCES = foo1.c
-foo1_la_LDFLAGS = $(LIBADD_M) -module -avoid-version
+foo1_la_LDFLAGS = -module -avoid-version
libfoo2_la_SOURCES = foo2.c
-libfoo2_la_LDFLAGS = $(LIBADD_M) -module
+libfoo2_la_LDFLAGS = -module
noinst_HEADERS = foo.h
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/libltdl.la "-dlopen" foo1.la "-dlopen" libfoo2.la
+mdemo_LDADD = ../libltdl/libltdl.la "-dlopen" self \
+ "-dlopen" foo1.la "-dlopen" libfoo2.la
mdemo_DEPENDENCIES = ../libltdl/libltdl.la foo1.la libfoo2.la
# Create a statically linked version of mdemo.
AC_PROG_CC
AC_C_CONST
AC_EXEEXT
+AC_LIBTOOL_DLOPEN
AM_PROG_LIBTOOL
if ${CONFIG_SHELL} ./libtool --features | grep "enable static" >/dev/null; then
AC_CHECK_HEADERS(math.h)
-AC_CHECK_LIB(m, cos, LIBADD_M="-lm", LIBADD_M=)
-AC_SUBST(LIBADD_M)
+AC_CHECK_LIBM
dnl Output the makefile
AC_OUTPUT(Makefile)
return 0;
}
+int
+myfunc ()
+{
+ return HELLO_RET;
+}
+
+int myvar;
+
+int
+test_dlself ()
+{
+ lt_dlhandle handle;
+ int (*pmyfunc)() = 0;
+ int *pmyvar = 0;
+
+ handle = lt_dlopen(0);
+ if (!handle) {
+ fprintf (stderr, "can't dlopen the program!\n");
+ fprintf (stderr, "error was: %s\n", lt_dlerror());
+ return 1;
+ }
+ pmyfunc = (int(*)())lt_dlsym(handle, "myfunc");
+ pmyvar = (int*)lt_dlsym(handle, "myvar");
+
+ if (pmyfunc)
+ {
+ int value = (*pmyfunc) ();
+
+ printf ("myfunc returned: %i\n", value);
+ if (value == HELLO_RET)
+ printf("myfunc is ok!\n");
+ }
+ else
+ fprintf (stderr, "did not find the `myfunc' function\n");
+
+ /* Try assigning to the variable. */
+ if (pmyvar)
+ *pmyvar = 1;
+ else
+ fprintf (stderr, "did not find the `myvar' variable\n");
+
+ lt_dlclose(handle);
+ return 0;
+}
+
int
main (argc, argv)
int argc;
if (test_dl(argv[i]))
return 1;
+ if (test_dlself())
+ return 1;
+
lt_dlexit();
return 0;
}