# define MACOSX
#endif
+// Create our own define for Solaris
+#if defined(__sun__) && defined(__svr4__)
+# define SUNOS
+#endif
+
+#ifdef SUNOS
+# define FNDELAY O_NDELAY // FNDELAY's equivalent on SunOS is O_NDELAY
+# define model_t dp_model_t // Workaround conflict with /usr/include/sys/model.h
+#endif
//============================================================================
# if defined(WIN32)
# define BYTE_ORDER LITTLE_ENDIAN
# else
-# warning "Unable to determine the CPU endianess. Defaulting to little endian"
-# define BYTE_ORDER LITTLE_ENDIAN
+# if defined(SUNOS)
+# if defined(__i386) || defined(__amd64)
+# define BYTE_ORDER LITTLE_ENDIAN
+# else
+# define BYTE_ORDER BIG_ENDIAN
+# endif
+# else
+# warning "Unable to determine the CPU endianess. Defaulting to little endian"
+# define BYTE_ORDER LITTLE_ENDIAN
+# endif
# endif
#endif
else
ifeq ($(DP_ARCH), Darwin)
DP_MAKE_TARGET=macosx
+else
+ifeq ($(DP_ARCH), SunOS)
+ DP_MAKE_TARGET=sunos
else
DP_MAKE_TARGET=linux
+endif # ifeq ($(DP_ARCH), SunOS)
endif # ifeq ($(DP_ARCH), Darwin)
endif # ifneq ($(filter %BSD,$(DP_ARCH)),)
endif # ifdef windir
EXE_SDL=$(EXE_UNIXSDL)
endif
+# SunOS configuration (Solaris)
+ifeq ($(DP_MAKE_TARGET), sunos)
+ OBJ_SOUND=$(OBJ_SUNOSSOUND)
+ LIB_SOUND=$(LIB_SUNOSSOUND)
+ OBJ_CD=$(OBJ_SUNOSCD)
+
+ OBJ_CL=$(OBJ_GLX)
+
+ CFLAGS_EXTRA=$(CFLAGS_SUNOS)
+
+ LDFLAGS_CL=$(LDFLAGS_SUNOSCL)
+ LDFLAGS_SV=$(LDFLAGS_SUNOSSV)
+ LDFLAGS_SDL=$(LDFLAGS_SUNOSSDL)
+
+ EXE_CL=$(EXE_UNIXCL)
+ EXE_SV=$(EXE_UNIXSV)
+ EXE_SDL=$(EXE_UNIXSDL)
+endif
+
# BSD configuration
ifeq ($(DP_MAKE_TARGET), bsd)
ifeq ($(DP_ARCH),FreeBSD)
OBJ_AGL= builddate.c sys_linux.o vid_agl.o $(OBJ_SOUND) $(OBJ_CD) $(OBJ_COMMON)
+##### SunOS specific variables #####
+
+OBJ_SUNOSSOUND=$(OBJ_OSSSOUND)
+LIB_SUNOSSOUND=$(LIB_OSSSOUND)
+
+# No CD support available
+OBJ_SUNOSCD=$(OBJ_NOCD)
+
+CFLAGS_SUNOS=-I/usr/lib/oss/include -DBSD_COMP
+
+# Link
+LDFLAGS_SUNOSCL=$(LDFLAGS_UNIXCOMMON) -ldl -lsocket -lnsl $(LDFLAGS_UNIXCL)
+LDFLAGS_SUNOSSV=$(LDFLAGS_UNIXCOMMON) -ldl -lsocket -lnsl
+LDFLAGS_SUNOSSDL=$(LDFLAGS_UNIXCOMMON) -ldl -lsocket -lnsl $(LDFLAGS_UNIXSDL)
+
##### BSD specific variables #####
@echo
@echo "========== $(EXE) (debug) =========="
$(MAKE) $(EXE) DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
- CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_DEBUG) $(OPTIM_DEBUG)"\
+ CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_EXTRA) $(CFLAGS_DEBUG) $(OPTIM_DEBUG)"\
LDFLAGS="$(LDFLAGS_DEBUG) $(LDFLAGS_COMMON)"
bin-profile :
@echo
@echo "========== $(EXE) (profile) =========="
$(MAKE) $(EXE) DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
- CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_PROFILE) $(OPTIM_RELEASE)"\
+ CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_EXTRA) $(CFLAGS_PROFILE) $(OPTIM_RELEASE)"\
LDFLAGS="$(LDFLAGS_PROFILE) $(LDFLAGS_COMMON)"
bin-release :
@echo
@echo "========== $(EXE) (release) =========="
$(MAKE) $(EXE) DP_MAKE_TARGET=$(DP_MAKE_TARGET) \
- CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_RELEASE) $(OPTIM_RELEASE)"\
+ CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_EXTRA) $(CFLAGS_RELEASE) $(OPTIM_RELEASE)"\
LDFLAGS="$(LDFLAGS_RELEASE) $(LDFLAGS_COMMON)"
strip $(EXE)