Commit Graph

411 Commits

Author SHA1 Message Date
Ileana Dumitrescu
d405ede870
Fix errors in distclean and maintainer-clean
The variable, LT_ARGZ_H, can be empty, which causes distclean and
maintainer-clean to error as a directory is attempted to be removed
instead of a file.

When running maintainer-clean for gnulib-tests, the .version file is
missing, which is needed by config.status, so the command will error.

* configure.ac: Update CONFIG_STATUS_DEPENDENCIES to use dotversion so
  that the .version file can be generated if needed.
* libltdl/ltdl.mk: Add conditional with LTARGZH_EXISTS to append path for
  LT_ARGZ_H file to BUILT_SOURCES.
* m4/ltdl.m4: Add AM_CONDITIONAL for LTARGZH_EXISTS that is set to
  true if LT_ARGZ_H is non-empty.
* NO-THANKS: Add 'Michael Pratt' for bug#73672 contribution.
* NEWS: List additional bug fix.
2024-10-22 19:55:50 +03:00
Joshua Root
82f7f52123
libtool.m4: Update '-single_module' detection
'-single_module' detection is broken with Xcode 15, where a message to
stderr indicates the flag is deprecated, not unsupported.

* m4/libtool.m4: Check macOS versions to see if '-single_module' flag is
  unnecessary.
2024-10-22 19:45:25 +03:00
Ileana Dumitrescu
182c7b3e25
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-18 17:15:27 +03:00
Ileana Dumitrescu
3e6c6284a7
libtoolize: Fix conflicting warnings about AC_PROG_RANLIB
The macro _LT_CMD_OLD_ARCHIVE inlines the definition of AC_PROG_RANLIB,
which seems to be outdated functionality. Running autoscan in a
directory with ltmain.sh produces conflicting warnings with libtoolize
about AC_PROG_RANLIB. Autoconf warns that AC_PROG_RANLIB is missing,
but libtoolize warns that it is obsolete. The outdated warning should
no longer appear after replacing AC_CHECK_TOOL(RANLIB, ranlib, :) with
AC_REQUIRE([AC_PROG_RANLIB]).

* m4/libtool.m4: Use AC_REQUIRE([AC_PROG_RANLIB]).
* Makefile.am: Added in tests/bug_42313.at.
* tests/bug_42313.at: Contains test cases for bug 42313.
2024-09-13 20:19:34 +03:00
Bruno Haible
6c8203d2ae
Rename option --with-aix-soname to --enable-aix-soname.
Reported at <https://savannah.gnu.org/support/index.php?110674>.

* doc/libtool.texi (LT_INIT): Talk about --enable-aix-soname instead of --with-aix-soname.
* m4/ltoptions.m4 (_LT_WITH_AIX_SONAME): Use AC_ARG_ENABLE instead of
AC_ARG_WITH. In the default case, use _AC_ENABLE_IF, in order to still
recognize the old option --with-aix-soname.
* m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER): Update comment.
* configure.ac: Update comment.
* NEWS: Mention the change.
2024-09-13 20:19:33 +03:00
Bruno Haible
9a8535f4e9
Rename option --with-pic to --enable-pic.
Reported at <https://savannah.gnu.org/support/index.php?110674>.

* doc/libtool.texi (LT_INIT): Talk about --enable-pic instead of
--with-pic, and about --disable-pic instead of --without-pic.
(Test descriptions): Likewise.
* m4/ltoptions.m4 (_LT_WITH_PIC): Use AC_ARG_ENABLE instead of
AC_ARG_WITH. In the default case, use _AC_ENABLE_IF, in order to still
recognize the old options --with-pic and --without-pic.
* tests/demo.at: Add a test for --enable-pic, keeping the test for
--with-pic. Test '--disable-pic' instead of '--with-pic=no'.
* tests/with-pic.at: Test --enable-pic instead of --with-pic.
* NEWS: Mention the change.
2024-09-13 20:19:33 +03:00
Bruno Haible
552d1db3fb
Fix libtool wrapper programs in 32-bit mode on FreeBSD/powerpc64.
* m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER): On FreeBSD/powerpc64, in 32-bit mode,
set shlibpath_var to LD_32_LIBRARY_PATH instead of LD_LIBRARY_PATH.
2024-08-27 17:07:29 +03:00
Ileana Dumitrescu
42229835ff
m4: Increment serial for recent changes
* m4/libtool.m4: Incremented serial to 62.
* m4/ltdl.m4: Incremented serial to 23.
2024-07-24 17:20:54 +03:00
Ileana Dumitrescu
2a25604bcf
m4: Support additional flang-based compilers
* m4/libtool.m4: Alter regex to support 'flang-new' and 'ftn'.
* NO-THANKS: Add thanks for Anton Shterenlikht.
2024-07-19 19:32:36 +03:00
Ileana Dumitrescu
f0507df8a7
m4: Disable chained fixups for macOS
Append '-no_fixup_chains' flag to disable chained fixups since it
is not compatible with '-undefined dynamic_lookup'.

