[quake3] quake3 on Solaris x86

vincent at cojot.name vincent at cojot.name
Tue Nov 1 09:16:23 EST 2005


Sean, Tim,

I have produced a diff against current SVN and based upon Sean's diff. It 
also includes improved endianness detection for Solaris..
Please tell us if the patch's acceptable..

Vincent


On Tue, 1 Nov 2005, darkshark atnight wrote:

> I've attached the diffs to get things compiled on x86.
>
> the lcc/etc/gcc-solaris.c is really the lcc/etc/linux.c renamed and
> s/linux/sun/g
>
> And, I can start quake3 now :)  Need to find me cd key, been a few years..
>
> Thanks guys.
>
> Sean.
-------------- next part --------------
Index: code/unix/snapvectora.s
===================================================================
--- code/unix/snapvectora.s	(revision 204)
+++ code/unix/snapvectora.s	(working copy)
@@ -76,7 +76,7 @@
 
 // void Sys_SnapVectorCW( float *v, unsigned short int cw )
 .global C(Sys_SnapVectorCW)
-C(Sys_SnapVector_cw):
+C(Sys_SnapVectorCW):
         pushl   %eax
         pushl   %ebp
         movl    %esp,%ebp
Index: code/unix/Makefile
===================================================================
--- code/unix/Makefile	(revision 204)
+++ code/unix/Makefile	(working copy)
@@ -418,13 +418,13 @@
   LDFLAGS=-lsocket -lnsl -ldl -lm
 
   ifeq ($(strip $(USE_SDL)),true)
-    GLLDFLAGS=$(shell sdl-config --libs) -lGLU -lX11 -lXext
+    GLLDFLAGS=$(shell sdl-config --libs) -L/usr/X11/lib -lGLU -lX11 -lXext
   else
-    GLLDFLAGS=-L/usr/openwin/$(LIB) -lGLU -lX11 -lXext
+    GLLDFLAGS=-L/usr/openwin/$(LIB) -L/usr/X11/lib -lGLU -lX11 -lXext
   endif
 
   ifeq ($(ARCH),i386)
-    # linux32 make ...
+    # Solarix x86 make ...
     BASE_CFLAGS += -m32
     LDFLAGS+=-m32
   endif
Index: code/tools/lcc/etc/gcc-solaris.c
===================================================================
--- code/tools/lcc/etc/gcc-solaris.c	(revision 204)
+++ code/tools/lcc/etc/gcc-solaris.c	(working copy)
@@ -1,4 +1,4 @@
-/* x86s running Linux */
+/* Solaris with GNU Compilers */
 
 #include <string.h>
 
@@ -25,7 +25,7 @@
 // TTimo experimental: do not compile with the __linux__ define, we are doing bytecode!
 char *cpp[] = { LCCDIR "q3cpp" BINEXT,
 	"-U__GNUC__", "-D_POSIX_SOURCE", "-D__STDC__=1", "-D__STRICT_ANSI__",
-	"-Dunix", "-Di386", "-Dlinux",
+	"-Dunix", "-Di386", "-Dsun",
 	"-D__unix__", "-D__i386__", "-D__signed__=signed",
 	"$1", "$2", "$3", 0 };
 char *include[] = {"-I" LCCDIR "include", "-I" LCCDIR "gcc/include", "-I/usr/include",
Index: code/renderer/qgl.h
===================================================================
--- code/renderer/qgl.h	(revision 204)
+++ code/renderer/qgl.h	(working copy)
@@ -94,7 +94,7 @@
 #endif /* defined(__sun) */
 
 // NOTE: some Linux platforms would need those prototypes
-#if defined(MACOS_X) || defined(__sun)
+#if defined(MACOS_X) || ( defined(__sun) && defined(__sparc) )
 typedef void (APIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
 typedef void (APIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
 typedef void (APIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
Index: code/qcommon/q_shared.h
===================================================================
--- code/qcommon/q_shared.h	(revision 204)
+++ code/qcommon/q_shared.h	(working copy)
@@ -346,6 +346,7 @@
 #ifdef __sun
 
 #include <sys/isa_defs.h>
+#include <sys/byteorder.h>
 
 // bk001205 - from Makefile
 #define stricmp strcasecmp
@@ -360,20 +361,24 @@
 
 #define	PATH_SEP '/'
 
-#if defined(_LITTLE_ENDIAN)
+#if defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)
+#define BigShort
+inline static short LittleShort(short l) { return ShortSwap(l); }
+#define BigLong
+inline static int LittleLong (int l) { return LongSwap(l); }
+#define BigFloat
+inline static float LittleFloat (const float l) { return FloatSwap(&l); }
+
+#elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)
 inline static short BigShort( short l) { return ShortSwap(l); }
 #define LittleShort
 inline static int BigLong(int l) { return LongSwap(l); }
 #define LittleLong
 inline static float BigFloat(const float l) { return FloatSwap(&l); }
 #define LittleFloat
-#else /* Must be _BIG_ENDIAN */
-#define BigShort
-inline static short LittleShort(short l) { return ShortSwap(l); }
-#define BigLong
-inline static int LittleLong (int l) { return LongSwap(l); }
-#define BigFloat
-inline static float LittleFloat (const float l) { return FloatSwap(&l); }
+
+#else
+#error "Either _BIG_ENDIAN or _LITTLE_ENDIAN must be #defined, but not both."
 #endif
 
 #endif
@@ -688,7 +693,7 @@
 	float	v[3];
 } vec3struct_t;
 #define VectorCopy(a,b)	(*(vec3struct_t *)b=*(vec3struct_t *)a)
-#define ID_INLINE static
+// #define ID_INLINE static
 #endif
 #endif
 


More information about the quake3 mailing list