203 Commits

Author SHA1 Message Date
Julien ÉLIE
a83ba2ff5e
ltmain.in: Supporting -S and -t flags from install-sh
Libtool silently discards options for install-sh that have not been
specified. Now the install directory and a suffix for backing up
files can be specified to be passed through libtool.

Reported: https://savannah.gnu.org/patch/index.php?10510

* build-aux/ltmain.in: Recognize -S and -t flags from install-sh.
2025-03-24 18:46:29 +02:00
Takashi Yano
f4c10752cc
ltmain.in: Fix mistaking a directory as an executable
find_executable() can return a directory of the same name as the target
executable if the directory is found earlier in the PATH, which causes
check_executable() to fail.

Reported: https://savannah.gnu.org/support/?111191

* build-aux/ltmain.in: Check if directory is found before executable
  in the PATH.
2025-02-20 20:39:14 +02:00
Ileana Dumitrescu
7b49ee14f9
ltmain.in: Increase revision limit to 19 digits
Current, age, and revision values for a library seem to have been chosen
arbitrarily, which is limiting users to a 5 digit maximum. Now, users
can set revision to at most 19 digits, which is referencing Unix epoch
time in nanoseconds.

Reported: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=75880

* build-aux/ltmain.in: Update revision check to allow up to 19 digits.
* tests/versioning.at: Add more version checks to test.
* NEWS: Update.
2025-01-28 16:35:31 +02:00
Frédéric Bérat
18dc06ade3
ltmain.in: Compiler dependencies wrongly deduplicated
Removing duplicate compiler dependencies causes linking problems on
linux with GCC libraries. This deduplication optimization is no longer
used for linux hosts.

Reported: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=75462

* build-aux/ltmain.in: Add linux to list of hosts that do not remove
  duplicate compiler dependencies.
2025-01-13 19:45:38 +02:00
Ileana Dumitrescu
c010d1e93f
libtool: Add tagging support for OBJC and OBJCXX
Reported: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=67754

* Makefile.am: Set environment variables for tests.
* configure.ac: Add language support for Objective-C and Objective-C++.
* build-aux/ltmain.in: Update help message for tags available.
* m4/libtool.m4: Add tagging support for OBJC and OBJCXX.
* tests/flags.at: Add tests for passing OBJC and OBJCXX flags.
* tests/infer-tag.at: Add tests for inferring OBJC and OBJCXX tags.
* doc/libtool.texi: Update documentation.
* NEWS: Update.
2025-01-13 17:33:50 +02:00
Ileana Dumitrescu
376411905b
ltmain.in: Update info supplied to user for --tag usage
* build-aux/ltmain.in: Make error message more explicit for users,
  and add tag name information to help menu.
* tests/infer-tag.at: Add testcase for unsupported compiler use.
2025-01-07 20:56:37 +02:00
Ileana Dumitrescu
74e6c3a828
libtool: Update copyright year 2025-01-02 16:47:53 +02:00
Ileana Dumitrescu
416ff25e14
ltmain.in: Replace old warnings with documentation
Without the ability to disable these old warnings individually, they
are migrating to the relevant section of the documentation to inform
new users that may not know. These warnings have been present for
two decades, so existing users should be aware of this functionality.

* build-aux/ltmain.in: Remove old warnings.
* doc/libtool.texi: Document contents of warning messages.
2024-12-06 16:28:02 +02:00
Khalid Masum
2c4bb57a88
libtool: add support for wasm32-emscripten
This patch adds support for emscripten compiler for shared compilation.

* build-aux/ltmain.in: clone link-mode handling for emscripten from
unixware7.
* m4/libtool.m4: translate emscripten specific flags for shared module
building.
2024-11-19 21:23:41 +02:00
Ileana Dumitrescu
63560839d3
ltmain.in: Fix handling xlc(1)-specific options
Patch supplied on Savannah by user, whr:
  https://savannah.gnu.org/patch/index.php?10126
2024-11-19 20:58:01 +02:00
Ileana Dumitrescu
f4345d86aa
libtool: Fix --no-warnings flag
Passing --no-warnings to libtool would not suppress warning messages.

* build-aux/ltmain.in: Add 'opt_warning' check before printing out
  warning messages.
