Re-add mingw libtool variant

It was removed in #10338 because it wasn't really used and the
msys one seemed good enough for autotools (via libtoolize), and
all packages using it were really just depending on libltdl.

Turns out some mingw packages use libtool directly and the msys
one has various things hardcoded for that environment, resulting
for example in wrongly named .dlls.

This adds back the mingw libtool with all patches synched from the
msys one and the Windows paths fixed up in the libtool script.
Also add it as a dependency to autotools, so we avoid sometimes
the msys one being used and sometimes the mingw one, which would
make it harded to debug.

Ideally this doesn't change anything for existing packages and
just fixes the ones using libtool directly, for example
mingw-w64-libvterm and mingw-w64-libtommath.

There is also a libtool integration test being added now in
https://github.com/msys2/msys2-tests/pull/45
This commit is contained in:
Christoph Reiter
2023-08-12 22:31:47 +02:00
parent d0c46f76ca
commit 31cf2ca0aa
15 changed files with 1957 additions and 51 deletions

View File

@@ -3,7 +3,7 @@
_realname=autotools
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=2022.01.16
pkgver=2023.08.12
pkgrel=1
pkgdesc="A meta package for the GNU autotools build system (mingw-w64)"
arch=('any')
@@ -14,7 +14,7 @@ depends=(
'autoconf-wrapper'
'automake-wrapper'
'make'
'libtool'
"${MINGW_PACKAGE_PREFIX}-libtool"
"${MINGW_PACKAGE_PREFIX}-gettext"
"${MINGW_PACKAGE_PREFIX}-pkg-config"
)

View File

@@ -1,49 +0,0 @@
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
# Contributor: Ray Donnelly <mingw.android@gmail.com>
_realname=libltdl
_parentname=libtool
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=2.4.7
pkgrel=1
pkgdesc="A system independent dlopen wrapper for GNU libtool (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
url="https://www.gnu.org/software/libtool"
license=("GPL")
makedepends=("${MINGW_PACKAGE_PREFIX}-autotools" "${MINGW_PACKAGE_PREFIX}-cc")
provides=("${MINGW_PACKAGE_PREFIX}-libtool")
conflicts=("${MINGW_PACKAGE_PREFIX}-libtool")
replaces=("${MINGW_PACKAGE_PREFIX}-libtool")
source=("https://ftp.gnu.org/pub/gnu/libtool/${_parentname}-${pkgver}.tar.xz"{,.sig})
sha256sums=('4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d'
'SKIP')
validpgpkeys=('7C5FBB96BE82B954AC20DF5F6EAC957F8EEB55C0') # "Alex Ameen <alex.ameen.tx@gmail.com>"
prepare() {
cd ${srcdir}/${_parentname}-${pkgver}/libltdl
autoreconf -fvi
}
build() {
mkdir -p ${srcdir}/build-${MINGW_CHOST} && cd ${srcdir}/build-${MINGW_CHOST}
export lt_cv_deplibs_check_method='pass_all'
../${_parentname}-${pkgver}/libltdl/configure \
--prefix=${MINGW_PREFIX} \
--build=${MINGW_CHOST} \
--host=${MINGW_CHOST} \
--target=${MINGW_CHOST} \
--enable-ltdl-install
make
}
package() {
cd "${srcdir}/build-${MINGW_CHOST}"
make DESTDIR="${pkgdir}" install
}

View File

