* build-aux/ltmain.in (func_mode_link): Reverse test operands to
forestall misinterpretation of contests of shell variable as
operand 1.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
If -no-undefined was not specified but the platform didn't
support shared libraries with undefined symbols (e.g. Cygwin/
MinGW), static libraries were built instead of shared ones,
even if building them was explicitly disabled with --disable-
static configure option.
Fix this by stopping with a fatal error if a shared library
can't be built in this case instead of unexpectedly building a
static library instead.
* libltdl/config/ltmain.m4sh (func_mode_link()): Stop with
fatal error when trying to build a shared library without -no-
undefined on a platform not supporting undefined symbols in
shared libraries.
Copyright-paperwork-exempt: Yes
Clang accepts options of the form "-mllvm $arg", and passes the
argument as an option to LLVM. These options caused problems
for Libtool when linking; in some cases, the -mllvm option is
passed through but the corresponding argument is dropped. (See
for example http://llvm.org/bugs/show_bug.cgi?id=14716.)
This patch resolves the issue by explicitly matching -mllvm and
taking an argument. Since Clang never uses LLVM for linking,
the matched "-mllvm $arg" option is irrelevant for the link
step, and we can simply discard it once we've recognized it.
Co-authored-by: Johannes Obermayr <johannesobermayr@gmx.de>
Copyright-paperwork-exempt: Yes
build-aux/ltmain.in (func_emit_cwrapperexe_src:main): XMALLOC wants a
size_t. Also use int instead of intptr_t for the return value (which
is fine since the _spawnv call is synchronous).
(func_emit_cwrapper_src) [MSVC]: Remove the intptr_t helper define.
(func_emit_cwrapperexe_src:find_executable): Use size_t for variables
involved in strlen computations.
(func_emit_cwrapperexe_src:lt_setenv): Likewise.
(func_emit_cwrapperexe_src:lt_extend_str): Likewise.
(func_emit_cwrapperexe_src:lt_update_exe_path): Likewise.
THANKS: Update.
Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Signed-off-by: Peter Rosin <peda@lysator.liu.se>
Rather than trying to find a new useful warning among the 55
expected warnings from vanilla gitlog-to-changelog, patch it to
elide the bogus warnings from duplicate log entries.
* gl/bulid-aux/gitlog-to-changelog.diff: Omit-from-ChangeLog is
a new log entry tag to skip legitimate log duplicates.
* build-aux/git-log-fix: Instead of deleting all content of
duplicates and generating a warning, append the new
Omit-from-ChangeLog tag to elide silently.
* Makefile.am *($(changelog)): Remove the 'expect 55 warnings'
echo.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
Resolves bug#13414. Problem reported by Erik van Pienbroek
and Martin Doucha.
build-aux/ltmain.in (func_mode_link): Factor out the test if a
given symbol file is a module-definition (.def) file into...
(func_dll_def_p): ...this function, which also improves the check.
m4/libtool.m4 (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG)
<cygwin, mingw, pw32, cegcc>: Similarly, factor out the test if
a given symbol file is a module-definition (.def) file into...
(_LT_DLL_DEF_P): ...this macro, which also improves the check.
tests/export-def.at: New test.
Makefile.am (TESTSUITE_AT): Add above test.
NEWS: Update.
THANKS: Update.
Signed-off-by: Peter Rosin <peda@lysator.liu.se>
This is in preparation for the next patch, which needs to have literal
tab characters survive the evaluation of the *_cmds variables.
build-aux/ltmain.in (func_execute_cmds, func_mode_link): Don't collapse
tabs and surrounding whitespace into a single space when executing a
tilde-separated cmds construct, instead keep any tabs intact.
Signed-off-by: Peter Rosin <peda@lysator.liu.se>
This reverts commit 5ed7430fcb, which is
totally bogus as the variable is also set in libtool.m4. Sorry for the
noise.
Signed-off-by: Peter Rosin <peda@lysator.liu.se>
* build-aux/ltmain.in (func_mode_link): Save a string comparison
by setting $lways_export_symbols to false or : and using it directly
as the first argument to if. Make sure that it is always initialized
while at it.
Signed-off-by: Peter Rosin <peda@lysator.liu.se>
* build-aux/ltmain.in (func_generate_dlsyms): Add a definition for
STREQ, and then use it in place of !strcmp.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* m4/libtool.m4 (_LT_CMD_GLOBAL_SYMBOLS) [dumpbin]: Adjust
lt_cv_sys_global_symbol_to_cdecl so that it declares imported
data symbols as __declspec(dllimport). Adjust
lt_cv_sys_global_symbol_to_c_name_address and
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix so that they
fill in "(void*) 0" for imported data symbols. Add new
lt_cv_sys_global_symbol_to_import which finds imported data
symbols if non-empty and export this variable to the libtool script
in the global_symbol_to_import variable. Adjust
lt_cv_sys_global_symbol_pipe so that data imports can be located.
* build-aux/ltmain.in (func_generate_dlsyms): When data imports
are present, as indicated by global_symbol_to_import, generate
a relocation function lt_syminit that fills in the addresses
of data imports at runtime and point to the new function with a
new virtual @INIT@ entry in the symbol list.
* libltdl/loaders/preopen.c (add_symlist): Look for the virtual
@INIT@ symbol (i.e. lt_syminit) and call it.
(vm_sym): Step past the @INIT@ symbol, if present.
* tests/demo.at (dlmain.c): Call the @INIT@ symbol, if present.
* NEWS: Update.
Signed-off-by: Peter Rosin <peda@lysator.liu.se>
* build-aux/git-log-fix: Mostly missing category tags and refilling
to 64 columns, but also deleting duplicate entries from merging the
gary/reredo-test-operand-order branch.
* g/build-aux/gitlog-to-changelog.diff: Local patch to prevent
printing unqualified header lines for deleted duplicate patches.
* THANKS: Put email address for Paul Seidler here...
* build-aux/git-log-fix: ...and remove from ChangeLog here.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
Modern GNU ASCII quoting in output and comments is done
'like this'.
* cfg.mk (sc_old_style_quoting): Try to catch most instances
of `old style quoting' so that it is not accidentally re-
introduced to the code.
* HACKING, Makefile.am, NEWS, PORTING, README, TODO, bootstrap,
bootstrap.conf, build-aux/edit-readme-alpha,
build-aux/git-hooks/commit-msg, build-aux/ltmain.in,
doc/libtool.texi, gl/build-aux/bootstrap.in,
gl/build-aux/extract-trace, gl/build-aux/funclib.sh,
gl/build-aux/inline-source, gl/build-aux/options-parser,
libltdl/libltdl/slist.h, libltdl/loaders/loadlibrary.c,
libltdl/ltdl.c, libltdl/slist.c, libtoolize.in, m4/argz.m4,
m4/libtool.m4, m4/ltdl.m4, m4/ltoptions.m4, m4/ltsugar.m4,
tests/cmdline_wrap.at, tests/configure-iface.at, tests/demo.at,
tests/depdemo.at, tests/deplib-in-subdir.at,
tests/deplibs-mingw.at, tests/destdir.at, tests/execute-mode.at,
tests/f77demo.at, tests/fail.at, tests/inherited_flags.at,
tests/libtool.at, tests/libtoolize.at, tests/lt_dladvise.at,
tests/lt_dlexit.at, tests/mdemo.at, tests/need_lib_prefix.at,
tests/old-ltdl-iface.at, tests/old-m4-iface.at, tests/static.at,
tests/stresstest.at, tests/testsuite.at, tests/versioning.at:
Convert to upright quotes.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
In order to work as if it were already adopted by upstream
gnulib, put bootstrap and supporting scripts into the local
gnulib overrides directory.
* bootstrap, build-aux/extract-trace, build-aux/funclib.sh,
build-aux/inline-source, build-aux/options-parser: Move from
here...
* gl/build-aux/bootstrap.in, gl/build-aux/extract-trace,
gl/build-aux/funclib.sh, gl/build-aux/inline-source,
gl/build-aux/options-parser: ...to here.
* gl/build-aux/options-parser (func_version): Show only the
first copyright notice on files generated with inline-source.
* gl/doc/bootstrap.texi: Developer documentation for bootstrap.
* gl/modules/extract-trace, gl/modules/funclib.sh,
gl/modules/inline-source, gl/modules/options-parser: Describe
dependencies for gnulib-tool.
* bootstrap.conf (gnulib_modules): Add extract-trace,
inline-source and options-parser modules.
* bootstrap: Regenerated from gnulib overrides as a mono-
lithic script file using gl/build-aux/inline-source.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* m4/libtool.m4 (_LT_CHECK_MAGIC_METHOD) [MSVC]: Use
func_win32_libid as file_magic_cmd when the name lister
is MS dumpbin.
(_LT_CMD_GLOBAL_SYMBOLS): Export the new veriable nm_interface
to the libtool script.
* build-aux/ltmain.in (func_cygming_gnu_implib_p)
(func_cygming_ms_implib_p): Move up to before...
(func_win32_libid): ...which now uses them to determine if
the object is an import library when the nm_interface is
"MS dumpbin".
* NEWS: Update.
Signed-off-by: Peter Rosin <peda@lysator.liu.se>
Previous releases of libtoolize used the final invocation when
there were several, and after the rewrite over extract-trace,
all the invocation directories were concatenated. This change
enforces correct and consistent behaviour.
* tests/libtoolize.at (multiple AC_CONFIG_MACRO_DIR invocation):
New test.
* build-aux/extract-trace (func_extract_trace_first): New function
for clients that source this file, which returns only the first
argument to the first invocation of the named macros.
* libtoolize.in (func_require_ac_macro_dir): Use it to make sure
the first argument is always used.
(func_require_ac_aux_dir, func_require_ac_ltdl_dir)
(func_require_ac_ltdl_options): Future proof these functions against
multiple invocations or additional arguments to the macros they
trace.
* News (Important incompatible changes): Note change in semantics.
Reported by Eric Blake.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
The lt_sed_naive_backslashify variable lost its lt_ prefix
when m4sh was dropped. But not everywhere.
* build-aux/ltmain.in (func_convert_core_file_wine_to_w32)
(func_convert_core_msys_to_w32): Drop the lt_ prefix from
the lt_sed_naive_backslashify variable.
Signed-off-by: Peter Rosin <peda@lysator.liu.se>
* build-aux/funclib.sh (func_echo_infix_1): These quotes are not
actually nested, so add an exclude marker for the syntax-check.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* build-aux/ltmain.in: Declare relative paths to aux scripts from
source commands, for early inlining during bootstrap.
* Makefile.am (bootstrap_edit): Move auxscriptsdir
substitution from here....
(configure_edit): ...to here.
($(ltmain_sh)): Feed ltmain.in through inline-source as ltmain.sh
is generated to remove relative paths to aux scripts.
(install-data-local): Simplify. No need for special treatment for
ltmain.sh during installation, since aux scripts have already
been inlined.
Reported by Peter Rosin.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* build-aux/extract-trace: $usage is too generic, and can cause
sourced extract-trace to re-source options-parser. We already
require that funclib.sh be sourced before sourcing options-parser,
so it's safer to check that $progname is correct before sourcing
options-parser again from here.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
Now that the code base has coalesced around a single option
parser, there's no need for the unused getopt.m4sh and support.
* build-aux/getopt.m4sh, build-aux/general.m4sh,
tests/getopt-m4sh.at: Remove.
* Makefile.am (m4sh_dir, LT_M4SH, general_m4sh, getopt_m4sh)
(sh_files): Remove.
(TESTSUITE_AT): Remove tests/getopt-m4sh.at.
(TESTS_ENVIRONMENT): Remove M4SH.
* bootstrap.conf (libtool_build_prerequisites): Remove M4SH.
* configure.ac (M4SH): Remove.
* HACKING (Editing `.m4sh' Files): Remove and renumber following
sections.
* Makefile.am (ltmain_m4sh, ltmain_sh_edit): Remove.
(ltmain_in): Path to ltmain.in.
(ltmain_sh): Generate ltmain.sh from ltmain.in using
$(bootstrap_edit).
* build-aux/ltmain.m4sh: Remove.
* build-aux/ltmain.in: Rewritten as a client of funclib.sh.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
When any argument contains a shell meta-character, it needs to be
quoted when passed around. We already pass parameter lists as
space delimited strings of arguments, and pass the string through
eval to turn it back into a list before re-assigning using `set'.
To prevent the shell from interpreting any meta-characters during
an `eval set dummy $argumentlist', they must be quoted again
inside the quoted argument list.
* build-aux/funclib.sh (func_quote_for_eval): Be careful to keep
a separate tally of quoted and unquoted argument lists, to
conform to the API of the single argument func_quote_for_eval
implementation in build-aux/general.m4sh.
* bulid-aux/options-parser (func_run_hooks): To account for the
doubly quoted meta-character argument lists, we must eval the
parameter reassignment `set' call separately from evaluating the
dynamically named hook results variable.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
Moving potentially reusable code into a common file that can
be sourced by clients, and adjusting for impedance mismatch
or necessary renames during integration.
* build-aux/funclib.sh: New file.
* build-aux/options-parser (Shell normalisation)
(User overrideable command paths, Global variables, func_append)
(require_term_colors, func_echo, func_echo_infix_1, func_warn)
(func_error, func_fatal_error, func_quote_for_eval, func_verbose):
Move from here...
* build-aux/funclib.sh (Shell normalisation, User overrideable
command paths, Global variables, func_append)
(require_term_colors, func_echo, func_echo_infix_1)
(func_warn_and_continue, func_error, func_fatal_error)
(func_quote_for_eval, func_verbose): ...to here.
* build-aux/general.m4sh (func_arith, func_basename)
(func_dirname, func_dirname_and_basename, func_echo_all)
(func_grep, func_len, func_mkdir_p, func_mktempdir)
(func_normal_abspath, func_relative_path, func_quote_for_expand)
(func_stripname, func_show_eval, func_tr_sh): Move from here...
* build-aux/funclib.sh(func_arith, func_basename)
(func_dirname, func_dirname_and_basename, func_echo_all)
(func_grep, func_len, func_mkdir_p, func_mktempdir)
(func_normal_abspath, func_relative_path, func_quote_for_expand)
(func_stripname, func_show_eval, func_tr_sh): ...to here.
* bootstrap (usage message): Document `-no-warn' option.
(func_append_u, func_warning): Move from here...
* build-aux/funclib.sh (func_append_uniq, func_warning): ...to
here.
* bootstrap, build-aux/extract-trace: Source build-aux/funclib.sh
before build-aux/options-parser.
* build-aux/options-parser (usage, long_help_message): Set
default values to match what is parsed by the unmodified parser.
* build-aux/extract-trace (usage, long_help_message): Only set
from func_main, so that clients sourcing this file can still use
the correct defaults from build-aux/options-parser.
* bootstrap (bootstrap_options_prep, bootstrap_parse_options):
Move warning option parsing from here...
* build-aux/option-parser (func_options_prep)
(func_parse_options): ...to here, where all clients can benefit.
* Makefile.am (funclib_sh): New macro; path to funclib.sh.
(EXTRA_DIST): Add $(funclib_sh).
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* build-aux/options-parser (_G_HAVE_XSI_OPS): Environment
overrideable defaults for bash and zsh, which are known to
support XSI extensions.
(_G_HAVE_PLUSEQ_OP): Similarly for new enough versions of bash,
which are known to have += support.
(func_append): Only perform the shell += probe when state of
support is unknown.
(func_split_equals, func_split_short_opt): Similarly for XSI
probe to select fastest working implementation.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* build-aux/options-parser (func_parse_options): When there is
more than one non-option argument, "$*" forces all of them into
a single string. Use ${1+"$@"} to set arguments correctly.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* bootstrap, build-aux/extract-trace, build-aux/options-parser
(Local variables): Use time-stamp-pattern to set number of
searched lines to 10, and to replace time-stamp-start,
time-stamp-end and time-stamp-format.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
No need for a spurious space before a command ending semi-colon.
* cfg.mk (sc_prohibit_space_semicolon): New test to catch
accidental reintroduction of spurious spaces removed by this
changeset.
* bootstrap, build-aux/general.m4sh, build-aux/ltmain.m4sh,
libltdl/lt__strl.c, m4/libtool.m4, m4/ltdl.m4, tests/bindir.at:
Remove spurious spaces.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* build-aux/ltmain.m4sh (func_mode_link): Unroll a hard to
understad nested if statement into a more readable single case
statement.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* build-aux/ltmain.m4sh (func_mode_link): Save an if statement
with '$skipped_export && { block; }' instead of 'if $skipped_export;
then block; fi'.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* build-aux/ltmain.m4sh (func_mode_link): Reverse the branch
order for an if statement for readability.
* m4/libtool.m4: Likewise.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* build-aux/ltmain.m4sh (func_mode_link): Save test invocations
by using 'test x,y = "$a,$b"' instead of 'test x = "$a" && test y
= "$b"'.
* m4/libtool.m4: Likewise.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* build-aux/ltmain.m4sh (func_mode_link): For readability, use
'test string = "$var" || { stuff; }' in preference to
'if test string != "$var"; then stuff; fi'.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* build-aux/ltmain.m4sh (func_mode_uninstall): Save a string
comparison by setting $rmforce to false or : and using it
directly as the first argument to if.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* build-aux/ltmain.m4sh (func_mode_link): Save a string
comparison by setting $wrappers_required to false or : and using
it directly with a ored block rather than an if statement.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
* build-aux/ltmain.m4sh (func_mode_link): Save a string
comparison by setting $linkalldeplibs to false or : and using it
directly as the first argument to if.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>