Remove Mac OS X support

No, this is not a rage quit but the result of a long discussion. There
are several reasons for us to drop OS X support:

- OS X support was always more or less hacky. For example is was never
  really integrated into the build system and some features like the
  OpenAL sound backend never worked well.
- The OS X support never grew into the new world based upon SDL2.
- It was broken since at least Lion which was released 4 years ago.
- None of the developers has a Mac or plans to buy one. Supporting
  a software for a platform not used by the developers is more or
  less impossible.
- And despite several appeals no one from the OS X community ever
  stept up and send patches.

Removed are:
- Makefile support
- The OpenAL quirks
- The Cocoa bindings
- The framworks

Not removed is:
- Savegame support
- Memory management support
- Platform detection
- OpenGL and SDL includes

So, if someone steps up and does a modern, fully integrated port based
upon SDL2 we're happy to merge it back. The requirements are:
- It must be a clean port, without any hacks
- Full build system integration must be provided
- The port must be maintained even after it was merged. At every release
  binaries must be build, API / ABI changes with new OS X versions must
  be tracked.
This commit is contained in:
Yamagi Burmeister 2015-03-20 16:59:29 +01:00
parent 47cde06e27
commit 177b424ba1
10 changed files with 8 additions and 104 deletions

View file

@ -20,7 +20,6 @@
# - FreeBSD # # - FreeBSD #
# - Linux # # - Linux #
# - OpenBSD # # - OpenBSD #
# - OS X #
# - Windows (MinGW) # # - Windows (MinGW) #
# ------------------------------------------------------ # # ------------------------------------------------------ #
@ -69,19 +68,6 @@ WITH_SYSTEMWIDE:=no
# MUST NOT be surrounded by quotation marks! # MUST NOT be surrounded by quotation marks!
WITH_SYSTEMDIR:="" WITH_SYSTEMDIR:=""
# This will set the architectures of the OSX-binaries.
# You have to make sure your libs/frameworks supports
# these architectures! To build an universal ppc-compatible
# one would add -arch ppc for example.
OSX_ARCH:=-arch i386 -arch x86_64
# This will set the build options to create an MacOS .app-bundle.
# The app-bundle itself will not be created, but the runtime paths
# will be set to expect the linked Frameworks in *.app/Contents/
# Frameworks and the game-data will be expected in *.app/
# Contents/Resources
OSX_APP:=yes
# This is an optional configuration file, it'll be used in # This is an optional configuration file, it'll be used in
# case of presence. # case of presence.
CONFIG_FILE := config.mk CONFIG_FILE := config.mk
@ -154,14 +140,8 @@ endif
# #
# -MMD to generate header dependencies. (They cannot be # -MMD to generate header dependencies. (They cannot be
# generated if building universal binaries on OSX) # generated if building universal binaries on OSX)
ifeq ($(OSTYPE), Darwin)
CFLAGS := -O2 -fno-strict-aliasing -fomit-frame-pointer \
-Wall -pipe -g
CFLAGS += $(OSX_ARCH)
else
CFLAGS := -O2 -fno-strict-aliasing -fomit-frame-pointer \ CFLAGS := -O2 -fno-strict-aliasing -fomit-frame-pointer \
-Wall -pipe -g -ggdb -MMD -Wall -pipe -g -ggdb -MMD
endif
# ---------- # ----------
@ -184,9 +164,6 @@ endif
# ---------- # ----------
# Extra CFLAGS for SDL # Extra CFLAGS for SDL
ifeq ($(OSTYPE), Darwin)
SDLCFLAGS :=
else # not darwin
ifeq ($(WITH_SDL2),yes) ifeq ($(WITH_SDL2),yes)
ifeq ($(OSTYPE),Windows) ifeq ($(OSTYPE),Windows)
SDLCFLAGS := $(shell /custom/bin/sdl2-config --cflags) SDLCFLAGS := $(shell /custom/bin/sdl2-config --cflags)
@ -200,19 +177,16 @@ else
SDLCFLAGS := $(shell sdl-config --cflags) SDLCFLAGS := $(shell sdl-config --cflags)
endif endif
endif # SDL2 endif # SDL2
endif # darwin's else
# ---------- # ----------
# Extra CFLAGS for X11 # Extra CFLAGS for X11
ifneq ($(OSTYPE), Windows) ifneq ($(OSTYPE), Windows)
ifneq ($(OSTYPE), Darwin)
ifeq ($(WITH_X11GAMMA),yes) ifeq ($(WITH_X11GAMMA),yes)
X11CFLAGS := $(shell pkg-config x11 --cflags) X11CFLAGS := $(shell pkg-config x11 --cflags)
X11CFLAGS += $(shell pkg-config xxf86vm --cflags) X11CFLAGS += $(shell pkg-config xxf86vm --cflags)
endif endif
endif endif
endif
# ---------- # ----------
@ -223,8 +197,6 @@ else ifeq ($(OSTYPE),FreeBSD)
INCLUDE := -I/usr/local/include INCLUDE := -I/usr/local/include
else ifeq ($(OSTYPE),OpenBSD) else ifeq ($(OSTYPE),OpenBSD)
INCLUDE := -I/usr/local/include INCLUDE := -I/usr/local/include
else ifeq ($(OSTYPE),Darwin)
INCLUDE :=
else ifeq ($(OSTYPE),Windows) else ifeq ($(OSTYPE),Windows)
INCLUDE := -I/custom/include INCLUDE := -I/custom/include
endif endif
@ -240,8 +212,6 @@ else ifeq ($(OSTYPE),OpenBSD)
LDFLAGS := -L/usr/local/lib -lm LDFLAGS := -L/usr/local/lib -lm
else ifeq ($(OSTYPE),Windows) else ifeq ($(OSTYPE),Windows)
LDFLAGS := -L/custom/lib -static -lws2_32 -lwinmm LDFLAGS := -L/custom/lib -static -lws2_32 -lwinmm
else ifeq ($(OSTYPE), Darwin)
LDFLAGS := $(OSX_ARCH) -lm
endif endif
# ---------- # ----------
@ -253,32 +223,24 @@ SDLLDFLAGS := $(shell /custom/bin/sdl2-config --static-libs)
else # not SDL2 else # not SDL2
SDLLDFLAGS := -lSDL SDLLDFLAGS := -lSDL
endif # SDL2 endif # SDL2
else ifeq ($(OSTYPE), Darwin) else # not Win
ifeq ($(WITH_SDL2),yes)
SDLLDFLAGS := -framework SDL2 -framework OpenGL -framework Cocoa
else # not SDL2
SDLLDFLAGS := -framework SDL -framework OpenGL -framework Cocoa
endif # SDL2
else # not Darwin/Win
ifeq ($(WITH_SDL2),yes) ifeq ($(WITH_SDL2),yes)
SDLLDFLAGS := $(shell sdl2-config --libs) SDLLDFLAGS := $(shell sdl2-config --libs)
else # not SDL2 else # not SDL2
SDLLDFLAGS := $(shell sdl-config --libs) SDLLDFLAGS := $(shell sdl-config --libs)
endif # SDL2 endif # SDL2
endif # Darwin/Win endif # Win
# ---------- # ----------
# Extra LDFLAGS for X11 # Extra LDFLAGS for X11
ifneq ($(OSTYPE), Windows) ifneq ($(OSTYPE), Windows)
ifneq ($(OSTYPE), Darwin)
ifeq ($(WITH_X11GAMMA),yes) ifeq ($(WITH_X11GAMMA),yes)
X11LDFLAGS := $(shell pkg-config x11 --libs) X11LDFLAGS := $(shell pkg-config x11 --libs)
X11LDFLAGS += $(shell pkg-config xxf86vm --libs) X11LDFLAGS += $(shell pkg-config xxf86vm --libs)
X11LDFLAGS += $(shell pkg-config xrandr --libs) X11LDFLAGS += $(shell pkg-config xrandr --libs)
endif endif
endif endif
endif
# ---------- # ----------
@ -376,7 +338,7 @@ release/quake2.exe : CFLAGS += -DSDL2
endif endif
release/quake2.exe : LDFLAGS += -mwindows -lopengl32 release/quake2.exe : LDFLAGS += -mwindows -lopengl32
else else # not Windows
client: client:
@echo "===> Building quake2" @echo "===> Building quake2"
${Q}mkdir -p release ${Q}mkdir -p release
@ -387,32 +349,18 @@ build/client/%.o: %.c
${Q}mkdir -p $(@D) ${Q}mkdir -p $(@D)
${Q}$(CC) -c $(CFLAGS) $(SDLCFLAGS) $(X11CFLAGS) $(INCLUDE) -o $@ $< ${Q}$(CC) -c $(CFLAGS) $(SDLCFLAGS) $(X11CFLAGS) $(INCLUDE) -o $@ $<
ifeq ($(OSTYPE), Darwin)
build/client/%.o : %.m
@echo "===> CC $<"
${Q}mkdir -p $(@D)
${Q}$(CC) $(OSX_ARCH) -x objective-c -c $< -o $@
endif
ifeq ($(WITH_CDA),yes) ifeq ($(WITH_CDA),yes)
release/quake2 : CFLAGS += -DCDA release/quake2 : CFLAGS += -DCDA
endif endif
ifeq ($(WITH_OGG),yes) ifeq ($(WITH_OGG),yes)
release/quake2 : CFLAGS += -DOGG release/quake2 : CFLAGS += -DOGG
ifeq ($(OSTYPE), Darwin)
release/quake2 : LDFLAGS += -framework Vorbis -framework Ogg
else
release/quake2 : LDFLAGS += -lvorbis -lvorbisfile -logg release/quake2 : LDFLAGS += -lvorbis -lvorbisfile -logg
endif endif
endif
ifeq ($(WITH_OPENAL),yes) ifeq ($(WITH_OPENAL),yes)
ifeq ($(OSTYPE), OpenBSD) ifeq ($(OSTYPE), OpenBSD)
release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.so"' release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.so"'
else ifeq ($(OSTYPE), Darwin)
release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"/System/Library/Frameworks/OpenAL.framework/OpenAL"'
release/quake2 : LDFLAGS += -framework OpenAL
else else
release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.so.1"' release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.so.1"'
endif endif
@ -431,15 +379,7 @@ ifeq ($(WITH_SDL2),yes)
release/quake2 : CFLAGS += -DSDL2 release/quake2 : CFLAGS += -DSDL2
endif endif
ifeq ($(OSTYPE), Darwin)
ifeq ($(OSX_APP), yes)
release/quake2 : LDFLAGS += -Xlinker -rpath -Xlinker @loader_path/../Frameworks
endif
endif
ifneq ($(OSTYPE), Darwin)
release/quake2 : LDFLAGS += -lGL release/quake2 : LDFLAGS += -lGL
endif
ifeq ($(OSTYPE), FreeBSD) ifeq ($(OSTYPE), FreeBSD)
release/quake2 : LDFLAGS += -Wl,-z,origin,-rpath='$$ORIGIN/lib' release/quake2 : LDFLAGS += -Wl,-z,origin,-rpath='$$ORIGIN/lib'
@ -485,7 +425,7 @@ ifeq ($(WITH_ZIP),yes)
release/q2ded.exe : CFLAGS += -DZIP -DNOUNCRYPT release/q2ded.exe : CFLAGS += -DZIP -DNOUNCRYPT
release/q2ded.exe : LDFLAGS += -lz release/q2ded.exe : LDFLAGS += -lz
endif endif
else else # not Windows
server: server:
@echo "===> Building q2ded" @echo "===> Building q2ded"
${Q}mkdir -p release ${Q}mkdir -p release
@ -519,7 +459,7 @@ build/baseq2/%.o: %.c
${Q}$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $< ${Q}$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
release/baseq2/game.dll : LDFLAGS += -shared release/baseq2/game.dll : LDFLAGS += -shared
else else # not Windows
game: game:
@echo "===> Building baseq2/game.so" @echo "===> Building baseq2/game.so"
${Q}mkdir -p release/baseq2 ${Q}mkdir -p release/baseq2
@ -683,10 +623,6 @@ CLIENT_OBJS_ += \
src/backends/unix/shared/hunk.o src/backends/unix/shared/hunk.o
endif endif
ifeq ($(OSTYPE), Darwin)
CLIENT_OBJS_ += src/backends/sdl_osx/SDLMain.o
endif
# ---------- # ----------
# Used by the server # Used by the server
@ -726,7 +662,7 @@ SERVER_OBJS_ += \
src/backends/windows/network.o \ src/backends/windows/network.o \
src/backends/windows/system.o \ src/backends/windows/system.o \
src/backends/windows/shared/mem.o src/backends/windows/shared/mem.o
else else # not Windows
SERVER_OBJS_ += \ SERVER_OBJS_ += \
src/backends/unix/main.o \ src/backends/unix/main.o \
src/backends/unix/network.o \ src/backends/unix/network.o \

