Add USE_ARCHLESS_FILENAMES
This commit is contained in:
parent
cb11c5e339
commit
d07bf88ce9
34
Makefile
34
Makefile
|
|
@ -243,6 +243,10 @@ ifndef USE_RENDERER_DLOPEN
|
||||||
USE_RENDERER_DLOPEN=1
|
USE_RENDERER_DLOPEN=1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifndef USE_ARCHLESS_FILENAMES
|
||||||
|
USE_ARCHLESS_FILENAMES=0
|
||||||
|
endif
|
||||||
|
|
||||||
ifndef USE_YACC
|
ifndef USE_YACC
|
||||||
USE_YACC=0
|
USE_YACC=0
|
||||||
endif
|
endif
|
||||||
|
|
@ -1067,11 +1071,21 @@ endif
|
||||||
TARGETS =
|
TARGETS =
|
||||||
|
|
||||||
ifndef FULLBINEXT
|
ifndef FULLBINEXT
|
||||||
FULLBINEXT=.$(ARCH)$(BINEXT)
|
ifeq ($(USE_ARCHLESS_FILENAMES),1)
|
||||||
|
FULLBINEXT=$(BINEXT)
|
||||||
|
else
|
||||||
|
FULLBINEXT=.$(ARCH)$(BINEXT)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef SHLIBNAME
|
ifndef SHLIBNAME
|
||||||
SHLIBNAME=$(ARCH).$(SHLIBEXT)
|
ifeq ($(USE_ARCHLESS_FILENAMES),1)
|
||||||
|
SHLIBNAME=.$(SHLIBEXT)
|
||||||
|
RSHLIBNAME=$(SHLIBNAME)
|
||||||
|
else
|
||||||
|
SHLIBNAME=$(ARCH).$(SHLIBEXT)
|
||||||
|
RSHLIBNAME=_$(SHLIBNAME)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(BUILD_SERVER),0)
|
ifneq ($(BUILD_SERVER),0)
|
||||||
|
|
@ -1083,10 +1097,10 @@ ifneq ($(BUILD_CLIENT),0)
|
||||||
TARGETS += $(B)/$(CLIENTBIN)$(FULLBINEXT)
|
TARGETS += $(B)/$(CLIENTBIN)$(FULLBINEXT)
|
||||||
|
|
||||||
ifneq ($(BUILD_RENDERER_OPENGL1),0)
|
ifneq ($(BUILD_RENDERER_OPENGL1),0)
|
||||||
TARGETS += $(B)/renderer_opengl1_$(SHLIBNAME)
|
TARGETS += $(B)/renderer_opengl1$(RSHLIBNAME)
|
||||||
endif
|
endif
|
||||||
ifneq ($(BUILD_RENDERER_OPENGL2),0)
|
ifneq ($(BUILD_RENDERER_OPENGL2),0)
|
||||||
TARGETS += $(B)/renderer_opengl2_$(SHLIBNAME)
|
TARGETS += $(B)/renderer_opengl2$(RSHLIBNAME)
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
ifneq ($(BUILD_RENDERER_OPENGL1),0)
|
ifneq ($(BUILD_RENDERER_OPENGL1),0)
|
||||||
|
|
@ -1308,6 +1322,10 @@ ifeq ($(BUILD_STANDALONE),1)
|
||||||
BASE_CFLAGS += -DSTANDALONE
|
BASE_CFLAGS += -DSTANDALONE
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_ARCHLESS_FILENAMES),1)
|
||||||
|
BASE_CFLAGS += -DUSE_ARCHLESS_FILENAMES
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(GENERATE_DEPENDENCIES),1)
|
ifeq ($(GENERATE_DEPENDENCIES),1)
|
||||||
DEPEND_CFLAGS = -MMD
|
DEPEND_CFLAGS = -MMD
|
||||||
else
|
else
|
||||||
|
|
@ -2369,12 +2387,12 @@ $(B)/$(CLIENTBIN)$(FULLBINEXT): $(Q3OBJ) $(LIBSDLMAIN)
|
||||||
-o $@ $(Q3OBJ) \
|
-o $@ $(Q3OBJ) \
|
||||||
$(LIBSDLMAIN) $(CLIENT_LIBS) $(LIBS)
|
$(LIBSDLMAIN) $(CLIENT_LIBS) $(LIBS)
|
||||||
|
|
||||||
$(B)/renderer_opengl1_$(SHLIBNAME): $(Q3ROBJ) $(JPGOBJ)
|
$(B)/renderer_opengl1$(RSHLIBNAME): $(Q3ROBJ) $(JPGOBJ)
|
||||||
$(echo_cmd) "LD $@"
|
$(echo_cmd) "LD $@"
|
||||||
$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3ROBJ) $(JPGOBJ) \
|
$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3ROBJ) $(JPGOBJ) \
|
||||||
$(THREAD_LIBS) $(LIBSDLMAIN) $(RENDERER_LIBS) $(LIBS)
|
$(THREAD_LIBS) $(LIBSDLMAIN) $(RENDERER_LIBS) $(LIBS)
|
||||||
|
|
||||||
$(B)/renderer_opengl2_$(SHLIBNAME): $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(JPGOBJ)
|
$(B)/renderer_opengl2$(RSHLIBNAME): $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(JPGOBJ)
|
||||||
$(echo_cmd) "LD $@"
|
$(echo_cmd) "LD $@"
|
||||||
$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(JPGOBJ) \
|
$(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(JPGOBJ) \
|
||||||
$(THREAD_LIBS) $(LIBSDLMAIN) $(RENDERER_LIBS) $(LIBS)
|
$(THREAD_LIBS) $(LIBSDLMAIN) $(RENDERER_LIBS) $(LIBS)
|
||||||
|
|
@ -3096,10 +3114,10 @@ ifneq ($(BUILD_CLIENT),0)
|
||||||
ifneq ($(USE_RENDERER_DLOPEN),0)
|
ifneq ($(USE_RENDERER_DLOPEN),0)
|
||||||
$(INSTALL) $(STRIP_FLAG) -m 0755 $(BR)/$(CLIENTBIN)$(FULLBINEXT) $(COPYBINDIR)/$(CLIENTBIN)$(FULLBINEXT)
|
$(INSTALL) $(STRIP_FLAG) -m 0755 $(BR)/$(CLIENTBIN)$(FULLBINEXT) $(COPYBINDIR)/$(CLIENTBIN)$(FULLBINEXT)
|
||||||
ifneq ($(BUILD_RENDERER_OPENGL1),0)
|
ifneq ($(BUILD_RENDERER_OPENGL1),0)
|
||||||
$(INSTALL) $(STRIP_FLAG) -m 0755 $(BR)/renderer_opengl1_$(SHLIBNAME) $(COPYBINDIR)/renderer_opengl1_$(SHLIBNAME)
|
$(INSTALL) $(STRIP_FLAG) -m 0755 $(BR)/renderer_opengl1$(RSHLIBNAME) $(COPYBINDIR)/renderer_opengl1$(RSHLIBNAME)
|
||||||
endif
|
endif
|
||||||
ifneq ($(BUILD_RENDERER_OPENGL2),0)
|
ifneq ($(BUILD_RENDERER_OPENGL2),0)
|
||||||
$(INSTALL) $(STRIP_FLAG) -m 0755 $(BR)/renderer_opengl2_$(SHLIBNAME) $(COPYBINDIR)/renderer_opengl2_$(SHLIBNAME)
|
$(INSTALL) $(STRIP_FLAG) -m 0755 $(BR)/renderer_opengl2$(RSHLIBNAME) $(COPYBINDIR)/renderer_opengl2$(RSHLIBNAME)
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
ifneq ($(BUILD_RENDERER_OPENGL1),0)
|
ifneq ($(BUILD_RENDERER_OPENGL1),0)
|
||||||
|
|
|
||||||
|
|
@ -144,6 +144,7 @@ Makefile.local:
|
||||||
BUILD_STANDALONE - build binaries suited for stand-alone games
|
BUILD_STANDALONE - build binaries suited for stand-alone games
|
||||||
SERVERBIN - rename 'ioq3ded' server binary
|
SERVERBIN - rename 'ioq3ded' server binary
|
||||||
CLIENTBIN - rename 'ioquake3' client binary
|
CLIENTBIN - rename 'ioquake3' client binary
|
||||||
|
USE_ARCHLESS_FILENAMES don't include the architecture in binary filenames
|
||||||
USE_RENDERER_DLOPEN - build and use the renderer in a library
|
USE_RENDERER_DLOPEN - build and use the renderer in a library
|
||||||
BUILD_RENDERER_OPENGL1 build the opengl1 client / renderer library
|
BUILD_RENDERER_OPENGL1 build the opengl1 client / renderer library
|
||||||
BUILD_RENDERER_OPENGL2 build the opengl2 client / renderer library
|
BUILD_RENDERER_OPENGL2 build the opengl2 client / renderer library
|
||||||
|
|
|
||||||
|
|
@ -3254,6 +3254,12 @@ void CL_InitRef( void ) {
|
||||||
#ifdef USE_RENDERER_DLOPEN
|
#ifdef USE_RENDERER_DLOPEN
|
||||||
GetRefAPI_t GetRefAPI;
|
GetRefAPI_t GetRefAPI;
|
||||||
char dllName[MAX_OSPATH];
|
char dllName[MAX_OSPATH];
|
||||||
|
|
||||||
|
#ifdef USE_ARCHLESS_FILENAMES
|
||||||
|
#define RENDERER_ARCH_DLL_EXT ARCH_DLL_EXT
|
||||||
|
#else
|
||||||
|
#define RENDERER_ARCH_DLL_EXT "_" ARCH_DLL_EXT
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Com_Printf( "----- Initializing Renderer ----\n" );
|
Com_Printf( "----- Initializing Renderer ----\n" );
|
||||||
|
|
@ -3261,14 +3267,14 @@ void CL_InitRef( void ) {
|
||||||
#ifdef USE_RENDERER_DLOPEN
|
#ifdef USE_RENDERER_DLOPEN
|
||||||
cl_renderer = Cvar_Get("cl_renderer", "opengl2", CVAR_ARCHIVE | CVAR_LATCH);
|
cl_renderer = Cvar_Get("cl_renderer", "opengl2", CVAR_ARCHIVE | CVAR_LATCH);
|
||||||
|
|
||||||
Com_sprintf(dllName, sizeof(dllName), "renderer_%s_" ARCH_STRING DLL_EXT, cl_renderer->string);
|
Com_sprintf(dllName, sizeof(dllName), "renderer_%s" RENDERER_ARCH_DLL_EXT, cl_renderer->string);
|
||||||
|
|
||||||
if(!(rendererLib = Sys_LoadDll(dllName, qfalse)) && strcmp(cl_renderer->string, cl_renderer->resetString))
|
if(!(rendererLib = Sys_LoadDll(dllName, qfalse)) && strcmp(cl_renderer->string, cl_renderer->resetString))
|
||||||
{
|
{
|
||||||
Com_Printf("failed:\n\"%s\"\n", Sys_LibraryError());
|
Com_Printf("failed:\n\"%s\"\n", Sys_LibraryError());
|
||||||
Cvar_ForceReset("cl_renderer");
|
Cvar_ForceReset("cl_renderer");
|
||||||
|
|
||||||
Com_sprintf(dllName, sizeof(dllName), "renderer_opengl2_" ARCH_STRING DLL_EXT);
|
Com_sprintf(dllName, sizeof(dllName), "renderer_opengl2" RENDERER_ARCH_DLL_EXT);
|
||||||
rendererLib = Sys_LoadDll(dllName, qfalse);
|
rendererLib = Sys_LoadDll(dllName, qfalse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1456,7 +1456,7 @@ int FS_FindVM(void **startSearch, char *found, int foundlen, const char *name, i
|
||||||
Com_Error(ERR_FATAL, "Filesystem call made without initialization");
|
Com_Error(ERR_FATAL, "Filesystem call made without initialization");
|
||||||
|
|
||||||
if(enableDll)
|
if(enableDll)
|
||||||
Com_sprintf(dllName, sizeof(dllName), "%s" ARCH_STRING DLL_EXT, name);
|
Com_sprintf(dllName, sizeof(dllName), "%s" ARCH_DLL_EXT, name);
|
||||||
|
|
||||||
Com_sprintf(qvmName, sizeof(qvmName), "vm/%s.qvm", name);
|
Com_sprintf(qvmName, sizeof(qvmName), "vm/%s.qvm", name);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -406,6 +406,12 @@ float FloatSwap (const float *f);
|
||||||
#define PLATFORM_STRING OS_STRING "-" ARCH_STRING "-debug"
|
#define PLATFORM_STRING OS_STRING "-" ARCH_STRING "-debug"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_ARCHLESS_FILENAMES
|
||||||
|
#define ARCH_DLL_EXT DLL_EXT
|
||||||
|
#else
|
||||||
|
#define ARCH_DLL_EXT ARCH_STRING DLL_EXT
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user