+2000-01-12 Thomas Tanner <tanner@ffii.org>
+
+ * update all copyright notices to 2000
+
+ * doc/libtool.texi (using libltdl): document new lt_dlinfo struct,
+ replace NULL with @code{NULL}, document lt_dlsetdata(),
+ lt_dlgetdata() and lt_dlgetinfo()
+ * libltdl/Makefile.am: increment interface version number
+ * libltdl/configure.in: set version number to 1.1
+ * libltdl/ltdl.c: make some variables public by moving them
+ to the info struct, add support for application specific data
+ within module handles, new lt_dlsetdata(), lt_dlgetdata() and
+ lt_dlgetinfo() functions,
+ fix memory leaks, minor cleanups
+ * libltdl/ltdl.h: ditto
+ * mdemo/main.c: demonstrate use of lt_dlgetinfo,
+ improved handling of errors
+
+ * ltconfig.in: set hardcode_into_libs = yes for GNU/Hurd, Linux
+ and Solaris, only hardcode *all* run-paths if hardcode_into_libs
+ is set to 'all', otherwise hardcode only user-specified rpaths
+ into libraries
+ * ltmain.in: minor cleanups, we don't need to add user-specified
+ rpaths to compile_rpath, finalize_rpath is sufficient
+
+ * ltconfig.in: transform linux* -> *linux-gnu* _after_ host_os has
+ been set! (reported by Bruno Haible <haible@ilog.fr>)
+
+ * configure.in: AC_SUBST reload_flag, deplibs_check_method
+ and file_magic_cmd
+
+ * README: use 'libtool --version' instead of 'ltconfig --version'
+ (suggested by Francios Pinard <pinard@iro.umontreal.ca>
+
2000-01-10 Gary V. Vaughan <gary@oranda.demon.co.uk>
* libltdl/ltdl.h (LTDL_DIRSEP_CHAR): Leave undefined when
NEWS - list of user-visible changes between releases of GNU Libtool
-New in 1.3d: 1999-??-??; CVS version 1.3c, Libtool team:
+New in 1.3d: 2000-??-??; CVS version 1.3c, Libtool team:
* libltdl can now be built as a dll with win32.
* m4 macros needed to configure libltdl split out into libltdl/ltdl.m4.
* Start of support code for cross-compiling to win32.
libtool to a new platform, please send electronic mail to the libtool
mailing list <libtool@gnu.org> or bug reports to <bug-libtool@gnu.org>.
Don't forget to mention the version of libtool that you are currently
-using (by typing `ltconfig --version').
+using (by typing `libtool --version').
cd $sub
rm -f acinclude.m4
cat ../libtool.m4 > acinclude.m4
- case "$sub" in libltdl) cat ../ltdl.m4 >> acinclude.m4 ;; esac
+ test "$sub" = libltdl && cat ../ltdl.m4 >> acinclude.m4
aclocal
test "$sub" = libltdl && autoheader
automake --gnits --add-missing
/* foo.c -- trivial test library
- Copyright (C) 1998-1999 Free Software Foundation, Inc.
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
Originally by Thomas Tanner <tanner@ffii.org>
This file is part of GNU Libtool.
/* foo.h -- interface to the libfoo* libraries
- Copyright (C) 1998-1999 Free Software Foundation, Inc.
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
Originally by Thomas Tanner <tanner@ffii.org>
This file is part of GNU Libtool.
/* main.c -- cdemo test program
- Copyright (C) 1998-1999 Free Software Foundation, Inc.
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
Originally by Thomas Tanner <tanner@ffii.org>
This file is part of GNU Libtool.
AC_SUBST(FILE)
AC_SUBST(OBJDUMP)
AC_SUBST(AS)
+AC_SUBST(reload_flag)
+AC_SUBST(file_magic_cmd)
+AC_SUBST(deplibs_check_method)
LIBTOOL_FLAGS="$libtool_flags"
AC_SUBST(LIBTOOL_FLAGS)
/* dlmain.c -- hello test program that uses simulated dynamic linking
- Copyright (C) 1996-1999 Free Software Foundation, Inc.
+ Copyright (C) 1996-2000 Free Software Foundation, Inc.
This file is part of GNU Libtool.
This program is free software; you can redistribute it and/or modify
/* foo.c -- trivial test function for libfoo
- Copyright (C) 1996-1999 Free Software Foundation, Inc.
+ Copyright (C) 1996-2000 Free Software Foundation, Inc.
Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
This file is part of GNU Libtool.
/* foo.h -- interface to the libfoo library
- Copyright (C) 1996-1999 Free Software Foundation, Inc.
+ Copyright (C) 1996-2000 Free Software Foundation, Inc.
Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
This file is part of GNU Libtool.
/* hello.c -- trivial test function for libfoo
- Copyright (C) 1996-1999 Free Software Foundation, Inc.
+ Copyright (C) 1996-2000 Free Software Foundation, Inc.
This file is part of GNU Libtool.
This program is free software; you can redistribute it and/or modify
/* main.c -- trivial hello test program
- Copyright (C) 1996-1999 Free Software Foundation, Inc.
+ Copyright (C) 1996-2000 Free Software Foundation, Inc.
This file is part of GNU Libtool.
This program is free software; you can redistribute it and/or modify
/* l1.c -- trivial test library
- Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
+ Copyright (C) 1998-2000 Thomas Tanner <tanner@ffii.org>
This file is part of GNU Libtool.
This program is free software; you can redistribute it and/or modify
/* l1.h -- interface to a trivial library
- Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
+ Copyright (C) 1998-2000 Thomas Tanner <tanner@ffii.org>
This file is part of GNU Libtool.
This program is free software; you can redistribute it and/or modify
/* l2.c -- trivial test library
- Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
+ Copyright (C) 1998-2000 Thomas Tanner <tanner@ffii.org>
This file is part of GNU Libtool.
This program is free software; you can redistribute it and/or modify
/* l2.h -- interface to a trivial library
- Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
+ Copyright (C) 1998-2000 Thomas Tanner <tanner@ffii.org>
This file is part of GNU Libtool.
This program is free software; you can redistribute it and/or modify
/* l3.c -- trivial test library
- Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
+ Copyright (C) 1998-2000 Thomas Tanner <tanner@ffii.org>
This file is part of GNU Libtool.
This program is free software; you can redistribute it and/or modify
/* l3.h -- interface to a trivial library
- Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
+ Copyright (C) 1998-2000 Thomas Tanner <tanner@ffii.org>
This file is part of GNU Libtool.
This program is free software; you can redistribute it and/or modify
/* l4.c -- trivial test library
- Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
+ Copyright (C) 1998-2000 Thomas Tanner <tanner@ffii.org>
This file is part of GNU Libtool.
This program is free software; you can redistribute it and/or modify
/* l4.h -- interface to a trivial library
- Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
+ Copyright (C) 1998-2000 Thomas Tanner <tanner@ffii.org>
This file is part of GNU Libtool.
This program is free software; you can redistribute it and/or modify
/* main.c -- inter-library dependency test program
- Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
+ Copyright (C) 1998-2000 Thomas Tanner <tanner@ffii.org>
This file is part of GNU Libtool.
This program is free software; you can redistribute it and/or modify
/* sysdep.h -- system dependent declarations
- Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
+ Copyright (C) 1998-2000 Thomas Tanner <tanner@ffii.org>
This file is part of GNU Libtool.
This program is free software; you can redistribute it and/or modify
@ifinfo
This file documents GNU Libtool @value{VERSION}
-Copyright (C) 1996-1999 Free Software Foundation, Inc.
+Copyright (C) 1996-2000 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
@page
@vskip 0pt plus 1filll
-Copyright @copyright{} 1996-1999 Free Software Foundation, Inc.
+Copyright @copyright{} 1996-2000 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
Libtool provides special support for dlopening libtool object and
libtool library files, so that their symbols can be resolved @emph{even
on platforms without any @code{dlopen} and @code{dlsym}
-functions.}.
+functions}.
Consider the following alternative ways of loading code into your
program, in order of increasing ``laziness'':
Every dlopened module has a handle associated with it.
@end deftp
+@deftypefn {Type} {struct} lt_dlinfo @{ @w{char *@var{filename};} @w{char *@var{name};} @w{int @var{ref_count};} @}
+@code{lt_dlinfo} is used to store information about a module.
+The @var{filename} attribute is a null-terminated character string of the
+real module file name. If the module is a libtool module then @var{name}
+is its module name (e.g. @code{"libfoo"} for @code{"dir/libfoo.la"}),
+otherwise it is set to @code{NULL}.
+The @var{ref_count} attribute is a reference counter that describes how often
+the same module is currently loaded.
+@end deftypefn
+
@deftp {Type} lt_dlsymlist
@code{lt_dlsymlist} is a symbol list for dlpreopened modules.
This structure is described in @pxref{Dlpreopening}.
flag, then the global symbols in the executable will also be used to
resolve references in the module.
-If @var{filename} is NULL and the program was linked with
+If @var{filename} is @code{NULL} and the program was linked with
@code{-export-dynamic} or @code{-dlopen self}, @code{lt_dlopen} will
return a handle for the program itself, which can be used to access its
symbols.
for example, @code{"/usr/lib/mypkg:/lib/foo"}.
If the same module is loaded several times, the same handle is returned.
-If @code{lt_dlopen} fails for any reason, it returns NULL.
+If @code{lt_dlopen} fails for any reason, it returns @code{NULL}.
@end deftypefun
@deftypefun lt_dlhandle lt_dlopenext (const char *@var{filename})
@deftypefun lt_ptr_t lt_dlsym (lt_dlhandle @var{handle}, const char *@var{name})
Return the address in the module @var{handle}, where the symbol given
by the null terminated string @var{name} is loaded.
-If the symbol cannot be found, NULL is returned.
+If the symbol cannot be found, @code{NULL} is returned.
@end deftypefun
@deftypefun {const char *} lt_dlerror (void)
Return a human readable string describing the most
recent error that occurred from any of libltdl's functions.
-Return NULL if no errors have occurred since initialization
+Return @code{NULL} if no errors have occurred since initialization
or since it was last called.
@end deftypefun
@deftypefun int lt_dlpreload (const lt_dlsymlist *@var{preloaded})
Register the list of preloaded modules @var{preloaded}.
-If @var{preloaded} is NULL, then all previously registered
+If @var{preloaded} is @code{NULL}, then all previously registered
symbol lists, except the list set by @code{lt_dlpreload_default},
are deleted. Return 0 on success.
@end deftypefun
Return the current user-defined library search path.
@end deftypefun
+@deftypefun int lt_dlsetdata (lt_dlhandle @var{handle}, lt_ptr_t @var{data})
+Set the application private data for the module @var{handle} to @var{data}.
+Return 0 on success.
+@end deftypefun
+
+@deftypefun lt_ptr_t lt_dlgetdata (lt_dlhandle @var{handle})
+Return the application private data for the module @var{handle}.
+If the handle @var{handle} is invalid or no data was set, it returns @code{NULL}.
+@end deftypefun
+
+@deftypefun {const lt_dlinfo *} lt_dlgetinfo (lt_dlhandle @var{handle})
+Return a pointer to a struct that contains some information about
+the module @var{handle}. The contents of the struct must not be modified.
+Return @code{NULL} on failure.
+@end deftypefun
+
@deftypevar {lt_ptr_t (*} lt_dlmalloc ) (size_t size)
@deftypevarx {void (*} lt_dlfree ) (lt_ptr_t ptr)
These variables are set to @code{malloc} and @code{free}, by default,
endif
libltdl_la_SOURCES = ltdl.c
-libltdl_la_LDFLAGS = -no-undefined -version-info 1:2:1
+libltdl_la_LDFLAGS = -no-undefined -version-info 2:1:2
libltdl_la_LIBADD = $(LIBADD_DL)
libltdlc_la_SOURCES = ltdl.c
fi
fi
-AM_INIT_AUTOMAKE(libltdl,1.0,-)
+AM_INIT_AUTOMAKE(libltdl,1.1,-)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
/* ltdl.c -- system independent dlopen wrapper
- Copyright (C) 1998-1999 Free Software Foundation, Inc.
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
Originally by Thomas Tanner <tanner@ffii.org>
This file is part of GNU Libtool.
typedef struct lt_dlhandle_t {
struct lt_dlhandle_t *next;
lt_dltype_t *type; /* dlopening interface */
- char *filename; /* file name */
- char *name; /* module name */
- int usage; /* usage */
+ lt_dlinfo info;
int depcount; /* number of dependencies */
lt_dlhandle *deplibs; /* dependencies */
lt_ptr_t handle; /* system handle */
lt_ptr_t system; /* system specific data */
+ lt_ptr_t app_private; /* application private data */
} lt_dlhandle_t;
#undef strdup
/* check whether the module was already opened */
cur = handles;
while (cur) {
- if (!cur->filename && !filename)
+ /* try to dlopen the program itself? */
+ if (!cur->info.filename && !filename)
break;
- if (cur->filename && filename &&
- strcmp(cur->filename, filename) == 0)
+ if (cur->info.filename && filename &&
+ strcmp(cur->info.filename, filename) == 0)
break;
cur = cur->next;
}
if (cur) {
- cur->usage++;
+ cur->info.ref_count++;
*handle = cur;
return 0;
}
cur = *handle;
if (filename) {
- cur->filename = strdup(filename);
- if (!cur->filename) {
+ cur->info.filename = strdup(filename);
+ if (!cur->info.filename) {
last_error = memory_error;
return 1;
}
} else
- cur->filename = 0;
+ cur->info.filename = 0;
while (type) {
if (type->lib_open(cur, filename) == 0)
break;
type = type->next;
}
if (!type) {
- if (cur->filename)
- lt_dlfree(cur->filename);
+ if (cur->info.filename)
+ lt_dlfree(cur->info.filename);
return 1;
}
cur->type = type;
return 1;
}
sprintf (filename, "%s/%s", libdir, dlname);
- error = tryall_dlopen(handle, filename) == 0;
+ error = tryall_dlopen(handle, filename) != 0;
lt_dlfree(filename);
- if (error)
+ if (!error)
return 0;
}
/* try to open the not-installed module */
strcat(filename, objdir);
strcat(filename, dlname);
- error = tryall_dlopen(handle, filename) == 0;
+ error = tryall_dlopen(handle, filename) != 0;
lt_dlfree(filename);
- if (error)
+ if (!error)
return 0;
}
- /* hmm, maybe it was moved to another directory */
+ /* maybe it was moved to another directory */
{
filename = (char*)
lt_dlmalloc((dir ? strlen(dir) : 0)
else
*filename = 0;
strcat(filename, dlname);
- error = tryall_dlopen(handle, filename) == 0;
+ error = tryall_dlopen(handle, filename) != 0;
lt_dlfree(filename);
- if (error)
+ if (!error)
return 0;
}
}
lt_dlhandle handle = 0, newhandle;
const char *ext;
const char *saved_error = last_error;
- char *basename = 0, *dir = 0, *name = 0;
+ char *canonical = 0, *basename = 0, *dir = 0, *name = 0;
if (!filename) {
handle = (lt_dlhandle) lt_dlmalloc(sizeof(lt_dlhandle_t));
last_error = memory_error;
return 0;
}
- handle->usage = 0;
+ handle->info.ref_count = 0;
handle->depcount = 0;
handle->deplibs = 0;
newhandle = handle;
}
goto register_handle;
}
- {
- char *canonical = canonicalize_path (filename);
- if (!canonical) {
+ canonical = canonicalize_path (filename);
+ if (!canonical) {
+ last_error = memory_error;
+ if (handle)
+ lt_dlfree(handle);
+ return 0;
+ }
+ basename = strrchr(canonical, '/');
+ if (basename) {
+ basename++;
+ dir = (char*) lt_dlmalloc(basename - canonical + 1);
+ if (!dir) {
last_error = memory_error;
- if (handle)
- lt_dlfree(handle);
- return 0;
+ handle = 0;
+ goto cleanup;
}
- basename = strrchr(canonical, '/');
- if (basename) {
- basename++;
- dir = (char*) lt_dlmalloc(basename - canonical + 1);
- if (!dir) {
- last_error = memory_error;
- handle = 0;
- goto cleanup;
- }
- strncpy(dir, canonical, basename - canonical);
- dir[basename - canonical] = '\0';
- } else
- basename = canonical;
- }
+ strncpy(dir, canonical, basename - canonical);
+ dir[basename - canonical] = '\0';
+ } else
+ basename = canonical;
/* check whether we open a libtool module (.la extension) */
ext = strrchr(basename, '.');
if (ext && strcmp(ext, ".la") == 0) {
/* handle is already set to 0 */
goto cleanup;
}
- handle->usage = 0;
+ handle->info.ref_count = 0;
if (load_deplibs(handle, deplibs) == 0) {
newhandle = handle;
/* find_module may replace newhandle */
}
} else
error = 1;
+ free_vars(dlname, old_name, libdir, deplibs);
if (error) {
lt_dlfree(handle);
handle = 0;
- free_vars(dlname, old_name, libdir, deplibs);
goto cleanup;
}
- if (handle != newhandle) {
+ if (handle != newhandle)
unload_deplibs(handle);
- }
} else {
/* not a libtool module */
handle = (lt_dlhandle) lt_dlmalloc(sizeof(lt_dlhandle_t));
/* handle is already set to 0 */
goto cleanup;
}
- handle->usage = 0;
+ handle->info.ref_count = 0;
/* non-libtool modules don't have dependencies */
handle->depcount = 0;
handle->deplibs = 0;
lt_dlfree(handle);
handle = newhandle;
}
- if (!handle->usage) {
- handle->usage = 1;
- handle->name = name;
+ if (!handle->info.ref_count) {
+ handle->info.ref_count = 1;
+ handle->app_private = 0;
+ handle->info.name = name;
handle->next = handles;
handles = handle;
name = 0; /* don't free this during `cleanup' */
lt_dlfree(dir);
if (name)
lt_dlfree(name);
+ if (canonical)
+ lt_dlfree(canonical);
return handle;
}
last_error = invalid_handle_error;
return 1;
}
- handle->usage--;
- if (!handle->usage) {
+ handle->info.ref_count--;
+ if (!handle->info.ref_count) {
int error;
if (handle != handles)
handles = handle->next;
error = handle->type->lib_close(handle);
error += unload_deplibs(handle);
- if (handle->filename)
- lt_dlfree(handle->filename);
- if (handle->name)
- lt_dlfree(handle->name);
+ if (handle->info.filename)
+ lt_dlfree(handle->info.filename);
+ if (handle->info.name)
+ lt_dlfree(handle->info.name);
lt_dlfree(handle);
return error;
}
lensym = strlen(symbol);
if (handle->type->sym_prefix)
lensym += strlen(handle->type->sym_prefix);
- if (handle->name)
- lensym += strlen(handle->name);
+ if (handle->info.name)
+ lensym += strlen(handle->info.name);
if (lensym + LTDL_SYMBOL_OVERHEAD < LTDL_SYMBOL_LENGTH)
sym = lsym;
else
last_error = buffer_overflow_error;
return 0;
}
- if (handle->name) {
+ if (handle->info.name) {
const char *saved_error = last_error;
/* this is a libtool module */
if (handle->type->sym_prefix) {
strcpy(sym, handle->type->sym_prefix);
- strcat(sym, handle->name);
+ strcat(sym, handle->info.name);
} else
- strcpy(sym, handle->name);
+ strcpy(sym, handle->info.name);
strcat(sym, "_LTX_");
strcat(sym, symbol);
/* try "modulename_LTX_symbol" */
{
return user_search_path;
}
+
+int
+lt_dlsetdata (handle, data)
+ lt_dlhandle handle;
+ lt_ptr_t data;
+{
+ if (!handle) {
+ last_error = invalid_handle_error;
+ return 1;
+ }
+ handle->app_private = data;
+ return 0;
+}
+
+lt_ptr_t
+lt_dlgetdata (handle)
+ lt_dlhandle handle;
+{
+ if (!handle) {
+ last_error = invalid_handle_error;
+ return 0;
+ }
+ return handle->app_private;
+}
+
+const lt_dlinfo *
+lt_dlgetinfo (handle)
+ lt_dlhandle handle;
+{
+ if (!handle) {
+ last_error = invalid_handle_error;
+ return 0;
+ }
+ return &(handle->info);
+}
/* ltdl.h -- generic dlopen functions
- Copyright (C) 1998-1999 Free Software Foundation, Inc.
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
Originally by Thomas Tanner <tanner@ffii.org>
This file is part of GNU Libtool.
lt_ptr_t address;
} lt_dlsymlist;
+typedef struct {
+ char *filename; /* file name */
+ char *name; /* module name */
+ int ref_count; /* reference count */
+} lt_dlinfo;
+
__BEGIN_DECLS
extern int lt_dlinit LTDL_PARAMS((void));
extern int lt_dlpreload LTDL_PARAMS((const lt_dlsymlist *preloaded));
extern int lt_dladdsearchdir LTDL_PARAMS((const char *search_dir));
extern int lt_dlsetsearchpath LTDL_PARAMS((const char *search_path));
extern const char *lt_dlgetsearchpath LTDL_PARAMS((void));
+extern int lt_dlsetdata LTDL_PARAMS((lt_dlhandle handle, lt_ptr_t data));
+extern lt_ptr_t lt_dlgetdata LTDL_PARAMS((lt_dlhandle handle));
+extern const lt_dlinfo *lt_dlgetinfo LTDL_PARAMS((lt_dlhandle handle));
LTDL_SCOPE const lt_dlsymlist lt_preloaded_symbols[];
#define LTDL_SET_PRELOADED_SYMBOLS() lt_dlpreload_default(lt_preloaded_symbols)
## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
-## Copyright (C) 1996-1999 Free Software Foundation, Inc.
+## Copyright (C) 1996-2000 Free Software Foundation, Inc.
## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
##
## This program is free software; you can redistribute it and/or modify
#! /bin/sh
# libtoolize - Prepare a package to use libtool.
# @configure_input@
-# Copyright (C) 1996-1999 Free Software Foundation, Inc.
+# Copyright (C) 1996-2000 Free Software Foundation, Inc.
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This program is free software; you can redistribute it and/or modify
# lineno - Replace instances of @LINENO@ with the file's current line number
# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1997
-# Copyright (C) 1992-1999 Free Software Foundation, Inc.
+# Copyright (C) 1992-2000 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#! /bin/sh
# ltconfig - Create a system-specific libtool.
-# Copyright (C) 1996-1999 Free Software Foundation, Inc.
+# Copyright (C) 1996-2000 Free Software Foundation, Inc.
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This file is free software; you can redistribute it and/or modify it
ac_tool_prefix=
fi
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
case "$host_os" in
linux-gnu*) ;;
linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
esac
-host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
case "$host_os" in
aix3*)
# AIX sometimes has problems with the GCC collect2 program. For some
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
soname_spec='${libname}${release}.so$major'
shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
;;
hpux9* | hpux10* | hpux11*)
# This implies no fast_install, which is unacceptable.
# Some rework will be needed to allow for fast_install
# before this can be enabled.
- # hardcode_into_libs=yes
+ hardcode_into_libs=yes
if test -f /lib/ld.so.1; then
dynamic_linker='GNU ld.so'
soname_spec='${libname}${release}.so$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
# ldd complains unless libraries are executable
postinstall_cmds='chmod +x $lib'
;;
echo "checking whether to build static libraries... $enable_static" 1>&6
-if test "$hardcode_action" = relink || test "$hardcode_into_libs" = yes; then
+if test "$hardcode_action" = relink || test "$hardcode_into_libs" = all; then
# Fast installation is not supported
enable_fast_install=no
elif test "$shlibpath_overrides_runpath" = yes ||
# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
#
-# Copyright (C) 1996-1999 Free Software Foundation, Inc.
+# Copyright (C) 1996-2000 Free Software Foundation, Inc.
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This program is free software; you can redistribute it and/or modify
# on Windows for dlls which lack them. Don't remove nor modify the
# starting and closing comments
# /* impgen.c starts here */
-# /* Copyright (C) 1999 Free Software Foundation, Inc.
+# /* Copyright (C) 1999-2000 Free Software Foundation, Inc.
#
# This file is part of GNU libtool.
#
-## libltdl.m4 - Configure ltdl for the target system. -*-Shell-script-*-
-## Copyright (C) 1999 Free Software Foundation, Inc.
+## ltdl.m4 - Configure ltdl for the target system. -*-Shell-script-*-
+## Copyright (C) 1999-2000 Free Software Foundation, Inc.
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
/* ltmain.c - C implementation of GNU Libtool
- * Copyright (C) 1998-1999 Free Software Foundation, Inc.
+ * Copyright (C) 1998-2000 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
# ltmain.sh - Provide generalized library-building support services.
# NOTE: Changing this file will not affect anything until you rerun ltconfig.
#
-# Copyright (C) 1996-1999 Free Software Foundation, Inc.
+# Copyright (C) 1996-2000 Free Software Foundation, Inc.
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This program is free software; you can redistribute it and/or modify
# libtool link mode
link | relink)
modename="$modename: link"
- relink=no
- test "$mode" = "relink" && relink=yes
case "$host" in
*-*-cygwin* | *-*-mingw* | *-*-os2*)
# It is impossible to link a dll without this setting, and
fi
fi
- if test "$relink" = no; then
+ if test "$mode" != relink; then
# Remove our outputs.
$show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
$run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
if test -n "$library_names" &&
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
# This is a shared library
- if test "$hardcode_into_libs" = yes; then
+ if test "$hardcode_into_libs" = all; then
# Hardcode the library path.
# Skip directories that are in the system default run-time
# search path.
add_dir=
add_shlibpath=
add_name=no
- if test "$relink" = no; then
+ if test "$mode" != relink; then
lib_linked=yes
case "$hardcode_action" in
immediate | unsupported)
fi
fi
- if test -n "$dependency_libs"; then
+ if test -n "$dependency_libs" &&
+ { test "$hardcode_into_libs" = no || test $build_old_libs = yes ||
+ test $link_static = yes; }; then
# Extract -R from dependency_libs
temp_deplibs=
for libdir in $dependency_libs; do
temp_xrpath=
for libdir in $xrpath; do
temp_xrpath="$temp_xrpath -R$libdir"
- case "$compile_rpath " in
- *" $libdir "*) ;;
- *) compile_rpath="$compile_rpath $libdir" ;;
- esac
case "$finalize_rpath " in
*" $libdir "*) ;;
*) finalize_rpath="$finalize_rpath $libdir" ;;
esac
done
- dependency_libs="$temp_xrpath $dependency_libs"
+ if test "$hardcode_into_libs" = no || test $build_old_libs = yes; then
+ dependency_libs="$temp_xrpath $dependency_libs"
+ fi
fi
# Restore the variables
# Test again, we may have decided not to build it any more
if test "$build_libtool_libs" = yes; then
- if test "$hardcode_into_libs" = yes; then
+ if test "$hardcode_into_libs" != no; then
# Hardcode the library paths
hardcode_libdirs=
dep_rpath=
rpath="$finalize_rpath"
- test "$relink" = no && rpath="$compile_rpath$rpath"
+ test "$mode" != relink && rpath="$compile_rpath$rpath"
for libdir in $rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
fi
shlibpath="$finalize_shlibpath"
- test "$relink" = no && shlibpath="$compile_shlibpath$shlibpath"
+ test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
if test -n "$shlibpath"; then
eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
fi
fi
# Make a backup of the uninstalled library when relinking
- if test "$relink" = yes && test "$hardcode_into_libs" = yes ; then
+ if test "$mode" = relink && test "$hardcode_into_libs" = all; then
$run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
fi
IFS="$save_ifs"
# Restore the uninstalled library and exit
- if test "$relink" = yes && test "$hardcode_into_libs" = yes; then
+ if test "$mode" = relink && test "$hardcode_into_libs" = all; then
$run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
exit 0
fi
fi
done
done
-
- # Eliminate all dependency_libs that are already contained in deplibs
- dependency_libs=
- for deplib in $newdependency_libs; do
- case "$deplibs " in
- *" $deplib "*) ;;
- *) dependency_libs="$dependency_libs $deplib" ;;
- esac
- done
+ dependency_libs="$newdependency_libs"
# Make sure lib_search_path contains only unique directories.
lib_search_path=
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
hardcode=yes
- test "$hardcode_into_libs" = yes && test "$alldeplibs" = yes && hardcode=no
+ test "$hardcode_into_libs" = all && test "$alldeplibs" = yes && hardcode=no
if test "$hardcode" = yes && test -n "$library_names" &&
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
# We need to hardcode the library path
# If the user specified any rpath flags, then add them.
for libdir in $rpath $xrpath; do
# This is the magic to use -rpath.
- case "$compile_rpath " in
- *" $libdir "*) ;;
- *) compile_rpath="$compile_rpath $libdir" ;;
- esac
case "$finalize_rpath " in
*" $libdir "*) ;;
*) finalize_rpath="$finalize_rpath $libdir" ;;
exit 0
fi
- if test "$hardcode_action" = relink || test "$hardcode_into_libs" = yes; then
+ if test "$hardcode_action" = relink || test "$hardcode_into_libs" = all; then
# Fast installation is not supported
link_command="$compile_var$compile_command$compile_rpath"
relink_command="$finalize_var$finalize_command$finalize_rpath"
test "X$dir" = "X$file/" && dir=
dir="$dir$objdir"
- if test "$hardcode_into_libs" = yes; then
+ if test "$hardcode_into_libs" = all; then
if test -z "$relink_command"; then
$echo "$modename: invalid libtool pseudo library \`$file'" 1>&2
exit 1
shift
srcname="$realname"
- test "$hardcode_into_libs" = yes && srcname="$realname"T
+ test "$hardcode_into_libs" = all && srcname="$realname"T
# Install the shared library and build the symlinks.
$show "$install_prog $dir/$srcname $destdir/$realname"
/* foo.h -- interface to the libfoo* libraries
- Copyright (C) 1998-1999 Free Software Foundation, Inc.
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
Originally by Thomas Tanner <tanner@ffii.org>
This file is part of GNU Libtool.
/* foo1.c -- trivial test library
- Copyright (C) 1998-1999 Free Software Foundation, Inc.
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
Originally by Thomas Tanner <tanner@ffii.org>
This file is part of GNU Libtool.
/* foo2.c -- trivial test library
- Copyright (C) 1998-1999 Free Software Foundation, Inc.
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
Originally by Thomas Tanner <tanner@ffii.org>
This file is part of GNU Libtool.
/* main.c -- mdemo test program
- Copyright (C) 1998-1999 Free Software Foundation, Inc.
+ Copyright (C) 1998-2000 Free Software Foundation, Inc.
Originally by Thomas Tanner <tanner@ffii.org>
This file is part of GNU Libtool.
char *filename;
{
lt_dlhandle handle;
+ const lt_dlinfo *info;
int (*pfoo1)() = 0;
int (*pfoo2)() = 0;
int (*phello)() = 0;
fprintf (stderr, "error was: %s\n", lt_dlerror());
return 1;
}
- phello = (int(*)())lt_dlsym(handle, "hello");
- pfoo1 = (int(*)())lt_dlsym(handle, "foo1");
- pfoo2 = (int(*)())lt_dlsym(handle, "foo2");
- pnothing = (int*)lt_dlsym(handle, "nothing");
+ info = lt_dlgetinfo(handle);
+ if (!info) {
+ fprintf (stderr, "can't get module info: %s\n", lt_dlerror());
+ return 1;
+ }
+ if (info->name) {
+ printf ("module name: %s\n", info->name);
+ } else {
+ printf ("module is not a libtool module\n");
+ }
+ printf ("module filename: %s\n", info->filename);
+ printf ("module reference count: %i\n", info->ref_count);
+
+ phello = (int(*)())lt_dlsym(handle, "hello");
if (phello)
{
int value = (*phello) ();
else
{
fprintf (stderr, "did not find the `hello' function\n");
+ fprintf (stderr, "error was: %s\n", lt_dlerror());
ret = 1;
}
+ pnothing = (int*)lt_dlsym(handle, "nothing");
/* Try assigning to the nothing variable. */
if (pnothing)
*pnothing = 1;
else
{
fprintf (stderr, "did not find the `nothing' variable\n");
+ fprintf (stderr, "error was: %s\n", lt_dlerror());
ret = 1;
}
+ pfoo1 = (int(*)())lt_dlsym(handle, "foo1");
/* Just call the functions and check return values. */
if (pfoo1)
{
else
ret = 1;
}
- else if (pfoo2)
- {
- if ((*pfoo2) () == FOO_RET)
- printf("foo2 is ok!\n");
- else ret = 1;
- }
- else
- {
- fprintf (stderr, "did not find the `foo' function\n");
- ret = 1;
- }
-
+ else {
+ pfoo2 = (int(*)())lt_dlsym(handle, "foo2");
+ if (pfoo2)
+ {
+ if ((*pfoo2) () == FOO_RET)
+ printf("foo2 is ok!\n");
+ else ret = 1;
+ }
+ else
+ {
+ fprintf (stderr, "did not find any of the `foo' functions\n");
+ fprintf (stderr, "error was: %s\n", lt_dlerror());
+ ret = 1;
+ }
+ }
lt_dlclose(handle);
return ret;
}
fprintf (stderr, "error was: %s\n", lt_dlerror());
return 1;
}
- pmyfunc = (int(*)())lt_dlsym(handle, "myfunc");
- pmyvar = (int*)lt_dlsym(handle, "myvar");
+ pmyfunc = (int(*)())lt_dlsym(handle, "myfunc");
if (pmyfunc)
{
int value = (*pmyfunc) ();
else
{
fprintf (stderr, "did not find the `myfunc' function\n");
+ fprintf (stderr, "error was: %s\n", lt_dlerror());
ret = 1;
}
+ pmyvar = (int*)lt_dlsym(handle, "myvar");
/* Try assigning to the variable. */
if (pmyvar)
*pmyvar = 1;
else
{
fprintf (stderr, "did not find the `myvar' variable\n");
+ fprintf (stderr, "error was: %s\n", lt_dlerror());
ret = 1;
}
#! /bin/sh
# mkstamp - extract data from Revision and Date RCS tags in a file
-# Copyright (C) 1999 Free Software Foundation, Inc.
+# Copyright (C) 1999-2000 Free Software Foundation, Inc.
# Alexandre Oliva <oliva@dcc.unicamp.br>
#
# This file is free software; you can redistribute it and/or modify it
fi
if test "x$hardcode_action" = xrelink ||
- test "x$hardcode_into_libs" = xyes; then
+ test "x$hardcode_into_libs" = xall; then
echo "= Exiting: install-time relinking is required"
exit 0
fi
fi
if test "x$hardcode_action" = xrelink ||
- test "x$hardcode_into_libs" = xyes; then
+ test "x$hardcode_into_libs" = xall; then
echo "= Exiting: install-time relinking is required"
exit 0
fi