mirror of
git://git.savannah.gnu.org/libtool.git
synced 2025-02-17 15:10:02 +08:00
* ltmain.in: rewrite of the ILD code, merge linking code for
programs, libraries and objects, allow linking of shared libraries against static libraries/objects on platforms that support it but print a warning, fix some typos * partially revert my previous change and update only copyright notices of files that were actually modified * NEWS: update * libltdl/Makefile.am: version number was wrong * libltdl/ltdl.c (tryall_dlopen): revert Gary's change since it breaks dlpreopening * ltdl.m4: ditto * libltdl/ltdl.c (sys_search_path): search in the system default library search path, too * ltdl.m4 (AC_LTDL_SYSSEARCHPATH): extract the path * libltdl/ltdl.c (find_module): remove bogus file_not_found_error * libltdl/ltdl.c (load_deplibs): implement loading of dependency libraries * libltdl/ltdl.c (unload_deplibs): implement unloading of dependency libraries * libltdl/ltdl.c (lt_dlexit): correctly close all modules and their dependencies * libltdl/ltdl.c (lt_dlforeach): new function * libltdl/ltdl.h: ditto * doc/libtool.texi (using libltdl): document it * libtool.m4: reformatting, only add -I$topsrc_dir/libltdl to INCLTDL * libtoolize.in: reformatting * ltconfig.in: reformatting * ltmain.in: reformatting * mdemo/configure.in: AC_SUBST INCLTDL * mdemo/Makefile.am: use INCLTDL * tests/Makefile.am: reexport OBJEXT and EXEEXT * tests/dryrun.test: use them for building main.obj and mdemo.exe
This commit is contained in:
parent
f7c496a099
commit
8683e2f1b4
48
ChangeLog
48
ChangeLog
@ -1,3 +1,51 @@
|
||||
2000-01-19 Thomas Tanner <tanner@ffii.org>
|
||||
|
||||
* ltmain.in: rewrite of the ILD code, merge linking code for
|
||||
programs, libraries and objects, allow linking of shared libraries
|
||||
against static libraries/objects on platforms that support it
|
||||
but print a warning, fix some typos
|
||||
|
||||
* partially revert my previous change and
|
||||
update only copyright notices of files that were actually modified
|
||||
|
||||
* NEWS: update
|
||||
|
||||
* libltdl/Makefile.am: version number was wrong
|
||||
|
||||
* libltdl/ltdl.c (tryall_dlopen): revert Gary's change
|
||||
since it breaks dlpreopening
|
||||
* ltdl.m4: ditto
|
||||
|
||||
* libltdl/ltdl.c (sys_search_path): search in the system default
|
||||
library search path, too
|
||||
* ltdl.m4 (AC_LTDL_SYSSEARCHPATH): extract the path
|
||||
|
||||
* libltdl/ltdl.c (find_module): remove bogus file_not_found_error
|
||||
|
||||
* libltdl/ltdl.c (load_deplibs): implement loading of dependency
|
||||
libraries
|
||||
* libltdl/ltdl.c (unload_deplibs): implement unloading of dependency
|
||||
libraries
|
||||
* libltdl/ltdl.c (lt_dlexit): correctly close all modules and
|
||||
their dependencies
|
||||
|
||||
* libltdl/ltdl.c (lt_dlforeach): new function
|
||||
* libltdl/ltdl.h: ditto
|
||||
* doc/libtool.texi (using libltdl): document it
|
||||
|
||||
* libtool.m4: reformatting, only add -I$topsrc_dir/libltdl to
|
||||
INCLTDL
|
||||
|
||||
* libtoolize.in: reformatting
|
||||
* ltconfig.in: reformatting
|
||||
* ltmain.in: reformatting
|
||||
|
||||
* mdemo/configure.in: AC_SUBST INCLTDL
|
||||
* mdemo/Makefile.am: use INCLTDL
|
||||
|
||||
* tests/Makefile.am: reexport OBJEXT and EXEEXT
|
||||
* tests/dryrun.test: use them for building main.obj and mdemo.exe
|
||||
|
||||
2000-01-17 Gary V. Vaughan <gary@oranda.demon.co.uk>
|
||||
|
||||
* libltdl/ltdl.c (tryall_dlopen): Abort with
|
||||
|
16
NEWS
16
NEWS
@ -1,16 +1,20 @@
|
||||
NEWS - list of user-visible changes between releases of GNU Libtool
|
||||
|
||||
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.
|
||||
* Improved support for mingw32.
|
||||
* Improved support for Compaq Tru64 V5.0, and Digital Unix V4.*.
|
||||
* New "-no-install" flag to avoid the use of executable wrapper scripts.
|
||||
* New --with-pic flag to control the generation of PIC/non-PIC code.
|
||||
* New --build flag to ltconfig to help with build cross compilation
|
||||
environments is inherited from --build flag passed to configure.
|
||||
* Various bugfixes
|
||||
* Support for hardcoding run-time paths (-R) into libraries.
|
||||
* Libtool now allows you to link shared libraries against static code.
|
||||
* New functions lt_dlgetdata, lt_dlsetdata, lt_dlgetinfo, lt_dlforeach
|
||||
in libltdl can be used to store application specific data in handles.
|
||||
* "-Xcompiler" and "-Wc," does now work in compile mode, too.
|
||||
* Start of support code for cross-compiling to win32.
|
||||
* libltdl can now be built as a dll with win32.
|
||||
* m4 macros needed to configure libltdl split out into libltdl/ltdl.m4.
|
||||
* Improved support for mingw32, Compaq Tru64 V5.0 and Digital Unix V4.*.
|
||||
* Many bugfixes (especially in libltdl)
|
||||
|
||||
New in 1.3.4: 1999-12-08, CVS version 1.3.3a, Libtool team:
|
||||
* Support for Compaq Tru64 V5.0.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* foo.c -- trivial test library
|
||||
Copyright (C) 1998-2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998-1999 Free Software Foundation, Inc.
|
||||
Originally by Thomas Tanner <tanner@ffii.org>
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* foo.h -- interface to the libfoo* libraries
|
||||
Copyright (C) 1998-2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998-1999 Free Software Foundation, Inc.
|
||||
Originally by Thomas Tanner <tanner@ffii.org>
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* main.c -- cdemo test program
|
||||
Copyright (C) 1998-2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998-1999 Free Software Foundation, Inc.
|
||||
Originally by Thomas Tanner <tanner@ffii.org>
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* dlmain.c -- hello test program that uses simulated dynamic linking
|
||||
Copyright (C) 1996-2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996-1999 Free Software Foundation, Inc.
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* foo.c -- trivial test function for libfoo
|
||||
Copyright (C) 1996-2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996-1999 Free Software Foundation, Inc.
|
||||
Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* foo.h -- interface to the libfoo library
|
||||
Copyright (C) 1996-2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996-1999 Free Software Foundation, Inc.
|
||||
Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* hello.c -- trivial test function for libfoo
|
||||
Copyright (C) 1996-2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996-1999 Free Software Foundation, Inc.
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* main.c -- trivial hello test program
|
||||
Copyright (C) 1996-2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996-1999 Free Software Foundation, Inc.
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* l1.c -- trivial test library
|
||||
Copyright (C) 1998-2000 Thomas Tanner <tanner@ffii.org>
|
||||
Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* l1.h -- interface to a trivial library
|
||||
Copyright (C) 1998-2000 Thomas Tanner <tanner@ffii.org>
|
||||
Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* l2.c -- trivial test library
|
||||
Copyright (C) 1998-2000 Thomas Tanner <tanner@ffii.org>
|
||||
Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* l2.h -- interface to a trivial library
|
||||
Copyright (C) 1998-2000 Thomas Tanner <tanner@ffii.org>
|
||||
Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* l3.c -- trivial test library
|
||||
Copyright (C) 1998-2000 Thomas Tanner <tanner@ffii.org>
|
||||
Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* l3.h -- interface to a trivial library
|
||||
Copyright (C) 1998-2000 Thomas Tanner <tanner@ffii.org>
|
||||
Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* l4.c -- trivial test library
|
||||
Copyright (C) 1998-2000 Thomas Tanner <tanner@ffii.org>
|
||||
Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* l4.h -- interface to a trivial library
|
||||
Copyright (C) 1998-2000 Thomas Tanner <tanner@ffii.org>
|
||||
Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* main.c -- inter-library dependency test program
|
||||
Copyright (C) 1998-2000 Thomas Tanner <tanner@ffii.org>
|
||||
Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* sysdep.h -- system dependent declarations
|
||||
Copyright (C) 1998-2000 Thomas Tanner <tanner@ffii.org>
|
||||
Copyright (C) 1998-1999 Thomas Tanner <tanner@ffii.org>
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
@ -3001,6 +3001,15 @@ the module @var{handle}. The contents of the struct must not be modified.
|
||||
Return @code{NULL} on failure.
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun int lt_dlforeach (int (*@var{func})(lt_dlhandle @var{handle}, lt_ptr_t @var{data}), lt_ptr_t @var{data})
|
||||
For each loaded module call the function @var{func}. The argument
|
||||
@var{handle} is the handle of one of the loaded modules, @var{data} is
|
||||
the @var{data} argument passed to @code{lt_dlforeach}.
|
||||
As soon as @var{func} returns a non-zero value for one of the handles,
|
||||
@code{lt_dlforeach} will stop calling @var{func} and immediately return 1.
|
||||
Otherwise 0 is returned.
|
||||
@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,
|
||||
|
@ -14,7 +14,7 @@ noinst_LTLIBRARIES = libltdlc.la
|
||||
endif
|
||||
|
||||
libltdl_la_SOURCES = ltdl.c
|
||||
libltdl_la_LDFLAGS = -no-undefined -version-info 2:1:2
|
||||
libltdl_la_LDFLAGS = -no-undefined -version-info 2:0:2
|
||||
libltdl_la_LIBADD = $(LIBADD_DL)
|
||||
|
||||
libltdlc_la_SOURCES = ltdl.c
|
||||
|
173
libltdl/ltdl.c
173
libltdl/ltdl.c
@ -54,10 +54,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_STDIO_H
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
@ -95,10 +91,14 @@ static const char objdir[] = LTDL_OBJDIR;
|
||||
#ifdef LTDL_SHLIB_EXT
|
||||
static const char shlib_ext[] = LTDL_SHLIB_EXT;
|
||||
#endif
|
||||
#ifdef LTDL_SYSSEARCHPATH
|
||||
static const char sys_search_path[] = LTDL_SYSSEARCHPATH;
|
||||
#endif
|
||||
|
||||
static const char unknown_error[] = "unknown error";
|
||||
static const char dlopen_not_supported_error[] = "dlopen support not available";
|
||||
static const char file_not_found_error[] = "file not found";
|
||||
static const char deplib_not_found_error[] = "dependency library not found";
|
||||
static const char no_symbols_error[] = "no symbols defined";
|
||||
static const char cannot_open_error[] = "can't open the module";
|
||||
static const char cannot_close_error[] = "can't close the module";
|
||||
@ -883,7 +883,7 @@ lt_dlexit LTDL_PARAMS((void))
|
||||
{
|
||||
/* shut down libltdl */
|
||||
lt_dltype_t *type = types;
|
||||
int errors;
|
||||
int errors, level;
|
||||
|
||||
if (!initialized) {
|
||||
last_error = shutdown_error;
|
||||
@ -895,10 +895,15 @@ lt_dlexit LTDL_PARAMS((void))
|
||||
}
|
||||
/* close all modules */
|
||||
errors = 0;
|
||||
while (handles) {
|
||||
/* FIXME: what if a module depends on another one? */
|
||||
if (lt_dlclose(handles))
|
||||
errors++;
|
||||
for (level = 1; handles; level++) {
|
||||
lt_dlhandle cur = handles;
|
||||
while (cur) {
|
||||
lt_dlhandle tmp = cur;
|
||||
cur = cur->next;
|
||||
if (tmp->info.ref_count <= level)
|
||||
if (lt_dlclose(tmp))
|
||||
errors++;
|
||||
}
|
||||
}
|
||||
initialized = 0;
|
||||
while (type) {
|
||||
@ -944,10 +949,6 @@ tryall_dlopen (handle, filename)
|
||||
}
|
||||
} else
|
||||
cur->info.filename = 0;
|
||||
if (access (filename, F_OK) < 0) {
|
||||
last_error = file_not_found_error;
|
||||
return 1;
|
||||
}
|
||||
while (type) {
|
||||
if (type->lib_open(cur, filename) == 0)
|
||||
break;
|
||||
@ -1032,7 +1033,6 @@ find_module (handle, dir, libdir, dlname, old_name, installed)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
last_error = file_not_found_error;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1145,24 +1145,123 @@ cleanup:
|
||||
static int
|
||||
load_deplibs(handle, deplibs)
|
||||
lt_dlhandle handle;
|
||||
const char *deplibs;
|
||||
char *deplibs;
|
||||
{
|
||||
/* FIXME: load deplibs */
|
||||
char *p, *save_search_path;
|
||||
int i;
|
||||
int ret = 1, depcount = 0;
|
||||
char **names = 0;
|
||||
lt_dlhandle *handles = 0;
|
||||
|
||||
handle->depcount = 0;
|
||||
handle->deplibs = 0;
|
||||
/* Just to silence gcc -Wall */
|
||||
deplibs = 0;
|
||||
return 0;
|
||||
if (!deplibs)
|
||||
return 0;
|
||||
save_search_path = strdup(user_search_path);
|
||||
if (user_search_path && !save_search_path) {
|
||||
last_error = memory_error;
|
||||
return 1;
|
||||
}
|
||||
p = deplibs;
|
||||
/* extract search paths and count deplibs */
|
||||
while (*p) {
|
||||
if (!isspace(*p)) {
|
||||
char *end = p+1;
|
||||
while (*end && !isspace(*end)) end++;
|
||||
if (strncmp(p, "-L", 2) == 0 ||
|
||||
strncmp(p, "-R", 2) == 0) {
|
||||
char save = *end;
|
||||
*end = 0; /* set a temporary string terminator */
|
||||
if (lt_dladdsearchdir(p+2))
|
||||
goto cleanup;
|
||||
*end = save;
|
||||
} else
|
||||
depcount++;
|
||||
p = end;
|
||||
} else
|
||||
p++;
|
||||
}
|
||||
if (!depcount) {
|
||||
ret = 0;
|
||||
goto cleanup;
|
||||
}
|
||||
names = lt_dlmalloc(depcount * sizeof(char*));
|
||||
if (!names)
|
||||
goto cleanup;
|
||||
handles = lt_dlmalloc(depcount * sizeof(lt_dlhandle*));
|
||||
if (!handles)
|
||||
goto cleanup;
|
||||
depcount = 0;
|
||||
/* now only extract the actual deplibs */
|
||||
p = deplibs;
|
||||
while (*p) {
|
||||
if (!isspace(*p)) {
|
||||
char *end = p+1;
|
||||
while (*end && !isspace(*end)) end++;
|
||||
if (strncmp(p, "-L", 2) != 0 &&
|
||||
strncmp(p, "-R", 2) != 0) {
|
||||
char *name;
|
||||
char save = *end;
|
||||
*end = 0; /* set a temporary string terminator */
|
||||
if (strncmp(p, "-l", 2) == 0) {
|
||||
name = lt_dlmalloc(3+ /* "lib" */
|
||||
strlen(p+2)+strlen(shlib_ext)+1);
|
||||
if (name)
|
||||
sprintf(name, "lib%s%s", p+2, shlib_ext);
|
||||
} else
|
||||
name = strdup(p);
|
||||
if (name)
|
||||
names[depcount++] = name;
|
||||
else
|
||||
goto cleanup_names;
|
||||
*end = save;
|
||||
}
|
||||
p = end;
|
||||
} else
|
||||
p++;
|
||||
}
|
||||
/* load the deplibs (in reverse order) */
|
||||
for (i = 0; i < depcount; i++) {
|
||||
lt_dlhandle handle = lt_dlopen(names[depcount-1-i]);
|
||||
if (!handle) {
|
||||
int j;
|
||||
for (j = 0; j < i; j++)
|
||||
lt_dlclose(handles[j]);
|
||||
last_error = deplib_not_found_error;
|
||||
goto cleanup_names;
|
||||
}
|
||||
handles[i] = handle;
|
||||
}
|
||||
handle->depcount = depcount;
|
||||
handle->deplibs = handles;
|
||||
handles = 0;
|
||||
ret = 0;
|
||||
cleanup_names:
|
||||
for (i = 0; i < depcount; i++)
|
||||
lt_dlfree(names[i]);
|
||||
cleanup:
|
||||
if (names)
|
||||
lt_dlfree(names);
|
||||
if (handles)
|
||||
lt_dlfree(handles);
|
||||
/* restore the old search path */
|
||||
if (user_search_path)
|
||||
lt_dlfree(user_search_path);
|
||||
user_search_path = save_search_path;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
unload_deplibs(handle)
|
||||
lt_dlhandle handle;
|
||||
{
|
||||
/* FIXME: unload deplibs */
|
||||
/* Just to silence gcc -Wall */
|
||||
handle = 0;
|
||||
return 0;
|
||||
int i;
|
||||
int errors = 0;
|
||||
|
||||
if (!handle->depcount)
|
||||
return 0;
|
||||
for (i = 0; i < handle->depcount; i++)
|
||||
errors += lt_dlclose(handle->deplibs[i]);
|
||||
return errors;
|
||||
}
|
||||
|
||||
static inline int
|
||||
@ -1302,6 +1401,12 @@ lt_dlopen (filename)
|
||||
file = (FILE*) find_file(basename,
|
||||
getenv(LTDL_SHLIBPATH_VAR),
|
||||
&dir, 0);
|
||||
#endif
|
||||
#ifdef LTDL_SYSSEARCHPATH
|
||||
if (!file)
|
||||
file = (FILE*) find_file(basename,
|
||||
sys_search_path,
|
||||
&dir, 0);
|
||||
#endif
|
||||
}
|
||||
if (!file) {
|
||||
@ -1413,6 +1518,10 @@ lt_dlopen (filename)
|
||||
&& !find_file(basename,
|
||||
getenv(LTDL_SHLIBPATH_VAR),
|
||||
0, &newhandle)
|
||||
#endif
|
||||
#ifdef LTDL_SYSSEARCHPATH
|
||||
&& !find_file(basename, sys_search_path,
|
||||
0, &newhandle)
|
||||
#endif
|
||||
))) {
|
||||
lt_dlfree(handle);
|
||||
@ -1694,3 +1803,19 @@ lt_dlgetinfo (handle)
|
||||
}
|
||||
return &(handle->info);
|
||||
}
|
||||
|
||||
int
|
||||
lt_dlforeach (func, data)
|
||||
int (*func) LTDL_PARAMS((lt_dlhandle handle, lt_ptr_t data));
|
||||
lt_ptr_t data;
|
||||
{
|
||||
lt_dlhandle cur = handles;
|
||||
while (cur) {
|
||||
lt_dlhandle tmp = cur;
|
||||
cur = cur->next;
|
||||
if (func(tmp, data))
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -147,6 +147,8 @@ 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));
|
||||
extern int lt_dlforeach LTDL_PARAMS((
|
||||
int (*func)(lt_dlhandle handle, lt_ptr_t data), lt_ptr_t data));
|
||||
|
||||
#define LTDL_SET_PRELOADED_SYMBOLS() LTDL_STMT_START{ \
|
||||
extern const lt_dlsymlist lt_preloaded_symbols[]; \
|
||||
|
26
libtool.m4
vendored
26
libtool.m4
vendored
@ -307,15 +307,15 @@ dnl not every word. This closes a longstanding sh security hole.
|
||||
if test -f $ac_dir/$1; then
|
||||
lt_cv_path_FILE="$ac_dir/$1"
|
||||
if test -n "$file_magic_test_file"; then
|
||||
case "$deplibs_check_method" in
|
||||
"file_magic "*)
|
||||
file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
|
||||
case "$deplibs_check_method" in
|
||||
"file_magic "*)
|
||||
file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
|
||||
FILE="$lt_cv_path_FILE"
|
||||
if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
|
||||
egrep "$file_magic_regex" > /dev/null; then
|
||||
:
|
||||
else
|
||||
cat <<EOF 1>&2
|
||||
if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
|
||||
egrep "$file_magic_regex" > /dev/null; then
|
||||
:
|
||||
else
|
||||
cat <<EOF 1>&2
|
||||
|
||||
*** Warning: the command libtool uses to detect shared libraries,
|
||||
*** $file_magic_cmd, produces output that libtool cannot recognize.
|
||||
@ -327,8 +327,8 @@ dnl not every word. This closes a longstanding sh security hole.
|
||||
*** bug-libtool@gnu.org
|
||||
|
||||
EOF
|
||||
fi ;;
|
||||
esac
|
||||
fi ;;
|
||||
esac
|
||||
fi
|
||||
break
|
||||
fi
|
||||
@ -637,8 +637,7 @@ AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
|
||||
esac
|
||||
LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
|
||||
INCLTDL=ifelse($#,1,-I$1,
|
||||
['-I${top_builddir}/libltdl -I${top_srcdir}/libltdl'])
|
||||
INCLTDL=ifelse($#,1,-I$1,['-I${top_srcdir}/libltdl'])
|
||||
])
|
||||
|
||||
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
|
||||
@ -662,8 +661,7 @@ AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
||||
if test x"$enable_ltdl_install" = x"yes"; then
|
||||
ac_configure_args="$ac_configure_args --enable-ltdl-install"
|
||||
LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
|
||||
INCLTDL=ifelse($#,1,-I$1,
|
||||
['-I${top_builddir}/libltdl -I${top_srcdir}/libltdl'])
|
||||
INCLTDL=ifelse($#,1,-I$1,['-I${top_srcdir}/libltdl'])
|
||||
else
|
||||
ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
|
||||
LIBLTDL="-lltdl"
|
||||
|
@ -238,12 +238,12 @@ if test -z "$automake"; then
|
||||
instserial=`grep '^# serial ' $ltdl_m4 | grep 'AC_LIB_LTDL' | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'`
|
||||
|
||||
if test -z "$instserial"; then
|
||||
echo "$progname: warning: no serial number on \`$ltdl_m4'" 1>&2
|
||||
echo "$progname: warning: no serial number on \`$ltdl_m4'" 1>&2
|
||||
else
|
||||
# If the local macro has no serial number, we assume it's ancient.
|
||||
localserial=`grep '^# serial ' aclocal.m4 | grep 'AC_LIB_LTDL' | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'`
|
||||
# If the local macro has no serial number, we assume it's ancient.
|
||||
localserial=`grep '^# serial ' aclocal.m4 | grep 'AC_LIB_LTDL' | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'`
|
||||
|
||||
test -z "$localserial" && localserial=0
|
||||
test -z "$localserial" && localserial=0
|
||||
|
||||
if test "$localserial" -lt "$instserial"; then
|
||||
echo "You should $updatemsg."
|
||||
|
14
ltconfig.in
14
ltconfig.in
@ -1042,7 +1042,7 @@ EOF
|
||||
if test "x$lt_cv_need_dllmain" = "xyes"; then
|
||||
ltdll_obj='$objdir/$soname-ltdll.'"$objext "
|
||||
ltdll_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
|
||||
test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~'
|
||||
test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~'
|
||||
else
|
||||
ltdll_obj=
|
||||
ltdll_cmds=
|
||||
@ -1061,10 +1061,10 @@ EOF
|
||||
_lt_hint=1;
|
||||
cat $export_symbols | while read symbol; do
|
||||
set dummy \$symbol;
|
||||
case \$# in
|
||||
2) echo " \$2 @ \$_lt_hint ; " >> $objdir/$soname-def;;
|
||||
*) echo " \$2 @ \$_lt_hint \$3 ; " >> $objdir/$soname-def;;
|
||||
esac;
|
||||
case \$# in
|
||||
2) echo " \$2 @ \$_lt_hint ; " >> $objdir/$soname-def;;
|
||||
*) echo " \$2 @ \$_lt_hint \$3 ; " >> $objdir/$soname-def;;
|
||||
esac;
|
||||
_lt_hint=`expr 1 + \$_lt_hint`;
|
||||
done~
|
||||
'"$ltdll_cmds"'
|
||||
@ -1134,9 +1134,9 @@ EOF
|
||||
*)
|
||||
# ancient GNU ld didn't support --whole-archive et. al.
|
||||
if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
|
||||
whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
|
||||
whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
|
||||
else
|
||||
whole_archive_flag_spec=
|
||||
whole_archive_flag_spec=
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
25
ltdl.m4
25
ltdl.m4
@ -33,7 +33,7 @@ dnl of the ltdl objects -- including compiler checks (above) and header
|
||||
dnl checks (below).
|
||||
AC_REQUIRE([AC_HEADER_STDC])dnl
|
||||
|
||||
AC_CHECK_HEADERS(malloc.h memory.h stdlib.h stdio.h unistd.h ctype.h dlfcn.h dl.h dld.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(strchr index, break)
|
||||
AC_CHECK_FUNCS(strrchr rindex, break)
|
||||
@ -41,6 +41,7 @@ AC_CHECK_FUNCS(strrchr rindex, break)
|
||||
AC_REQUIRE([AC_LTDL_ENABLE_INSTALL])dnl
|
||||
AC_REQUIRE([AC_LTDL_SHLIBEXT])dnl
|
||||
AC_REQUIRE([AC_LTDL_SHLIBPATH])dnl
|
||||
AC_REQUIRE([AC_LTDL_SYSSEARCHPATH])dnl
|
||||
AC_REQUIRE([AC_LTDL_OBJDIR])dnl
|
||||
AC_REQUIRE([AC_LTDL_DLPREOPEN])dnl
|
||||
AC_REQUIRE([AC_LTDL_DLLIB])dnl
|
||||
@ -96,6 +97,28 @@ if test -n "$libltdl_cv_shlibpath_var"; then
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN(AC_LTDL_SYSSEARCHPATH,
|
||||
[AC_REQUIRE([AC_LTDL_SNARF_CONFIG])dnl
|
||||
AC_CACHE_CHECK([for the default library search path],
|
||||
libltdl_cv_sys_search_path, [libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec"])
|
||||
if test -n "$libltdl_cv_sys_search_path"; then
|
||||
case "$lt_target" in
|
||||
*-*-mingw*) pathsep=";" ;;
|
||||
*) pathsep=":" ;;
|
||||
esac
|
||||
sys_search_path=
|
||||
for dir in $libltdl_cv_sys_search_path; do
|
||||
if test -z "$sys_search_path"; then
|
||||
sys_search_path="$dir"
|
||||
else
|
||||
sys_search_path="$sys_search_path$pathsep$dir"
|
||||
fi
|
||||
done
|
||||
AC_DEFINE_UNQUOTED(LTDL_SYSSEARCHPATH, "$sys_search_path",
|
||||
[Define to the system default library search path. ])
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN(AC_LTDL_OBJDIR,
|
||||
[AC_CACHE_CHECK([for objdir],
|
||||
libltdl_cv_objdir, [libltdl_cv_objdir="$objdir"
|
||||
|
2
ltmain.c
2
ltmain.c
@ -1,5 +1,5 @@
|
||||
/* ltmain.c - C implementation of GNU Libtool
|
||||
* Copyright (C) 1998-2000 Free Software Foundation, Inc.
|
||||
* Copyright (C) 1998-1999 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
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
AUTOMAKE_OPTIONS = no-dependencies foreign
|
||||
|
||||
INCLUDES = -I$(srcdir)/../libltdl
|
||||
INCLUDES = $(INCLTDL)
|
||||
|
||||
EXTRA_DIST = acinclude.m4
|
||||
|
||||
|
@ -12,6 +12,7 @@ dnl Since the package is flat, we need not use the line above,
|
||||
dnl and not having macros in LIBLTDL allows us to build LIBLTDL
|
||||
dnl on demand even with broken makes
|
||||
AC_LIBLTDL_CONVENIENCE(../libltdl)
|
||||
AC_SUBST(INCLTDL)
|
||||
AC_SUBST(LIBLTDL)
|
||||
|
||||
AC_LIBTOOL_WIN32_DLL
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* foo.h -- interface to the libfoo* libraries
|
||||
Copyright (C) 1998-2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998-1999 Free Software Foundation, Inc.
|
||||
Originally by Thomas Tanner <tanner@ffii.org>
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* foo1.c -- trivial test library
|
||||
Copyright (C) 1998-2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998-1999 Free Software Foundation, Inc.
|
||||
Originally by Thomas Tanner <tanner@ffii.org>
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* foo2.c -- trivial test library
|
||||
Copyright (C) 1998-2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998-1999 Free Software Foundation, Inc.
|
||||
Originally by Thomas Tanner <tanner@ffii.org>
|
||||
This file is part of GNU Libtool.
|
||||
|
||||
|
2
mkstamp
2
mkstamp
@ -1,7 +1,7 @@
|
||||
#! /bin/sh
|
||||
|
||||
# mkstamp - extract data from Revision and Date RCS tags in a file
|
||||
# Copyright (C) 1999-2000 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
# Alexandre Oliva <oliva@dcc.unicamp.br>
|
||||
#
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
|
@ -46,7 +46,8 @@ LIBS = @LIBS@
|
||||
# Be sure to reexport important environment variables.
|
||||
TESTS_ENVIRONMENT = CC="$(CC)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" \
|
||||
LD="$(LD)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)" \
|
||||
LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)"
|
||||
LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \
|
||||
OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)"
|
||||
|
||||
EXTRA_DIST = defs $(TESTS)
|
||||
|
||||
|
@ -43,7 +43,7 @@ mv $objdir/libtool.new libtool
|
||||
|
||||
# main.o is not compiled with libtool, but it depends on it, so make
|
||||
# sure it is up-to-date
|
||||
$make main.o || exit 1
|
||||
$make main.$OBJEXT || exit 1
|
||||
|
||||
echo "= Making object files in ../mdemo (dry run)"
|
||||
ls -l . $objdir > $before
|
||||
@ -65,12 +65,12 @@ $make foo1.la libfoo2.la || exit 1
|
||||
|
||||
echo "= Making programs in ../mdemo (dry run)"
|
||||
ls -l . $objdir > $before
|
||||
force_dry_run=yes $make mdemo mdemo.static 1>&2 || exit $?
|
||||
force_dry_run=yes $make mdemo$EXEEXT mdemo.static 1>&2 || exit $?
|
||||
ls -l . $objdir > $after
|
||||
cmp $before $after > /dev/null || exit 1
|
||||
# Now really make them
|
||||
echo "= Making programs in ../mdemo"
|
||||
$make mdemo mdemo.static || exit 1
|
||||
$make mdemo$EXEEXT mdemo.static || exit 1
|
||||
|
||||
echo "= Running $make install in ../mdemo (dry run)"
|
||||
# Libtool does not create these directories
|
||||
@ -88,7 +88,7 @@ $make install || exit 1
|
||||
|
||||
echo "= Running $make uninstall in ../mdemo (dry run)"
|
||||
# Libtool does not uninstall the programs, remove them first
|
||||
rm -f $prefix/bin/mdemo $prefix/bin/mdemo.static
|
||||
rm -f $prefix/bin/mdemo$EXEEXT $prefix/bin/mdemo.static
|
||||
ls -l . $objdir > $before
|
||||
ls -lR $prefix >> $before
|
||||
force_dry_run=yes $make uninstall 1>&2 || exit $?
|
||||
|
Loading…
Reference in New Issue
Block a user