serenity/Ports/quake3/patches/0001-Meta-Refactor-Makefile-to-support-Serenity.patch
Gunnar Beutner ce8d410f36 Ports: Make the quake3 port buildable on ARM64 hosts
Previously, on ARM64 hosts we'd try to build ARM64 binaries even when
SERENITY_ARCH was set to x86_64. This would cause the build to fail.
2022-10-18 17:23:52 +02:00

131 lines
3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jesse Buhagiar <jooster669@gmail.com>
Date: Fri, 25 Mar 2022 09:39:21 +1100
Subject: [PATCH] Meta: Refactor Makefile to support Serenity
---
Makefile | 44 ++++++++++++++++----------------------------
1 file changed, 16 insertions(+), 28 deletions(-)
diff --git a/Makefile b/Makefile
index 9e53555..b26ceb7 100644
--- a/Makefile
+++ b/Makefile
@@ -3,16 +3,8 @@
#
# GNU Make required
#
-COMPILE_PLATFORM=$(shell uname | sed -e 's/_.*//' | tr '[:upper:]' '[:lower:]' | sed -e 's/\//_/g')
-COMPILE_ARCH=$(shell uname -m | sed -e 's/i.86/x86/' | sed -e 's/^arm.*/arm/')
-
-#arm64 hack!
-ifeq ($(shell uname -m), arm64)
- COMPILE_ARCH=arm64
-endif
-ifeq ($(shell uname -m), aarch64)
- COMPILE_ARCH=arm64
-endif
+COMPILE_PLATFORM=serenity
+COMPILE_ARCH=${SERENITY_ARCH}
ifeq ($(COMPILE_PLATFORM),sunos)
# Solaris uname and GNU uname differ
@@ -35,13 +27,13 @@ ifndef BUILD_GAME_QVM
BUILD_GAME_QVM =
endif
ifndef BUILD_BASEGAME
- BUILD_BASEGAME =
+ BUILD_BASEGAME =1
endif
ifndef BUILD_MISSIONPACK
- BUILD_MISSIONPACK=
+ BUILD_MISSIONPACK=0
endif
ifndef BUILD_RENDERER_OPENGL2
- BUILD_RENDERER_OPENGL2=
+ BUILD_RENDERER_OPENGL2=0
endif
ifndef BUILD_AUTOUPDATER # DON'T build unless you mean to!
BUILD_AUTOUPDATER=0
@@ -164,39 +156,39 @@ GENERATE_DEPENDENCIES=1
endif
ifndef USE_OPENAL
-USE_OPENAL=1
+USE_OPENAL=0
endif
ifndef USE_OPENAL_DLOPEN
-USE_OPENAL_DLOPEN=1
+USE_OPENAL_DLOPEN=0
endif
ifndef USE_CURL
-USE_CURL=1
+USE_CURL=0
endif
ifndef USE_CURL_DLOPEN
ifdef MINGW
USE_CURL_DLOPEN=0
else
- USE_CURL_DLOPEN=1
+ USE_CURL_DLOPEN=0
endif
endif
ifndef USE_CODEC_VORBIS
-USE_CODEC_VORBIS=1
+USE_CODEC_VORBIS=0
endif
ifndef USE_CODEC_OPUS
-USE_CODEC_OPUS=1
+USE_CODEC_OPUS=0
endif
ifndef USE_MUMBLE
-USE_MUMBLE=1
+USE_MUMBLE=0
endif
ifndef USE_VOIP
-USE_VOIP=1
+USE_VOIP=0
endif
ifndef USE_FREETYPE
@@ -505,10 +497,6 @@ ifeq ($(PLATFORM),darwin)
ifeq ($(CROSS_COMPILING),1)
# If CC is already set to something generic, we probably want to use
# something more specific
- ifneq ($(findstring $(strip $(CC)),cc gcc),)
- CC=
- endif
-
ifndef CC
ifndef DARWIN
# macOS 10.9 SDK
@@ -817,11 +805,10 @@ ifeq ($(PLATFORM),freebsd)
else # ifeq freebsd
#############################################################################
-# SETUP AND BUILD -- OPENBSD
+# SETUP AND BUILD -- SERENITY
#############################################################################
-ifeq ($(PLATFORM),openbsd)
-
+ifeq ($(PLATFORM),serenity)
BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \
-pipe -DUSE_ICON -DMAP_ANONYMOUS=MAP_ANON
CLIENT_CFLAGS += $(SDL_CFLAGS)
@@ -1000,6 +987,7 @@ ifeq ($(PLATFORM),sunos)
else # ifeq sunos
+
#############################################################################
# SETUP AND BUILD -- GENERIC
#############################################################################