New function.
(func_dirname_and_basename) <!XSI>: New function.
* libltdl/config/ltmain.m4sh (func_ltwrapper_scriptname):
Call it. Also, take advantage of missed optimization using
func_dirname's additional arguments.
(func_mode_compile): Call it.
(func_mode_install): Call it.
(func_mode_link): Call it.
libltdl/loaders/dyld.c, libltdl/loaders/dlopen.c, libltdl/ltdl.c,
libltdl/lt_error.c, libltdl/lt_dlloader.c, libltdl/lt__dirent.c:
Include lt__private.h prior to any system headers.
* libltdl/lt__alloc.c: Remove redundant inclusion of configuration
header.
force-pull in this file by aclocal.
* libltdl/m4/libtool.m4 (LT_INIT): Require LTOBSOLETE_VERSION.
* tests/libtoolize.at (upgrading verbatim style aclocal.m4):
Adjust.
Report by H. J. Lu <hjl@lucon.org>.
need a library prefix like 'lib', such as BeOS. Fix a number
of bugs exposed by this test in order for it to pass.
Currently the prefix is hardcoded as 'lib', as I am not aware
of systems that require a different prefix:
* libltdl/loaders/preopen.c (lt_dlpreload_open): Move error
condition out of test loop to be sure that each originator is
tried, instead of erroring out if the first doesn't match.
Support passing NULL as the originator to load all preloaded
modules originating in the program itself.
* libltdl/lt_dlloader.c (lt_dlloader_dump): New debug function.
* libltdl/libltdl/lt_dlloader.h (lt_dlloader_dump): Declare it
when LT_DEBUG_LOADERS is defined at compile time.
* libltdl/ltdl.c (lt_dlinit): Dump loader list after successful
initialisation.
(tryall_dlopen): Add a new VTABLE parameter to force use of a
specific loader in preference to trying every loader in turn.
Adjust all callers.
(try_dlopen): Always see whether a module was preloaded for
module names with no directory component before searching the
filesystem for a match.
* libltdl/m4/libtool.m4 (_LT_CMD_GLOBAL_SYMBOLS): Declare
a new global_symbol_to_c_name_address_lib_prefix variable.
(global_symbol_to_c_name_address_lib_prefix): The sed
expressions to use when a lib prefix is enforced need to be
slightly different to work with preloaded modules.
* libltdl/config/ltmain.m4sh (func_generate_dlsyms): In order
to name preloaded symbols correctly for the lookup algorithm
to work when the loaded module file must be prefixed with lib.
Use global_symbol_to_c_name_address_lib_prefix when
need_lib_prefix is other than no.
* tests/need_lib_prefix.at: New test to check for breakage on
hosts where need_lib_prefix is unknown.
* Makefile.am (TESTSUITE_AT): Add new test.
* tests/TODO: Note missing tests that would have caught some
of the latent bugs fixed by this patch.
* HACKING: Document libltdl keyword.
* NEWS: Updated.
for use with cwrapper.
(func_ltwrapper_script_p): New function.
(func_ltwrapper_executable_p): New function.
(func_ltwrapper_scriptname): New function.
(func_ltwrapper_p): Accomodate both wrapper scripts and
wrapper executables.
(func_mode_execute): Handle $file that is a wrapper
script and $file that is a wrapper executable differently.
(func_mode_install) [cygwin|mingw]: If $file is a wrapper
executable, use func_ltwrapper_scriptname to determine
wrapper script name. Afterwards, always use
func_ltwrapper_script_p instead of func_ltwrapper_p.
(func_emit_libtool_wrapper_script): Rename to...
(func_emit_wrapper): ...this. All callers changed.
(func_emit_libtool_cwrapperexe_source): Rename to...
(func_emit_cwrapperexe_src): ...this. All callers changed.
Embed new magic_exe variable into source. Private transient
wrapper script now called foo_ltshwrapperTMP, not
foo_ltshwrapper.
(func_emit_cwrapperexe_src) [main, mingw]: Use _spawnv
and return child's exit code manually rather than rely on
broken execv.
(func_mode_link) [cygwin|mingw]: Don't call dirname and
basename directly; use func_dirname and func_basename
when computing cwrapper names. Use cwrapper to generate
wrapper script, and use pathname returned by
func_ltwrapper_scriptname instead of $output.
(func_mode_link) [NOT cygwin|mingw]: move wrapper script
generation for non-win32 inside case statement, as default
case.
(func_mode_uninstall) [$name's extension != .lo|.la]:
'clean' mode must handle $file differently if it is a libtool
wrapper script, or if it is a libtool wrapper executable.
* tests/destdir.at [Simple DESTDIR install]: $EXEEXT fixups.
* tests/destdir.at [DESTDIR with in-package deplibs]: Ditto.
Take an argument to specify value assigned to
WRAPPER_SCRIPT_BELONGS_IN_OBJDIR in the emitted
script.
(func_emit_libtool_cwrapperexe_source) [file scope]:
define permission flags S_IXGRP and S_IXOTH if not
already defined.
(func_emit_libtool_cwrapperexe_source) [LTWRAPPER_DEBUGPRINTF]:
Use C89-compatible syntax to mimic variadic macros.
Adjust all callers.
(func_emit_libtool_cwrapperexe_source) [check_executable]:
avoid embedded #ifdefs; use S_IXGRP and S_IXOTH
unconditionally.
(func_emit_libtool_cwrapperexe_source) [make_executable]:
ditto.
(func_emit_libtool_cwrapperexe_source): don't rewrite
WRAPPER_SCRIPT_BELONGS_IN_OBJDIR posthoc; instead pass
correct argument when calling func_emit_libtool_wrapper_script.
(func_mode_link): pass correct argument when calling
func_emit_libtool_wrapper_script.
code block to handle cases when wrapper script is in $objdir.
(func_emit_libtool_cwrapperexe_source): replace DEBUG() macro
with namespace-safe LTWRAPPER_DEBUGPRINTF(). Call
func_emit_libtool_wrapper_script() with appropriate filters to
embed script text in C char* static variable.
(f_e_l_c_s: main): add new option --lt-dump-script, parse argv[]
for it, and take appropriate action. Call chase_symlinks()
on argv[0], in case this.exe was launched via one. Use chased
value to determine full absolute pathname of wrapper script, in
$objdir. Unconditionally write script out to this pathname and
set permission bits. Remove extraneous ';' from debugging loop.
(f_e_l_c_s: main) [mingw]: DOS-ize $SHELL before populating
newargv[0]; if $TARGETSHELL environment variable is set, use
it instead of $SHELL and do not DOS-ize. Ensure newargv[1]
(wrapper script absolute path) uses only '/', not '\'. Make
sure to call execv() with DOS-ized $SHELL (or un-DOS-ized
$TARGETSHELL, if set)
(f_e_l_c_s: make_executable): new function
(f_e_l_c_s: chase_symlinks): new function (no-op if !S_ISLNK)
old_deplibs.
* tests/dmacks.at: Check for archives as members of static
archives. Currently XFAILS, above only eliminates one of the
two static archives.
* Makefile.am: Add test.
Reported by Daniel Macks <dmacks@netspace.org>
better portability - testing whether modules build and load
without that prefix is not the domain of this test.
Also, only run the test of the global hint with the depend
module on hosts that can compile a module without passing
-no-undefined in link mode.
visibility set according to the underlying implementation.
Here, we add lt_dlopenadvise() to allow callers to request,
among other things, local or global symbol visibility from the
underlying dlloader:
* libltdl/ltdl.c (LT_DLRESIDENT_FLAG): Removed.
(LT_DLIS_RESIDENT): Use public is_resident info field.
(LT_DLIS_SYMLOCAL, LT_DLIS_SYMGLOBAL): New macros to test for
module symbol visibility status.
(tryall_dlopen): If vtable->module_open() was able to act on
either is_symlocal or is_symglobal hints, store that in
the handle flags.
(lt_dlopenadvise): New function that works like lt_dlopen(),
but accepts an advise type to determine whether to ask
dlloaders to change default symbol visibility.
(lt_dlopen, lt_dlopenext): Just call lt_dlopenadvise() with
the correct parameters.
(lt_dladvise_init, lt_dladvise_destroy): New functions to
initialize and destroy an advise type hint.
(lt_dladvise_ext, lt_dladvise_resident, lt_dladvise_local)
(lt_dladvise_global): Set hints on an advise type.
(openadvise): Factored out of lt_dlopenadvise.
(has_library_ext): Factored out of lt_dlopenadvise.
* libltdl/ltdl.h: Declare all of the above.
(lt_dlinfo): New fields for advise hints.
* libltdl/libltdl/lt_dlloader.h (lt_module_open): Add a new
advise parameter. Adjust all callers.
(lt_dladvise): New opaque type for advise hints.
* libltdl/libltdl/lt__private.h (lt__advise): Declare
contents of opaque lt_dladvise type.
* libltdl/libltdl/lt_error.h (CONFLICTING_FLAGS): New error
for attempts to have local and global symbol visibility at the
same time.
* libltdl/loaders/dld_link.c, libltdl/loaders/dyld.c,
libltdl/loaders/load_add_on.c, libltdl/loaders/loadlibrary.c,
libltdl/loaders/preopen.c, libltdl/loaders/shl_load.c: Adjust.
* libltdl/loaders/dlopen.c (RTLD_LOCAL, RTLD_GLOBAL): Try to
define these symbols if the system has equivalents.
(vmopen): If unable to act on a caller request to set symbol
visibility, then unset the relevant hints in the advise type.
* tests/lt_dladvise.at: New tests for the above.
* doc/libtool.texi (Libltdl Interface): Updated.
* NEWS: Updated.
(libtool, $(srcdir)/$(m4dir)/ltversion.m4)
($(srcdir)/$(auxdir)/ltmain.sh): Updated to not depend on any
phony rules. Test `$?' for prerequisites that should always
cause us to update the target. Fixes rebuilding rules, at the
cost of sometimes updating too much with non-GNU make.
instead of SYSTEM_ARGZ_IS_BROKEN.
* libltdl/m4/argz.m4 (gl_FUNC_ARGZ): Ditto. Also, minor
stylistic improvements.
Report by Bruno Haible <bruno@clisp.org>.
in same mechanism system argz.h would have.
* libltdl/libltdl/lt__glibc.h: also detect if
SYSTEM_ARGZ_IS_BROKEN when determining whether to re#def
argz* functions.
* libltdl/m4/argz.m4 (gl_FUNC_ARGZ): add new test to check
if $host's argz facilities are known bad. Err on the side
of caution if cross-compiling.