# 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
# 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
# SunOS configuration (Solaris)
ifeq ($(DP_MAKE_TARGET), sunos)
- DEFAULT_SNDAPI=OSS
+ DEFAULT_SNDAPI=BSD
OBJ_CD=$(OBJ_SUNOSCD)
OBJ_CL=$(OBJ_GLX)
#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
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
# 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)
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
#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"
#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)
#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;
#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>
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
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;
{
if (vid_usingmouse)
{
-#ifndef __APPLE__
+#if !defined(__APPLE__) && !defined(SUNOS)
if (vid_dga.integer)
XF86DGADirectVideo(vidx11_display, DefaultScreen(vidx11_display), 0);
#endif
// 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;
void VID_Init(void)
{
-#ifndef __APPLE__
+#if !defined(__APPLE__) && !defined(SUNOS)
Cvar_RegisterVariable (&vid_dga);
Cvar_RegisterVariable (&vid_dga_mouseaccel);
#endif