Ludwig's 1st diff: Some 64bit fixes for x86_64. Also fixes Makefile build.
This commit is contained in:
parent
59cce31e75
commit
f46ede91fb
23 changed files with 150 additions and 84 deletions
|
@ -60,7 +60,7 @@ BLIBDIR=$(MOUNT_DIR)/botlib
|
|||
NDIR=$(MOUNT_DIR)/null
|
||||
UIDIR=$(MOUNT_DIR)/ui
|
||||
Q3UIDIR=$(MOUNT_DIR)/q3_ui
|
||||
FTDIR=$(MOUNT_DIR)/ft2
|
||||
#FTDIR=$(MOUNT_DIR)/ft2
|
||||
JPDIR=$(MOUNT_DIR)/jpeg-6
|
||||
SPLNDIR=$(MOUNT_DIR)/splines
|
||||
|
||||
|
@ -80,6 +80,7 @@ DLL_ONLY=false
|
|||
# bk010215 - TODO - add all defaults / kill Ryan
|
||||
|
||||
|
||||
LIB=lib
|
||||
ifeq ($(PLATFORM),linux)
|
||||
|
||||
ifneq (,$(findstring libc6,$(shell if [ -e /lib/libc.so.6* ];then echo libc6;fi)))
|
||||
|
@ -100,18 +101,27 @@ ifeq ($(PLATFORM),linux)
|
|||
RPMARCH=ppc
|
||||
VENDOR=unknown
|
||||
DLL_ONLY=true
|
||||
else
|
||||
ifneq (,$(findstring x86_64,$(shell uname -m)))
|
||||
MESADIR=../Mesa/
|
||||
ARCH=x86_64
|
||||
RPMARCH=x86_64
|
||||
VENDOR=unknown
|
||||
DLL_ONLY=false
|
||||
LIB=lib64
|
||||
else #default to i386
|
||||
MESADIR=../Mesa/
|
||||
ARCH=i386
|
||||
RPMARCH=i386
|
||||
VENDOR=unknown
|
||||
DLL_ONLY=false
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# bk001205: no mo' -I/usr/include/glide, no FX
|
||||
# bk001205: no mo' -Dstricmp=strcasecmp, see q_shared.h
|
||||
BASE_CFLAGS = -pipe -fsigned-char
|
||||
BASE_CFLAGS = -pipe -Wall
|
||||
# rcg010216: DLL_ONLY for PPC
|
||||
ifeq ($(strip $(DLL_ONLY)),true)
|
||||
BASE_CFLAGS += -DDLL_ONLY
|
||||
|
@ -125,9 +135,9 @@ ifeq ($(PLATFORM),linux)
|
|||
# bk001205 - took out -O to get assertions (NDEBUG)
|
||||
# bk001206 - MALLOC_CHECK in addition to ZONE_DEBUG
|
||||
# TTimo 03/30/2001 temporary took out -Werror for initial merge
|
||||
DEBUG_CFLAGS = $(BASE_CFLAGS) -g -Wall -Werror
|
||||
DEBUG_CFLAGS = $(BASE_CFLAGS) -g
|
||||
DEBUG_CFLAGS += -DNO_MOUSEGRAB
|
||||
DEBUG_CFLAGS += -O
|
||||
DEBUG_CFLAGS += -O0
|
||||
# DEBUG_CFLAGS=$(BASE_CFLAGS) -g -Wall -O
|
||||
ifeq ($(ARCH),axp)
|
||||
CC=pgcc
|
||||
|
@ -136,17 +146,21 @@ ifeq ($(PLATFORM),linux)
|
|||
ifeq ($(ARCH),ppc)
|
||||
NEWPGCC=/loki/global/ppc/bin/gcc
|
||||
CC=$(NEWPGCC)
|
||||
RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O6 -fomit-frame-pointer -pipe -ffast-math -malign-loops=2 -malign-jumps=2 -malign-functions=2 -fno-strict-aliasing -fstrength-reduce
|
||||
RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O6 -fomit-frame-pointer -ffast-math -malign-loops=2 -malign-jumps=2 -malign-functions=2 -fno-strict-aliasing -fstrength-reduce
|
||||
endif
|
||||
ifeq ($(ARCH),x86_64)
|
||||
CC=gcc
|
||||
CXX=g++
|
||||
RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O6 -fomit-frame-pointer -ffast-math -falign-loops=2 -falign-jumps=2 -falign-functions=2 -fno-strict-aliasing -fstrength-reduce
|
||||
else
|
||||
#NEWPGCC=/usr/local/gcc-2.95.2/bin/gcc # bk001205
|
||||
#NEWPGCC=/loki/global/x86/bin/gcc
|
||||
NEWPGCC=/usr/bin/gcc
|
||||
CC=$(shell if [ -f $(NEWPGCC) ]; then echo $(NEWPGCC); else echo pgcc; fi )
|
||||
CXX=/usr/bin/g++
|
||||
CC=gcc
|
||||
CXX=g++
|
||||
# TTimo: legacy RELEASE_CFLAGS
|
||||
# NOTE: the -fomit-frame-pointer option leads to an unstable binary on my test box if it was built on the main box
|
||||
# but building on the Mdk 7.2 baseline seems to work
|
||||
RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O6 -mcpu=pentiumpro -march=pentium -fomit-frame-pointer -pipe -ffast-math -malign-loops=2 -malign-jumps=2 -malign-functions=2 -fno-strict-aliasing -fstrength-reduce
|
||||
RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O6 -mcpu=pentiumpro -march=pentium -fomit-frame-pointer -ffast-math -falign-loops=2 -falign-jumps=2 -falign-functions=2 -fno-strict-aliasing -fstrength-reduce
|
||||
# TTimo: use this for building on P3 gcc 2.95.3 libc2.2 for all targets (experimental! -fomit-fram-pointer removed)
|
||||
# RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O6 -mcpu=pentiumpro -march=pentium -pipe -ffast-math -malign-loops=2 -malign-jumps=2 -malign-functions=2 -fno-strict-aliasing -fstrength-reduce
|
||||
endif
|
||||
|
@ -163,7 +177,7 @@ ifeq ($(PLATFORM),linux)
|
|||
|
||||
THREAD_LDFLAGS=-lpthread
|
||||
LDFLAGS=-ldl -lm
|
||||
GLLDFLAGS=-L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm
|
||||
GLLDFLAGS=-L/usr/X11R6/$(LIB) -lX11 -lXext -lXxf86dga -lXxf86vm
|
||||
|
||||
ifeq ($(ARCH),axp)
|
||||
TARGETS=\
|
||||
|
@ -240,7 +254,7 @@ THREAD_LDFLAGS=-lpthread
|
|||
LDFLAGS=-lm
|
||||
#GLLDFLAGS=-L/usr/X11R6/lib -L$(MESADIR)/lib -lGL -lX11 -lXext -lXxf86dga -lXxf86vm
|
||||
#GLLDFLAGS=-L/usr/X11/lib -lGL -lX11 -lXext -lm
|
||||
GLLDFLAGS=-L/usr/X11R6/lib -lGL -lX11 -lXext -lXxf86dga -lXxf86vm
|
||||
GLLDFLAGS=-L/usr/X11R6/$(LIB) -lGL -lX11 -lXext -lXxf86dga -lXxf86vm
|
||||
|
||||
ifeq ($(ARCH),axp)
|
||||
TARGETS=\
|
||||
|
@ -284,7 +298,7 @@ ARFLAGS=ar rv
|
|||
RANLIB=ranlib
|
||||
|
||||
LDFLAGS=-ldl -lm
|
||||
GLLDFLAGS=-L/usr/X11/lib -lGL -lX11 -lXext -lm
|
||||
GLLDFLAGS=-L/usr/X11/$(LIB) -lGL -lX11 -lXext -lm
|
||||
|
||||
TARGETS=$(B)/sgiquake3 \
|
||||
$(B)/q3ded
|
||||
|
@ -516,20 +530,6 @@ Q3OBJ = \
|
|||
$(B)/client/unix_net.o \
|
||||
$(B)/client/unix_shared.o \
|
||||
\
|
||||
$(B)/client/ahoptim.o \
|
||||
$(B)/client/autohint.o \
|
||||
$(B)/client/ftbase.o \
|
||||
$(B)/client/ftdebug.o \
|
||||
$(B)/client/ftglyph.o \
|
||||
$(B)/client/ftinit.o \
|
||||
$(B)/client/ftmm.o \
|
||||
$(B)/client/ftsystem.o \
|
||||
$(B)/client/raster1.o \
|
||||
$(B)/client/sfnt.o \
|
||||
$(B)/client/sfobjs.o \
|
||||
$(B)/client/smooth.o \
|
||||
$(B)/client/truetype.o
|
||||
# \
|
||||
# $(B)/client/q_parse.o \
|
||||
# $(B)/client/math_quaternion.o \
|
||||
# $(B)/client/util_str.o \
|
||||
|
@ -544,6 +544,10 @@ Q3OBJ = \
|
|||
Q3OBJ += $(B)/client/vm_x86.o
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),x86_64)
|
||||
Q3OBJ += $(B)/client/vm_none.o
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),ppc)
|
||||
ifeq ($(DLL_ONLY),false)
|
||||
Q3OBJ += $(B)/client/vm_ppc.o
|
||||
|
@ -555,6 +559,7 @@ Q3OBJ = \
|
|||
#platform specific objects
|
||||
ifeq ($(PLATFORM),freebsd)
|
||||
Q3POBJ=\
|
||||
$(B)/client/linux_signals.o \
|
||||
$(B)/client/linux_common.o \
|
||||
$(B)/client/linux_qgl.o \
|
||||
$(B)/client/linux_glimp.o \
|
||||
|
@ -575,6 +580,7 @@ ifeq ($(ARCH),axp)
|
|||
Q3POBJ=
|
||||
else
|
||||
Q3POBJ=\
|
||||
$(B)/client/linux_signals.o \
|
||||
$(B)/client/linux_common.o \
|
||||
$(B)/client/linux_qgl.o \
|
||||
$(B)/client/linux_glimp.o \
|
||||
|
@ -584,6 +590,7 @@ else
|
|||
$(B)/client/matha.o \
|
||||
|
||||
Q3POBJ_SMP=\
|
||||
$(B)/client/linux_signals.o \
|
||||
$(B)/client/linux_common.o \
|
||||
$(B)/client/linux_qgl.o \
|
||||
$(B)/client/linux_glimp_smp.o \
|
||||
|
@ -751,6 +758,7 @@ $(B)/client/irix_glimp.o : $(UDIR)/irix_glimp.c; $(DO_CC)
|
|||
$(B)/client/irix_glimp_smp.o : $(UDIR)/irix_glimp.c; $(DO_SMP_CC)
|
||||
$(B)/client/irix_snd.o : $(UDIR)/irix_snd.c; $(DO_CC)
|
||||
$(B)/client/irix_input.o : $(UDIR)/irix_input.c; $(DO_CC)
|
||||
$(B)/client/linux_signals.o : $(UDIR)/linux_signals.c; $(DO_CC)
|
||||
$(B)/client/linux_common.o : $(UDIR)/linux_common.c; $(DO_CC)
|
||||
$(B)/client/linux_glimp.o : $(UDIR)/linux_glimp.c; $(DO_CC) $(GL_CFLAGS)
|
||||
$(B)/client/linux_glimp_smp.o : $(UDIR)/linux_glimp.c; $(DO_SMP_CC) $(GL_CFLAGS)
|
||||
|
@ -767,6 +775,10 @@ $(B)/client/snapvector.o : $(UDIR)/snapvector.nasm; $(DO_NASM)
|
|||
$(B)/client/vm_x86.o : $(CMDIR)/vm_x86.c; $(DO_CC)
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),x86_64)
|
||||
$(B)/client/vm_none.o : $(CMDIR)/vm_none.c; $(DO_CC)
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),ppc)
|
||||
ifeq ($(DLL_ONLY),false)
|
||||
$(B)/client/vm_ppc.o : $(CMDIR)/vm_ppc.c; $(DO_CC)
|
||||
|
@ -777,20 +789,6 @@ $(B)/client/unzip.o : $(CMDIR)/unzip.c; $(DO_CC)
|
|||
$(B)/client/vm.o : $(CMDIR)/vm.c; $(DO_CC)
|
||||
$(B)/client/vm_interpreted.o : $(CMDIR)/vm_interpreted.c; $(DO_CC)
|
||||
|
||||
$(B)/client/ahoptim.o : $(FTDIR)/ahoptim.c; $(DO_CC)
|
||||
$(B)/client/autohint.o : $(FTDIR)/autohint.c; $(DO_CC)
|
||||
$(B)/client/ftbase.o : $(FTDIR)/ftbase.c; $(DO_CC)
|
||||
$(B)/client/ftdebug.o : $(FTDIR)/ftdebug.c; $(DO_CC)
|
||||
$(B)/client/ftglyph.o : $(FTDIR)/ftglyph.c; $(DO_CC)
|
||||
$(B)/client/ftinit.o : $(FTDIR)/ftinit.c; $(DO_CC)
|
||||
$(B)/client/ftmm.o : $(FTDIR)/ftmm.c; $(DO_CC)
|
||||
$(B)/client/ftsystem.o : $(FTDIR)/ftsystem.c; $(DO_CC)
|
||||
$(B)/client/raster1.o : $(FTDIR)/raster1.c; $(DO_CC) -DFT_FLAT_COMPILE
|
||||
$(B)/client/sfnt.o : $(FTDIR)/sfnt.c; $(DO_CC)
|
||||
$(B)/client/sfobjs.o : $(FTDIR)/sfobjs.c; $(DO_CC)
|
||||
$(B)/client/smooth.o : $(FTDIR)/smooth.c; $(DO_CC) -DFT_FLAT_COMPILE
|
||||
$(B)/client/truetype.o : $(FTDIR)/truetype.c; $(DO_CC)
|
||||
|
||||
# TTimo: took out splines code
|
||||
#$(B)/client/q_parse.o : $(SPLNDIR)/q_parse.cpp; $(DO_CXX)
|
||||
#$(B)/client/math_quaternion.o : $(SPLNDIR)/math_quaternion.cpp; $(DO_CXX)
|
||||
|
@ -908,6 +906,7 @@ Q3DOBJ = \
|
|||
$(B)/ded/l_script.o \
|
||||
$(B)/ded/l_struct.o \
|
||||
\
|
||||
$(B)/ded/linux_signals.o \
|
||||
$(B)/ded/linux_common.o \
|
||||
$(B)/ded/unix_main.o \
|
||||
$(B)/ded/unix_net.o \
|
||||
|
@ -921,6 +920,10 @@ ifeq ($(ARCH),i386)
|
|||
Q3DOBJ += $(B)/ded/vm_x86.o $(B)/ded/ftol.o $(B)/ded/snapvector.o
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),x86_64)
|
||||
Q3DOBJ += $(B)/ded/vm_none.o
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),ppc)
|
||||
ifeq ($(DLL_ONLY),false)
|
||||
Q3DOBJ += $(B)/ded/vm_ppc.o
|
||||
|
@ -984,7 +987,8 @@ $(B)/ded/l_precomp.o : $(BLIBDIR)/l_precomp.c; $(DO_BOT_CC)
|
|||
$(B)/ded/l_script.o : $(BLIBDIR)/l_script.c; $(DO_BOT_CC)
|
||||
$(B)/ded/l_struct.o : $(BLIBDIR)/l_struct.c; $(DO_BOT_CC)
|
||||
|
||||
$(B)/ded/linux_common.o : $(UDIR)/linux_common.c; $(DO_CC)
|
||||
$(B)/ded/linux_signals.o : $(UDIR)/linux_signals.c; $(DO_DED_CC)
|
||||
$(B)/ded/linux_common.o : $(UDIR)/linux_common.c; $(DO_DED_CC)
|
||||
$(B)/ded/unix_main.o : $(UDIR)/unix_main.c; $(DO_DED_CC)
|
||||
$(B)/ded/unix_net.o : $(UDIR)/unix_net.c; $(DO_DED_CC)
|
||||
$(B)/ded/unix_shared.o : $(UDIR)/unix_shared.c; $(DO_DED_CC)
|
||||
|
@ -1001,6 +1005,10 @@ $(B)/ded/ftol.o : $(UDIR)/ftol.nasm; $(DO_NASM)
|
|||
$(B)/ded/snapvector.o : $(UDIR)/snapvector.nasm; $(DO_NASM)
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),x86_64)
|
||||
$(B)/ded/vm_none.o : $(CMDIR)/vm_none.c; $(DO_DED_CC)
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),ppc)
|
||||
ifeq ($(DLL_ONLY),false)
|
||||
$(B)/ded/vm_ppc.o : $(CMDIR)/vm_ppc.c; $(DO_DED_CC)
|
||||
|
@ -1410,7 +1418,7 @@ $(B)/baseq3/ui/ui_spskill.o : $(Q3UIDIR)/ui_spskill.c; $(DO_SHLIB_CC)
|
|||
$(B)/baseq3/ui/ui_startserver.o : $(Q3UIDIR)/ui_startserver.c; $(DO_SHLIB_CC)
|
||||
$(B)/baseq3/ui/ui_team.o : $(Q3UIDIR)/ui_team.c; $(DO_SHLIB_CC)
|
||||
$(B)/baseq3/ui/ui_teamorders.o : $(Q3UIDIR)/ui_teamorders.c; $(DO_SHLIB_CC)
|
||||
$(B)/baseq3/ui/ui_syscalls.o : $(Q3UIDIR)/ui_syscalls.c; $(DO_SHLIB_CC)
|
||||
$(B)/baseq3/ui/ui_syscalls.o : $(UIDIR)/ui_syscalls.c; $(DO_SHLIB_CC)
|
||||
$(B)/baseq3/ui/ui_video.o : $(Q3UIDIR)/ui_video.c; $(DO_SHLIB_CC)
|
||||
|
||||
# bk001205 - these wre the only SHLIB compiles in 1.17
|
||||
|
@ -1613,20 +1621,6 @@ Q3SOBJ = \
|
|||
$(B)/q3static/unix_net.o \
|
||||
$(B)/q3static/unix_shared.o \
|
||||
\
|
||||
$(B)/q3static/ahoptim.o \
|
||||
$(B)/q3static/autohint.o \
|
||||
$(B)/q3static/ftbase.o \
|
||||
$(B)/q3static/ftdebug.o \
|
||||
$(B)/q3static/ftglyph.o \
|
||||
$(B)/q3static/ftinit.o \
|
||||
$(B)/q3static/ftmm.o \
|
||||
$(B)/q3static/ftsystem.o \
|
||||
$(B)/q3static/raster1.o \
|
||||
$(B)/q3static/sfnt.o \
|
||||
$(B)/q3static/sfobjs.o \
|
||||
$(B)/q3static/smooth.o \
|
||||
$(B)/q3static/truetype.o \
|
||||
\
|
||||
$(B)/q3static/linux_qgl.o \
|
||||
$(B)/q3static/linux_glimp.o \
|
||||
$(B)/q3static/linux_joystick.o \
|
||||
|
@ -1638,6 +1632,10 @@ ifeq ($(ARCH),i386)
|
|||
Q3SOBJ += $(B)/q3static/vm_x86.o
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),x86_64)
|
||||
Q3SOBJ += $(B)/q3static/vm_none.o
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),ppc)
|
||||
ifeq ($(DLL_ONLY),false)
|
||||
Q3SOBJ += $(B)/q3static/vm_ppc.o
|
||||
|
@ -1793,6 +1791,10 @@ ifeq ($(ARCH),i386)
|
|||
$(B)/q3static/vm_x86.o : $(CMDIR)/vm_x86.c; $(DO_CC) -DQ3_STATIC
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),x86_64)
|
||||
$(B)/q3static/vm_none.o : $(CMDIR)/vm_none.c; $(DO_CC) -DQ3_STATIC
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),ppc)
|
||||
ifeq ($(DLL_ONLY),false)
|
||||
$(B)/q3static/vm_ppc.o : $(CMDIR)/vm_ppc.c; $(DO_CC) -DQ3_STATIC
|
||||
|
|
|
@ -349,6 +349,8 @@ void Sys_Init(void)
|
|||
#if defined __linux__
|
||||
#if defined __i386__
|
||||
Cvar_Set( "arch", "linux i386" );
|
||||
#elif defined __x86_64__
|
||||
Cvar_Set( "arch", "linux x86_64" );
|
||||
#elif defined __alpha__
|
||||
Cvar_Set( "arch", "linux alpha" );
|
||||
#elif defined __sparc__
|
||||
|
@ -724,6 +726,8 @@ void *Sys_LoadDll( const char *name, char *fqpath ,
|
|||
getcwd(curpath, sizeof(curpath));
|
||||
#if defined __i386__
|
||||
snprintf (fname, sizeof(fname), "%si386.so", name);
|
||||
#elif defined __x86_64__
|
||||
snprintf (fname, sizeof(fname), "%sx86_64.so", name);
|
||||
#elif defined __powerpc__ //rcg010207 - PPC support.
|
||||
snprintf (fname, sizeof(fname), "%sppc.so", name);
|
||||
#elif defined __axp__
|
||||
|
|
|
@ -139,7 +139,7 @@ int Sys_XTimeToSysTime (unsigned long xtime)
|
|||
#endif
|
||||
|
||||
//#if 0 // bk001215 - see snapvector.nasm for replacement
|
||||
#if (defined __APPLE__) // rcg010206 - using this for PPC builds...
|
||||
#if !(defined __i386__) // rcg010206 - using this for PPC builds...
|
||||
long fastftol( float f ) { // bk001213 - from win32/win_shared.c
|
||||
//static int tmp;
|
||||
// __asm fld f
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue