Commit Graph

3310 Commits

Author SHA1 Message Date
Ralf Wildenhues
7877d1d13f Unconditionally normalize LC_ALL, LANGUAGE in libtool script.
* libltdl/config/ltmain.m4sh: Unconditionally set LC_ALL and
LANGUAGE to 'C', to avoid semantic differences on MinGW under
Chines locale.  SCO issues with e.g. LANG=C are not known to
be relevant today any more.
Report by Pete Batard <pbatard@gmail.com> and Xiaofan Chen
<xiaofanc@gmail.com>.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2010-03-19 06:24:23 +01:00
Peter Rosin
f21029c498 Preserve the last error when restoring the error mode.
* libltdl/loaders/loadlibrary.c (wm_open): Don't rely on
SetThreadErrorMode (or SetErrorMode) to not clobber the last
error.
Report by Ralf Wildenhues.

Signed-off-by: Peter Rosin <peda@lysator.liu.se>
2010-03-17 09:01:57 +01:00
Peter Rosin
3f0fa1bae4 Use Get/SetThreadErrorMode if they are available.
* libltdl/loaders/loadlibrary.c (wrap_geterrormode): Replaced...
(wrap_getthreaderrormode): ...by this function that checks
first for GetThreadErrorMode, then GetErrorMode and makes use
of either of those or...
(fallback_getthreaderrormode): ...else falls back to this
replacement function that implements the old workaround, which
was previously implemented in...
(fallback_geterrormode): ...this now renamed function.
(geterrormode): Replaced...
(getthreaderrormode): ...by this function pointer that points
at either of wrap_getthreaderrormode, GetThreadErrorMode,
GetErrorMode or fallback_getthreaderrormode.
(wrap_setthreaderrormode): New function that checks if
SetThreadErrorMode is supported by the system and makes use of
it if it is.
(fallback_setthreaderrormode): New function that is used
otherwise that implements the old version using SetErrorMode.
(setthreaderrormode): New function pointer that points at
either of wrap_setthreaderrormode, SetThreadErrorMode or
fallback_setthreaderrormode.
(vm_open): Adjust to the above.

