Topic Options
#41888 - 04/06/08 12:51 PM Patches for OpenSolaris 2008.05
qmc2 Offline
Senior Member

Registered: 29/05/08
Posts: 380
Loc: Germany
Hi again,

to successfully build SDLMAME 0.125u3 on OpenSolaris 2008.05, I had to change the following set of files:

1) makefile

diff -u makefile.orig makefile
--- makefile.orig 2008-05-29 20:00:57.000000000 +0200
+++ makefile 2008-06-04 13:35:49.000000000 +0200
@@ -288,6 +288,11 @@
DEFS += -DMAME_PROFILER
endif

+# define SDLMAME_X11 if we are on Solaris
+ifeq ($(TARGETOS),solaris)
+DEFS += -DSDLMAME_X11
+endif
+


#-------------------------------------------------
@@ -377,9 +382,11 @@
LDFLAGS =
ifneq ($(TARGETOS),macosx)
ifneq ($(TARGETOS),os2)
+ifneq ($(TARGETOS),solaris)
LDFLAGS = -Wl,--warn-common
endif
endif
+endif
LDFLAGSEMULATOR =

# add profiling information for the linker
@@ -459,6 +466,11 @@
ZLIB =
endif

+# explicitly add libs on Solaris
+ifeq ($(TARGETOS),solaris)
+LIBS += -lSDL -lX11 -lXinerama -lm
+endif
+


#-------------------------------------------------

2) src/osd/sdl/sdlsync.h

$ diff -u src/osd/sdl/sdlsync.h.orig src/osd/sdl/sdlsync.h
--- src/osd/sdl/sdlsync.h.orig 2008-05-16 18:47:56.000000000 +0200
+++ src/osd/sdl/sdlsync.h 2008-06-04 12:27:31.000000000 +0200
@@ -16,7 +16,7 @@

#ifndef SDLMAME_OS2

-#if (defined SDLMAME_MACOSX) || (defined SDLMAME_FREEBSD)
+#if (defined SDLMAME_MACOSX) || (defined SDLMAME_FREEBSD) || (defined SDLMAME_SOLARIS)
#define THREAD_COOPERATIVE (0)
#else
#define THREAD_COOPERATIVE (1)

3) src/mame/video/model2.c

diff -u src/mame/video/model2.c.orig src/mame/video/model2.c
--- src/mame/video/model2.c.orig 2008-06-04 12:41:23.000000000 +0200
+++ src/mame/video/model2.c 2008-06-04 12:41:34.000000000 +0200
@@ -144,7 +144,7 @@
UINT16 z;
UINT16 texheader[4];
UINT8 luma;
-} quad;
+} _quad;

typedef struct _poly_extra_data poly_extra_data;
struct _poly_extra_data
@@ -368,7 +368,7 @@

static void model2_3d_process_quad( UINT32 attr )
{
- quad object;
+ _quad object;
UINT16 *th, *tp;
INT32 tho;
UINT32 cull, i;

4) src/emu/cpu/m6502/opsce02.h

diff -u src/emu/cpu/m6502/opsce02.h.orig src/emu/cpu/m6502/opsce02.h
--- src/emu/cpu/m6502/opsce02.h.orig 2008-06-04 13:20:05.000000000 +0200
+++ src/emu/cpu/m6502/opsce02.h 2008-06-04 13:20:32.000000000 +0200
@@ -832,6 +832,9 @@
/* 65ce02 ******************************************************
* SEC Set carry flag
***************************************************************/
+#if defined(SEC)
+#undef SEC
+#endif
#define SEC \
P |= F_C

5) src/emu/cpu/m6502/ops02.h

diff -u src/emu/cpu/m6502/ops02.h.orig src/emu/cpu/m6502/ops02.h
--- ./src/emu/cpu/m6502/ops02.h.orig 2008-06-04 13:18:16.000000000 +0200
+++ ./src/emu/cpu/m6502/ops02.h 2008-06-04 13:18:34.000000000 +0200
@@ -728,6 +728,9 @@
/* 6502 ********************************************************
* SEC Set carry flag
***************************************************************/
+#if defined(SEC)
+#undef SEC
+#endif
#define SEC \
P |= F_C

6) src/emu/cpu/m6800/m6800.c

diff -u src/emu/cpu/m6800/m6800.c.orig src/emu/cpu/m6800/m6800.c
--- src/emu/cpu/m6800/m6800.c.orig 2008-06-04 13:22:54.000000000 +0200
+++ src/emu/cpu/m6800/m6800.c 2008-06-04 13:23:16.000000000 +0200
@@ -367,6 +367,9 @@
#define INDEXED {EA=X+(UINT8)M_RDOP_ARG(PCD);PC++;}