View file

@ -31,12 +31,8 @@
#ifndef _QAL_API_H_ #ifndef _QAL_API_H_
#define _QAL_API_H_ #define _QAL_API_H_
#if defined (__APPLE__)
#include <OpenAL/al.h>
#else
#include <AL/al.h> #include <AL/al.h>
#include <AL/efx.h> #include <AL/efx.h>
#endif
/* Function pointers used to tie /* Function pointers used to tie
* the qal API to the OpenAL API */ * the qal API to the OpenAL API */
@ -113,12 +109,10 @@ extern LPALDOPPLERFACTOR qalDopplerFactor;
extern LPALDOPPLERVELOCITY qalDopplerVelocity; extern LPALDOPPLERVELOCITY qalDopplerVelocity;
extern LPALSPEEDOFSOUND qalSpeedOfSound; extern LPALSPEEDOFSOUND qalSpeedOfSound;
extern LPALDISTANCEMODEL qalDistanceModel; extern LPALDISTANCEMODEL qalDistanceModel;
#if !defined (__APPLE__)
extern LPALGENFILTERS qalGenFilters; extern LPALGENFILTERS qalGenFilters;
extern LPALFILTERI qalFilteri; extern LPALFILTERI qalFilteri;
extern LPALFILTERF qalFilterf; extern LPALFILTERF qalFilterf;
extern LPALDELETEFILTERS qalDeleteFilters; extern LPALDELETEFILTERS qalDeleteFilters;
#endif
/* /*
* Gives information over the OpenAL * Gives information over the OpenAL

View file

@ -32,14 +32,9 @@
#ifdef USE_OPENAL #ifdef USE_OPENAL
#if defined (__APPLE__)
#include <OpenAL/al.h>
#include <OpenAL/alc.h>
#else
#include <AL/al.h> #include <AL/al.h>
#include <AL/alc.h> #include <AL/alc.h>
#include <AL/alext.h> #include <AL/alext.h>
#endif
#include "../../common/header/common.h" #include "../../common/header/common.h"
#include "../../client/sound/header/local.h" #include "../../client/sound/header/local.h"
@ -148,12 +143,10 @@ LPALDOPPLERFACTOR qalDopplerFactor;
LPALDOPPLERVELOCITY qalDopplerVelocity; LPALDOPPLERVELOCITY qalDopplerVelocity;
LPALSPEEDOFSOUND qalSpeedOfSound; LPALSPEEDOFSOUND qalSpeedOfSound;
LPALDISTANCEMODEL qalDistanceModel; LPALDISTANCEMODEL qalDistanceModel;
#if !defined (__APPLE__)
LPALGENFILTERS qalGenFilters; LPALGENFILTERS qalGenFilters;
LPALFILTERI qalFilteri; LPALFILTERI qalFilteri;
LPALFILTERF qalFilterf; LPALFILTERF qalFilterf;
LPALDELETEFILTERS qalDeleteFilters; LPALDELETEFILTERS qalDeleteFilters;
#endif
/* /*
* Gives information over the OpenAL * Gives information over the OpenAL
@ -324,12 +317,10 @@ QAL_Shutdown()
qalDopplerVelocity = NULL; qalDopplerVelocity = NULL;
qalSpeedOfSound = NULL; qalSpeedOfSound = NULL;
qalDistanceModel = NULL; qalDistanceModel = NULL;
#if !defined (__APPLE__)
qalGenFilters = NULL; qalGenFilters = NULL;
qalFilteri = NULL; qalFilteri = NULL;
qalFilterf = NULL; qalFilterf = NULL;
qalDeleteFilters = NULL; qalDeleteFilters = NULL;
#endif
/* Unload the shared lib */ /* Unload the shared lib */
Sys_FreeLibrary(handle); Sys_FreeLibrary(handle);
@ -494,7 +485,6 @@ QAL_Init()
return false; return false;
} }
#if !defined (__APPLE__)
if (qalcIsExtensionPresent(device, "ALC_EXT_EFX") != AL_FALSE) { if (qalcIsExtensionPresent(device, "ALC_EXT_EFX") != AL_FALSE) {
qalGenFilters = qalGetProcAddress("alGenFilters"); qalGenFilters = qalGetProcAddress("alGenFilters");
qalFilteri = qalGetProcAddress("alFilteri"); qalFilteri = qalGetProcAddress("alFilteri");
@ -506,7 +496,6 @@ QAL_Init()
qalFilterf = NULL; qalFilterf = NULL;
qalDeleteFilters = NULL; qalDeleteFilters = NULL;
} }
#endif
Com_Printf("ok\n"); Com_Printf("ok\n");

