[quake2] Quake 0.16 rc2...

Ludwig Nussel ludwig.nussel at gmx.de
Tue Sep 21 19:09:13 EDT 2004


Brendan Burns wrote:
> Thanks for the tip on the flags.  The last person who sent in x86_64 
> patches didn't mention this.

I've sent you patches in January already, one of them fixed build on
x86_64. Apparently you didn't apply them. I've attached them again.
I did quick check today, quake2 at least starts in 64bit. There are
some compiler warnings that may or may not be a problem, I didn't
check:

src/client/cl_scrn.c: In function `entitycmpfnc':
src/client/cl_scrn.c:626: warning: cast from pointer to integer of different size
src/client/cl_scrn.c:626: warning: cast from pointer to integer of different size
src/client/cl_scrn.c:630: warning: cast from pointer to integer of different size
src/client/cl_scrn.c:630: warning: cast from pointer to integer of different size

src/client/snd_mem.c: In function `DumpChunks':
src/client/snd_mem.c:256: warning: cast from pointer to integer of different size

> Does anyone know if this is a distribution specific thing, or is it 
> standardized across Linux?

It's a standard across all distros (except Debian AFAIK) and not
specific to x86_64, see
http://www.pathname.com/fhs/pub/fhs-2.3.html#LIB64

cu
Ludwig

