Commit Graph

246 Commits

Author SHA1 Message Date
Gary V. Vaughan
2d38c0a17d * configure.ac, libltdl/configure.ac, tests/cdemo/configure.ac,
tests/demo/configure.ac, tests/depdemo/configure.ac,
tests/f77demo/configure.ac, tests/mdemo/configure.ac,
tests/mdemo2/configure.ac, tests/pdemo/configure.ac,
tests/tagdemo/configure.ac (AM_INIT_AUTOMAKE): Remove redundant
arguments.
* libltdl/configure.ac: Use quadrigraphs to escape macronames.
2003-10-21 10:56:24 +00:00
Scott James Remnant
1bbeb14f36 * libltdl/ltdl.c (lt_dlerror): change return value when
no error has occured to NULL to match documentation.
(Debian Bug #157229)
2003-10-07 22:29:05 +00:00
Bob Friesenhahn
abaff9e0ec * libltdl/ltdl.c: Only include malloc.h if stdlib.h can not be
found.
2003-09-29 10:57:57 +00:00
Gary V. Vaughan
27a9392fb1 * bootstrap: Rewritten to use autoreconf.
* config.guess, config.sub, mkstamp:  Moved from here...
* config/config.guess, config/config.sub, config/mkstamp: ...to
here, respectively.
* libtool.m4, ltdl.m4: Moved from here...
* m4/libtool.m4, m4/ltdl.m4: ...to here, respectively.
* configure.ac: Removed various acinclude.m4 hackery, as these
files are no longer needed with automake 1.8.
* Makefile.am: Removed various acinclude.m4 hackery, as these
files are no longer needed with automake 1.8.
(AUTOMAKE_OPTIONS): Require CVS automake.
(CONF_SUBDIRS, CFLAGS, CPPFLAGS, LDFLAGS, LIBS, FFLAGS, FLIBS):
Automake now makes a Make variable from every AC_SUBST, so these
are NOP.
(aclocal_macros): These files are now in their own m4 subdir.
Changed all clients.
(EXTRA_DIST): mkstamp has moved to the new config subdir.  Changed
all clients.
(pkgdata_SCRIPTS): Ditto wrt config.guess and config.sub.
(pkgdata_DATA): Ditto wrt ltmain.sh.
* f77demo/configure.ac, libltdl/configure.ac (AM_CONFIG_HEADER):
Is deprecated in favour of AC_CONFIG_HEADERS.  Updated to the
latter.
* Makefile.am, cdemo/Makefile.am, demo/Makefile.am,
depdemo/Makefile.am, f77demo/Makefile.am, mdemo/Makefile.am,
mdemo2/Makefile.am, pdemo/Makefile.am, tagdemo/Makefile.am
(EXTRA_DIST): Remove acinclude.m4.
(ACLOCAL_AMFLAGS): Search new `m4' macro directory.
* configure.ac, cdemo/configure.ac, demo/configure.ac,
depdemo/configure.ac, f77demo/configure.ac, mdemo/configure.ac,
mdemo2/configure.ac, pdemo/configure.ac, tagdemo/configure.ac
(AC_CONFIG_AUX_DIR): Declare that config helper	scripts are now
kept in the new config subdir.
* libltdl/configure.ac (AC_CONFIG_AUX_DIR): Removed.  Defaults to
`.' anyway.
2003-09-25 11:22:29 +00:00
Robert Millan
68bac5f496 Updated to reflect upcoming autoconf 2.58 and automake 1.8 2003-09-24 17:03:27 +00:00
Jim Pick
522aef6a38 Much as we have tried not to make it the callers' responsibility
to maintain an lt_dlrealloc function pointer, it is too difficult
to implement realloc as malloc/memcpy/free without knowing the
size of the original block.  rpl_realloc has been deprecated since
2002-10-30, but kaffe has real failures with that so it's time to
bite the bullet.  Caller gets to maintain lt_dlrealloc:

* NEWS (1.5.1): Updated.
* libltdl/ltdl.c (LT_DLREALLOC): Use lt_dlrealloc so the user can
update the function pointer to match lt_dlmalloc.
(lt_emalloc): Use lt_dlrealloc rather than hardcoding realloc.
* doc/libtool.texi (Libltdl interface): Describe lt_dlrealloc now
that it too has become part of the exported interface to libltdl.
2003-08-05 16:05:01 +00:00
Peter O'Gorman
9bfa9cf6b9 * libtool.m4 (darwin): Use "-undefined dynamic_lookup" if the
user set MACOSX_DEPLOYMENT_TARGET to 10.3 or greater.
* libltdl/ltdl.c (dyld): Save the error from the first lookup
to report in lt_dlerror(). Otherwise the error is always
"Symbol _foo not in /usr/lib/libSystem.dylib".
Thanks to Chris Zubrzycki for reporting this.
2003-08-01 19:08:14 +00:00
Robert Boehne
f6f942758d * libltdl/ltdl.h: Tweak the header to support visual studio. 2003-08-01 18:31:55 +00:00
Peter O'Gorman
90233b7fa9 * libtool.m4 (darwin): Remove checks for Apple-specific gcc.
* libltdl/ltdl.c (HAVE_MACH_O_DYLD_H): #define
__private_extern__ for fsf gcc.
* ltmain.in (darwin): Only add new paths to newlib_search_path.
2003-06-03 15:36:58 +00:00
Gary V. Vaughan
a45bccc70d * libltdl/ltdl.c (argz_insert): Corrected an off by one error when
checking that before is not out of range.
2003-05-30 15:25:10 +00:00
Gary V. Vaughan
b6dc76b844 * libltdl/ltdl.c (lt_int_dyld_lib_install_name): Removed unused
variable mh1.
(sys_dyld_close): Removed unused variable size.
2003-05-30 15:21:46 +00:00
Peter O'Gorman
eeb3d9cc7c * libltdl/ltdl.c (dyld): Remove some debug printf's, fix a bug.
* ltmain.in (darwin): Only link against shared libraries when doing
link_all_deplibs.
2003-03-29 04:09:00 +00:00
Peter O'Gorman
97ade8120f * ltmain.in: Always use $echo not echo for consistency.
Changes for darwin building. Warn if linking against libs linked
with -module. Use module_cmds if available and building a module,
move convenience double lib check,
* libltdl/ltdl.c: ltdl support for darwin (first blush)
* libltdl/README: note that darwin is supported
* ltdl.m4: Changes for darwin, and for new shrext
* libtool.m4: Changed the way darwin builds stuff (make check passes)
added module_cmds, module_expsym_cmds and hardcode_automatic and put
them in the libtool script. check for zsh's removal of escapes. Allow
libraries to be stripped on darwin.
* TODO: Remove the todo about zsh's removal of excapes. note that zsh
echo works perfectly well, eval is screwed up. Seems to be fixed in
latest zsh.
* THANKS: added self :)
* f77demo/configure.ac: Use config.h or it doesn't work.
2003-03-20 20:24:21 +00:00
Robert Boehne
65c07ebba9 * libltdl/configure.ac: Use AC_CONFIG_AUX_DIR([.]) to place
auxilary files in the libltdl directory.
* Makefile.am: Add to the ltmain.sh rule to copy it into the
libltdl subdirectory.
* bootstrap: Explicitly handle ltmain.sh in libltdl, and pass
--copy to automake.
2003-02-25 00:30:28 +00:00
Charles Wilson
6da15e03aa * libtool.m4 (AC_LIBTOOL_PROG_CC_C_O): use printf, not
echo. (AC_DEPLIBS_CHECK_METHOD): use new shell function
win32_libid on w32 platforms
* ltmain.in: add new section for shell functions. Add
win32_libid() shell function.
* f77demo/Makefile.am: add -no-undefined flag