Signed-off-by: Peter Rosin <peda@lysator.liu.se>
2010-03-17 08:54:16 +01:00
Ralf Wildenhues
d5ca75c82d Detect Sun compiler suite with 'sun'-prefixed names.
* libltdl/m4/libtool.m4 (_LT_COMPILER_PIC, _LT_LANG_CXX_CONFIG)
(_LT_SYS_HIDDEN_LIBDEPS) [solaris]: Accept compiler names sunCC,
sunf77, sunf90, sunf95 in addition to CC, f77, f90, f95.
* NEWS: Update.
Report by Vadim Zeitlin.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2010-02-28 13:38:34 +01:00
Pierre Ossman
7efdc2482e Fix deplibs check fallback for 64-bit Windows and Windows CE.
* libltdl/m4/libtool.m4 (_LT_CHECK_MAGIC_METHOD): Accept file formats
'pe-arm-wince' and 'pe-x86-64'.  Add note about consistency with ...
* libltdl/config/ltmain.m4sh (func_win32_libid): ... the respective
pattern here; sync pattern from the former.
* tests/deplibs-mingw.at (deplibs without file command): New
file, new test.
* Makefile.am (TESTSUITE_AT): Update.
* NEWS: Update.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2010-02-28 05:46:16 +01:00
Scott McCreary
5627b263cc Update search path on Haiku for legacy system directory.
* libltdl/m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER) [haiku]
<sys_lib_dlsearch_path_spec>: Replace legacy
/boot/beos/system/lib directory with /boot/system/lib.
* THANKS: Update.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2010-02-24 22:10:52 +01:00
Ralf Wildenhues
3cca61ae59 manual: fix detailmenu ordering.
* doc/libtool.texi (Top): Add section for `Linking executables'
in the detailmenu.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2010-02-22 22:05:14 +01:00
Charles Wilson
948e6bbecd Guard against strerror()==NULL
* libltdl/config/ltmain.m4sh (func_emit_cwrapperexe_src:main):
Check return value of strerror() using nonnull().
(func_emit_cwrapperexe_src:find_executable): Ditto.
(func_emit_cwrapperexe_src:chase_symlinks): Ditto.
2010-02-21 16:58:31 -05:00
Charles Wilson
76735dcb93 Document wrapper changes.
* NEWS: Indicate new feature and incompatibility.
* doc/libtool.texi [detailmenu]: Add reference to subsection
'Wrapper executables for programs', in Platform Quirks category.
[Linking executables]: Mention wrapper executables, in
addition to wrapper scripts. Add menu referencing subsection
'Wrapper executables for programs'.
[Wrapper executables for programs]: New subsection. Documents
cwrapper rationale and command line options.
2010-02-21 15:07:12 -05:00
Charles Wilson
efa4728055 Add --lt-* options to shell wrapper
* libltdl/config/ltmain.m4sh (func_emit_wrapper): Call
func_parse_lt_options early. Use func_exec_program.
(func_emit_wrapper:func_parse_lt_options): New function.
(func_emit_wrapper:func_lt_dump_args): New function.
(func_emit_wrapper:func_exec_program_core): New function.
(func_emit_wrapper:func_exec_program): New function.
2010-02-21 00:42:13 -05:00
Charles Wilson
2613ea3ab2 Enable runtime cwrapper debugging; add tests
* libltdl/config/ltmain.m4sh (func_emit_cwrapperexe_src):
Update comments. Initialize program_name. Eliminate _LENGTH
variables for string constants. In debug mode, print a
banner with known content before any other output. Remove
LTWRAPPER_DEBUGPRINTF macro. Add constants and variables
to support new --lt-debug option.
(func_emit_cwrapperexe_src:ltwrapper_debugprintf): Renamed to...
(func_emit_cwrapperexe_src:lt_debugprintf): this. Only print
messages if lt_debug != 0. Ensure appearance of messages
conforms to GCS.
(func_emit_cwrapperexe_src:lt_fatal): Ditto.
(func_emit_cwrapperexe_src:lt_error_core): Ditto.
(func_emit_cwrapperexe_src): Update all callers to lt_fatal.
Update all users of LTWRAPPER_DEBUGPRINTF (()) to call
lt_debugprintf () directly.
(func_emit_cwrapperexe_src:main): Consolidate option parsing.
Ensure first use of lt_debugprintf occurs after option parsing.
Add stanza to parse for --lt-debug and set lt_debug variable.
Use strcmp rather than strncmp, where safe.
* tests/cwrapper.at: Add new tests for --lt-debug and
-DLT_DEBUGWRAPPER.
2010-02-21 00:32:17 -05:00
Ralf Wildenhues
7e8be90f48 Use --email with gendocs.sh.
* Makefile.maint (web-manual): Pass bug reporting address to
gendocs.sh.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2010-01-31 15:34:51 +01:00
Ralf Wildenhues
2080fe9649 Make testsuite code C++ clean again.
* tests/resident.at (resident modules): Fix for C++.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2010-01-31 15:33:27 +01:00
Peter Rosin
e4eefcd401 Testsuite exposure for dlloader API.
* tests/dlloadet-api.at: New file, new test.
* Makefile.am (TESTSUITE_AT): Update.

Signed-off-by: Peter Rosin <peda@lysator.liu.se>
2010-01-29 09:04:13 +01:00
Peter Rosin
f4c63234c9 * tests/loadlibrary.at: Fix C++ issues.
Signed-off-by: Peter Rosin <peda@lysator.liu.se>
2010-01-29 08:50:13 +01:00
Peter Rosin
080e088e42 Report proper errors from the loadlibrary loader.
* libltdl/loaders/loadlibrary.c (loadlibraryerror): New
helper function that returns the latest Windows error as a
string, or the provided default string on failure to do so.
(LOADLIB_SETERROR): New macro that wraps previous to make it
easy to use.
(vm_open, vm_close, vm_sym): Make use of previous.
(LOCALFREE): New macro to help free the Windows error string.
(vl_exit): Make use of previous.
* tests/loadlibarry.at: New file, new test that makes sure
the loadlibrary loader reports non-standard error messages.
* Makefile.am (TESTSUITE_AT): Add above test.

Signed-off-by: Peter Rosin <peda@lysator.liu.se>
2010-01-21 08:42:12 +01:00
Peter Rosin
16362c656a Use GetErrorMode if it is available.
* libltdl/loaders/loadlibrary.c (wrap_geterrormode): New
function that checks if GetErrorMode is supported by the
system and makes use of it if it is.
(fallback_geterrormode): New function that is used otherwise
that implements the old workaround.
(geterrormode): New function pointer that points at either
of the above or directly at GetErrorMode.
(vm_open): Make use of the above.

Signed-off-by: Peter Rosin <peda@lysator.liu.se>
2010-01-18 09:48:23 +01:00
Ralf Wildenhues
a75f8acf28 Ensure functions from resident modules work in atexit handlers.
* tests/resident.at (resident modules): New file, new test.
* Makefile.am (TESTSUITE_AT): Adjust.
Report by Bob Friesenhahn.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2010-01-11 21:56:23 +01:00
Ralf Wildenhues
574b79474a Testsuite exposure for relative output file names and deplibs.
* tests/deplib-in-subdir.at (deplib in subdir): New file, new
test.
* Makefile.am (TESTSUITE_AT): Update.
Prompted by report from Bob Friesenhahn.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2010-01-11 21:49:38 +01:00
Ralf Wildenhues
85223ba6a4 Testsuite exposure for C++ exception handling.
* tests/exceptions.at (C++ exception handling): New file, new
test.
* Makefile.am (TESTSUITE_AT): Update.
Report by Bob Friesenhahn.
2010-01-11 21:21:13 +01:00
Ralf Wildenhues
4d9381c8e1 Bump copyright years.
* ChangeLog.2009: New, rotated from ...
* ChangeLog: ... here.
* Makefile.am (EXTRA_DIST): Add ChangeLog.2009.
* NEWS, libltdl/config/ltmain.m4sh: Bump copyright years.
* libltdl/m4/libtool.m4 (_LT_COPYING, LT_OUTPUT): Likewise.
* libtoolize.m4sh: Likewise.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2010-01-06 08:03:33 +01:00
Peter Rosin
78f270a9ab * libltdl/ltdl.c (lt_dlerror): Remove meaningless conditional.
Signed-off-by: Peter Rosin <peda@lysator.liu.se>
2009-12-30 03:18:19 +01:00
Peter Rosin
a2a8d8a663 * libltdl/ltdl.c (file_not_found): Fix typos in code comment.
Signed-off-by: Peter Rosin <peda@lysator.liu.se>
2009-12-29 19:00:58 +01:00
Ralf Wildenhues
7ce92b0b9b Replace last __oline__ instance.
* libltdl/m4/libtool.m4 (_LT_TRY_DLOPEN_SELF): Replace last
__oline__ instance with $LINENO.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-12-12 08:51:02 +01:00
Ralf Wildenhues
93f5529731 Improve parsing of .la files in libltdl.
* libltdl/ltdl.c (trim): Do not dump core upon missing quote in
module .la file.
* tests/lalib-syntax.at (syntax of .la files): New file, new
test.
* Makefile.am (TESTSUITE_AT): Add tests/lalib-syntax.at.
Report by Bob Friesenhahn.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-12-09 07:28:59 +01:00
Ralf Wildenhues
31eb92de4f Sane fallback initialization of $ECHO from $as_echo.
* libltdl/config/general.m4sh: Use 'printf %s\n' if $as_echo is
unset.
* tests/testsuite.at: Likewise.
* THANKS: Update.
Report by Vadim Zeitlin and Peter Rosin.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-12-05 15:50:56 +01:00
Ralf Wildenhues
c4e8bf31aa lt_dlloader_remove and lt_dlloader_find accept const arguments.
* libltdl/lt_dlloader.c (lt_dlloader_remove, lt_dlloader_find):
Accept `const char *' arguments, as documented.  Cast them to
`void *' for the slist machinery.
* libltdl/libltdl/lt_dlloader.h: Adjust prototypes.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-12-02 23:13:20 +01:00
Ralf Wildenhues
fea7fdee4e Test and fix slist.c.
* libltdl/libltdl/slist.h: Include stddef.h, for size_t.
(slist_remove): Return pointer to SList, not void.
* libltdl/slist.c: Include stdlib.h, for malloc and free.
(slist_remove): Adjust prototype as above.
(slist_sort): Do not loop forever on one-item list.
* tests/slist.at (SList functionality): New file, new test.
* Makefile.am (TESTSUITE_AT): Add tests/slist.at.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-12-02 23:13:05 +01:00
Peter Rosin
2c9c38d8a1 Please C++ compilers when calling strrchr.
* libltdl/ltdl.c (has_library_ext): Match the return type of
strrchr with the first argument to please C++ compilers.
Report by Peter O'Gorman.

Signed-off-by: Peter Rosin <peda@lysator.liu.se>
2009-11-30 14:20:36 -05:00
Ralf Wildenhues
b15f6f9ded Fix bindir and dlopen tests for C++ compilers (CC=g++).
* tests/bindir.at (bindir basic lib test, bindir install tests):
Include stdlib.h rather than declaring abort.
* tests/lt_dlopenext.at (lt_dlopenext error messages): Use
`extern "C"' annotation for dlsym'ed function in C++ mode.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-11-29 23:03:14 +01:00
Ralf Wildenhues
ef32f487d7 Enable symbol versioning with the GNU gold linker.
* libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS): Accept 'GNU gold'
in the version string.
* NEWS, THANKS: Update.
Report by Peter Fritzsche.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-11-29 23:02:34 +01:00
Peter Rosin
4137bb8a15 Fix cross build issue in execute mode test.
* tests/execute-mode.at: Skip test for cross builds.

