Ports: Replace manually linking libgpg-error with a libtool patch

This commit is contained in:
Tim Schumacher 2022-06-03 16:37:26 +02:00 committed by Linus Groh
parent 9d3e8b3e57
commit 9e1de61613
Notes: sideshowbarker 2024-07-17 10:28:23 +09:00
5 changed files with 94 additions and 10 deletions

View file

@ -12,9 +12,3 @@ auth_type=sha256
configure() {
run ./configure --host="${SERENITY_ARCH}-pc-serenity" --build="$($workdir/build-aux/config.guess)" "${configopts[@]}"
}
install() {
run make DESTDIR=${SERENITY_INSTALL_ROOT} "${installopts[@]}" install
${CC} -shared -o ${SERENITY_INSTALL_ROOT}/usr/local/lib/libgpg-error.so -Wl,-soname,libgpg-error.so -Wl,--whole-archive ${SERENITY_INSTALL_ROOT}/usr/local/lib/libgpg-error.a -Wl,--no-whole-archive -lintl
rm -f ${SERENITY_INSTALL_ROOT}/usr/local/lib/libgpg-error.la
}

View file

@ -1,7 +1,7 @@
From ea4d2441210e9bacb778e892227ed99ff496a9e1 Mon Sep 17 00:00:00 2001
From bd7b392f9447112458e9e5cfd89a2b25d544c465 Mon Sep 17 00:00:00 2001
From: Gunnar Beutner <gbeutner@serenityos.org>
Date: Wed, 14 Apr 2021 04:32:34 +0200
Subject: [PATCH 1/2] Include errno.h
Subject: [PATCH 1/3] Include errno.h
---
src/mkerrcodes.c | 1 +

View file

@ -1,7 +1,7 @@
From 473f87074e63a2786d42035c919e061c8574b7fe Mon Sep 17 00:00:00 2001
From 29782147d325747be57381458bc9dffb9bbfaf57 Mon Sep 17 00:00:00 2001
From: Gunnar Beutner <gbeutner@serenityos.org>
Date: Wed, 14 Apr 2021 04:32:34 +0200
Subject: [PATCH 2/2] Stub out the gpgrt lock impl
Subject: [PATCH 2/3] Stub out the gpgrt lock impl
---
src/syscfg/lock-obj-pub.i686-pc-serenity.h | 17 +++++++++++++++++

View file

@ -0,0 +1,76 @@
From 8c73450cf10645d91bb3fbe4e240184765d2af92 Mon Sep 17 00:00:00 2001
From: Tim Schumacher <timschumi@gmx.de>
Date: Sun, 29 May 2022 15:01:28 +0200
Subject: [PATCH 3/3] libtool: Enable shared library support for SerenityOS
For some odd reason, libtool handles the configuration for shared
libraries entirely statically and in its configure script. If no
shared library support is "present", building shared libraries is
disabled entirely.
Fix that by just adding the appropriate configuration options for
`serenity`. This allows us to finally create dynamic libraries
automatically using libtool, without having to manually link the
static library into a shared library.
---
configure | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/configure b/configure
index 24b0799..1838edf 100755
--- a/configure
+++ b/configure
@@ -6615,6 +6615,10 @@ sysv4 | sysv4.3*)
tpf*)
lt_cv_deplibs_check_method=pass_all
;;
+
+serenity*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
esac
fi
@@ -9639,6 +9643,10 @@ lt_prog_compiler_static=
lt_prog_compiler_static='-Bstatic'
;;
+ serenity*)
+ lt_prog_compiler_can_build_shared=yes
+ ;;
+
*)
lt_prog_compiler_can_build_shared=no
;;
@@ -11055,6 +11063,10 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
hardcode_shlibpath_var=no
;;
+ serenity*)
+ ld_shlibs=yes
+ ;;
+
*)
ld_shlibs=no
;;
@@ -12070,6 +12082,17 @@ uts4*)
shlibpath_var=LD_LIBRARY_PATH
;;
+serenity*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}${versuffix} ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}${major}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ dynamic_linker='SerenityOS LibELF'
+ ;;
+
*)
dynamic_linker=no
;;
--
2.36.1

View file

@ -10,3 +10,17 @@ Include errno.h
Stub out the gpgrt lock impl
## `0003-libtool-Enable-shared-library-support-for-SerenityOS.patch`
libtool: Enable shared library support for SerenityOS
For some odd reason, libtool handles the configuration for shared
libraries entirely statically and in its configure script. If no
shared library support is "present", building shared libraries is
disabled entirely.
Fix that by just adding the appropriate configuration options for
`serenity`. This allows us to finally create dynamic libraries
automatically using libtool, without having to manually link the
static library into a shared library.