* ltdl.c (realloc): Remove custom realloc. (#define
rpl_realloc realloc) and comment out later code for custom
realloc. You can't define your own malloc unless you know
enough about the malloc in use to be able to tell how big
the src ptr is. The disabled code incorrectly used the
*destination* ptr to decide how much to copy. This
sometimes results in out-of-bound accesses which cause
segfaults. This is a quick hack for now; we may want
something cleaner later. (tryall_dlopen_module): check to
be sure (dirname_len > 0) before testing first character
against '/'. (try_dlopen): check for feof(file) in read
loop -- otherwise infloop?
2002-10-31 00:52:39 +00:00
Andrew Suffield
6487bfdcb5 Correct sense of libltdl file not found check. 2002-10-24 21:28:34 +00:00
Robert Boehne
c2b67f1043 * libltdl/ltdl.c: Commented out access() call that checks for a
library file's existence and permissions, as it appears to fail
in every case.
2002-09-24 14:06:50 +00:00
Bob Friesenhahn
d036ca584c Port libltdl fully to native Win32 API. 2002-08-28 20:40:28 +00:00
Gary V. Vaughan
f57ca23232 * libltdl/ltdl.c (tryall_dlopen): We need to catch missing file
errors early so that file_not_found() can detect what happened.
2002-07-16 09:12:30 +00:00
Gary V. Vaughan
a6eb30bff0 * libltdl/ltdl.c (argz_insert): Actually, BEFORE can be NULL
when *PARGZ_LEN is non-NULL, so the assertion to the contrary was
bogus.
Reported by Bob Friesenhahn <bfreisen@simple.dallas.tx.us>
and Albert Chin-A-Young <china@thewrittenword.com>
2002-06-23 21:35:58 +00:00
Gary V. Vaughan
762853d3e2 * libltdl/ltdl.c (foreach_dirinpath): Ensure that filename is '0'
terminated by all code paths.
Reported by Lutz Mller <lutz@users.sourceforge.net>
2002-06-22 14:47:24 +00:00
Daniel Kobras
9fb013ff55 * libltdl/ltdl.c (try_dlopen): Don't return bogus handle to user
if tryall_dlopen() fails.
2002-06-11 16:09:22 +00:00
Charles Wilson
7cb0a065a5 * NEWS: Updated.
* libtool.m4: use $NM to create the symbol list on cygwin, not
$ltdll_cmds as on mingw.  For all tags, (and host=cygwin) set
allow_undefined_flag="" so that the --auto-import magic
works properly.  For all tags (and host=cygiwn) set
always_export_symbols=no -- it is unnecessary thanks to
binutils' auto-export magic.
* libltdl/ltdl.c: Don't force cygwin to use the LoadLibrary
wrapper; use cygwin's builtin implementatino of dl*.
* cdemo/Makefile.am: the downside of unsetting
'allow_undefined_flag' -- we must include -no-undefined
in the _la_LDFLAGS variable.
* depdemo/l1/Makefile.am: ditto.
* depdemo/l2/Makefile.am: ditto.
* depdemo/l3/Makefile.am: ditto.
* depdemo/l4/Makefile.am: ditto.
* mdemo/Makefile.am: ditto.
* tagdemo/Makefile.am: ditto.
* demo/Makefile.am: ditto.  But also, we must make special
provision to clean up the hell0 wrapper script.
* pdemo/Makefile.am: ditto -no-undefined.  ditto hell0.
And use 'hell_static' instead of 'hell.static'.
* tests/pdemo-inst.test: use 'hell_static' instead
of 'hell.static'.
* tests/pdemo-exec.test: ditto.
2002-06-01 14:09:50 +00:00
Gary V. Vaughan
1cf9d2964d * NEWS: Updated.
* THANKS: Added Rob Collins and Chuck Wilson for their cygwin
work.