@@ -0,0 +1,99 @@
[PATCH 2/6] [cygwin|mingw] Create UAC manifest files.
* build-aux/ltmain.in (func_emit_exe_manifest): New function.
(func_mode_link) [cygwin|mingw]: Create manifest files for wrapper
and target exe when target name matches heuristic that triggers
UAC problems for newer win32 OSs. Clean up $cwrapper.manifest on
error. Ensure manifest files have executable permission.
(func_mode_uninstall): Clean up manifest files.
Various reports by Eric Blake, Kai Tietz, and Cesar Strauss.
---
build-auxltmain.in | 50 ++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 48 insertions(+), 2 deletions(-)
diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
index 0418007..1821779 100644
--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -4277,6 +4277,41 @@ EOF
}
# end: func_emit_cwrapperexe_src
+# func_emit_exe_manifest
+# emit a Win32 UAC manifest for executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_exe_manifest ()
+{
+ cat <<EOF
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+ <assemblyIdentity version="1.0.0.0"
+EOF
+
+ case $host in
+ i?86-*-* ) echo ' processorArchitecture="x86"' ;;
+ ia64-*-* ) echo ' processorArchitecture="ia64"' ;;
+ x86_64-*-* ) echo ' processorArchitecture="amd64"' ;;
+ *) echo ' processorArchitecture="*"' ;;
+ esac
+
+ cat <<EOF
+ name="$host_os.$PROGRAM.$outputname"
+ type="win32"/>
+
+ <!-- Identify the application security requirements. -->
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+ <security>
+ <requestedPrivileges>
+ <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
+ </requestedPrivileges>
+ </security>
+ </trustInfo>
+</assembly>
+EOF
+}
+
# func_win32_import_lib_p ARG
# True if ARG is an import lib, as indicated by $file_magic_cmd
func_win32_import_lib_p ()
@@ -8237,7 +8272,7 @@ EOF
cwrappersource="$output_path/$objdir/lt-$output_name.c"
cwrapper="$output_path/$output_name.exe"
$RM $cwrappersource $cwrapper
- trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+ trap "$RM $cwrappersource $cwrapper $cwrapper.manifest; exit $EXIT_FAILURE" 1 2 15
func_emit_cwrapperexe_src > $cwrappersource
@@ -8257,6 +8292,16 @@ EOF
$opt_dry_run || {
# note: this script will not be executed, so do not chmod.
if test "x$build" = "x$host"; then
+ # Create the UAC manifests first if necessary (but the
+ # manifest files must have executable permission regardless).
+ case $output_name in
+ *instal*|*patch*|*setup*|*update*)
+ func_emit_exe_manifest > $cwrapper.manifest
+ func_emit_exe_manifest > $output_path/$objdir/$output_name.exe.manifest
+ chmod +x $cwrapper.manifest
+ chmod +x $output_path/$objdir/$output_name.exe.manifest
+ ;;
+ esac
$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
else
func_emit_wrapper no > $func_ltwrapper_scriptname_result
@@ -8777,8 +8822,9 @@ func_mode_uninstall ()
# note $name still contains .exe if it was in $file originally
# as does the version of $file that was added into $rmfiles
func_append rmfiles " $odir/$name $odir/${name}S.$objext"
+ func_append rmfiles " ${name}.manifest $objdir/${name}.manifest"
if test yes = "$fast_install" && test -n "$relink_command"; then
- func_append rmfiles " $odir/lt-$name"
+ func_append rmfiles " $odir/lt-$name $objdir/lt-${name}.manifest"
fi
if test "X$noexename" != "X$name"; then
func_append rmfiles " $odir/lt-$noexename.c"
--
1.7.1

View File

@@ -0,0 +1,27 @@
[PATCH 3/6] Pass various runtime library flags to GCC.
* build-aux/ltmain.in (func_mode_link): Pass the
-shared-libgcc and -static-lib* flags along to GCC.
diff -urN libtool-2.4.7/build-aux/ltmain.in.orig libtool-2.4.7/build-aux/ltmain.in
--- libtool-2.4.7/build-aux/ltmain.in.orig 2022-05-25 13:57:50.311734300 +0200
+++ libtool-2.4.7/build-aux/ltmain.in 2022-05-25 14:01:54.621866600 +0200
@@ -5440,13 +5440,18 @@
# -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
# -specs=* GCC specs files
# -stdlib=* select c++ std lib with clang
+ # -{shared,static}-libgcc, -static-{libgfortran|libstdc++}
+ # link against specified runtime library
# -fsanitize=* Clang/GCC memory and address sanitizer
# -fuse-ld=* Linker select flags for GCC
# -Wa,* Pass flags directly to the assembler
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
- -specs=*|-fsanitize=*|-fuse-ld=*|-Wa,*)
+ -specs=*|-fsanitize=*|-fuse-ld=*|-Wa,*|-ftree-parallelize-loops=*| \
+ -fcilkplus|-fgnu-tm|-ffast-math|-funsafe-math-optimizations| \
+ -fvtable-verify*|-shared-libgcc|-static-libgcc|-static-libgfortran| \
+ -static-libstdc++)
func_quote_arg pretty "$arg"
arg=$func_quote_arg_result
func_append compile_command " $arg"

