From 36c9bba47db88ab3e42e422d26a35de3536d1d76 Mon Sep 17 00:00:00 2001 From: couriersud Date: Sun, 25 Jan 2015 22:01:16 +0100 Subject: Solaris 11 build support. [Couriersud] --- makefile | 9 +++++++++ src/osd/modules/font/font_sdl.c | 2 +- src/osd/sdl/sdl.mak | 18 +++++++++++++++--- src/osd/sdl/sdlprefix.h | 19 +++++++++---------- src/osd/sdl/sdlptty_unix.c | 28 ++++++++++++++++++++++++++++ 5 files changed, 62 insertions(+), 14 deletions(-) diff --git a/makefile b/makefile index 99eaa8c1757..430014db251 100644 --- a/makefile +++ b/makefile @@ -98,6 +98,10 @@ endif ifeq ($(firstword $(filter Haiku,$(UNAME))),Haiku) TARGETOS = haiku endif +ifeq ($(firstword $(filter SunOS,$(UNAME))),SunOS) +TARGETOS = solaris +SDL_LIBVER = sdl +endif ifndef TARGETOS $(error Unable to detect TARGETOS from uname -a: $(UNAME)) @@ -114,6 +118,11 @@ endif ifeq ($(firstword $(filter ppc64,$(UNAME))),ppc64) PTR64 = 1 endif +ifeq ($(TARGETOS), solaris) +ifeq ($(firstword $(filter amd64,$(shell /usr/bin/isainfo -k))),amd64) +PTR64 = 1 +endif +endif endif # Autodetect BIGENDIAN diff --git a/src/osd/modules/font/font_sdl.c b/src/osd/modules/font/font_sdl.c index 5f63ce70ade..6ae72ca4fb3 100644 --- a/src/osd/modules/font/font_sdl.c +++ b/src/osd/modules/font/font_sdl.c @@ -6,7 +6,7 @@ #include "font_module.h" #include "modules/osdmodule.h" -#if defined(SDLMAME_UNIX) && (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_HAIKU)) && (!defined(SDLMAME_EMSCRIPTEN)) +#if defined(SDLMAME_UNIX) && (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_SOLARIS)) && (!defined(SDLMAME_HAIKU)) && (!defined(SDLMAME_EMSCRIPTEN)) #if (SDLMAME_SDL2) #include diff --git a/src/osd/sdl/sdl.mak b/src/osd/sdl/sdl.mak index 60b91cfb75e..e47645205fa 100644 --- a/src/osd/sdl/sdl.mak +++ b/src/osd/sdl/sdl.mak @@ -246,9 +246,11 @@ endif ifeq ($(TARGETOS),solaris) BASE_TARGETOS = unix -DEFS += -DNO_AFFINITY_NP -UHAVE_VSNPRINTF -DNO_vsnprintf +#DEFS += -DNO_AFFINITY_NP -UHAVE_VSNPRINTF -DNO_vsnprintf +DEFS += -DNO_AFFINITY_NP SYNC_IMPLEMENTATION = tc NO_USE_MIDI = 1 +NO_USE_QTDEBUG = 1 endif ifeq ($(TARGETOS),haiku) @@ -606,12 +608,22 @@ else LIBS += -lSDL_ttf endif +# FIXME: should be dealt with elsewhere # libs that Haiku doesn't want but are mandatory on *IX ifneq ($(TARGETOS),haiku) -BASELIBS += -lm -lutil -lpthread -LIBS += -lm -lutil -lpthread +BASELIBS += -lm -lpthread +LIBS += -lm -lpthread +ifneq ($(TARGETOS),solaris) +BASELIBS += -lutil +LIBS += -lutil +else +SUPPORTSM32M64 = 1 +BASELIBS += -lsocket -lnsl +LIBS += -lsocket -lnsl +endif endif + endif # not Mac OS X ifneq (,$(findstring ppc,$(UNAME))) diff --git a/src/osd/sdl/sdlprefix.h b/src/osd/sdl/sdlprefix.h index 84c0d197fdd..9b75948dc9d 100644 --- a/src/osd/sdl/sdlprefix.h +++ b/src/osd/sdl/sdlprefix.h @@ -27,16 +27,15 @@ #if defined(__sun__) && defined(__svr4__) #define SDLMAME_SOLARIS 1 -#undef _XOPEN_SOURCE -#undef _XOPEN_VERSION -#undef _XOPEN_SOURCE_EXTENDED -#undef _XPG6 -#undef _XPG5 -#undef _XPG4_2 - -#define _XOPEN_SOURCE -#define _XOPEN_VERSION 4 - +//#undef _XOPEN_SOURCE +//#undef _XOPEN_VERSION +//#undef _XOPEN_SOURCE_EXTENDED +//#undef _XPG6 +//#undef _XPG5 +//#undef _XPG4_2 + +//#define _XOPEN_SOURCE +//#define _XOPEN_VERSION 4 #elif defined(__irix__) || defined(__sgi) #define SDLMAME_IRIX 1 /* Large file support on IRIX needs _SGI_SOURCE */ diff --git a/src/osd/sdl/sdlptty_unix.c b/src/osd/sdl/sdlptty_unix.c index 92eb15e0261..bc9b3a8ff25 100644 --- a/src/osd/sdl/sdlptty_unix.c +++ b/src/osd/sdl/sdlptty_unix.c @@ -9,6 +9,8 @@ // //============================================================ +#if (!defined(SDLMAME_SOLARIS) && !(defined(SDLMAME_OS2))) + #include #include #include @@ -101,3 +103,29 @@ file_error sdl_close_ptty(osd_file *file) return FILERR_NONE; } + +#else +#include "sdlfile.h" + +const char *sdlfile_ptty_identifier = ""; + +file_error sdl_open_ptty(const char *path, UINT32 openflags, osd_file **file, UINT64 *filesize) +{ + return FILERR_ACCESS_DENIED; +} + +file_error sdl_read_ptty(osd_file *file, void *buffer, UINT64 offset, UINT32 count, UINT32 *actual) +{ + return FILERR_ACCESS_DENIED; +} + +file_error sdl_write_ptty(osd_file *file, const void *buffer, UINT64 offset, UINT32 count, UINT32 *actual) +{ + return FILERR_ACCESS_DENIED; +} + +file_error sdl_close_ptty(osd_file *file) +{ + return FILERR_ACCESS_DENIED; +} +#endif -- cgit v1.2.3