View file

@ -34,7 +34,7 @@
#include "../../common/header/common.h" #include "../../common/header/common.h"
#include "header/unix.h" #include "header/unix.h"
#if defined(__APPLE__) && !defined(DEDICATED_ONLY) #if !defined(DEDICATED_ONLY)
#include <SDL/SDL.h> #include <SDL/SDL.h>
#endif #endif

View file

@ -54,12 +54,7 @@ qboolean streamPlaying;
static ALuint s_srcnums[MAX_CHANNELS - 1]; static ALuint s_srcnums[MAX_CHANNELS - 1];
static ALuint streamSource; static ALuint streamSource;
static int s_framecount; static int s_framecount;
/* Apple crappy OpenAL implementation
has no support for filters. */
#ifndef __APPLE__
static ALuint underwaterFilter; static ALuint underwaterFilter;
#endif
/* ----------------------------------------------------------------- */ /* ----------------------------------------------------------------- */
@ -661,7 +656,6 @@ AL_Update(void)
void void
AL_Underwater() AL_Underwater()
{ {
#if !defined (__APPLE__)
int i; int i;
if (sound_started != SS_OAL) if (sound_started != SS_OAL)
@ -677,7 +671,6 @@ AL_Underwater()
{ {
qalSourcei(s_srcnums[i], AL_DIRECT_FILTER, underwaterFilter); qalSourcei(s_srcnums[i], AL_DIRECT_FILTER, underwaterFilter);
} }
#endif
} }
/* /*
@ -686,7 +679,6 @@ AL_Underwater()
void void
AL_Overwater() AL_Overwater()
{ {
#if !defined (__APPLE__)
int i; int i;
if (sound_started != SS_OAL) if (sound_started != SS_OAL)
@ -702,7 +694,6 @@ AL_Overwater()
{ {
qalSourcei(s_srcnums[i], AL_DIRECT_FILTER, 0); qalSourcei(s_srcnums[i], AL_DIRECT_FILTER, 0);
} }
#endif
} }
/* ----------------------------------------------------------------- */ /* ----------------------------------------------------------------- */
@ -728,7 +719,6 @@ AL_InitStreamSource()
static void static void
AL_InitUnderwaterFilter() AL_InitUnderwaterFilter()
{ {
#if !defined (__APPLE__)
underwaterFilter = 0; underwaterFilter = 0;
if (!(qalGenFilters && qalFilteri && qalFilterf && qalDeleteFilters)) if (!(qalGenFilters && qalFilteri && qalFilterf && qalDeleteFilters))
@ -756,7 +746,6 @@ AL_InitUnderwaterFilter()
s_underwater->modified = true; s_underwater->modified = true;
s_underwater_gain_hf->modified = true; s_underwater_gain_hf->modified = true;
#endif
} }
/* /*
@ -817,10 +806,7 @@ AL_Init(void)
s_numchannels = i; s_numchannels = i;
AL_InitStreamSource(); AL_InitStreamSource();
#ifndef __APPLE__
AL_InitUnderwaterFilter(); AL_InitUnderwaterFilter();
#endif
Com_Printf("Number of OpenAL sources: %d\n\n", s_numchannels); Com_Printf("Number of OpenAL sources: %d\n\n", s_numchannels);
return true; return true;
@ -837,9 +823,8 @@ AL_Shutdown(void)
AL_StreamDie(); AL_StreamDie();
qalDeleteSources(1, &streamSource); qalDeleteSources(1, &streamSource);
#if !defined (__APPLE__)
qalDeleteFilters(1, &underwaterFilter); qalDeleteFilters(1, &underwaterFilter);
#endif
if (s_numchannels) if (s_numchannels)
{ {
/* delete source names */ /* delete source names */

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.