1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:27:46 +00:00

Ports/python3: Update patch for configure

- Dropped modifications to `configure.ac`
- "Merged" `0007-Set-name-of-shared-libpython.patch` into
  `0002-Tweak-configure.patch`
- Use `CCSHARED=fPIC`
This commit is contained in:
Oskar Skog 2023-09-27 15:43:59 +03:00 committed by Tim Schumacher
parent 14d8403a7b
commit ebee480bcc
4 changed files with 85 additions and 122 deletions

View file

@ -0,0 +1,77 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Linus Groh <mail@linusgroh.de>
Date: Fri, 14 Jan 2022 23:35:57 +0330
Subject: [PATCH] Tweak configure
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
As usual, make the `configure` script recognize Serenity. Also set
`MACHDEP` (which is used for `sys.platform`) to a version-less
`serenityos`, even when not cross-compiling.
Co-Authored-By: Julian Offenhäuser <offenhaeuser@protonmail.com>
Co-Authored-By: Oskar Skog <oskar@oskog97.com>
---
configure | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/configure b/configure
index af4a5bbfdfa1a4cc8069f67f4e4fe20a35fd27ee..8a043f76112625ffe425c3a69420191abe382f54 100755
--- a/configure
+++ b/configure
@@ -3814,6 +3814,9 @@ then
# a lot of different things including 'define_xopen_source'
# in the case statement below.
case "$host" in
+ *-*-serenity*)
+ ac_sys_system=SerenityOS
+ ;;
*-*-linux-android*)
ac_sys_system=Linux-android
;;
@@ -3858,6 +3861,7 @@ then
linux*) MACHDEP="linux";;
cygwin*) MACHDEP="cygwin";;
darwin*) MACHDEP="darwin";;
+ serenityos*) MACHDEP="serenityos";;
'') MACHDEP="unknown";;
esac
fi
@@ -3867,6 +3871,9 @@ $as_echo "\"$MACHDEP\"" >&6; }
if test "$cross_compiling" = yes; then
case "$host" in
+ *-*-serenity*)
+ _host_cpu=$host_cpu
+ ;;
*-*-linux*)
case "$host_cpu" in
arm*)
@@ -6743,7 +6750,7 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>confdefs.h
PY3LIBRARY=libpython3.so
fi
;;
- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|VxWorks*)
+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|VxWorks*|SerenityOS*)
LDLIBRARY='libpython$(LDVERSION).so'
BLDLIBRARY='-L. -lpython$(LDVERSION)'
RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
@@ -11028,7 +11035,7 @@ then
else CCSHARED="+z";
fi;;
Linux-android*) ;;
- Linux*|GNU*) CCSHARED="-fPIC";;
+ Linux*|GNU*|SerenityOS*) CCSHARED="-fPIC";;
Emscripten*|WASI*)
if test "x$enable_wasm_dynamic_linking" = xyes; then :
@@ -11065,7 +11072,7 @@ then
LINKFORSHARED="-Wl,-E -Wl,+s";;
# LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
Linux-android*) LINKFORSHARED="-pie -Xlinker -export-dynamic";;
- Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
+ Linux*|GNU*|SerenityOS*) LINKFORSHARED="-Xlinker -export-dynamic";;
# -u libsys_s pulls in all symbols in libsys
Darwin/*)
LINKFORSHARED="$extra_undefs -framework CoreFoundation"