Signed-off-by: Peter Rosin <peda@lysator.liu.se>
2009-11-25 17:29:34 -05:00
Ralf Wildenhues
79dc9e9c8a Tighten regex for Portland C++ compiler for version 10.
* libltdl/m4/libtool.m4 (_LT_LANG_CXX_CONFIG) [linux]:
Match a dot after version 1 through 5, so 10 and up don't match,
and use weak symbols.
* THANKS: Update.
Report by Jeff Squyres and Brent Leback.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-11-24 15:27:37 +01:00
Peter O'Gorman
614eb28c76 Update libltdl version to match 2.2.6b release.
libltdl/Makefile.inc: Make version 9:1:2
2009-11-16 09:26:29 -06:00
Bob Friesenhahn
e91f7b9600 Don't load module.la from current directory by default.
* libltdl/ltdl.c (try_dlopen): Do not attempt to load an
unqualified module.la file from the current directory (by
default) since doing so is insecure and is not compliant with
the documentation.
* tests/testsuite.at: Qualify access to module.la file in
current directory so that test passes.
2009-11-15 20:50:02 -06:00
Peter O'Gorman
3580cddcea Only use preopen loader to load preopened archives
* libltdl/ltdl.c: Limit checking of .a to preopen loader.
* tests/lt_dlopen_a.at: Add test.
* Makefile.am: Add test.
2009-11-15 20:49:55 -06:00
Ralf Wildenhues
c242ea638d Recognize `pgfortran' as Portland compiler.
* libltdl/m4/libtool.m4 (_LT_COMPILER_PIC, _LT_LINKER_SHLIBS):
Accept `pgfortran*' too.
Report by Jeff Squyres.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-11-14 11:32:18 +01:00
Alexandre Oliva
1d3560143c Fix verbose link extraction for multiply reconfigured GCC.
* libltdl/m4/libtool.m4 (_LT_LANG_CXX_CONFIG)
<output_verbose_link_cmd>: Drop GCC lines "Configured with" that
may contain unrelated flags.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-11-04 20:02:47 +01:00
Eric Blake
eae9d5832f Allow gcc builds with -Wall -Werror.
* libltdl/ltdl.c (try_dlopen): Use strlen rather than LT_STRLEN on
an array that will never be NULL.

