]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Fixups for Solaris port.
authoreviltypeguy <eviltypeguy@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 14 Aug 2005 23:33:30 +0000 (23:33 +0000)
committereviltypeguy <eviltypeguy@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 14 Aug 2005 23:33:30 +0000 (23:33 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5579 d7cf8633-e32d-0410-b094-e92efae38249

common.h
makefile
makefile.inc
netconn.h
snd_bsd.c
vid_glx.c

index cceb571af3ff090c3b1c66a3a357bc165da5c286..507d3f7dceb86fb80d4833e88eef0bfc044baf6a 100644 (file)
--- a/common.h
+++ b/common.h
@@ -33,11 +33,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 # define MACOSX
 #endif
 
-// Create our own define for Solaris
-#if defined(__sun__) && defined(__svr4__)
-# define SUNOS
-#endif
-
 #ifdef SUNOS
 #include <sys/file.h>          // Needed for FNDELAY
 # define model_t dp_model_t // Workaround conflict with /usr/include/sys/model.h
index 299893bae932d5d0999f98d51436e3db72638fbf..63ba438be4c25c1ede4d654cea1dc189273b736d 100644 (file)
--- a/makefile
+++ b/makefile
@@ -42,9 +42,9 @@ endif
 
 # 64bits AMD CPUs use another lib directory
 ifeq ($(DP_MACHINE),x86_64)
-       UNIX_X11LIBPATH:=-L/usr/X11R6/lib64
+       UNIX_X11LIBPATH:=/usr/X11R6/lib64
 else
-       UNIX_X11LIBPATH:=-L/usr/X11R6/lib
+       UNIX_X11LIBPATH:=/usr/X11R6/lib
 endif
 
 
@@ -82,7 +82,7 @@ endif
 
 # SunOS configuration (Solaris)
 ifeq ($(DP_MAKE_TARGET), sunos)
-       DEFAULT_SNDAPI=OSS
+       DEFAULT_SNDAPI=BSD
        OBJ_CD=$(OBJ_SUNOSCD)
 
        OBJ_CL=$(OBJ_GLX)
index 3494779ef664618c65417921bec2ac3d3bade98e..07d73b308d34eb0991f66dcbca2a29d04c7b23ea 100644 (file)
@@ -5,6 +5,8 @@ CC=gcc
 #CPUOPTIMIZATIONS=-march=athlon
 # athlon xp optimizations
 #CPUOPTIMIZATIONS=-march=athlon-xp
+# athlon 64 optimizations
+#CPUOPTIMIZATIONS=-march=athlon64 -m32
 # Pentium 3 optimizations
 #CPUOPTIMIZATIONS=-march=pentium3
 # Pentium 4 optimizations
@@ -156,7 +158,12 @@ OBJ_GLX= builddate.c sys_linux.o vid_glx.o $(OBJ_SOUND) $(OBJ_CD) $(OBJ_COMMON)
 
 LDFLAGS_UNIXCOMMON=-lm
 #LDFLAGS_UNIXCL=-L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm $(LIB_SOUND)
-LDFLAGS_UNIXCL=$(UNIX_X11LIBPATH) -lX11 -lXext -lXxf86dga -lXxf86vm $(LIB_SOUND)
+ifeq ($(DP_MAKE_TARGET), sunos)
+       LDFLAGS_UNIXCL=-R$(UNIX_X11LIBPATH) -L$(UNIX_X11LIBPATH) -lX11 -lXext -lXxf86vm $(LIB_SOUND)
+else
+       LDFLAGS_UNIXCL=-L$(UNIX_X11LIBPATH) -lX11 -lXext -lXxf86dga -lXxf86vm $(LIB_SOUND)
+endif
+
 LDFLAGS_UNIXSDL=`sdl-config --libs`
 EXE_UNIXCL=darkplaces-glx
 EXE_UNIXSV=darkplaces-dedicated
@@ -197,7 +204,7 @@ OBJ_AGL= builddate.c sys_linux.o vid_agl.o $(OBJ_SOUND) $(OBJ_CD) $(OBJ_COMMON)
 # No CD support available
 OBJ_SUNOSCD=$(OBJ_NOCD)
 
-CFLAGS_SUNOS=-I/usr/lib/oss/include -DBSD_COMP
+CFLAGS_SUNOS=-I/usr/lib/oss/include -DBSD_COMP -DSUNOS
 
 # Link
 LDFLAGS_SUNOSCL=$(LDFLAGS_UNIXCOMMON) -ldl -lsocket -lnsl $(LDFLAGS_UNIXCL)
index fd39833e8ee504746da668d58db4ac30dd62d79d..e66b71d17fe19534991ab3682302c484744872c7 100755 (executable)
--- a/netconn.h
+++ b/netconn.h
@@ -251,7 +251,7 @@ extern int serverlist_cachecount;
 
 extern qboolean serverlist_consoleoutput;
 
-#if !defined(_WIN32 ) && !defined (__linux__) && !defined (__sun__)
+#if !defined(_WIN32) && !defined(__linux__) && !defined(SUNOS)
 #ifndef htonl
 extern unsigned long htonl (unsigned long hostlong);
 #endif
index 0ca754f1711f3a0b595ba0cc86dfcdd03a0d3c11..6c1bd6ee3583e01bede3ab2b73c3819272bdbe26 100644 (file)
--- a/snd_bsd.c
+++ b/snd_bsd.c
@@ -20,11 +20,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include <sys/param.h>
 #include <sys/audioio.h>
+#ifndef SUNOS
 #include <sys/endian.h>
+#endif
 #include <sys/ioctl.h>
 
 #include <fcntl.h>
+#ifndef SUNOS
 #include <paths.h>
+#endif
 #include <unistd.h>
 
 #include "quakedef.h"
@@ -55,7 +59,11 @@ qboolean SNDDMA_Init (void)
 #ifdef _PATH_SOUND
        snddev = _PATH_SOUND;
 #else
+#ifndef SUNOS
        snddev = "/dev/sound";
+#else
+       snddev = "/dev/audio";
+#endif
 #endif
        audio_fd = open (snddev, O_WRONLY | O_NDELAY | O_NONBLOCK);
        if (audio_fd < 0)
@@ -81,7 +89,11 @@ qboolean SNDDMA_Init (void)
 #if BYTE_ORDER == BIG_ENDIAN
                info.play.encoding = AUDIO_ENCODING_SLINEAR_BE;
 #else
+#ifndef SUNOS
                info.play.encoding = AUDIO_ENCODING_SLINEAR_LE;
+#else
+               info.play.encoding = AUDIO_ENCODING_LINEAR;
+#endif
 #endif
                if (ioctl (audio_fd, AUDIO_SETINFO, &info) == 0)
                        break;
index 30687ca78ac1368581577e32d755aa2eb0fd162c..890cf78f34704fbaf5318ab3f40bafd0cf4a49ec 100644 (file)
--- a/vid_glx.c
+++ b/vid_glx.c
@@ -35,7 +35,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include <X11/cursorfont.h>
 
 #include <X11/extensions/XShm.h>
-#if !defined(__APPLE__) && !defined(__MACH__)
+#if !defined(__APPLE__) && !defined(__MACH__) && !defined(SUNOS)
 #include <X11/extensions/xf86dga.h>
 #endif
 #include <X11/extensions/xf86vmode.h>
@@ -93,7 +93,7 @@ static qboolean vid_usevsync = false;
 static float   mouse_x, mouse_y;
 static int p_mouse_x, p_mouse_y;
 
-#ifndef __APPLE__
+#if !defined(__APPLE__) && !defined(SUNOS)
 cvar_t vid_dga = {CVAR_SAVE, "vid_dga", "1"};
 cvar_t vid_dga_mouseaccel = {0, "vid_dga_mouseaccel", "1"};
 #endif
@@ -265,7 +265,7 @@ static void IN_Activate (qboolean grab)
 
                        XGrabPointer(vidx11_display, win,  True, 0, GrabModeAsync, GrabModeAsync, win, None, CurrentTime);
 
-#ifndef __APPLE__
+#if !defined(__APPLE__) && !defined(SUNOS)
                        if (vid_dga.integer)
                        {
                                int MajorVersion, MinorVersion;
@@ -298,7 +298,7 @@ static void IN_Activate (qboolean grab)
        {
                if (vid_usingmouse)
                {
-#ifndef __APPLE__
+#if !defined(__APPLE__) && !defined(SUNOS)
                        if (vid_dga.integer)
                                XF86DGADirectVideo(vidx11_display, DefaultScreen(vidx11_display), 0);
 #endif
@@ -348,7 +348,7 @@ static void HandleEvents(void)
                        // mouse moved
                        if (vid_usingmouse)
                        {
-#ifndef __APPLE__
+#if !defined(__APPLE__) && !defined(SUNOS)
                                if (vid_dga.integer == 1)
                                {
                                        mouse_x += event.xmotion.x_root * vid_dga_mouseaccel.value;
@@ -652,7 +652,7 @@ int VID_GetGamma(unsigned short *ramps)
 
 void VID_Init(void)
 {
-#ifndef __APPLE__
+#if !defined(__APPLE__) && !defined(SUNOS)
        Cvar_RegisterVariable (&vid_dga);
        Cvar_RegisterVariable (&vid_dga_mouseaccel);
 #endif