* m4/libtool.m4: AC_VAR_APPEND will handle appending the option to
  the variable, which allows the '+=' extension to be used by shells
  that provide this capability for more efficient scaling. Also, bump
  minimum required version of autoconf from 2.62 to 2.64.
* tests/no-executables.at: Set cache variable for link test.
* NO-THANKS: Add thanks for Carlo Cabrera and Dave Allured.
2024-07-19 19:26:09 +03:00
trcrsired
ab89ebbcc2
libtool: Correct DLL Installation Path for mingw
When building native GCC for the x86_64-w64-mingw32 host, the
compiler copies its library DLLs to the `bin` directory. However,
in the case of a multilib configuration, both 32-bit and 64-bit
libraries end up in the same `bin` directory, leading to conflicts
where 64-bit DLLs are overridden by their 32-bit counterparts.

This patch addresses the issue by adjusting the installation path
for the libraries. Specifically, it installs the libraries to
separate directories: `lib` for 64-bit and `lib32` for 32-bit. This
behavior aligns with how libraries are installed when creating an
x86_64-w64-mingw32 cross-compiler without copying them to the `bin`
directory if it is a multilib build.

* m4/libtool.m4: Install DLL to $(libdir), not $(libdir)/bin, if
  multilib build.
2024-07-19 19:20:46 +03:00
Peter Kokot
434a308f46
m4: Fix Wstrict-prototypes warnings
This changes the C function prototypes to use void where needed. When
building with CFLAGS=-Werror=strict-prototypes or similar, the libtool's
tests can cause false reports and errors in the log files:

    error: function declaration isn't a prototype

* m4/libtool.m4: Specify void for main function prototypes.
* m4/ltdl.m4: Specify void for main and fnord function prototypes.
2024-07-19 19:20:46 +03:00
Richard Purdie
9a4a02615c
m4/libtool.m4: Fixed AC_CHECK_PROG call
AC_CHECK_TOOL was changed to AC_CHECK_PROG however the arguments are
different and this result is a value of ":". Change this to match the
original intent.

The lack of FILECMD was causing failures for mips64 builds as -m elf was
being passed to LD which isn't supported on our targets.
2024-06-05 20:25:58 +03:00
Ileana Dumitrescu
3280f27cda
libtool.m4: Incremented serial
* m4/libtool.m4: Incremented serial for previous changes.
2024-05-11 10:29:07 +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
Ileana Dumitrescu
fb617e2ba0
libtool.m4: Check for space after -l flag
The -R and -L flags are currently checked if they have a space behind
them. -l should be added to the list of cases checked.

* m4/libtool.m4: Check for a space after the -l flag.
2024-02-17 18:40:46 +02:00
Mike Frysinger
57dae03b04 m4: update serial numbers in modified files
These should have been included in the commits that updated these
files, but too late now to rewrite git history.

* m4/libtool.m4: Update serial number.
* m4/ltdl.m4, m4/ltoptions.m4: Likewise.
2024-02-01 00:02:23 -05:00
Richard Purdie
365805327c libtool.m4: Cleanup sysroot trailing "/"
If $CC has --sysroot=/, it is a valid configuration however libtool will
then set lt_sysroot to "/".

This means references like $lt_sysroot$libdir become //usr/lib instead
of the more normally expected /usr/lib. This may or may not break something
but certainly is confusing to the user and gives confusing output. Making
"/" simply unset lt_sysroot is much cleaner.

Whilst here, trim any trailing '/' from sysroot paths to drop the duplication
and result in cleaner/consistent output.

* m4/libtool.m4: Cleanup sysroot trailing '/' handling.
2024-01-17 17:01:45 -05:00
Ozkan Sezer
97859bda6a
libtool: add mingw to systems not requiring libm
mingw uses msvcrt as it's standard library and does not use libm.
So in LT_LIB_M it can be added to the list of systems which do not
require libm.