Signed-off-by: Eric Blake <ebb9@byu.net>
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-11-02 20:08:17 -07:00
Ralf Wildenhues
5a46d6e5c1 Fix func_normal_abspath sed script for Solaris.
* libltdl/config/general.m4sh (pathcar, pathcdr, removedotparts)
(collapseslashes, finalslash): Use single quotes, for clarity.
(removedotparts): Avoid \{N,M\} after subexpression \(...\), for
Solaris /bin/sed.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-11-01 11:41:34 +01:00
Ralf Wildenhues
7890173078 Improve versioning algorithm documentation.
* doc/libtool.texi (Updating version info): Repeat the
algorithms in different, hopefully simpler terms.
* THANKS: Update.
Prompted by Richard B. Kreckel.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-11-01 11:38:23 +01:00
Ingo Weinhold
a4cc3d2c9f Support for the Haiku operating system.
* libltdl/config/ltmain.m4sh (func_mode_link): Add cases for
`*-*-haiku*' alongside `*-*-beos*'.
* libltdl/m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER)
(_LT_CHECK_MAGIC_METHOD, LT_LIB_M, _LT_COMPILER_PIC)
(_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG): Add cases for
`haiku*'.
* NEWS, THANKS: Update.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-11-01 10:53:23 +01:00
Ralf Wildenhues
16988b3532 Fix quoting of AS, DLLTOOL, and OBJDUMP for the libtool script.
* libltdl/m4/ltoptions.m4 (AC_LIBTOOL_DLOPEN): Quote values of
$AS, $DLLTOOL, and $OBJDUMP, so they can contain arguments.
* THANKS: Update.
Report by Matthijs Kooijman.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-11-01 09:26:51 +01:00
Ralf Wildenhues
741a9867eb Initial support for the Cuda Compiler Driver on Linux.
* libltdl/config/ltmain.m4sh (func_mode_compile): Accept source
file extensions `.cu' and `.cup'.
* libltdl/m4/libtool.m4 (_LT_COMPILER_NO_RTTI, _LT_COMPILER_PIC)
(_LT_LINKER_SHLIBS): Support for `nvcc' compiler driver.
* NEWS, THANKS: Update.
Report by Mahesh Narayanamurthi.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-09-18 20:36:34 +02:00
Dave Korn
6858ed03d8 Control where win32 DLLs get installed.
* libltdl/config/general.m4sh (func_normal_abspath): New function.
(func_relative_path): Likewise.
* libltdl/config/ltmain.m4sh (func_mode_help): Document "-bindir".
(func_mode_link): Accept new "-bindir" option and use it, if
supplied, to place Windows DLLs.
* tests/bindir.at: New file for install tests using "-bindir".
* Makefile.am (TESTSUITE_AT): Add bindir.at.
* doc/libtool.texi (Link Mode): Update documentation.
* NEWS, THANKS: Update.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-09-12 08:23:03 +02:00
Akim Demaille
55e9cc469d libtool: clean libconftest.a.
* libltdl/m4/libtool.m4 (_LT_REQUIRED_DARWIN_CHECKS): Here.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-09-12 07:33:54 +02:00
Peter Rosin
3a4f0d3958 func_win32_libid doesn't work with MS dumpbin
* libltdl/m4/libtool.m4 (_LT_CHECK_MAGIC_METHOD): The $NM
interface is assumed to be BSD nm in func_win32_libid, so
check for that before using it.

Signed-off-by: Peter Rosin <peda@lysator.liu.se>
2009-09-10 09:52:37 +02:00
Ralf Wildenhues
b03736353b Allow dlopen self test to work with gcc's -fvisibility=hidden.
* libltdl/m4/libtool.m4 (_LT_TRY_DLOPEN_SELF): Declare default
visibility for the symbol we are going to test dlopen (NULL)
when a GCC version is used that understands the visibility
attribute, under the assumption that if -fvisibility=hidden
will be used, the user code will be sufficiently annotated
for visibility of needed symbols from the main executable.
* THANKS: Update.
Report by Josh Hursey against OpenMPI.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-09-08 20:03:54 +02:00
Ralf Wildenhues
1e4e1984b0 Fix and split recent testsuite addition for compile/link flags.
* tests/flags.at (passing flags through libtool): Split into ...
(passing CC flags through libtool)
(passing CXX flags through libtool)
(passing F77 flags through libtool)
(passing FC flags through libtool)
(passing GCJ flags through libtool): ... these five tests,
factorized with m4_foreach.  Fix F77 and FC compile and link
commands; add GCJ tag.  Use LT_AT_TAG to correctly skip tags
for which no compiler exists.  Use $EXEEXT where appropriate.
Drop unneeded use of reload_cmds.
Reports by Peter Rosin and Peter O'Gorman.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2009-09-08 20:02:57 +02:00
Peter O'Gorman
91697c2092 Fix redirect in test case.
tests/darwin.at: Fix stderr redirect.
2009-09-07 15:17:03 -05:00