Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace USE_LOCAL_HEADERS with USE_INTERNAL_* #548

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 29 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,18 @@ ifndef USE_INTERNAL_LIBS
USE_INTERNAL_LIBS=1
endif

ifndef USE_INTERNAL_CURL
USE_INTERNAL_CURL=$(USE_INTERNAL_LIBS)
endif

ifndef USE_INTERNAL_OGG
USE_INTERNAL_OGG=$(USE_INTERNAL_LIBS)
endif

ifndef USE_INTERNAL_OPENAL
USE_INTERNAL_OPENAL=$(USE_INTERNAL_LIBS)
endif

ifndef USE_INTERNAL_VORBIS
USE_INTERNAL_VORBIS=$(USE_INTERNAL_LIBS)
endif
Expand All @@ -219,6 +227,10 @@ ifndef USE_INTERNAL_OPUS
USE_INTERNAL_OPUS=$(USE_INTERNAL_LIBS)
endif

ifndef USE_INTERNAL_SDL
USE_INTERNAL_SDL=$(USE_INTERNAL_LIBS)
endif

ifndef USE_INTERNAL_ZLIB
USE_INTERNAL_ZLIB=$(USE_INTERNAL_LIBS)
endif
Expand Down Expand Up @@ -560,7 +572,7 @@ ifeq ($(PLATFORM),darwin)
CLIENT_LIBS += -framework IOKit
RENDERER_LIBS += -framework OpenGL

ifeq ($(USE_LOCAL_HEADERS),1)
ifeq ($(USE_INTERNAL_SDL),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
Expand Down Expand Up @@ -710,7 +722,7 @@ ifdef MINGW
ifeq ($(USE_CURL),1)
CLIENT_CFLAGS += $(CURL_CFLAGS)
ifneq ($(USE_CURL_DLOPEN),1)
ifeq ($(USE_LOCAL_HEADERS),1)
ifeq ($(USE_INTERNAL_CURL),1)
CLIENT_CFLAGS += -DCURL_STATICLIB
ifeq ($(ARCH),x86_64)
CLIENT_LIBS += $(LIBSDIR)/win64/libcurl.a -lcrypt32
Expand All @@ -734,7 +746,7 @@ ifdef MINGW
CLIENT_LIBS += -lmingw32
RENDERER_LIBS += -lmingw32

ifeq ($(USE_LOCAL_HEADERS),1)
ifeq ($(USE_INTERNAL_SDL),1)
CLIENT_CFLAGS += -I$(SDLHDIR)/include
ifeq ($(ARCH),x86)
CLIENT_LIBS += $(LIBSDIR)/win32/libSDL2main.a \
Expand Down Expand Up @@ -1217,8 +1229,20 @@ ifdef DEFAULT_BASEDIR
BASE_CFLAGS += -DDEFAULT_BASEDIR=\\\"$(DEFAULT_BASEDIR)\\\"
endif

ifeq ($(USE_LOCAL_HEADERS),1)
BASE_CFLAGS += -DUSE_LOCAL_HEADERS
ifeq ($(USE_INTERNAL_OPENAL),1)
BASE_CFLAGS += -DUSE_INTERNAL_OPENAL
endif

ifeq ($(USE_INTERNAL_CURL),1)
BASE_CFLAGS += -DUSE_INTERNAL_CURL
endif

ifeq ($(USE_INTERNAL_SDL),1)
BASE_CFLAGS += -DUSE_INTERNAL_SDL
endif

ifeq ($(USE_INTERNAL_ZLIB),1)
BASE_CFLAGS += -DUSE_INTERNAL_ZLIB
endif

ifeq ($(BUILD_STANDALONE),1)
Expand Down
2 changes: 1 addition & 1 deletion code/client/cl_curl.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "../qcommon/q_shared.h"
#include "../qcommon/qcommon.h"

#ifdef USE_LOCAL_HEADERS
#ifdef USE_INTERNAL_CURL
#include "../curl-7.54.0/include/curl/curl.h"
#else
#include <curl/curl.h>
Expand Down
2 changes: 1 addition & 1 deletion code/client/qal.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define ALC_NO_PROTOTYPES
#endif

#ifdef USE_LOCAL_HEADERS
#ifdef USE_INTERNAL_OPENAL
#include "../AL/al.h"
#include "../AL/alc.h"
#else
Expand Down
2 changes: 1 addition & 1 deletion code/qcommon/ioapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <stdlib.h>
#include <string.h>

#ifdef USE_LOCAL_HEADERS
#ifdef USE_INTERNAL_ZLIB
#include "../zlib/zlib.h"
#else
#include <zlib.h>
Expand Down
2 changes: 1 addition & 1 deletion code/qcommon/unzip.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
extern "C" {
#endif

#ifdef USE_LOCAL_HEADERS
#ifdef USE_INTERNAL_ZLIB
#include "../zlib/zlib.h"
#else
#include <zlib.h>
Expand Down
2 changes: 1 addition & 1 deletion code/renderercommon/qgl.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#ifndef __QGL_H__
#define __QGL_H__

#ifdef USE_LOCAL_HEADERS
#ifdef USE_INTERNAL_SDL
# include "SDL_opengl.h"
#else
# include <SDL_opengl.h>
Expand Down
2 changes: 1 addition & 1 deletion code/renderergl2/tr_extensions.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// tr_extensions.c - extensions needed by the renderer not in sdl_glimp.c

#ifdef USE_LOCAL_HEADERS
#ifdef USE_INTERNAL_SDL
# include "SDL.h"
#else
# include <SDL.h>
Expand Down
2 changes: 1 addition & 1 deletion code/sdl/sdl_gamma.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/

#ifdef USE_LOCAL_HEADERS
#ifdef USE_INTERNAL_SDL
# include "SDL.h"
#else
# include <SDL.h>
Expand Down
2 changes: 1 addition & 1 deletion code/sdl/sdl_glimp.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/

#ifdef USE_LOCAL_HEADERS
#ifdef USE_INTERNAL_SDL
# include "SDL.h"
#else
# include <SDL.h>
Expand Down
2 changes: 1 addition & 1 deletion code/sdl/sdl_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/

#ifdef USE_LOCAL_HEADERS
#ifdef USE_INTERNAL_SDL
# include "SDL.h"
#else
# include <SDL.h>
Expand Down
2 changes: 1 addition & 1 deletion code/sdl/sdl_snd.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <stdlib.h>
#include <stdio.h>

#ifdef USE_LOCAL_HEADERS
#ifdef USE_INTERNAL_SDL
# include "SDL.h"
#else
# include <SDL.h>
Expand Down
2 changes: 1 addition & 1 deletion code/sys/sys_loadlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# define Sys_LibraryError() dlerror()
# endif
#else
# ifdef USE_LOCAL_HEADERS
# ifdef USE_INTERNAL_SDL
# include "SDL.h"
# include "SDL_loadso.h"
# else
Expand Down
2 changes: 1 addition & 1 deletion code/sys/sys_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "../qcommon/qcommon.h"

#ifndef DEDICATED
#ifdef USE_LOCAL_HEADERS
#ifdef USE_INTERNAL_SDL
# include "SDL_version.h"
#else
# include <SDL_version.h>
Expand Down
2 changes: 1 addition & 1 deletion code/sys/sys_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <errno.h>

#ifndef DEDICATED
#ifdef USE_LOCAL_HEADERS
#ifdef USE_INTERNAL_SDL
# include "SDL.h"
# include "SDL_cpuinfo.h"
#else
Expand Down