* tests/libtool.at: Add simple test for '--no-warnings'.
* NEWS: Update.
2024-11-18 20:19:57 +02:00
Ileana Dumitrescu
7fd72bec1a
ltmain.in: Fix infinite loop for error messages
If an invalid argument is passed to options '--mode' or '--reorder-cache'
after a valid command, error messages will print infinitely:

  $ libtool --help --mode=MODE
  libtool:   error: invalid argument 'MODE' for --mode
  libtool:   error: invalid argument 'MODE' for --mode
  libtool:   error: invalid argument 'MODE' for --mode
  ...

* build-aux/ltmain.in: Remove 'break' in case statement to fix infinite
  loop, and add shift for option '--reorder-cache' to allow more options
  to be processed.
2024-11-14 21:18:33 +02:00
Ileana Dumitrescu
d8fad26c31
ltmain.in: Upgrade warnings to errors 2024-11-14 20:31:55 +02:00
Ileana Dumitrescu
d0ceb95e9a
ltmain.in: Update libtool usage for missing options
Some options were not listed in the usage output of libtool: --finish,
--no-quiet, and --no-silent.
2024-11-14 20:21:41 +02:00
Ileana Dumitrescu
92725b31eb
libtool: Rename and reduce to one option, '--no-finish'
'--test' and '--check' options caused confusion with the previous
naming, so it has been updated to '--no-finish' for skipping
finish_cmds.

* build-aux/ltmain.in: Replace option names.
* doc/libtool.texi: Update.
* NEWS: Update.
2024-11-14 20:14:22 +02:00
Ileana Dumitrescu
0a1e894220
libtool: Add option to reorder the shared library cache
Add option to reorder the shared library cache in OpenBSD so that user
preferred directories for shared libraries can be used when linking
before directories previously listed in the shared library cache.

This allows for users in OpenBSD to easily switch between versions of
libraries with the same name during testing.

* NEWS: Update for new (OpenBSD) option.
* build-aux/ltmain.in: Add option --reorder-cache=DIRS.
* doc/libtool.texi: Update documentation for new option.
* test/bug_71489.at: Alter test for OpenBSD to utilize new option.
2024-11-12 20:17:11 +02:00
Ileana Dumitrescu
90e1c01272
ltmain.in: Update usage message for libtool
* build-aux/ltmain.in: Add --test and --check usage information.
2024-11-07 18:07:19 +02:00
Ileana Dumitrescu
3996b1fddc
libtool: Fix local testing of shared libraries on OpenBSD
On OpenBSD 7.5, the shared library cache is updated with finish_cmds,
which causes the test for 'Use local version' to fail. Simply, installed
versions of shared libraries take precedence over those locally built.

To ensure local versions of shared libraries can be tested properly and
more easily, additional options have been added to libtool to skip
executing finish_cmds, like 'ldconfig -m $libdir' in OpenBSD.

* build-aux/ltmain.in: Add libtool options, '--test' and '--check'.
* doc/libtool.texi: Document new options in libtool.
* NEWS: Update for bug fix.
2024-11-07 17:01:47 +02:00
Martin Storsjö
5fa7a3b505
libtool: Prefer response files over linker scripts for mingw tools
The GCC/binutils tools support response files just fine, while
lld (impersonating GNU ld) only supports response files, not
linker scripts. Using a linker script as input just to pass a
list of files is overkill for cases when a response file is enough.

* build-aux/ltmain.in: Move creation of ld script.
* m4/libtool.m4: Add new variable tag for file_list_spec.
2024-10-25 19:36:53 +03:00
Richard Purdie
b3839cb99b
ltmain.in: Handle trailing slashes on install commands
A command like:

libtool --mode=install /usr/bin/install -c gck-roots-store-standalone.la
'/image/usr/lib/gnome-keyring/standalone/'

where the path ends with a trailing slash currently fails. This occurs in
software like gnome-keyring or pulseaudio and is because the comparision
code doesn't see the paths as equal. Strip both paths to ensure this works
reliably.

* build-aux/ltmain.in: Strip trailing slashes on install commands.
2024-10-25 16:19:10 +03:00
Alastair McKinstry
61f184eb60
ltmain.in: Add error message for unknown version type 2024-10-18 17:17:14 +03:00
Alastair McKinstry
8c7a8352e3
libtool: Change how version is derived
Avoid duplication of '(GNU @PACKAGE@) @VERSION@' in multiple
places by using '$scriptversion'.

* libtoolize.in, build-aux/ltmain.in: Change version from
  '(GNU @PACKAGE@) @VERSION@' to '$scriptversion'.
2024-10-18 17:17:14 +03:00
Ileana Dumitrescu
9d99f7fdfd
Update documentation and version output
* libtoolize.in: Overwrite function in bootstrap for printing version
  information for libtoolize.