* libtool.m4: Add mingw to the list of systems not requiring libm
2024-01-17 20:34:58 +02:00
Paul Green
e60044908e libtool.m4: fix old_archive_from_new_cmds variable name typo
The "From" should be "from" in the variable name.

Fixes libtool bug https://bugs.gnu.org/38305

* m4/libtool.m4: Change F to f in old_archive_from_new_cmds.
2024-01-17 02:45:49 -05:00
Mike Frysinger
9665e2f25e libtool.m4: drop AC_PROG_SED fallback
We require autoconf 2.62 which includes this macro so we don't need
this fallback logic anymore.

* m4/libtool.m4 (AC_PROG_SED): Delete.
2024-01-17 02:31:22 -05:00
Albert Chu
bfcbcc2dce libtool.m4: fix "manifest" typos
* m4/libtool.m4: Rename lt_cv_path_mainfest_tool to lt_cv_path_manifest_tool.

Signed-off-by: Albert Chu <chu11@llnl.gov>
2024-01-17 01:52:43 -05:00
Oliver Kiddle
b67d1a2db8 libtool: fix Solaris 11 builds
Trying to build clamav on Solaris 11.3 with the Oracle C compiler,
I got the following error:

libtool: error: not configured to extract global symbols from dlpreopened files

I would have expected a build to use dlopen rather than the preopen
fallback so looked for related configure tests that were perhaps
returning the wrong answer.

The global_symbol_pipe being empty seemed a likely culprit.
the last three lines of nm -p on the conftest.o in this test are:

0000000032 T main
0000000016 T nm_test_func
0000000001 C nm_test_var

On Solaris 10, I'd get a D instead of a C. Adding C to the list of
characters in the symcode variable and building again resulted in a
successful build. I've attached a patch to add this C.

Url: https://savannah.gnu.org/patch/?9086

* m4/libtool.m4 (symcode): Add C for solaris.
2024-01-17 01:32:06 -05:00
Brad Smith
1ae386ba78 libtool: remove OpenBSD specific performance hack for ranlib
The -t flag was used as a performance hack for ranlib. The flag was
supported by the GNU toolchain, but is a no-op with the LLVM toolchain.

* m4/libtool.m4: Remove use of -t flag with ranlib.
2024-01-16 20:52:26 -05:00
Raul E Rangel
f81f36e4e9 libtool: Use $LD when checking for --whole-archive
Using `$CC -print-prog-name=ld` will always use the `ld` linker. We
should instead be using the $LD variable so that we use the proper
linker.

There is already another part of the code that does this same check,
so I just copy/pasted the if line.

* m4/libtool.m4: Change `$CC -print-prog-name=ld` to $LD.

Url: https://savannah.gnu.org/support/?110978
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
2024-01-16 15:28:57 -05:00
Brad Smith
5a7193dbfb libtool: remove bitrig support.
Bitrig has been defunct for 7 years.

* build-aux/ltmain.in (func_mode_link): Remove bitrig support.
* m4/libtool.m4 (_LT_CMD_OLD_ARCHIVE, LT_CMD_MAX_LEN)
(_LT_SYS_DYNAMIC_LINKER, _LT_CHECK_MAGIC_METHOD)
(_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG): Ditto.
* m4/ltdl.m4 (LT_SYS_DLOPEN_DEPLIBS): Ditto.
* NEWS: Updated.
2024-01-16 15:11:38 -05:00
Olly Betts
81e8abf3dd
libtool: use -Fe with MSVC to specify filename
This avoids a deprecation warning with current versions of MSVC, by
replacing the -o flag with -Fe. -Fe is documented as supported at
least as far back as Visual C 6.0 which was released in 1998.

* m4/libtool.m4: Use -Fe instead of -o to specify DLL output filename
for MSVC.

Signed-off-by: Olly Betts <olly@survex.com>
2024-01-16 20:43:00 +02:00
Xiang.Lin
4da5b57531
libtool: fix empty "-L" in compiler_lib_search_path
If the compiler places a space between "-L" and the path, the path will
be skipped and only an empty "-L" will appear in the final
compiler_lib_search_path. This will cause the first library in postdeps
following compiler_lib_search_path to be accidentally skipped.

* libtool.m4: Fixed string comparison by adding missing 'x's.
2024-01-16 19:47:20 +02:00
Bruno Haible
47c71f61df
Fix shared library support on Android.
This patch fixes two problems:
1) A libtool library created with the -release option and no -version-info
   option was, when built with --enable-shared, installed without the
   symlink libNAME.so -> libNAME-RELEASE.so. This led to subsequent failures
   during "make install" of shared libraries that depend on it.
2) Executables were created without a RUNPATH property. These executables
   then did not find their shared libraries when run.

* m4/libtool.m4: On Android, fix library_names_spec and
hardcode_libdir_flag_spec.
2024-01-15 22:58:56 +02:00
Richard Purdie
bd826173c4 libtool.m4: For reproducibility stop encoding hostname in libtool script
For reproducibility, stop encoding the hostname into the libtool script,
this isn't really adding much to debugging and most distros are carrying
such a patch now as reproducibility is important.

* m4/libtool.m4: Delete call to hostname & uname.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-14 02:11:35 -05:00
Gilles Gouaillardet
33d4b69fcc libtool: Add support for flang (Fortran LLVM-based) compilers
This patch adds support for flang compilers.  Some specific flags
are needed so these compilers must be handled in a specific way.
By default, the compiler is called 'flang', but ARM releases their
own flang-based compiler called 'armflang'.

Because of the current lack of flang support in libtool, the
generated 'libtool' must be manually modified after 'configure' is
invoked.  Such a process is for example described on ARM web site
(it involves the Open MPI library).

Url: https://savannah.gnu.org/patch/?9442

* m4/libtool.m4: Handle *flang.
2024-01-14 02:07:38 -05:00
Mike Frysinger
22406ebb83 maint: extend release version hook to cover config.lt
* cfg.mk: Extend rule to cover config.lt.
* m4/libtool.m4: Update copyright year.
2024-01-14 01:10:32 -05:00
Jakub Wilk
9ced107b8c libtool.m4: fix typos
* m4/libtool.m4: Fix various typos.
2024-01-14 01:03:54 -05:00
Samuel Thibault
7464f1db29 libtool: hurd-amd64 support
This adds support for passing -m elf32_x86_64 vs -m elf_x86_64 to the
linker on hurd-amd64.

Url: https://savannah.gnu.org/patch/?10398

* m4/libtool.m4: dd x86_64-gnu* case to pass -m elf32_x86_64 vs
-m elf_x86_64 to linker.
2024-01-14 00:48:00 -05:00
Bruno Haible
9e7b9631ec Recognize *-*-windows* config triplets
The gnuconfig project recognizes windows* as a host OS to denote native
Windows environments.  The commit message makes it sound like LLVM and
Crablang communities will use the 'windows' value, whereas GNU will
continue to use 'mingw'. But I think it's only a matter of time until
people start to pass the option --host=x86_64-pc-windows to configure
scripts. We should be prepared for that.

Url: https://savannah.gnu.org/patch/?10387

* build-aux/ltmain.in: Treat windows* as equivalent to mingw*.
* m4/libtool.m4: Likewise.
* m4/ltdl.m4: Likewise.
* m4/ltoptions.m4: Likewise.
* tests/bindir.at: Likewise.
* tests/deplibs-mingw.at: Likewise.
* tests/lt_dladvise.at: Likewise.
* tests/testsuite.at: Likewise.
2024-01-14 00:41:20 -05:00
Paul Eggert
eb2a21cf2e libtool: port to GNU grep 3.8
GNU grep 3.8 warns about some regular expressions that POSIX says have
undefined effect, e.g., '\-'.  Unfortunately Libtool uses regular
expressions of this form.  Some unittests now fail, e.g. link-order.at:

--- /dev/null
+++ .../libtool/tests/testsuite.dir/at-groups/66/stderr
@@ -0,0 +1,4 @@
+/bin/grep: warning: stray \ before /
+/bin/grep: warning: stray \ before /
+/bin/grep: warning: stray \ before /
+/bin/grep: warning: stray \ before /

Url: https://savannah.gnu.org/patch/index.php?10282

* m4/libtool.m4 (_LT_LANG_CXX_CONFIG): Do not use \- in a BRE or ERE,
as this produces undefined results that GNU grep 3.8 warns about.
Use [-] instead.
* tests/link-order.at (Link order test): Similarly, do not use
\/ in an ERE; use / instead.
2024-01-13 22:56:10 -05:00
Mike Frysinger
96dafbda93 maint: add hook to automate release version updates
Fixes libtool bug https://bugs.gnu.org/67588.

Automate the process to avoid it falling stale again in the future,
and then refresh here to get in sync.

* cfg.mk: Add rule to update libtool.m4 release version.
* m4/libtool.m4: Update release year.
2024-01-12 02:09:28 -05:00
Uwe Kleine-König
64bef5ba65 libtool: Use AC_CHECK_PROG instead of AC_CHECK_TOOL to find "file"
This fixes a warning when cross-building:

	checking for arm-v7a-linux-gnueabihf-file... no
	checking for file... file
	configure: WARNING: using cross tools not prefixed with host triplet

file isn't platform specific and not usually installed with a host
triplet. So use AC_CHECK_PROG which differs from AC_CHECK_TOOL by not
expecting such a host triplet prefix.

* m4/libtool.m4 (_LT_DECL_FILECMD): Change AC_CHECK_TOOL to AC_CHECK_PROG.
2024-01-12 01:37:17 -05:00
Mike Frysinger
85093d697a maint: update copyrights across project 2024-01-12 01:35:32 -05:00
Alex Ameen
6132006b5f
Revert "libtool: permit compiler libs in shlibs"
This reverts commit 1d2577357e.
2022-05-16 00:07:17 -05:00
Alex Ameen
1d2577357e
libtool: permit compiler libs in shlibs 2022-05-08 21:46:30 -05:00
Alex Ameen
28fbcb6a9a libtool: correct linter syntax complaints in M4
* m4/libtool.m4: remove unnecessary braces on variable derefence.
* m4/ltargz.m4: change quote style for inline comment.
2022-02-08 13:44:03 -06:00
Alex Ameen
7e69e44199 gnulib: update submodule to new repository.
* configure.ac: Update autoconf requirement for bootstrapping to 2.64.
* README.md: Update note concerning autoconf version requirement.
* bootstrap: Propogate change to GPL license from GPL 3 to GPL 2.
2022-02-08 13:32:47 -06:00
Alex Ameen
2dc7dad770 maint: update copyrights across project. 2022-02-08 12:11:10 -06:00
Alex Ameen
f51eddf0db * libtool: Bump M4 serial versions and add missing AC_PROG_SED to ltdl.m4
* m4/libtool.m4: bump serial version ( covers entire release ).
* m4/ltargz.m4: bump serial version ( covers entire release ).
Add AC_PROG_SED requirement to LT_FUNC_ARGZ.
* m4/ltdl.m4: bump serial version ( covers entire release ).
2021-11-29 21:43:26 -06:00
Václav Haisman
ccc878dd72 libtool: replace raw invocations of sed with $SED
* build-aux/ltmain.in: replace raw invocations of sed with $SED
* m4/libtool.m4: replace raw invocations of sed with $SED
* m4/ltargz.m4: replace raw invocations of sed with $SED
* m4/ltdl.m4: replace raw invocations of sed with $SED

Co-authored-by: Alex Ameen <alex.ameen.tx@gmail.com>
Copyright-paperwork-exempt: Yes
2021-11-29 20:37:49 -06:00
Lucas Holt
5df7dd49d5 libtool: add support for MidnightBSD
* build-aux/ltmain.in: clone link-mode handling for MidnightBSD from FreeBSD
* m4/libtool.m4: clone various TAGVARs for MidnightBSD from FreeBSD
* m4/ltdl.m4: clone dlopen handling for MidnightBSD from FreeBSD

Copyright-paperwork-exempt: Yes
2021-11-29 18:54:09 -06:00
Ryan Schmidt
8f4bdbda0a libtool: powerpc 10.5 detection without a deployment target
* m4/libtool.m4: properly set "allow undefined" flag for darwin powerpc 10.5
even if deployment target is unset

Copyright-paperwork-exempt: Yes
2021-11-21 21:06:50 -06:00
Jeremy Huddleston Sequoia
9e8c882517 libtool: support macOS 11
Fixes bug#44605

* m4/libtool.m4: '_LT_REQUIRED_DARWIN_CHECKS' sets proper "allow undefined" flag
for particular macOS versions and powerpc.

Copyright-paperwork-exempt: Yes
2021-11-21 20:36:34 -06:00
Vincent Lefevre
0904164dd5 libtool: correct m4 quoting in sed expression
* m4/libtool.m4: properly escape character set in sed expression

Copyright-paperwork-exempt: Yes
2021-11-21 19:59:54 -06:00