From 31bc6f42205f75d58be52a0059c95cdbe90679af Mon Sep 17 00:00:00 2001 From: eviltypeguy Date: Sun, 14 Aug 2005 23:33:30 +0000 Subject: [PATCH] Fixups for Solaris port. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5579 d7cf8633-e32d-0410-b094-e92efae38249 --- common.h | 5 ----- makefile | 6 +++--- makefile.inc | 11 +++++++++-- netconn.h | 2 +- snd_bsd.c | 12 ++++++++++++ vid_glx.c | 12 ++++++------ 6 files changed, 31 insertions(+), 17 deletions(-) diff --git a/common.h b/common.h index cceb571a..507d3f7d 100644 --- 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 // Needed for FNDELAY # define model_t dp_model_t // Workaround conflict with /usr/include/sys/model.h diff --git a/makefile b/makefile index 299893ba..63ba438b 100644 --- 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) diff --git a/makefile.inc b/makefile.inc index 3494779e..07d73b30 100644 --- a/makefile.inc +++ b/makefile.inc @@ -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) diff --git a/netconn.h b/netconn.h index fd39833e..e66b71d1 100755 --- 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 diff --git a/snd_bsd.c b/snd_bsd.c index 0ca754f1..6c1bd6ee 100644 --- 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 #include +#ifndef SUNOS #include +#endif #include #include +#ifndef SUNOS #include +#endif #include #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; diff --git a/vid_glx.c b/vid_glx.c index 30687ca7..890cf78f 100644 --- 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 #include -#if !defined(__APPLE__) && !defined(__MACH__) +#if !defined(__APPLE__) && !defined(__MACH__) && !defined(SUNOS) #include #endif #include @@ -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 -- 2.39.2