* build-aux/ltmain.in: Overwrite function in bootstrap for printing
  version information for libtool.
* doc/libtool.texi: Fix typo and correct references for tests/demo
  subdirectory to the tests/demo.at Autotest file.
* gl/top/README-release.diff: Add documentation for maintainers so
  the CVS repository is properly updated following a stable release.
2024-10-10 20:16:09 +03:00
Sergey Poznyakoff
44ad06b0d2
Don't omit directories from the constructed rpath.
This fixes bug introduced by 0e1b333324.

* build-aux/ltmain.in: Don't omit paths that are not under $progdir
from the compiled_rpath.  Append them to the end of it.
2024-10-10 17:15:18 +03:00
Ileana Dumitrescu
1638a64075
Add 'aarch64' support to the file magic test
The file magic test fails to determine the file type of libraries when
cross-compiling with an aarch64 compiler without additional strings to
search for in an objdump.

* build-aux/ltmain.in: Append 'pe-aarch64' to file_magic in the
lt_cv_deplibs_check_method.
* m4/libtool.m4: Append 'pe-aarch64' to file format check.
2024-09-11 20:48:18 +03:00
Ileana Dumitrescu
ac5768d1fc
libtool: FSF office address replaced by URL
* AUTHORS, HACKING, Makefile.am, bootstrap.conf, build-aux/edit-readme-alpha,
build-aux/no-bogus-m4-defines, cfg.mk, configure.ac, libltdl/configure.ac,
libltdl/libltdl/lt__alloc.h, libltdl/libltdl/lt__argz_.h,
libltdl/libltdl/lt__dirent.h, libltdl/libltdl/lt__glibc.h,
libltdl/libltdl/lt__private.h, libltdl/libltdl/lt__strl.h,
libltdl/libltdl/lt_dlloader.h, libltdl/libltdl/lt_error.h,
libltdl/libltdl/lt_system.h, libltdl/libltdl/slist.h,
libltdl/loaders/dld_link.c, libltdl/loaders/dlopen.c,
libltdl/loaders/dyld.c, libltdl/loaders/load_add_on.c,
libltdl/loaders/loadlibrary.c, libltdl/loaders/preopen.c,
libltdl/loaders/shl_load.c, libltdl/lt__alloc.c, libltdl/lt__argz.c,
libltdl/lt__dirent.c, libltdl/lt__strl.c, libltdl/lt_dlloader.c,
libltdl/lt_error.c, libltdl/ltdl.c, libltdl/ltdl.h, libltdl/ltdl.mk,
libltdl/slist.c, tests/am-subdir.at, tests/archive-in-archive.at,
tests/bindir.at, tests/bug_62343.at, tests/cdemo.at, tests/cmdline_wrap.at,
tests/configure-funcs.at, tests/configure-iface.at, tests/convenience.at,
tests/ctor.at, tests/cwrapper.at, tests/darwin.at, tests/demo.at,
tests/depdemo.at, tests/deplib-in-subdir.at, tests/deplibs-ident.at,
tests/deplibs-mingw.at, tests/destdir.at, tests/dlloader-api.at,
tests/dumpbin-symbols.at, tests/duplicate_conv.at, tests/duplicate_deps.at,
tests/duplicate_members.at, tests/early-libtool.at, tests/exceptions.at,
tests/execute-mode.at, tests/exeext.at, tests/export-def.at,
tests/export.at, tests/f77demo.at, tests/fail.at, tests/fcdemo.at,
tests/flags.at, tests/help.at, tests/indirect_deps.at, tests/infer-tag.at,
tests/inherited_flags.at, tests/install.at, tests/lalib-syntax.at,
tests/libtool.at, tests/libtoolize.at, tests/link-order.at,
tests/link-order2.at, tests/loadlibrary.at, tests/localization.at,
tests/lt_dladvise.at, tests/lt_dlexit.at, tests/lt_dlopen.at,
tests/lt_dlopen_a.at, tests/lt_dlopenext.at, tests/ltdl-api.at,
tests/ltdl-libdir.at, tests/mdemo.at, tests/need_lib_prefix.at,
tests/no-executables.at, tests/nocase.at, tests/nonrecursive.at,
tests/old-m4-iface.at, tests/pic_flag.at, tests/recursive.at,
tests/resident.at, tests/runpath-in-lalib.at, tests/search-path.at,
tests/shlibpath.at, tests/slist.at, tests/standalone.at, tests/static.at,
tests/stresstest.at, tests/subproject.at, tests/sysroot.at, tests/tagdemo.at,
tests/template.at, tests/testsuite.at, tests/versioning.at,
tests/with-pic.at: Replace FSF address in each file's license block with
a URL that points to licenses online hosted by GNU.
2024-09-03 19:40:25 +03:00
Ileana Dumitrescu
ce352a54e4
Revert 37b7146c13a62a46273fd1478e6ad8fe42f9b551
Removing a forward slash launches an interactive cmd prompt when run in
an MSYS shell, so the previous change has been reverted. For more
details: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=49246
2024-08-19 20:17:48 +03:00
Brian Inglis
37b7146c13
libtool: mingw hangs in func_convert_core_msys_to_w32
The `cmd //c ...` is is an invocation of the Windows console command
line shell `cmd`. The slashes are Windows console shell command line
option switch characters '/', with `cmd /c ...` meant to be
equivalent to `sh -c ...`.

