From cf09fb2a99a140c66874a5e7b5a42b3170f769af Mon Sep 17 00:00:00 2001 From: Yamagi Burmeister Date: Tue, 14 Aug 2018 11:51:55 +0200 Subject: [PATCH] Remove support for static linked OpenAL. We haven't used that for years and it just complicates things. --- Makefile | 23 ++++------------------- src/client/sound/qal.c | 10 ++-------- 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/Makefile b/Makefile index 94a5cb6c..28737ed4 100755 --- a/Makefile +++ b/Makefile @@ -31,12 +31,6 @@ # installed WITH_OPENAL:=yes -# Enables optional runtime loading of OpenAL (dlopen or -# similar). If set to "no", the library is linked in at -# compile time in the normal way. On Windows this option -# is ignored, OpenAL is always loaded at runtime. -DLOPEN_OPENAL:=yes - # Enable systemwide installation of game assets WITH_SYSTEMWIDE:=no @@ -332,7 +326,7 @@ build/client/%.o: %.c ${Q}$(CC) -c $(CFLAGS) $(SDLCFLAGS) $(ZIPCFLAGS) $(INCLUDE) -o $@ $< ifeq ($(WITH_OPENAL),yes) -release/yquake2.exe : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"openal32.dll"' -DDLOPEN_OPENAL +release/yquake2.exe : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"openal32.dll"' endif release/yquake2.exe : LDFLAGS += -mwindows @@ -359,23 +353,14 @@ endif release/quake2 : CFLAGS += -Wno-unused-result ifeq ($(WITH_OPENAL),yes) -ifeq ($(DLOPEN_OPENAL),yes) ifeq ($(YQ2_OSTYPE), OpenBSD) -release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.so"' -DDLOPEN_OPENAL +release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.so"' else ifeq ($(YQ2_OSTYPE), Darwin) -release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.dylib"' -I/usr/local/opt/openal-soft/include -DDLOPEN_OPENAL +release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.dylib"' -I/usr/local/opt/openal-soft/include release/quake2 : LDFLAGS += -L/usr/local/opt/openal-soft/lib -rpath /usr/local/opt/openal-soft/lib else -release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.so.1"' -DDLOPEN_OPENAL +release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.so.1"' endif -else # !DLOPEN_OPENAL -release/quake2 : CFLAGS += -DUSE_OPENAL -release/quake2 : LDFLAGS += -lopenal -ifeq ($(YQ2_OSTYPE), Darwin) -release/quake2 : CFLAGS += -I/usr/local/opt/openal-soft/include -release/quake2 : LDFLAGS += -L/usr/local/opt/openal-soft/lib -rpath /usr/local/opt/openal-soft/lib -endif # Darwin -endif # !DLOPEN_OPENAL endif # WITH_OPENAL ifeq ($(YQ2_OSTYPE), FreeBSD) diff --git a/src/client/sound/qal.c b/src/client/sound/qal.c index 746c0757..fb624ba1 100644 --- a/src/client/sound/qal.c +++ b/src/client/sound/qal.c @@ -43,9 +43,7 @@ static ALCcontext *context; static ALCdevice *device; static cvar_t *al_device; -#ifdef DLOPEN_OPENAL static cvar_t *al_driver; -#endif static void *handle; /* Function pointers for OpenAL management */ @@ -341,7 +339,6 @@ QAL_Init() { al_device = Cvar_Get("al_device", "", CVAR_ARCHIVE); -#ifdef DLOPEN_OPENAL /* DEFAULT_OPENAL_DRIVER is defined at compile time via the compiler */ al_driver = Cvar_Get("al_driver", DEFAULT_OPENAL_DRIVER, CVAR_ARCHIVE); @@ -355,11 +352,8 @@ QAL_Init() Com_Printf("Loading %s failed! Disabling OpenAL.\n", al_driver->string); return false; } -# define ALSYMBOL(handle, sym) Sys_GetProcAddress(handle, #sym) -#else - handle = NULL; -# define ALSYMBOL(handle, sym) sym -#endif + + #define ALSYMBOL(handle, sym) Sys_GetProcAddress(handle, #sym) /* Connect function pointers to management functions */ qalcCreateContext = ALSYMBOL(handle, alcCreateContext);