Skip to content

Commit

Permalink
First patch from vapier for easier packaging:
Browse files Browse the repository at this point in the history
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
  • Loading branch information
NuclearMonster committed Aug 31, 2005
1 parent 5bc2c49 commit dee436c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
15 changes: 9 additions & 6 deletions code/unix/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ BUILD_FREETYPE=0
##
#############################################################################

BASEQ3_DIR=$(BDIR)/baseq3

BD=debug$(ARCH)$(GLIBC)
BR=release$(ARCH)$(GLIBC)
CDIR=$(MOUNT_DIR)/client
Expand Down Expand Up @@ -96,8 +94,8 @@ LIB=lib
ifeq ($(PLATFORM),linux)

GLIBC=-glibc
CC=gcc
CXX=g++
CC?=gcc
CXX?=g++

RPMARCH=$(ARCH)
ifeq ($(ARCH),alpha)
Expand Down Expand Up @@ -165,8 +163,9 @@ ifeq ($(PLATFORM),linux)
SHLIBCFLAGS=-fPIC
SHLIBLDFLAGS=-shared $(LDFLAGS)

ARFLAGS=ar rv
RANLIB=ranlib
AR?=ar
ARFLAGS=rv
RANLIB?=ranlib

THREAD_LDFLAGS=-lpthread
LDFLAGS=-ldl -lm
Expand Down Expand Up @@ -344,6 +343,10 @@ endif #Linux
endif #FreeBSD
endif #IRIX

ifdef DEFAULT_BASEDIR
BASE_CFLAGS += -DDEFAULT_BASEDIR=\\\"$(DEFAULT_BASEDIR)\\\"
endif

DO_CC=$(CC) $(CFLAGS) -o $@ -c $<
DO_CXX=$(CXX) $(CFLAGS) -o $@ -c $<
DO_SMP_CC=$(CC) $(CFLAGS) -DSMP -o $@ -c $<
Expand Down
6 changes: 6 additions & 0 deletions code/unix/unix_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1246,6 +1246,10 @@ void Sys_ParseArgs( int argc, char* argv[] ) {
}
}

#ifndef DEFAULT_BASEDIR
# define DEFAULT_BASEDIR Sys_Cwd()
#endif

#include "../client/client.h"
extern clientStatic_t cls;

Expand All @@ -1266,6 +1270,8 @@ int main ( int argc, char* argv[] )
strncat(cdpath, argv[0], sizeof(cdpath)-1);
Sys_SetDefaultCDPath(dirname(cdpath));

Sys_SetDefaultInstallPath(DEFAULT_BASEDIR);

// merge the command line, this is kinda silly
for (len = 1, i = 1; i < argc; i++)
len += strlen(argv[i]) + 1;
Expand Down

0 comments on commit dee436c

Please sign in to comment.