-- 
(o_  Ludwig.Nussel at gmx.de
//\  PGP Key ID: FF8135CE
V_/_ ICQ:        52166811
-------------- next part --------------
Index: quake2.1/Makefile
===================================================================
--- quake2.1.orig/Makefile	2004-09-18 22:00:40.000000000 +0200
+++ quake2.1/Makefile	2004-09-20 21:49:19.940463727 +0200
@@ -99,6 +99,9 @@
 	-fomit-frame-pointer -fexpensive-optimizations
 endif
 
+# include local configuration
+-include Make.config
+
 VERSION=3.21+r0.16
 
 MOUNT_DIR=src
-------------- next part --------------
Index: quake2/Makefile
===================================================================
--- quake2.orig/Makefile
+++ quake2/Makefile
@@ -87,7 +87,7 @@ endif
 
 ifeq ($(ARCH),i386)
 RELEASE_CFLAGS=$(BASE_CFLAGS) -O2 -ffast-math -funroll-loops -falign-loops=2 \
-	-falign-jumps=2 -falign-functions=2 -g
+	-falign-jumps=2 -falign-functions=2 -g -fno-strict-aliasing
 # compiler bugs with gcc 2.96 and 3.0.1 can cause bad builds with heavy opts.
 #RELEASE_CFLAGS=$(BASE_CFLAGS) -O6 -m486 -ffast-math -funroll-loops \
 #	-fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
@@ -96,7 +96,7 @@ endif
 
 ifeq ($(ARCH),x86_64)
 RELEASE_CFLAGS=$(BASE_CFLAGS) -O2 -ffast-math -funroll-loops \
-	-fomit-frame-pointer -fexpensive-optimizations
+	-fomit-frame-pointer -fexpensive-optimizations -fno-strict-aliasing
 endif
 
 # include local configuration
@@ -122,7 +122,10 @@ NULL_DIR=$(MOUNT_DIR)/null
 
 BASE_CFLAGS=-Wall -pipe -Dstricmp=strcasecmp
 ifeq ($(HAVE_IPV6),YES)
-BASE_CFLAGS+= -DHAVE_IPV6 -DHAVE_SIN6_LEN
+BASE_CFLAGS+= -DHAVE_IPV6
+ifeq ($(OSTYPE),FreeBSD)
+BASE_CFLAGS+= -DHAVE_SIN6_LEN
+endif
 NET_UDP=net_udp6
 else
 NET_UDP=net_udp
-------------- next part --------------
Index: quake2.1/src/client/cl_parse.c
===================================================================
--- quake2.1.orig/src/client/cl_parse.c	2002-01-03 06:10:13.000000000 +0100
+++ quake2.1/src/client/cl_parse.c	2004-01-12 19:44:22.000000000 +0100
@@ -70,6 +70,7 @@
 {
 	FILE *fp;
 	char	name[MAX_OSPATH];
+	char* ptr;
 
 	if (strstr (filename, ".."))
 	{
@@ -77,6 +78,12 @@
 		return true;
 	}
 
+	// fix backslashes
+	while((ptr = strchr(filename,'\\')))
+	{
+		*ptr = '/';
+	}
+
 	if (FS_LoadFile (filename, NULL) != -1)
 	{	// it exists, no need to download
 		return true;
Index: quake2.1/src/ref_gl/gl_image.c
===================================================================
--- quake2.1.orig/src/ref_gl/gl_image.c	2004-01-11 02:16:24.000000000 +0100
+++ quake2.1/src/ref_gl/gl_image.c	2004-01-12 19:44:22.000000000 +0100
@@ -1393,6 +1393,7 @@
 	int		i, len;
 	byte	*pic, *palette;
 	int		width, height;
+	char* ptr;
 
 	if (!name)
 		return NULL;	//	ri.Sys_Error (ERR_DROP, "GL_FindImage: NULL name");
@@ -1400,6 +1401,12 @@
 	if (len<5)
 		return NULL;	//	ri.Sys_Error (ERR_DROP, "GL_FindImage: bad name: %s", name);
 
+	// fix backslashes
+	while((ptr = strchr(name,'\\')))
+	{
+		*ptr = '/';
+	}
+
 	// look for it
 	for (i=0, image=gltextures ; i<numgltextures ; i++,image++)
 	{
Index: quake2.1/src/ref_soft/r_image.c
===================================================================
--- quake2.1.orig/src/ref_soft/r_image.c	2002-01-03 06:10:14.000000000 +0100
+++ quake2.1/src/ref_soft/r_image.c	2004-01-12 19:44:22.000000000 +0100
@@ -500,6 +500,7 @@
 	int		i, len;
 	byte	*pic, *palette;
 	int		width, height;
+	char* ptr;
 
 	if (!name)
 		return NULL;	// ri.Sys_Error (ERR_DROP, "R_FindImage: NULL name");
@@ -507,6 +508,12 @@
 	if (len<5)
 		return NULL;	// ri.Sys_Error (ERR_DROP, "R_FindImage: bad name: %s", name);
 
+	// fix backslashes
+	while((ptr = strchr(name,'\\')))
+	{
+		*ptr = '/';
+	}
+
 	// look for it
 	for (i=0, image=r_images ; i<numr_images ; i++,image++)
 	{
-------------- next part --------------
Index: quake2.1/src/linux/vid_menu.c
===================================================================
--- quake2.1.orig/src/linux/vid_menu.c	2004-01-12 19:49:02.000000000 +0100
+++ quake2.1/src/linux/vid_menu.c	2004-01-12 19:51:41.000000000 +0100
@@ -188,7 +188,7 @@
 	{
 		Cvar_Set( "vid_ref", "glx" );
 		// below is wrong if we use different libs for different GL reflibs
-		Cvar_Get( "gl_driver", "libGL.so", CVAR_ARCHIVE ); // ??? create if it doesn't exit
+		Cvar_Get( "gl_driver", "libGL.so.1", CVAR_ARCHIVE ); // ??? create if it doesn't exit
 		if (gl_driver->modified)
 			vid_ref->modified = true;
 	}
@@ -196,7 +196,7 @@
 	{
 		Cvar_Set( "vid_ref", "sdlgl" );
 		// below is wrong if we use different libs for different GL reflibs
-		Cvar_Get( "gl_driver", "libGL.so", CVAR_ARCHIVE ); // ??? create if it doesn't exist
+		Cvar_Get( "gl_driver", "libGL.so.1", CVAR_ARCHIVE ); // ??? create if it doesn't exist
 		if (gl_driver->modified)
 			vid_ref->modified = true;
 	}
@@ -301,7 +301,7 @@
 	refs[counter] = (char*) 0;
 
 	if ( !gl_driver )
-		gl_driver = Cvar_Get( "gl_driver", "libGL.so", 0 );
+		gl_driver = Cvar_Get( "gl_driver", "libGL.so.1", 0 );
 	if ( !gl_picmip )
 		gl_picmip = Cvar_Get( "gl_picmip", "0", 0 );
 	if ( !gl_mode )
Index: quake2.1/src/ref_gl/gl_rmain.c
===================================================================
--- quake2.1.orig/src/ref_gl/gl_rmain.c	2004-01-12 19:49:02.000000000 +0100
+++ quake2.1/src/ref_gl/gl_rmain.c	2004-01-12 19:51:41.000000000 +0100
@@ -1026,7 +1026,7 @@
 #ifdef _WIN32
 	gl_driver = ri.Cvar_Get( "gl_driver", "opengl32", CVAR_ARCHIVE );
 #else
-	gl_driver = ri.Cvar_Get( "gl_driver", "libGL.so", CVAR_ARCHIVE );
+	gl_driver = ri.Cvar_Get( "gl_driver", "libGL.so.1", CVAR_ARCHIVE );
 #endif	
 	gl_texturemode = ri.Cvar_Get( "gl_texturemode", "GL_LINEAR_MIPMAP_NEAREST", CVAR_ARCHIVE );
 	gl_texturealphamode = ri.Cvar_Get( "gl_texturealphamode", "default", CVAR_ARCHIVE );
Index: quake2.1/./src/ref_candygl/gl_rmain.c
===================================================================
--- quake2.1.orig/./src/ref_candygl/gl_rmain.c	2004-01-12 19:49:02.000000000 +0100
+++ quake2.1/./src/ref_candygl/gl_rmain.c	2004-01-12 19:51:41.000000000 +0100
@@ -1720,7 +1720,7 @@
 #ifdef _WIN32
 	gl_driver = ri.Cvar_Get( "gl_driver", "opengl32", CVAR_ARCHIVE );
 #else
-	gl_driver = ri.Cvar_Get( "gl_driver", "libGL.so", CVAR_ARCHIVE );
+	gl_driver = ri.Cvar_Get( "gl_driver", "libGL.so.1", CVAR_ARCHIVE );
 #endif	
 	gl_texturemode = ri.Cvar_Get( "gl_texturemode", "GL_LINEAR_MIPMAP_NEAREST", CVAR_ARCHIVE );
 	gl_texturealphamode = ri.Cvar_Get( "gl_texturealphamode", "default", CVAR_ARCHIVE );
-------------- next part --------------
Index: quake2.1/Makefile
===================================================================
--- quake2.1.orig/Makefile	2004-09-20 21:49:22.441932841 +0200
+++ quake2.1/Makefile	2004-09-20 21:49:22.552909288 +0200
@@ -70,6 +70,12 @@
 
 CC=gcc
 
+ifeq ($(ARCH),x86_64)
+_LIB := lib64
+else
+_LIB := lib
+endif
+
 ifeq ($(ARCH),axp)
 RELEASE_CFLAGS=$(BASE_CFLAGS) -ffast-math -funroll-loops \
 	-fomit-frame-pointer -fexpensive-optimizations
@@ -171,12 +177,12 @@
 SVGALDFLAGS=-lvga
 
 XCFLAGS=-I/usr/X11R6/include
-XLDFLAGS=-L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm
+XLDFLAGS=-L/usr/X11R6/$(_LIB) -lX11 -lXext -lXxf86dga -lXxf86vm
 AALDFLAGS=-lm -laa
 
 SDLCFLAGS=$(shell sdl-config --cflags)
 ifeq ($(strip $(STATICSDL)),YES)
-	SDLLDFLAGS += -L/usr/X11R6/lib -Wl,-Bstatic $(SDLDIR)/libSDL.a
+	SDLLDFLAGS += -L/usr/X11R6/$(_LIB) -Wl,-Bstatic $(SDLDIR)/libSDL.a
 	SDLLDFLAGS += $(SDLDIR)/libesd.a $(SDLDIR)/libartsc.a -Wl,-Bdynamic
 	SDLLDFLAGS += -lpthread -lX11 -lXext -lXxf86dga -lXxf86vm -lXv \
 		-lXinerama
@@ -193,7 +199,7 @@
 	-L/usr/X11R6/lib -lX11 -lXext -lGL -lvga
 
 GLXCFLAGS=-I/usr/X11R6/include -DOPENGL
-GLXLDFLAGS=-L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm
+GLXLDFLAGS=-L/usr/X11R6/$(_LIB) -lX11 -lXext -lXxf86dga -lXxf86vm
 
 SDLGLCFLAGS=$(SDLCFLAGS) -DOPENGL
 SDLGLLDFLAGS=$(SDLLDFLAGS)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://icculus.org/pipermail/quake2/attachments/20040922/4173e4fe/attachment.pgp>


More information about the quake2 mailing list