View File

@@ -0,0 +1,24 @@
[PATCH 5/6] Fix "seems to be moved"
* build-aux/ltmain.in (func_mode_link): Compare files by inode
to fix "seems to be moved" warning.
---
build-aux/ltmain.in | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
index af46cb8..244bb5b 100644
--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -6283,7 +6283,9 @@ func_mode_link ()
eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
test -z "$libdir" && \
func_fatal_error "'$deplib' is not a valid libtool archive"
- test "$absdir" != "$libdir" && \
+ abs_inode=`ls -i "$deplib" | awk '{print $1}'`
+ lib_inode=`ls -i "$libdir/$(basename $deplib)" | awk '{print $1}'`
+ test "$abs_inode" != "$lib_inode" && \
func_warning "'$deplib' seems to be moved"
path=-L$absdir
--
1.7.0.2.msysgit.0

View File

@@ -0,0 +1,22 @@
[PATCH 6/6] Fix STRICT_ANSI vs POSIX
* build-aux/ltmain.in (func_mode_link): Also check for _POSIX
as well as __STRICT_ANSI__ to avoid re-definitions.
---
build-aux/ltmain.in | 4 +++-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
index af46cb8..244bb5b 100644
--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -3382,7 +3382,7 @@
/* declarations of non-ANSI functions */
#if defined __MINGW32__
-# ifdef __STRICT_ANSI__
+# if defined(__STRICT_ANSI__) && !defined(__MINGW64_VERSION_MAJOR) || defined(_POSIX_)
int _putenv (const char *);
# endif
#elif defined __CYGWIN__
--
1.7.0.2.msysgit.0

View File

@@ -0,0 +1,22 @@
--- libtool-2.4.2/configure.orig 2011-10-17 10:18:58.000000000 +0000
+++ libtool-2.4.2/configure 2013-08-04 19:01:30.220494400 +0000
@@ -28825,7 +28825,7 @@
fi
ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
- ac_cs_awk_cr='\\r'
+ ac_cs_awk_cr='\r'
else
ac_cs_awk_cr=$ac_cr
fi
--- libtool-2.4.2/libltdl/configure.orig 2011-10-17 10:19:47.000000000 +0000
+++ libtool-2.4.2/libltdl/configure 2013-08-05 11:49:24.990792500 +0000
@@ -13574,7 +13574,7 @@
fi
ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
- ac_cs_awk_cr='\\r'
+ ac_cs_awk_cr='\r'
else
ac_cs_awk_cr=$ac_cr
fi

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,24 @@
diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
index 0418007..91276c2 100644
--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -4163,6 +4163,7 @@
# include <unistd.h>
# include <stdint.h>
# ifdef __CYGWIN__
+# include <process.h>
# include <io.h>
# endif
#endif
diff --git a/build-aux/ltmain.sh b/build-aux/ltmain.sh
index 0418007..91276c2 100644
--- a/build-aux/ltmain.sh
+++ b/build-aux/ltmain.sh
@@ -4163,6 +4163,7 @@
# include <unistd.h>
# include <stdint.h>
# ifdef __CYGWIN__
+# include <process.h>
# include <io.h>
# endif
#endif

View File

@@ -0,0 +1,33 @@
From a18473ed4e5574dab899db640b8efeff78939b54 Mon Sep 17 00:00:00 2001
From: Manoj Gupta <manojgupta@chromium.org>
Date: Wed, 10 Oct 2018 10:50:23 +0300
Subject: [PATCH 1/2] Pick up clang_rt static archives compiler internal
libraries
Libtool checks only for libraries linked as -l* when trying to
find internal compiler libraries. Clang, however uses the absolute
path to link its internal libraries e.g. compiler_rt. This patch
handles clang's statically linked libraries when finding internal
compiler libraries.
https://crbug.com/749263
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27866
---
m4/libtool.m4 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index b55a6e5..d9322d0 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -7556,7 +7556,7 @@ if AC_TRY_EVAL(ac_compile); then
for p in `eval "$output_verbose_link_cmd"`; do
case $prev$p in
- -L* | -R* | -l*)
+ -L* | -R* | -l* | */libclang_rt.*.a)
# Some compilers place space between "-{L,R}" and the path.
# Remove the space.
if test x-L = "$p" ||
--
2.7.4

View File

@@ -0,0 +1,83 @@
From ec15841963ca3aab3bc88fb0932c014337284bfc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin@martin.st>
Date: Wed, 10 Oct 2018 10:47:21 +0300
Subject: [PATCH 2/2] 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 | 28 ++++++++++++++--------------
m4/libtool.m4 | 2 ++
2 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
index e2fb263..db5d590 100644
--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -7932,20 +7932,7 @@ EOF
last_robj=
k=1
- if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
- output=$output_objdir/$output_la.lnkscript
- func_verbose "creating GNU ld script: $output"
- echo 'INPUT (' > $output
- for obj in $save_libobjs
- do
- func_to_tool_file "$obj"
- $ECHO "$func_to_tool_file_result" >> $output
- done
- echo ')' >> $output
- func_append delfiles " $output"
- func_to_tool_file "$output"
- output=$func_to_tool_file_result
- elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
+ if test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
output=$output_objdir/$output_la.lnk
func_verbose "creating linker input file list: $output"
: > $output
@@ -7964,6 +7951,19 @@ EOF
func_append delfiles " $output"
func_to_tool_file "$output"
output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
+ elif test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
+ output=$output_objdir/$output_la.lnkscript
+ func_verbose "creating GNU ld script: $output"
+ echo 'INPUT (' > $output
+ for obj in $save_libobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
+ done
+ echo ')' >> $output
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$func_to_tool_file_result
else
if test -n "$save_libobjs"; then
func_verbose "creating reloadable object files..."
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index d9322d0..9046a84 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -5130,6 +5130,7 @@ _LT_EOF
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
_LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+ _LT_TAGVAR(file_list_spec, $1)='@'
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -6706,6 +6707,7 @@ if test yes != "$_lt_caught_CXX_error"; then
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(always_export_symbols, $1)=no
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
--
2.7.4

View File

@@ -0,0 +1,38 @@
From b9f77cae8cfbe850e58cac686fcb4d246b5bfc51 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin@martin.st>
Date: Mon, 19 Aug 2019 13:34:51 +0300
Subject: [PATCH] Allow statically linking compiler support libraries when
linking a library
For cases with deplibs_check_method="file_magic ..." (as it is for mingw),
there were previously no way that a static library could be accepted
here.
---
build-aux/ltmain.in | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
index e2fb2633..db4d775c 100644
--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -5870,8 +5870,15 @@ func_mode_link ()
fi
case $linkmode in
lib)
- # Linking convenience modules into shared libraries is allowed,
- # but linking other static libraries is non-portable.
+ # Linking convenience modules and compiler provided static libraries
+ # into shared libraries is allowed, but linking other static
+ # libraries is non-portable.
+ case $deplib in
+ */libgcc*.$libext | */libclang_rt*.$libext)
+ deplibs="$deplib $deplibs"
+ continue
+ ;;
+ esac
case " $dlpreconveniencelibs " in
*" $deplib "*) ;;
*)
--
2.17.1