It results in the Windows `cmd` shell being invoked as an interactive
console shell, as if invoked with the '/k' switch, but ignoring any
provided command string, hanging builds!

* build-aux/ltmain.in: Remove additional forward slash for option.
2024-08-14 21:15:48 +03:00
Sergey Poznyakoff
998a334762
ltmain: Use shared objects built in source tree
It has been discovered that under certain conditions libtool creates
wrappers that prefer installed versions of the shared objects over
those built in the source tree. As a result, any tests run in the
source tree produce unreliable results.

* build-aux/ltmain.in: Alter to use shared objects in source tree
  instead of installed.
* Makefile.am: Added in tests/bug_71489.at.
* tests/bug_71489.at: Contains test case for bug 71489.
2024-08-09 16:37:40 +03:00
Ileana Dumitrescu
f5a7acee1d
ltmain: Further error message improvement
* build-aux/ltmain.in: Edit message of each instance where run-paths
  are not absolute to better reflect the issue occurring to the user.
2024-07-02 16:42:20 +03:00
Ileana Dumitrescu
33be3e9653
ltmain: Error message improvement
* build-aux/ltmain.in: Append argument to error message to make it
  easier to understand.
2024-06-29 15:28:49 +03:00
Ileana Dumitrescu
e517cfe7e1
ltmain: Remove unnecessary comment for INN 2024-06-27 17:31:29 +03:00
Julien ÉLIE
938a0f4b01
ltmain.in: Fix --preserve-dup-deps stripping duplicates
Building INN with libtool otherwise failed with unresolved circular
dependencies, even with the use of --preserve-dup-deps.
2024-06-20 16:21:44 +03:00
Ileana Dumitrescu
c0b1a53aac
ltmain: Fix testsuite errors for windows
Numerous test failures on windows/cygwin/mingw result with:
	did not find the 'nothing' variable

A syntax fix resolves these test failures for 64-bit windows-
based systems.

* build-aux/ltmain.in: Alter syntax in sed command.
2024-06-18 20:20:21 +03:00
Ileana Dumitrescu
b8cad780da
ltmain.in: Additional sysroot to prepend to libdir
Addition to commit 3221f9f0fb98d5740ab5d0e8db6a731302520644.
2024-05-31 17:56:09 +03:00
Vincent Lefevre
40b73c116e
libtool: pass more flags to the linker
Resolves bug 17750.

* build-aux/ltmain.in (func_mode_link): In the flags to be passed
through unchanged, also pass -static-* and -fcilkplus.
2024-05-31 16:18:34 +03:00
Khem Raj
3221f9f0fb
ltmain.in: Add missing sysroot to library path
When using a sysroot we should append it to libdir, which is helpful in
cross builds as the system is staged in the sysroot. For normal builds,
i.e. when lt_sysroot is not set, it will still behave the same and add
-L/usr/lib to the relink command.

* build-aux/ltmain.in: Prepend sysroot to libdir.
2024-05-30 17:43:15 +03:00
Ileana Dumitrescu
90710b139b
libtool: Minor syntax and typo fixes
doc/notes.texi: Duplicate "to" removed.
build-aux/ltmain.in: Useless parentheses in cpp directive removed.
2024-05-11 10:52:47 +03:00
Ileana Dumitrescu
7b09183107
ltmain.in: Use func_warning for all warnings
Several warning messages have been updated to use func_warning rather
than echo. This will allow them to be disabled properly.