From Robert Collins  <robert.collins@itdomain.com.au>:
* configure.ac (AC_EXEEXT): Needed for DOSish systems.
* libtool.m4 (shlibpath_overrides_runpath) [cygwin]: Set to yes
when compiling with gcc.
(lt_prog_compiler_pic) [cygwin]: No longer needs the -DDLL_EXPORT
hack, so we just say the pic is the default.
(AC_LIBTOOL_PROG_LD_SHLIBS) [cygwin]: Extract symbols from a
library normally.
[cygwin]: Declare C++ compiler characterisics for g++, taking into
account the new auto-import support in cygwin ld.
* ltmain.in (specialdeplibs) [cygwin]: Be careful about
eliminating duplicate -lgcc's from the link line.
[cygwin]: Be smarter about .exe suffixes.
* demo/configure.ac (AC_EXEEXT, AC_LIBTOOL_WIN32_DLL):  Support
DOSish systems properly.
* depdemo/configure.ac (AC_EXEEXT, AC_LIBTOOL_WIN32_DLL):  Ditto.
* demo/Makefile.am (deplibs-check): Allow for .exe suffix.  Use
hell_static instead of hell.static for multi-`.' inhibited OSes.
* tests/demo-exec.test: Ditto.
* tests/demo-inst.test: Ditto.
* demo/foo.h [cygwin]: Sanitize cygwin dll support.
* demo/foo.c (_LIBFOO_COMPILATION_): No longer required.
* demo/hello.c (_LIBFOO_COMPILATION_): Ditto.
* depdemo/Makefile.am (bin_PROGRAMS): Use depdemo_static instead
of depdemo.static for multi-`.' inhibited OSes.
* tests/depdemo-exec.test: Ditto.
* tests/depdemo-inst.test: Ditto.
* mdemo/Makefile.am (bin_PROGRAMS):  Ditto for mdemo.static.
* tests/dryrun.test: Ditto.
* tests/mdemo-exec.test: Ditto.
* tests/mdemo-inst.test: Ditto.
* tests/build-relink.test:  Be careful about possible .exe
suffixes.
* tests/noinst-link.test: Allow for .exe suffix.
2002-03-03 03:19:55 +00:00
Volker Christian
bc88ff43b1 * libltdl/ltdl.c (find_handle_callback): treat the result of a call
to access(2) correctly when deciding whether a library can be found
in a directory from user_search_path.
2002-01-11 00:25:19 +00:00
Albert Chin-A-Young
55770c848b * ltdl.c: change some types to size_t from int because
strlen() returns size_t. argz_len changed to size_t in
foreach_dirinpath() because argzize_path() takes 3rd
argument as size_t, not int. Based on lint run from
Bob Friesenhahn <bfriesen@simple.dallas.tx.us>.
2001-10-28 02:35:22 +00:00
Gary V. Vaughan
9c63d67ebe * configure.ac: General modernisation and cleanup.
* cdemo/configure.ac: Ditto.
* demo/configure.ac: Ditto.
* depdemo/configrue.ac: Ditto.
* ltdl/configure.ac: Ditto.
* ltdldemo/configure.ac: Ditto.
* mdemo/configure.ac: Ditto.
* pdemo/configure.ac: Ditto.
* tagdemo/configure.ac: Ditto.
2001-10-06 15:35:17 +00:00
Albert Chin-A-Young
1093bb18a8 * libltdl/ltdl.c: Match function return type with prototype
(add static initializer to file_not_found).
2001-10-04 14:53:19 +00:00
Albert Chin-A-Young
d4e4eab57e * libltdl/ltdl.c: Match function return type with prototype
(add static initializer to some functions) to prevent warnings
from HP-UX cc.
2001-09-21 17:38:39 +00:00
Gary V. Vaughan
862b3a97d5 * libltdl/ltdl.c: Added support for dmalloc, and uncovered some
memory bugs as a result.
2001-09-21 03:28:39 +00:00
Gary V. Vaughan
7eba1343df * ltdl.m4 (AC_CHECK_HEADERS): Check for assert.h.
* libltdl/ltdl.c:  If not, disable assertions manually.
2001-09-13 19:43:58 +00:00
Gary V. Vaughan
2d4c83cc36 * libltdl/configure.ac (AM_INIT_AUTOMAKE): Bump libltdl version to
1.2.
* libltdl/Makefile.am (libltdl_la_LDFLAGS):  Bump libtool library
version info to 4:0:1.
2001-09-11 01:26:44 +00:00
Gary V. Vaughan
d736ae4d0c * libltdl/ltdl.c (foreach_dirinpath): argz_len should be a size_t.
Reported by Albert Chin <china@thewrittenword.com>
2001-09-06 23:16:04 +00:00
Gary V. Vaughan
adc412c82b From Michael Pruett <mpruett@engr.sgi.com>:
* libltdl/ltdl.c (find_module): `0' valued arguments to
tryall_dlopen_module() must be explicitly cast to avoid compiler
warnings on some environments.
2001-09-06 21:23:59 +00:00
Gary V. Vaughan
cc3dcd152e From Marius Vollmer <mvo@zagadka.ping.de>:
* libltdl/ltdl.c (tryall_dlopen_module): Don't forget to propogate
errors over recurse levels.
2001-09-03 00:22:13 +00:00
Gary V. Vaughan
1a6eb03f74 Based on a patch from Marius Vollmer <mvo@zagadka.ping.de>:
* NEWS: updated.
* ltdl.m4 (AC_LIB_LTDL): Check for unistd.h.
* ltdl.c: Include unistd.h if it exists.
(LTDL_SEARCHPATH_VAR): Macro to prevent hardcoding
"LTDL_LIBRARY_PATH".
(LTDL_ARCHIVE_EXT): Macro to prevent hardcoding ".la".
(archive_ext): Have only one copy of ".la" in the readonly
segment of the compiled library.
(find_handle_callback): Don't bother trying to dlopen the file if
it doesn't exist.
(find_handle): Don't bother searching for files if no search_path
was supplied.
(file_not_found): A new function to determine whether the last
error was due to a file not found condition.
(try_dlopen): Renamed from lt_dlopen() and changed to have the
same footprint as tryall_dlopen.  This involved a minor rewrite of
much of the internals of this function.
(lt_dlopen): A new function wrapped arounf try_dlopen().
(lt_dlopenext): If a file already has a suitable extension, don't
bother adding additional extensions and trying to open those.
Tidy up the rest of the code to prevent continued searching with
an eventual FILE_NOT_FOUND when a genuine failure earlier in the
search process could be legitimately reported.
2001-09-02 17:38:55 +00:00
Gary V. Vaughan
63ad459714 * libltdl/ltdl.c (argz_create_sep): Don't forget to include the
terminating '0' when counting argz_len.
(argz_create_sep): When canonicalizing argz, don't forget to copy
the terminating '0', incase canonicalization has shortened argz.
(argz_stringify): Don't covert the final '0' to a separator.
2001-08-16 00:48:52 +00:00
Gary V. Vaughan
196a286bc6 * libltdl/ltdl.c (lt_dlhandle_next): Now we can loop through all
loaded module handles as originally intended.
2001-08-15 00:23:22 +00:00
Gary V. Vaughan
27f0f2ccee * libltdl/ltdl.c (lt_dlseterror): Oops. This never worked
either, due to a pair of typos.  Now fixed.
2001-08-15 00:01:46 +00:00
Gary V. Vaughan
a3c34e5ca2 * libltdl/ltdl.c (N_ELEMENTS): Deleted. How come nobody noticed
there was no way this could have ever worked?
(lt_dlcaller_set_data): Now that valid caller_ids must be
non-zero, allocate an addition entry in the caller_data vector and
use a zero valued key as the end marker.
(lt_dlcaller_get_data): Iterate up to the end marker in one pass.
2001-08-14 23:28:40 +00:00
Gary V. Vaughan
93a734ce9d * libltdl/ltdl.c (lt_dlcaller_register): Caller ids are allocated
starting from value `1', so that clients can use a value of zero
to indicate that libltdl has not yet initialised.
2001-08-14 22:45:21 +00:00
Gary V. Vaughan
47491fdaa1 * libltdl/ltdl.c (find_file_callback): Fix a multiple free()
bug.
(tryall_dlopen_module): Remove some unused variables.
2001-08-13 22:53:39 +00:00
Gary V. Vaughan
01d29019a5 * libltdl/ltdl.c (lt_dlinsertsearchdir): Calculate the address
of the end of user_search_path correctly.
2001-08-13 19:51:34 +00:00
Gary V. Vaughan
8fe352b363 * libltdl/ltdl.c (rpl_argz_stringify): New fallback implementation.
* ltdl.m4 (AC_LTDL_FUNC_ARGZ):  Test for argz_stringify in libc.
* libltdl/ltdl.c (lt_argz_insertinorder): Renamed from
lt_argz_insert to make room for...
(lt_argz_insert): Wraps argz_insert with libltdl error handling.
(lt_dlpath_insertdir): Insert new path elements into an
argzized path.
(lt_dlinsertsearchdir): New function to insert new search
directories anywhere into user_search_path using the above.
(lt_dladdsearchdir): Rewritten to use lt_dlpath_insertdir.
* libltdl/ltdl.h (lt_dlinsertsearchdir): Prototype for export.
* doc/libtool.texi (Libltdl interface): Document it.
* NEWS: Updated,
2001-08-13 17:25:49 +00:00
Gary V. Vaughan
3539a1bf85 * libltdl/ltdl.c (load_deplibs): Insert missing 1st argument to
LT_EMALLOC.
2001-08-05 16:01:56 +00:00
Gary V. Vaughan
9b398f1b1d * libltdl/ltdl.c: Fixed several careless mistakes in the
foreach_dirinpath support functions.
(foreach_dirinpath): Walk path elements with the argz API.
2001-08-05 10:57:03 +00:00
Gary V. Vaughan
5473bb5e38 * ltdl.m4: Bump serial number.
General reformat and tify up in line with Autoconf-2.50 support.
(AC_LTDL_FUNC_ARGZ): Test for system implementations of a
handful of argz API calls, the error_t type, and the argz.h
header.
* libltdl/configure.ac (AM_INIT_AUTOMAKE): Bump version number.
* libltdl/ltdl.c (rpl_argz_append, rpl_argz_create_sep.
rpl_argz_insert, rpl_rgz_next):  Fallback implementations of
the similarly named functions for machines that don;t use glibc.
(lt_dlrealloc):  New memory function pointer that can be set by
the client.  Defaults to rpl_realloc, which in turn uses only
lt_dlmalloc and lt_dlfree.
(LT_EMALLOC, LT_EREALLOC): Set internal out-of-memory error
inside the functions called by these new macros.  Simplified all
callers by removing explicit client error reporting.
(memmove):  Fallback implementation of overlap safe memory copy
function.
(tryall_dlopen):  Factorized common code into...
(tryall_dlopen_module): ...this new helper function.
(canonicalize_path):  Changed function signature to return success
or failure.  Updated all callers.
(foreachfile_callback):  Make use of argz API.
(LT_DLSTRLEN): Moved from here...
* libltdl/ltdl.h (LT_STRLEN): ...to here.  Updated all callers.
(lt_dlrealloc):  Declare new memory management handle.
2001-08-01 06:50:16 +00:00
Gary V. Vaughan
be59bd4ad3 From Steve Ellcey <sje@cup.hp.com>:
* libltdl/ltdl.c (foreach_dirinpath): Free unassigned pointer
fix for `canonical'.
2001-07-25 02:52:36 +00:00
Gary V. Vaughan
63a4771533 Cleanup of libltdl:
* ltdl.c (lt_dladderror): Don't use `index' as a variable name,
since it is a function on BSD based boxes.
(lt_dlseterror): Ditto.
(lt_dlexit): Remove unused errormsg declaration.
(foreach_dirinpath):  Make sure filename is initialised.
(find_handle):  Return NULL for a failed search.
(foreachfile_callback): Don't reuse data2 symbol from prototype
in func declaration to prevent symbol shadowing.
* ltdl.h (lt_dlmutex_seterror): Don't use `error' as a parameter
name, since it is a function on glibc boxes.
2001-07-02 01:21:30 +00:00
Tim Van Holder
4925d0771e General cleanup of autoconf-2.50 upgrade:
* configure.ac: Mark as needing autoconf-mode in
emacs.  Pass arguments to AC_INIT.
* cdemo/configure.ac: Ditto.
* demo/configure.ac: Ditto.
* depdemo/configure.ac: Ditto.
* libtldl/configure.ac: Ditto.
* mdemo/configure.ac: Ditto.
* pdemo/configure.ac: Ditto.
* tagdemo/configure.ac: Ditto.
* ltdl.m4: Mark as needing autoconf-mode in
emacs.
* libtool.m4: Mark as needing autoconf-mode in
emacs.  Don't add () to AS_MESSAGE_LOG_FD.
* libltdl/configure.ac: Use config-h.in as
template for config.h.
* tagdemo/configure.ac: Drop the AC_DIAGNOSTIC. Move
AC_LANG([C++]) after the OBJEXT/EXEEXT check.
2001-06-29 22:56:50 +00:00