Fixes testsuite failure for lt_dladvise.at on MSYS/MSVC.
* libltdl/ltdl.c (libprefix): New static variable describing
the prefix of static archives.
(try_dlopen): Use libprefix.
* libltdl/m4/ltdl.m4 (_LTDL_SETUP): Export prefix of static
archives to config.h. Also fix assignment of LTDLOPEN to be more
efficient and less error prone while at it.
* libltdl/m4/libtool.m4 (_LT_PROG_FUNCTION_REPLACE): Remove
spurious trailing space.
* ChangeLog: Reorder to match commit order after botched
merge.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* libltdl/m4/libtool.m4 (_LT_PROG_XSI_SHELLFNS): Rename to
_LT_PROG_REPLACE_SHELLFNS.
(_LT_PROG_XSI_REPLACE): Rename to _LT_PROG_FUNCTION_REPLACE.
(_LT_PROG_FUNCTION_REPLACE): Change decorator comment to use
'Extended shell' rather than 'XSI' on successful replacement.
* libltdl/config/general.m4sh (func_dirname, func_basename)
(func_dirname_and_basename, func_stripname): Change decorator
comment to use 'extended shell' rather than 'XSI' on fallback
implementations.
* libltdl/config/getopt.m4sh (func_split_short_opt)
(func_split_long_opt): Ditto.
* libltdl/config/ltmain.m4sh (func_append, func_append_quoted)
(func_arith, func_len, func_lo2o, func_xform): Ditto.
* tests/getopt-m4sh.at (_LT_AT_XSI_FUNC_EXTRACT): Rename to
_LT_AT_EXTENDED_SHELL_FUNC_EXTRACT.
(_LT_AT_EXTENDED_SHELL_FUNC_EXTRACT): Change regular expression to
match new replacable function decorator comments.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* libltdl/m4/libtool.m4 (_LT_CHECK_SHAREDLIB_FROM_LINKLIB): Make
sure hyphens in function name comment header underline line up.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* libltdl/config/general.m4sh (func_tr_sh): New function.
* libltdl/config/ltmain.m4sh (func_generate_dlsyms) [cygwin|mingw]:
Obtain DLL name corresponding to import library by using value
stored in unique variable libfile_$(transliterated implib name).
If that fails, use $sharedlib_from_linklib_cmd to extract DLL
name from import library directly. Also, properly extract dlsyms
from the import library.
(func_mode_link) [cygwin|mingw]: Prefer to dlpreopen DLLs
over static libs when both are available. When dlpreopening
DLLs, use linklib (that is, import lib) as dlpreopen file,
rather than DLL. Store name of associated la file in
unique variable libfile_$(transliterated implib name)
for later use.
(func_win32_libid): Accomodate pei-i386 import libs
as well as pe-i386.
(func_cygming_dll_for_implib): New function.
(func_cygming_dll_for_implib_fallback): New function.
(func_cygming_dll_for_implib_fallback_core): New function.
(func_cygming_gnu_implib_p): New function.
(func_cygming_ms_implib_p): New function.
* libltdl/m4/libtool.m4 (_LT_CMD_GLOBAL_SYMBOLS): Adjust sed
expressions for lt_cv_sys_global_symbol_to_c_name_address and
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
as trailing space after module name is optional.
(_LT_LINKER_SHLIBS) [cygwin|mingw][C++]:
Set exclude_expsyms correctly for $host. Simplify regular
expression in export_symbols_cmds.
(_LT_LINKER_SHLIBS) [cygwin|mingw|pw32][C]: Set exclude_expsyms
correctly for $host. Enable export_symbols_cmds to identify
DATA exports by _nm_ prefix.
(_LT_CHECK_SHAREDLIB_FROM_LINKLIB): New macro sets
sharedlib_from_linklib_cmd variable.
(_LT_DECL_DLLTOOL): New macro ensures DLLTOOL is always set.
* libltdl/m4/libtool.m4 (_LT_CMD_GLOBAL_SYMBOLS)
<nm_file_list_spec>: New tag variable. Set it to '@' if input
files can be passed to $NM in a file named with the '@' option.
* libltdl/config/ltmain.m4sh (func_mode_link): When
nm_file_list_spec is nonempty, use it to avoid skipped_export.
* doc/libtool.texi (libtool script contents): Document
new variable.
* libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS)
[ cygwin, mingw, cegcc ] <cl*>: Remove all spaces in the
case statement of postlink_cmds to make file name expansion
more unlikely.
(_LT_LANG_CXX_CONFIG): Likewise, but also add the missing |.
Signed-off-by: Peter Rosin <peda@lysator.liu.se>
Fixes a lot of testsuite failures with MSVC 2003 (v8.0) and
above (and perhaps also MSVC .Net) related to running programs
that have been moved (e.g. installed) without their manifests
also having been moved.
* libltdl/m4/libtool.m4 (_LT_PATH_MANIFEST_TOOL): New macro
that locates the Manifest Tool (mt) and verifies that it is
indeed the manifest tool. The result is stored in the new
variable MANIFEST_TOOL.
(_LT_LINKER_SHLIBS) <postlink_cmds>: New tag variable.
[ cygwin, mingw, cegcc ] <cl*>: Embed the manifest file as a
resource. Make sure the embedding work regardless of if the
@OUTPUT@ file name includes a trailing $EXEEXT.
(_LT_LANG_CXX_CONFIG): Likewise.
(_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG): Require the above
_LT_PATH_MANIFEST_TOOL.
* libltdl/config/ltmain.m4sh (func_mode_link): After linking
a program, replace @OUTPUT@ in $postlink_cmds and then execute
the commands.
* doc/libtool.texi (libtool script contents): Document
new postlink_cmds variable.
(LT_INIT): Add that the MANIFEST_TOOL environment variable can
be used to override the manifest tool to use.
* tests/exeext.at: New. Make sure linking with both -o prog
and -o prog$EXEEXT works.
* Makefile.am (TESTSUITE_AT): Update.
(TESTS_ENVIRONMENT): Propagate $(MANIFEST_TOOL) to the
testsuite.
* NEWS: Add note of the new MANIFEST_TOOL environment variable.
* libltdl/m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER)
(_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG) [mingw, cygwin]: Add
support for the Microsoft C/C++ Compiler (cl) relying on help
from the compile script in Automake.
* NEWS: Add note of the above.
* tests/getopt-m4sh.at [enhanced shell option appending]:
_LT_AT_XSI_FUNC_EXTRACT will not be able to find the enhanced
libtool func_append function if the replacement wasn't substituted
by configure, since the decorator comments will be different - in
that case simply skip the test.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* tests/getopt-m4sh.at (_LT_AT_FALLBACK_FUNC_EXTRACT): New
macro to extract a fallback function implementation from
ltmain.m4sh.
[option appending]: Use it for a test of the fallback
implementation of func_append.
[enhanced shell option appending]: And also test the enhanced
implementation.
* libltdl/config/ltmain.m4sh (func_append_quoted): Fix missing \
to escape a quoted space for eval.
* libltdl/m4/libtool.m4 (_LT_PROG_XSI_SHELLFNS): Fix missing $ in
dereference of func_append inline replacement for retarded
shells.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* libtool/m4/libtool.m4 (_LT_CHECK_SHELL_FEATURES): Remove
test ${foo:n:m} substrings, instead adding a ${foo%??} check
to the existing XSI tests.
(_LT_PROG_XSI_SHELLFNS): Remove the ${foo:n:m} based
func_split_short_opt substitution in favour of a properly
XSI compliant substitution.
Suggested by Paolo Bonzini.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* libtool/config/ltmain.m4sh: Replace all occurrences of
`foo="$foo bar"' with func_append. No decorator comment was
added since /func_append [a-zA-Z0-9_]* "/ is already an
excellent match regexp, and additional comments would only
complicate things.
(func_append_quoted): New function that quotes a value with
func_quote_for_eval before appending it. To avoid quoting the
whitespace in the passed value, a single whitespace is added
automatically. Changed callers where possible.
* libtool/m4/libtool.m4 (_LT_PROG_XSI_SHELLFNS): Perform a
`+=' implementation substitution for func_append_quoted. More
importantly, systematically replace matching func_append calls
with inline `+=' when supported (for maximum speed), and
longhand `foo="$foo bar"' otherwise to avoid the function
overhead.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* libltdl/config/getopt.m4sh (m4go_shortnoargs): Remove 'v' now
that getopt.m4sh doesn't steal that letter for the --version
short option.
* libltdl/config/ltmain.m4sh (M4SH_GETOPTS): We can now use 'v'
as a short option for '--verbose'.
* libltdl/config/getopt.m4sh (m4go_printopts): Add back in the
leading '-' for remaining non-argument short options.
(func_split_short_opt): Use the correct sed script variable.
* libltdl/m4/libtool.m4 (_LT_CHECK_SHELL_FEATURES): Also ensure
that XSI substring extraction is supported.
(_LT_PROG_XSI_SHELLFNS): Use XSI substring extraction to split
short options to avoid unnecessary forks if the host shell
supports that.
* tests/getopt-m4sh.at: New tests for getopt.m4sh coverage.
* Makefile.am (TESTSUITE_AT): Add getopt-m4sh.at.
(TESTS_ENVIRONMENT): Pass M4SH and SED for substition into the
m4sh expansion performed in tests/getopt-m4sh.at.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* libltdl/m4/libtool.m4 (_LT_PROG_XSI_REPLACE): Some editors
might optimise away the SPACE in SPACE-TAB sequences, so use
TAB-SPACE just in case.
Reported by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* libltdl/m4/libtool.m4 (_LT_PROG_XSI_REPLACE): `sed -i' is not
portable; use `mv -f ...|| cp -f ...' instead.
Add an initial backslash to sed `c' substitutions with leading
whitespace, so that indentation is not removed by some non-POSIX
compliant sed implementations.
(_LT_PROG_XSI_SHELLFNS): Display a diagnostic warning message if
one or more XSI function replacements failed.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* libltdl/m4/libtool.m4 (_LT_PROG_XSI_SHELLFNS): Moved portable
shell versions of various utility functions from here...
* libltdl/config/getopt.m4sh (func_split_long_opt): ...to here...
* libltdl/config/general.m4sh (func_dirname, func_basename)
(func_dirname_and_basename, func_strip_name): ...here...
* libltdl/config/ltmain.m4sh (func_append, func_arith, func_len)
(func_lo2o, func_xform): ...and here.
* libltdl/config/libtool.m4 (_LT_PROG_XSI_REPLACE): New macro that
expands into a sed command for replacing the contents of a
suitably decorated shell function with an alternate XSI
implementation.
(_LT_PROG_XSI_SHELLFNS): Use it to replace the portable shell
versions of the functions above with equivalent XSI
implementations that avoid unnecessary forks if the host shell
supports that.
* libltdl/config/ltmain.m4sh: Replace hand written shell code
with a call to M4SH_GETOPTS. Rename some option variables in
the client code to match the generated option parser settings.
* libltdl/config/general.m4sh (func_echo, func_error)
(func_warning): Use $opt_mode instead of obsoleted $mode in
message leader.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* tests/exception.at (common.h): New file, refactored from
(module.h): Move declaration of modexc to libcommon.
Include common.h. Use explicit import/export markings for
symbols when building on win32 or cygwin.
(common.cpp): New file.
(module.cpp): Ensure correct symbols markings when including
module.h.
(lib.h): Use explicit import/export markings for symbols
when building on win32 or cygwin.
(lib.cpp): Ensure correct symbol markings when including lib.h.
(main.cpp): Include common.h.
(commands): Ensure correct symbol markings when compiling
main.cpp, and lib.cpp, and module.cpp. Add command to compile
common.cpp, and to link libcommon.la. Add libcommon.la when
linking module.la and main. Add command to install libcommon.la.
Signed-off-by: Charles Wilson <libtool@cwilson.fastmail.fm>
* libltdl/config/getopt.m4sh (m4_chomp): Ensure this macro is
implemented even if Autoconf's m4sugar.m4 doesn't provide it.
(m4go_expand): New macro based on Autoconf-2.64 m4_expand. Use
it everywhere incase m4sugar.m4 doesn't have an implementation.
(m4_ifnblank): Replace all uses with m4_ifval, which was
available long before m4_ifnblank was introduced.
* libltdl/config/ltmain.m4sh (func_mode_uninstall): Do not try
to match a null string in a case pattern, even with surrounding
spaces. Fixes `lt_dlopenadvise library loading' test.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* tests/flags.at (passing CC flags through libtool): When $LD
is used for linking libraries, ensure flags passed with `-Wc,'
are not passed through to $LD, but flags passed with `-Wl,' use
$wl when linking programs. Fixed testsuite failure on HP-UX
10.20.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* tests/exceptions.at (main.cpp:exceptions_in_module):
Move dlclose outside catch block; otherwise __cxa_end_catch
(part of the cygwin g++ ABI) accesses pointers to data inside
unloaded DLL. This is a platform ABI-specific bug, but is
likely common to many platforms' g++ and/or other C++
compilers.
Signed-off-by: Charles Wilson <libtool@cwilson.fastmail.fm>
* tests/defs.m4sh: Strip trailing `/tests' from srcdir, to allow
`$srcdir/tests/FOO.test' to be run from the top build directory.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* doc/libtool.texi: Throughout the manual, replace @var with
@samp or @code as appropriate, ensure the argument of remaining
@var uses are lower-case.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* tests/execute-mode.at (execute mode): Do not use grep -F
with an empty pattern.
* THANKS: Update.
Report by Jay K.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* libltdl/m4/libtool.m4 (_LT_COMPILER_PIC) <lt_prog_compiler_pic>:
Save result, and allow override, through cache variable
lt_cv_prog_compiler_pic{,_CXX,_F77,_FC}. The cache variable
needs to contain an eventual -DPIC.
* doc/libtool.texi (): Document it.
* tests/pic_flag.at (override pic_flag at configure time):
New file, new test.
* Makefile.am (TESTSUITE_AT): Update.
* NEWS, THANKS: Update.
Suggestion by Joakim Tjernlund and Paolo Bonzini.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* libltdl/config/ltmain.m4sh (func_ltwrapper_scriptname): Do not
call func_ltwrapper_executable_p again here, this function is
documented to allow being called with wrapper executables.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* bootstrap: When extracting PACKAGE and VERSION from AC_INIT
arguments, be sure to remove a 'GNU ' prefix and lowercase the
package name for PACKAGE. Also set PACKAGE_NAME and PACKAGE_URL
appropriately for GNU software. Pass these variables to the
make commands creating tests/package.m4 and other files.
* Makefile.am (edit): Fix substitution of PACKAGE_NAME and
PACKAGE_STRING.
* libltdl/config/announce-gen.m4sh: Use @PACKAGE@ not
@PACKAGE_STRING@.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* libltdl/m4/libtool.m4 (_LT_CHECK_MAGIC_METHOD),
libltdl/config/ltmain.m4sh (func_mode_link): On Windows,
find potential libs regardless of file name case.
* tests/nocase.at: New test, to check for regressions
of the above.
* Makefile.am: Add above new test.
* doc/libtool.texi (libtool script contents): Document
new variables.
* NEWS: Updated.
Signed-off-by: Peter Rosin <peda@lysator.liu.se>
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* libltdl/config/ltmain.m4sh (func_mode_uninstall): Do not
override global objdir variable, instead use odir for the
directory of to-be-removed files. Drop unneeded origobjdir.
Report by Charles Wilson.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* tests/testsuite.at: Move AT_INIT call down to late in the
file, all prior code can go beforehand.
Call AT_COLOR_TESTS if defined.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>