View File

@@ -0,0 +1,39 @@
From 03dabb6a70847761e65572a2a7b770a3b1b9f123 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= <mati865@gmail.com>
Date: Mon, 12 Apr 2021 23:44:10 +0200
Subject: [PATCH] Support llvm-objdump -f output
---
build-aux/ltmain.in | 2 +-
m4/libtool.m4 | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
index a9f070a..4a434cc 100644
--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -3019,7 +3019,7 @@ func_win32_libid ()
*ar\ archive*) # could be an import, or static
# Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
- $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+ $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|coff-arm|coff-arm64|coff-i386|coff-x86-64)' >/dev/null; then
case $nm_interface in
"MS dumpbin")
if func_cygming_ms_implib_p "$1" ||
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index 21a7d60..594be9c 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -3473,7 +3473,7 @@ mingw* | pw32*)
lt_cv_file_magic_cmd='func_win32_libid'
else
# Keep this pattern in sync with the one in func_win32_libid.
- lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|coff-arm|coff-arm64|coff-i386|coff-x86-64)'
lt_cv_file_magic_cmd='$OBJDUMP -f'
fi
;;
--
2.31.1

View File

@@ -0,0 +1,21 @@
Allow statically linking Flang support libraries when linking a library
diff -urN libtool-2.4.7/build-aux/ltmain.in.orig libtool-2.4.7/build-aux/ltmain.in
--- libtool-2.4.7/build-aux/ltmain.in.orig 2022-03-17 03:43:39.000000000 +0100
+++ libtool-2.4.7/build-aux/ltmain.in 2022-10-30 11:49:11.337887100 +0100
@@ -7459,6 +7459,15 @@
a_deplib=
break 2
fi
+ # Linking compiler provided static libraries into shared
+ # libraries is allowed, but linking other static libraries is
+ # non-portable.
+ case $potlib in
+ */libFortran*.$libext)
+ func_append newdeplibs " $potlib"
+ a_deplib=
+ ;;
+ esac
done
done
fi

120
mingw-w64-libtool/PKGBUILD Normal file
View File

