Skip to content

Commit

Permalink
Merge remote-tracking branch 'ioquake3/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
zturtleman committed Apr 2, 2023
2 parents 4f72706 + 4610a24 commit 68aa83c
Show file tree
Hide file tree
Showing 222 changed files with 66,952 additions and 4,237 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ misc/code_blocks/*.layout
.DS_Store
.LSOverride
Icon?
make-macosx-values.local

# Xcode
####################
Expand Down
31 changes: 31 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,34 @@ ioquake3 can be developed locally. For instructions on how to do this, see [the

* Fill in [the required template](PULL_REQUEST_TEMPLATE.md)
* Do not include issue numbers in the PR title.


### Building Official Installers

This is a reminder for how official installers should be built:

* Please include the id patch pk3s in your installer, which are available
from http://ioquake3.org/patch-data/ subject to agreement to the id
EULA. Your installer shall also ask the user to agree to this EULA (which
is in the /web/include directory for your convenience) and subsequently
refuse to continue the installation of the patch pk3s and pak0.pk3 if they
do not.

* Please don't require pak0.pk3, since not everyone using the engine
plans on playing Quake 3 Arena on it. It's fine to (optionally) assist the
user in copying the file or tell them how.

* It is fine to just install the binaries without requiring id EULA agreement,
providing pak0.pk3 and the patch pk3s are not referred to or included in the
installer.

* Please include at least a libSDL2 so/dylib/dll on every platform.

* Please include an OpenAL so/dylib/dll, since every platform should be using
it by now.

* Please be prepared to alter your installer on the whim of the maintainers.

* Your installer will be mirrored to an "official" directory, thus making it
a done deal.

124 changes: 106 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
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

ifeq ($(COMPILE_PLATFORM),sunos)
# Solaris uname and GNU uname differ
COMPILE_ARCH=$(shell uname -p | sed -e 's/i.86/x86/')
Expand Down Expand Up @@ -440,7 +448,34 @@ ifeq ($(PLATFORM),darwin)

# Default minimum Mac OS X version
ifeq ($(MACOSX_VERSION_MIN),)
MACOSX_VERSION_MIN=10.7
MACOSX_VERSION_MIN=10.9
ifneq ($(findstring $(ARCH),ppc ppc64),)
MACOSX_VERSION_MIN=10.5
endif
ifeq ($(ARCH),x86)
MACOSX_VERSION_MIN=10.6
endif
ifeq ($(ARCH),x86_64)
# trying to find default SDK version is hard
# macOS 10.15 requires -sdk macosx but 10.11 doesn't support it
# macOS 10.6 doesn't have -show-sdk-version
DEFAULT_SDK=$(shell xcrun -sdk macosx -show-sdk-version 2> /dev/null)
ifeq ($(DEFAULT_SDK),)
DEFAULT_SDK=$(shell xcrun -show-sdk-version 2> /dev/null)
endif
ifeq ($(DEFAULT_SDK),)
$(error Error: Unable to determine macOS SDK version. On macOS 10.6 to 10.8 run: make MACOSX_VERSION_MIN=10.6 On macOS 10.9 or later run: make MACOSX_VERSION_MIN=10.9 );
endif

ifneq ($(findstring $(DEFAULT_SDK),10.6 10.7 10.8),)
MACOSX_VERSION_MIN=10.6
else
MACOSX_VERSION_MIN=10.9
endif
endif
ifeq ($(ARCH),arm64)
MACOSX_VERSION_MIN=11.0
endif
endif

MACOSX_MAJOR=$(shell echo $(MACOSX_VERSION_MIN) | cut -d. -f1)
Expand All @@ -457,6 +492,11 @@ ifeq ($(PLATFORM),darwin)
BASE_CFLAGS += -mmacosx-version-min=$(MACOSX_VERSION_MIN) \
-DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED)

MACOSX_ARCH=$(ARCH)
ifeq ($(ARCH),x86)
MACOSX_ARCH=i386
endif

ifeq ($(ARCH),ppc)
BASE_CFLAGS += -arch ppc
ALTIVEC_CFLAGS = -faltivec
Expand All @@ -475,6 +515,10 @@ ifeq ($(PLATFORM),darwin)
OPTIMIZEVM += -mfpmath=sse
BASE_CFLAGS += -arch x86_64
endif
ifeq ($(ARCH),arm64)
# HAVE_VM_COMPILED=false # TODO: implement compiled vm
BASE_CFLAGS += -arch arm64
endif

# When compiling on OSX for OSX, we're not cross compiling as far as the
# Makefile is concerned, as target architecture is specified as a compiler
Expand All @@ -484,19 +528,40 @@ ifeq ($(PLATFORM),darwin)
endif

ifeq ($(CROSS_COMPILING),1)
ifeq ($(ARCH),x86_64)
CC=x86_64-apple-darwin13-cc
RANLIB=x86_64-apple-darwin13-ranlib
else
ifeq ($(ARCH),x86)
CC=i386-apple-darwin13-cc
RANLIB=i386-apple-darwin13-ranlib
else
$(error Architecture $(ARCH) is not supported when cross compiling)
# 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
DARWIN=13
ifneq ($(findstring $(ARCH),ppc ppc64),)
# macOS 10.5 SDK, though as of writing osxcross doesn't support ppc/ppc64
DARWIN=9
endif
ifeq ($(ARCH),arm64)
# macOS 11.3 SDK
DARWIN=20.4
endif
endif

CC=$(MACOSX_ARCH)-apple-darwin$(DARWIN)-cc
RANLIB=$(MACOSX_ARCH)-apple-darwin$(DARWIN)-ranlib
LIPO=$(MACOSX_ARCH)-apple-darwin$(DARWIN)-lipo

ifeq ($(call bin_path, $(CC)),)
$(error Unable to find osxcross $(CC))
endif
endif
endif

ifndef LIPO
LIPO=lipo
endif

BASE_CFLAGS += -fno-strict-aliasing -fno-common -pipe -DUSE_ICON

ifeq ($(USE_OPENAL),1)
Expand All @@ -521,20 +586,39 @@ ifeq ($(PLATFORM),darwin)
RENDERER_LIBS += -framework OpenGL

ifeq ($(USE_LOCAL_HEADERS),1)
# libSDL2-2.0.0.dylib for PPC is SDL 2.0.1 + changes to compile
ifneq ($(findstring $(ARCH),ppc ppc64),)
BASE_CFLAGS += -I$(SDLHDIR)/include-macppc
else
ifeq ($(shell test $(MAC_OS_X_VERSION_MIN_REQUIRED) -ge 1090; echo $$?),0)
# Universal Binary 2 - for running on macOS 10.9 or later
# x86_64 (10.9 or later), arm64 (11.0 or later)
MACLIBSDIR=$(LIBSDIR)/macosx-ub2
BASE_CFLAGS += -I$(SDLHDIR)/include
else
# Universal Binary - for running on Mac OS X 10.5 or later
# ppc (10.5/10.6), x86 (10.6 or later), x86_64 (10.6 or later)
#
# x86/x86_64 on 10.5 will run the ppc build.
#
# SDL 2.0.1, last with Mac OS X PowerPC
# SDL 2.0.4, last with Mac OS X 10.5 (x86/x86_64)
# SDL 2.0.22, last with Mac OS X 10.6 (x86/x86_64)
#
# code/libs/macosx-ub/libSDL2-2.0.0.dylib contents
# - ppc build is SDL 2.0.1 with a header change so it compiles
# - x86/x86_64 build are SDL 2.0.22
MACLIBSDIR=$(LIBSDIR)/macosx-ub
ifneq ($(findstring $(ARCH),ppc ppc64),)
BASE_CFLAGS += -I$(SDLHDIR)/include-macppc
else
BASE_CFLAGS += -I$(SDLHDIR)/include-2.0.22
endif
endif

# We copy sdlmain before ranlib'ing it so that subversion doesn't think
# the file has been modified by each build.
LIBSDLMAIN=$(B)/libSDL2main.a
LIBSDLMAINSRC=$(LIBSDIR)/macosx/libSDL2main.a
CLIENT_LIBS += $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib
RENDERER_LIBS += $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib
CLIENT_EXTRA_FILES += $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib
LIBSDLMAINSRC=$(MACLIBSDIR)/libSDL2main.a
CLIENT_LIBS += $(MACLIBSDIR)/libSDL2-2.0.0.dylib
RENDERER_LIBS += $(MACLIBSDIR)/libSDL2-2.0.0.dylib
CLIENT_EXTRA_FILES += $(MACLIBSDIR)/libSDL2-2.0.0.dylib
else
BASE_CFLAGS += -I/Library/Frameworks/SDL2.framework/Headers
CLIENT_LIBS += -framework SDL2
Expand Down Expand Up @@ -2084,7 +2168,11 @@ endif
ifneq ($(strip $(LIBSDLMAIN)),)
ifneq ($(strip $(LIBSDLMAINSRC)),)
$(LIBSDLMAIN) : $(LIBSDLMAINSRC)
ifeq ($(PLATFORM),darwin)
$(LIPO) -extract $(MACOSX_ARCH) $< -o $@
else
cp $< $@
endif
$(RANLIB) $@
endif
endif
Expand Down
Loading

0 comments on commit 68aa83c

Please sign in to comment.