First patch from vapier for easier packaging:

it'd make it easier on people packaging up quake3 if we could set system paths
for the baseq3 dir and if the makefile would respect things like CC/CXX from the
build env
This commit is contained in:
Zachary Slater 2005-08-31 17:43:56 +00:00
parent 5bc2c49293
commit dee436c126
2 changed files with 15 additions and 6 deletions

View file

@ -54,8 +54,6 @@ BUILD_FREETYPE=0
## ##
############################################################################# #############################################################################
BASEQ3_DIR=$(BDIR)/baseq3
BD=debug$(ARCH)$(GLIBC) BD=debug$(ARCH)$(GLIBC)
BR=release$(ARCH)$(GLIBC) BR=release$(ARCH)$(GLIBC)
CDIR=$(MOUNT_DIR)/client CDIR=$(MOUNT_DIR)/client
@ -96,8 +94,8 @@ LIB=lib
ifeq ($(PLATFORM),linux) ifeq ($(PLATFORM),linux)
GLIBC=-glibc GLIBC=-glibc
CC=gcc CC?=gcc
CXX=g++ CXX?=g++
RPMARCH=$(ARCH) RPMARCH=$(ARCH)
ifeq ($(ARCH),alpha) ifeq ($(ARCH),alpha)
@ -165,8 +163,9 @@ ifeq ($(PLATFORM),linux)
SHLIBCFLAGS=-fPIC SHLIBCFLAGS=-fPIC
SHLIBLDFLAGS=-shared $(LDFLAGS) SHLIBLDFLAGS=-shared $(LDFLAGS)
ARFLAGS=ar rv AR?=ar
RANLIB=ranlib ARFLAGS=rv
RANLIB?=ranlib
THREAD_LDFLAGS=-lpthread THREAD_LDFLAGS=-lpthread
LDFLAGS=-ldl -lm LDFLAGS=-ldl -lm
@ -344,6 +343,10 @@ endif #Linux
endif #FreeBSD endif #FreeBSD
endif #IRIX endif #IRIX
ifdef DEFAULT_BASEDIR
BASE_CFLAGS += -DDEFAULT_BASEDIR=\\\"$(DEFAULT_BASEDIR)\\\"
endif
DO_CC=$(CC) $(CFLAGS) -o $@ -c $< DO_CC=$(CC) $(CFLAGS) -o $@ -c $<
DO_CXX=$(CXX) $(CFLAGS) -o $@ -c $< DO_CXX=$(CXX) $(CFLAGS) -o $@ -c $<
DO_SMP_CC=$(CC) $(CFLAGS) -DSMP -o $@ -c $< DO_SMP_CC=$(CC) $(CFLAGS) -DSMP -o $@ -c $<

View file

@ -1246,6 +1246,10 @@ void Sys_ParseArgs( int argc, char* argv[] ) {
} }
} }
#ifndef DEFAULT_BASEDIR
# define DEFAULT_BASEDIR Sys_Cwd()
#endif
#include "../client/client.h" #include "../client/client.h"
extern clientStatic_t cls; extern clientStatic_t cls;
@ -1266,6 +1270,8 @@ int main ( int argc, char* argv[] )
strncat(cdpath, argv[0], sizeof(cdpath)-1); strncat(cdpath, argv[0], sizeof(cdpath)-1);
Sys_SetDefaultCDPath(dirname(cdpath)); Sys_SetDefaultCDPath(dirname(cdpath));
Sys_SetDefaultInstallPath(DEFAULT_BASEDIR);
// merge the command line, this is kinda silly // merge the command line, this is kinda silly
for (len = 1, i = 1; i < argc; i++) for (len = 1, i = 1; i < argc; i++)
len += strlen(argv[i]) + 1; len += strlen(argv[i]) + 1;