@@ -0,0 +1,120 @@
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
# Contributor: Ray Donnelly <mingw.android@gmail.com>
_realname=libtool
pkgbase=mingw-w64-libtool
pkgname=("${MINGW_PACKAGE_PREFIX}-libtool" "${MINGW_PACKAGE_PREFIX}-libltdl")
pkgver=2.4.7
pkgrel=2
pkgdesc="A generic library support script (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
url="https://www.gnu.org/software/libtool"
license=("GPL")
makedepends=(
"${MINGW_PACKAGE_PREFIX}-cc"
"automake-wrapper"
"autoconf-wrapper"
"help2man"
)
source=("https://ftp.gnu.org/pub/gnu/libtool/${_realname}-${pkgver}.tar.xz"{,.sig}
0002-cygwin-mingw-Create-UAC-manifest-files.mingw.patch
0003-Pass-various-runtime-library-flags-to-GCC.mingw.patch
0005-Fix-seems-to-be-moved.patch
0006-Fix-strict-ansi-vs-posix.patch
0007-fix-cr-for-awk-in-configure.all.patch
0009-libtool-2.4.2.418-msysize.patch
0010-libtool-2.4.2-include-process-h.patch
0011-Pick-up-clang_rt-static-archives-compiler-internal-l.patch
0012-Prefer-response-files-over-linker-scripts-for-mingw-.patch
0013-Allow-statically-linking-compiler-support-libraries-.patch
0014-Support-llvm-objdump-f-output.patch
0015-Allow-statically-linking-Flang-support-libraries.patch)
sha256sums=('4f7f217f057ce655ff22559ad221a0fd8ef84ad1fc5fcb6990cecc333aa1635d'
'SKIP'
'fe8b80efd34f9385220ebc90aaec945e44de8c343c75719d6ac0d4e472a6eed5'
'37d46a7964cf56617b897feb566537d847dee5e8f53e4771255d3cccf722918d'
'dc39fbe066958178f96108f07db62b48b9339efddf2c21f800ff8d67110ca393'
'6a94ada08b0a0aa36240efd9ccb826e22ab94ef0969270f2edb8be344dc8c62b'
'd96beecfc5d15f94ce46bbe0e89d6e6fdb973a25ad6be98c30504b58453792c1'
'1a858a13592a1a5bd56ae3c4e610408ca19ec9d318ebdfd96bebcfc585b2924f'
'0f3defa657d353b9f55469f6d514abd96494ce7459ef76bbd63980d8994cafe9'
'c727b2b017163cfdeca60820d3cff2dac8968c5630745602b150f92b159af313'
'c95a65e890b1ae6362807abc66809e72cf81aeea5f9f556e38f9752f974bf435'
'8069e887aeeab7491f15e00547fa66d9b9e86407f5a23f37a6d8c7d165de752e'
'db16cd322e0ebc578c906e94b0788810af17ce617c700a50db2e3c598dbbed7e'
'9fe454603a519e9ac50b32de125d4c5293520142c34a895c6e392a190719ff52')
validpgpkeys=('7C5FBB96BE82B954AC20DF5F6EAC957F8EEB55C0') # "Alex Ameen <alex.ameen.tx@gmail.com>"
apply_patch_with_msg() {
for _patch in "$@"
do
msg2 "Applying $_patch"
patch -Nbp1 -i "${srcdir}/$_patch"
done
}
prepare() {
cd "${_realname}-${pkgver}"
# Note: keep the patches in sync with msys libtool
apply_patch_with_msg \
0002-cygwin-mingw-Create-UAC-manifest-files.mingw.patch \
0003-Pass-various-runtime-library-flags-to-GCC.mingw.patch \
0005-Fix-seems-to-be-moved.patch \
0006-Fix-strict-ansi-vs-posix.patch \
0007-fix-cr-for-awk-in-configure.all.patch \
\
0009-libtool-2.4.2.418-msysize.patch \
0010-libtool-2.4.2-include-process-h.patch \
0011-Pick-up-clang_rt-static-archives-compiler-internal-l.patch \
0012-Prefer-response-files-over-linker-scripts-for-mingw-.patch \
0013-Allow-statically-linking-compiler-support-libraries-.patch \
0014-Support-llvm-objdump-f-output.patch \
0015-Allow-statically-linking-Flang-support-libraries.patch
}
build() {
cd "${_realname}-${pkgver}"
./configure \
--prefix=${MINGW_PREFIX} \
--build=${MINGW_CHOST} \
--host=${MINGW_CHOST} \
--target=${MINGW_CHOST}
make
}
package_libtool() {
depends=("${MINGW_PACKAGE_PREFIX}-libltdl")
cd "${_realname}-${pkgver}"
make DESTDIR=${pkgdir} install-binSCRIPTS install-man install-info \
install-data-local
# Fix paths
local WINPREFIX=$(cygpath -wm ${MINGW_PREFIX})
sed -i "s|${WINPREFIX}|${MINGW_PREFIX}|g" "${pkgdir}${MINGW_PREFIX}/bin/libtool"
}
package_libltdl() {
pkgdesc="A system independent dlopen wrapper for GNU libtool"
cd "${_realname}-${pkgver}"
make DESTDIR=${pkgdir} install-libLTLIBRARIES install-includeHEADERS \
install-ltdlincludeHEADERS
}
# template start; name=mingw-w64-splitpkg-wrappers; version=1.0;
# vim: set ft=bash :
# generate wrappers
for _name in "${pkgname[@]}"; do
_short="package_${_name#${MINGW_PACKAGE_PREFIX}-}"
_func="$(declare -f "${_short}")"
eval "${_func/#${_short}/package_${_name}}"
done
# template end;