* build-aux/ltmain.in: Replace echo command with func_warning function.
2024-04-20 13:04:33 +03:00
Ileana Dumitrescu
297b5cf19f
libtool: Pass the "-no-canonical-prefixes" linker flag
When using the -no-canonical-prefixes flag in libtool, the flag is
removed from the linking command, causing linking to fail. This adds
the flag to the list of linker flags to be passed through to the
linker.

* build-aux/ltmain.in: Pass -no-canonical-prefixes to the linker.
* Makefile.am: Added in tests/bug_62343.at.
* tests/bug_62343.at: Contains test case for bug 62343.
2024-04-18 19:26:55 +03:00
Ileana Dumitrescu
88fc2b892c
libtool: Remove test_compile
This is cleanup for libtool. The option test_compile is not used in
libtool, and the documentation states that it would probably be dropped
in the future.

* build-aux/ltmain.in: Remove case statement for test_compile.
* doc/libtool.texi: Remove test_compile from documentation.
* m4/libtool.m4: Remove test_compile definition from macro file.
2024-04-08 22:34:19 +03:00
Sam James
888bd7ad44
Clang uses -fopenmp=* to allow choosing between libgomp and libomp.
* build-aux/ltmain.in: Pass through -fopenmp=*.
2024-03-25 20:32:30 +02:00
Stephen Webb
a956f5ce7d
ltmain.in: update QNX version_type handling
QNX handles ELF SONAME versioning just like most other targets.
2024-03-25 19:09:08 +02:00
Ozkan Sezer
3afd415a90
ltmain.in: correct windows compiler preprocessor checks
Commit f54924fa5d8d5959038e58adab7c552c3ca495ae seems to have been
wrongly applied.
2024-03-01 19:51:32 +02:00
Ileana Dumitrescu
f54924fa5d
ltmain.in: Expand process.h inclusion on Windows
Multiple compilers on Windows besides the proprietary MSVC compiler
require process.h, and not unistd.h. The inclusion check is expanded
to include these alternative compilers which also require process.h.

* ltmain.in: Replace _MSV_VER with WIN32 and !__GNU_C check
2024-02-29 16:25:35 +02:00
Richard Purdie
725646bf09 ltmain.in: Parse additional clang options
clang uses -rtlib and -unwindlib to select proper compiler runtime in
some cases.  Therefore pass these options to linker when found in
ldflags.

* build-aux/ltmain.in: Handle clang linker options.
2024-01-17 17:05:12 -05:00
Richard Purdie
cdf4bf702f ltmain.in: Handle prefix-map compiler options correctly
If lto is enabled, we need the prefix-map variables to be passed to the
linker to correctly link the objects using correctly mapped paths.

Add these to the list of options libtool passes through.

* build-aux/ltmain.in: Handle prefix-map compiler options.
2024-01-17 14:49:08 -05:00
Tim Rice
31d9133b4c ltmain: correct fallout from freebsd-elf changes
Here is a small patch to correct builds on svr5.
When the freebsd-elf target was changed, this got missed.

Symptoms were, building newer lib ended up with libfoo.nn a lower number
than the previous version.  And building libpng-1.6.29 produced:
libtool:   error: CURRENT '' must be a nonnegative integer
libtool:   error: '16:29:0' is not valid version information

* build-aux/ltmain.in (func_mode_link): Add sco.
2024-01-17 14:45:30 -05:00
Richard Purdie
49e6cb0d4d libtool: Fix support for NIOS2 processor
When building for a nios2 system, the $host tuple starts with "nios2-"
which is caught by the some of the greedy checks for OS/2 in libtool.
In particular, the *os2* branches of switch statements that only want
to match the OS setting end up matching all nios2 targets, which
results in incorrect behavior.

Switch to use $host_os instead of $host and tweak the patterns to
match to avoid this problem for nios2.

* build-aux/ltmain.in: Switch some $host checks to $host_os.
2024-01-16 20:48:27 -05:00
Antonin Décimo
fd8ab0cbd3 Fix various typos
* NEWS: Fix various typos.
* NO-THANKS, README.md, TODO, bootstrap, bootstrap.conf,
build-aux/edit-readme-alpha, build-aux/git-log-fix, build-aux/ltmain.in,
doc/libtool.texi, libltdl/libltdl/lt_error.h, libltdl/lt__argz.c,
libltdl/ltdl.c, libtoolize.in, tests/depdemo.at, tests/link-order.at: Likewise.
* cfg.mk (old_NEWS_hash): Update.

Copyright-paperwork-exempt: Yes
2024-01-16 17:54:26 -05:00