/* macros to set status flags */
+#if defined(SEC)
+#undef SEC
+#endif
#define SEC CC|=0x01
#define CLC CC&=0xfe
#define SEZ CC|=0x04

7) src/emu/cpu/h6280/h6280ops.h

diff -u src/emu/cpu/h6280/h6280ops.h.orig src/emu/cpu/h6280/h6280ops.h
--- src/emu/cpu/h6280/h6280ops.h.orig 2008-06-04 13:13:09.000000000 +0200
+++ src/emu/cpu/h6280/h6280ops.h 2008-06-04 13:12:48.000000000 +0200
@@ -1080,6 +1080,9 @@
/* 6280 ********************************************************
* SEC Set carry flag
***************************************************************/
+#if defined(SEC)
+#undef SEC
+#endif
#define SEC \
CLEAR_T; \
P |= _fC

8) src/emu/cpu/hd6309/hd6309.c

diff -u src/emu/cpu/hd6309/hd6309.c.orig src/emu/cpu/hd6309/hd6309.c
--- src/emu/cpu/hd6309/hd6309.c.orig 2008-06-04 13:07:12.000000000 +0200
+++ src/emu/cpu/hd6309/hd6309.c 2008-06-04 13:06:51.000000000 +0200
@@ -299,6 +299,9 @@
#define EXTENDED IMMWORD(ea)

/* macros to set status flags */
+#if defined(SEC)
+#undef SEC
+#endif
#define SEC CC|=CC_C
#define CLC CC&=~CC_C
#define SEZ CC|=CC_Z

9) src/emu/cpu/m6809/m6809.c

diff -u src/emu/cpu/m6809/m6809.c.orig src/emu/cpu/m6809/m6809.c
--- src/emu/cpu/m6809/m6809.c.orig 2008-06-04 13:25:21.000000000 +0200
+++ src/emu/cpu/m6809/m6809.c 2008-06-04 13:25:40.000000000 +0200
@@ -311,6 +311,9 @@
#define EXTENDED IMMWORD(ea)

/* macros to set status flags */
+#if defined(SEC)
+#undef SEC
+#endif
#define SEC CC|=CC_C
#define CLC CC&=~CC_C
#define SEZ CC|=CC_Z

10) src/emu/cpu/konami/konami.c

diff -u src/emu/cpu/konami/konami.c.orig src/emu/cpu/konami/konami.c
--- src/emu/cpu/konami/konami.c.orig 2008-06-04 13:15:35.000000000 +0200
+++ src/emu/cpu/konami/konami.c 2008-06-04 13:15:55.000000000 +0200
@@ -262,6 +262,9 @@
#define EXTENDED IMMWORD(ea)

/* macros to set status flags */
+#if defined(SEC)
+#undef SEC
+#endif
#define SEC CC|=CC_C
#define CLC CC&=~CC_C
#define SEZ CC|=CC_Z

11) src/emu/cpu/m6805/m6805.c

diff -u src/emu/cpu/m6805/m6805.c.orig src/emu/cpu/m6805/m6805.c
--- src/emu/cpu/m6805/m6805.c.orig 2008-06-04 13:23:31.000000000 +0200
+++ src/emu/cpu/m6805/m6805.c 2008-06-04 13:23:49.000000000 +0200
@@ -178,6 +178,9 @@
#define INDEXED2 {IMMWORD(ea); EA+=X;}

/* macros to set status flags */
+#if defined(SEC)
+#undef SEC
+#endif
#define SEC CC|=CFLAG
#define CLC CC&=~CFLAG
#define SEZ CC|=ZFLAG

After applying these patches, build SDLMAME with

$ gmake TARGETOS=solaris

and you're fine smile!

Hope this will help others and / or be included into mainstream.

The problem with the patches 3) - 11) is that they are MAME core issues. There are conflicting types and macros which Solaris already uses.

The type quad is already declared in /usr/include/sys/types.h for UFS

...
typedef struct _quad { int val[2]; } quad_t; /* used by UFS */
typedef quad_t quad; /* used by UFS */
...

and the macro SEC is defined in /usr/include/sys/time.h.

Top
#42037 - 09/06/08 09:45 PM Re: Patches for OpenSolaris 2008.05 [Re: qmc2]
robiza Offline
Member

Registered: 19/09/06
Posts: 50
nice to see mess in different OS smile

Top


Moderator:  R. Belmont 
Who's Online
3 registered (Kale, Tafoid, mangamuscle), 18 Guests and 9 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Forum Stats
3956 Members
9 Forums
6141 Topics
62884 Posts

Max Online: 162 @ 01/05/07 03:28 AM