summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/Makefile9
-rw-r--r--apps/bitmaps/mono/SOURCES3
-rw-r--r--apps/bitmaps/mono/osx.dummy.bmpbin0 -> 66 bytes
-rw-r--r--apps/bitmaps/remote_mono/SOURCES3
-rw-r--r--apps/bitmaps/remote_mono/osx.dummy.bmpbin0 -> 66 bytes
-rw-r--r--apps/codecs/Makefile10
-rw-r--r--apps/plugins/Makefile10
-rw-r--r--apps/plugins/chessbox/Makefile10
-rw-r--r--apps/plugins/databox/Makefile10
-rw-r--r--apps/plugins/doom/Makefile15
-rw-r--r--apps/plugins/mpegplayer/Makefile9
-rw-r--r--apps/plugins/pacbox/Makefile9
-rw-r--r--apps/plugins/rockboy/Makefile10
-rw-r--r--apps/plugins/searchengine/Makefile10
-rw-r--r--apps/plugins/sudoku/Makefile10
-rw-r--r--apps/plugins/zxbox/Makefile7
-rwxr-xr-xtools/configure11
-rw-r--r--uisimulator/common/io.c3
18 files changed, 114 insertions, 25 deletions
diff --git a/apps/Makefile b/apps/Makefile
index 53a0d373bb..6214ce138b 100644
--- a/apps/Makefile
+++ b/apps/Makefile
@@ -164,12 +164,17 @@ EXTRAOBJ = $(BUILDDIR)/sim/uisw32-res.o
LDOPTS += -lwinmm
endif
+# OS X's ld does not support -Map
+ifeq ($(UNAME), Darwin)
+SIMULATOR_MAP=
+else
+SIMULATOR_MAP=-Wl,-Map,$(OBJDIR)/rockbox.map
+endif
$(BUILDDIR)/$(BINARY) : $(OBJS) $(DEPFILE) $(BUILDDIR)/libsim.a \
$(BUILDDIR)/libcomsim.a $(LIBROCKBOX) $(BITMAPLIBS)
@echo "LD $(BINARY)"
- $(SILENT)$(CC) $(GCCOPTS) -o $@ $(OBJS) -L$(BUILDDIR) -lrockbox -lsim -lcomsim $(LINKBITMAPS) $(LDOPTS) $(EXTRAOBJ) -Wl,-Map,$(OBJDIR)/rockbox.map
-
+ $(SILENT)$(CC) $(GCCOPTS) -o $@ $(OBJS) -L$(BUILDDIR) -lrockbox -lsim -lcomsim $(LINKBITMAPS) $(LDOPTS) $(EXTRAOBJ) $(SIMULATOR_MAP)
endif
$(BUILDDIR)/rockbox.ucl: $(OBJDIR)/rockbox.bin
diff --git a/apps/bitmaps/mono/SOURCES b/apps/bitmaps/mono/SOURCES
index e69de29bb2..c59aab6107 100644
--- a/apps/bitmaps/mono/SOURCES
+++ b/apps/bitmaps/mono/SOURCES
@@ -0,0 +1,3 @@
+#if defined(SIMULATOR) && defined(__APPLE__)
+osx.dummy.bmp
+#endif
diff --git a/apps/bitmaps/mono/osx.dummy.bmp b/apps/bitmaps/mono/osx.dummy.bmp
new file mode 100644
index 0000000000..f09bec7a4c
--- /dev/null
+++ b/apps/bitmaps/mono/osx.dummy.bmp
Binary files differ
diff --git a/apps/bitmaps/remote_mono/SOURCES b/apps/bitmaps/remote_mono/SOURCES
index e69de29bb2..c59aab6107 100644
--- a/apps/bitmaps/remote_mono/SOURCES
+++ b/apps/bitmaps/remote_mono/SOURCES
@@ -0,0 +1,3 @@
+#if defined(SIMULATOR) && defined(__APPLE__)
+osx.dummy.bmp
+#endif
diff --git a/apps/bitmaps/remote_mono/osx.dummy.bmp b/apps/bitmaps/remote_mono/osx.dummy.bmp
new file mode 100644
index 0000000000..f09bec7a4c
--- /dev/null
+++ b/apps/bitmaps/remote_mono/osx.dummy.bmp
Binary files differ
diff --git a/apps/codecs/Makefile b/apps/codecs/Makefile
index 62312e2288..28fc82ba79 100644
--- a/apps/codecs/Makefile
+++ b/apps/codecs/Makefile
@@ -12,6 +12,12 @@ INCLUDES = -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I$(FIRMDIR)/common \
CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(TARGET) $(EXTRA_DEFINES) \
-DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DCODEC
+ifeq ($(UNAME), Darwin)
+SHARED_FLAG=-dynamiclib -Wl,-single_module
+else
+SHARED_FLAG=-shared
+endif
+
ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
endif
@@ -80,7 +86,7 @@ ifeq ($(SIMVER), x11)
$(OBJDIR)/%.codec : $(OBJDIR)/%.o $(BUILDDIR)/libcodec.a $(OUTPUT)
@echo "LD $(notdir $@)"
- $(SILENT)$(CC) $(CFLAGS) -shared $< -L$(BUILDDIR) $(CODECLIBS) -lcodec -o $@
+ $(SILENT)$(CC) $(CFLAGS) $(SHARED_FLAG) $< -L$(BUILDDIR) $(CODECLIBS) -lcodec -o $@
ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
# 'x' must be kept or you'll have "Win32 error 5"
# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
@@ -96,7 +102,7 @@ ifeq ($(SIMVER), sdl)
$(OBJDIR)/%.codec : $(OBJDIR)/%.o $(BUILDDIR)/libcodec.a $(OUTPUT)
@echo "LD $(notdir $@) $^"
- $(SILENT)$(CC) $(CFLAGS) -shared $< -L$(BUILDDIR) $(CODECLIBS) -lcodec -o $@
+ $(SILENT)$(CC) $(CFLAGS) $(SHARED_FLAG) $< -L$(BUILDDIR) $(CODECLIBS) -lcodec -o $@
ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
# 'x' must be kept or you'll have "Win32 error 5"
# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
diff --git a/apps/plugins/Makefile b/apps/plugins/Makefile
index 0b2974f565..adc7895da0 100644
--- a/apps/plugins/Makefile
+++ b/apps/plugins/Makefile
@@ -13,6 +13,12 @@ INCLUDES = $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I$(FIRMDIR)/c
CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
-DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
+ifeq ($(UNAME), Darwin)
+SHARED_FLAG=-dynamiclib -Wl,-single_module
+else
+SHARED_FLAG=-shared
+endif
+
ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
endif
@@ -96,7 +102,7 @@ ifeq ($(SIMVER), x11)
$(OBJDIR)/%.rock : $(OBJDIR)/%.o $(BUILDDIR)/libplugin.a $(BITMAPLIBS)
@echo "LD "`basename $@`
- $(SILENT)$(CC) $(CFLAGS) -shared $< -L$(BUILDDIR) $(CODECLIBS) -lplugin $(LINKBITMAPS) -o $@
+ $(SILENT)$(CC) $(CFLAGS) $(SHARED_FLAG) $< -L$(BUILDDIR) $(CODECLIBS) -lplugin $(LINKBITMAPS) -o $@
ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
# 'x' must be kept or you'll have "Win32 error 5"
# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
@@ -112,7 +118,7 @@ ifeq ($(SIMVER), sdl)
$(OBJDIR)/%.rock : $(OBJDIR)/%.o $(BUILDDIR)/libplugin.a $(BITMAPLIBS)
@echo "LD "`basename $@`
- $(SILENT)$(CC) $(CFLAGS) -shared $< -L$(BUILDDIR) $(CODECLIBS) -lplugin $(LINKBITMAPS) -o $@
+ $(SILENT)$(CC) $(CFLAGS) $(SHARED_FLAG) $< -L$(BUILDDIR) $(CODECLIBS) -lplugin $(LINKBITMAPS) -o $@
ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
# 'x' must be kept or you'll have "Win32 error 5"
# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
diff --git a/apps/plugins/chessbox/Makefile b/apps/plugins/chessbox/Makefile
index 66381bea12..9d13a2e12d 100644
--- a/apps/plugins/chessbox/Makefile
+++ b/apps/plugins/chessbox/Makefile
@@ -12,6 +12,12 @@ INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)
CFLAGS = $(GCCOPTS) -O2 $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \
-DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
+ifeq ($(UNAME), Darwin)
+SHARED_FLAG=-dynamiclib -Wl,-single_module
+else
+SHARED_FLAG=-shared
+endif
+
ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
endif
@@ -55,7 +61,7 @@ ifeq ($(SIMVER), x11)
$(OUTPUT): $(OBJS)
@echo "LD $<"
- @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
+ @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
# 'x' must be kept or you'll have "Win32 error 5"
# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
@@ -71,7 +77,7 @@ ifeq ($(SIMVER), sdl)
$(OUTPUT): $(OBJS)
@echo "LD $<"
- @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
+ @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
# 'x' must be kept or you'll have "Win32 error 5"
# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
diff --git a/apps/plugins/databox/Makefile b/apps/plugins/databox/Makefile
index 507a861f9b..dba5597c8d 100644
--- a/apps/plugins/databox/Makefile
+++ b/apps/plugins/databox/Makefile
@@ -12,6 +12,12 @@ INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)
CFLAGS = $(INCLUDES) $(GCCOPTS) -O3 $(TARGET) $(EXTRA_DEFINES) \
-DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
+ifeq ($(UNAME), Darwin)
+SHARED_FLAG=-dynamiclib -Wl,-single_module
+else
+SHARED_FLAG=-shared
+endif
+
ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
endif
@@ -46,7 +52,7 @@ ifeq ($(SIMVER), x11)
$(OUTPUT): $(OBJS)
@echo "LD $<"
- @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@
+ @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
# 'x' must be kept or you'll have "Win32 error 5"
# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
@@ -62,7 +68,7 @@ ifeq ($(SIMVER), sdl)
$(OUTPUT): $(OBJS)
@echo "LD $<"
- @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@
+ @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
# 'x' must be kept or you'll have "Win32 error 5"
# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
diff --git a/apps/plugins/doom/Makefile b/apps/plugins/doom/Makefile
index b79f5be7b0..a94a26a544 100644
--- a/apps/plugins/doom/Makefile
+++ b/apps/plugins/doom/Makefile
@@ -3,7 +3,10 @@
# $Id$
#
# $Log$
-# Revision 1.4 2006/07/27 13:27:19 linus
+# Revision 1.5 2006/09/29 16:15:08 barrywardell
+# Allow UI simulator to be build on OS (Slightly updated version of FS5767)
+#
+# Revision 1.4 2006-07-27 13:27:19 linus
# Moved the X5 button driver to the target tree
#
# Revision 1.3 2006-04-14 21:07:56 kkurbjun
@@ -23,6 +26,12 @@ CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \
-DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN \
-Wno-strict-prototypes -O2 $(PROFILE_OPTS)
+ifeq ($(UNAME), Darwin)
+SHARED_FLAG=-dynamiclib -Wl,-single_module
+else
+SHARED_FLAG=-shared
+endif
+
ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
endif
@@ -85,7 +94,7 @@ ifeq ($(SIMVER), x11)
$(OUTPUT): $(OBJS)
@echo "LD $@"
- @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@
+ @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
# 'x' must be kept or you'll have "Win32 error 5"
# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
@@ -101,7 +110,7 @@ ifeq ($(SIMVER), sdl)
$(OUTPUT): $(OBJS)
@echo "LD $@"
- @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@
+ @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
# 'x' must be kept or you'll have "Win32 error 5"
# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
diff --git a/apps/plugins/mpegplayer/Makefile b/apps/plugins/mpegplayer/Makefile
index 46ea76633b..5982884700 100644
--- a/apps/plugins/mpegplayer/Makefile
+++ b/apps/plugins/mpegplayer/Makefile
@@ -12,6 +12,11 @@ INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)
CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \
-DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
+ifeq ($(UNAME), Darwin)
+SHARED_FLAG=-dynamiclib -Wl,-single_module
+else
+SHARED_FLAG=-shared
+endif
ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
@@ -50,7 +55,7 @@ ifeq ($(SIMVER), x11)
$(OUTPUT): $(OBJS)
@echo "LD $<"
- @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@
+ @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
# 'x' must be kept or you'll have "Win32 error 5"
# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
@@ -66,7 +71,7 @@ ifeq ($(SIMVER), sdl)
$(OUTPUT): $(OBJS)
@echo "LD $<"
- @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@
+ @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
# 'x' must be kept or you'll have "Win32 error 5"
# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
diff --git a/apps/plugins/pacbox/Makefile b/apps/plugins/pacbox/Makefile
index 4a5442c25f..fbff8b5109 100644
--- a/apps/plugins/pacbox/Makefile
+++ b/apps/plugins/pacbox/Makefile
@@ -12,6 +12,11 @@ INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)
CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \
-DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
+ifeq ($(UNAME), Darwin)
+SHARED_FLAG=-dynamiclib -Wl,-single_module
+else
+SHARED_FLAG=-shared
+endif
ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
@@ -50,7 +55,7 @@ ifeq ($(SIMVER), x11)
$(OUTPUT): $(OBJS)
@echo "LD $<"
- @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@
+ @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
# 'x' must be kept or you'll have "Win32 error 5"
# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
@@ -66,7 +71,7 @@ ifeq ($(SIMVER), sdl)
$(OUTPUT): $(OBJS)
@echo "LD $<"
- @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@
+ @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
# 'x' must be kept or you'll have "Win32 error 5"
# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
diff --git a/apps/plugins/rockboy/Makefile b/apps/plugins/rockboy/Makefile
index 39e684e143..91fdf67c31 100644
--- a/apps/plugins/rockboy/Makefile
+++ b/apps/plugins/rockboy/Makefile
@@ -16,6 +16,12 @@ ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
endif
+ifeq ($(UNAME), Darwin)
+SHARED_FLAG=-dynamiclib -Wl,-single_module
+else
+SHARED_FLAG=-shared
+endif
+
LINKFILE := $(OBJDIR)/link.lds
DEPFILE = $(OBJDIR)/dep-rockboy
SRC = cpu.c emu.c events.c exports.c fastmem.c hw.c lcd.c lcdc.c loader.c \
@@ -62,7 +68,7 @@ ifeq ($(SIMVER), x11)
$(OUTPUT): $(OBJS)
@echo "LD $@"
- @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@
+ @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
# 'x' must be kept or you'll have "Win32 error 5"
# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
@@ -78,7 +84,7 @@ ifeq ($(SIMVER), sdl)
$(OUTPUT): $(OBJS)
@echo "LD $@"
- @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@
+ @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
# 'x' must be kept or you'll have "Win32 error 5"
# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
diff --git a/apps/plugins/searchengine/Makefile b/apps/plugins/searchengine/Makefile
index 92e9f03991..d397f315f4 100644
--- a/apps/plugins/searchengine/Makefile
+++ b/apps/plugins/searchengine/Makefile
@@ -16,6 +16,12 @@ ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
endif
+ifeq ($(UNAME), Darwin)
+SHARED_FLAG=-dynamiclib -Wl,-single_module
+else
+SHARED_FLAG=-shared
+endif
+
LINKFILE := $(OBJDIR)/link.lds
DEPFILE = $(OBJDIR)/dep-searchengine
SRC = searchengine.c parser.c token.c dbinterface.c
@@ -46,7 +52,7 @@ ifeq ($(SIMVER), x11)
$(OUTPUT): $(OBJS)
@echo "LD $<"
- @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@
+ @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
# 'x' must be kept or you'll have "Win32 error 5"
# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
@@ -62,7 +68,7 @@ ifeq ($(SIMVER), sdl)
$(OUTPUT): $(OBJS)
@echo "LD $<"
- @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@
+ @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
# 'x' must be kept or you'll have "Win32 error 5"
# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
diff --git a/apps/plugins/sudoku/Makefile b/apps/plugins/sudoku/Makefile
index 8a1d8b189d..713d31bcb2 100644
--- a/apps/plugins/sudoku/Makefile
+++ b/apps/plugins/sudoku/Makefile
@@ -17,6 +17,12 @@ ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
endif
+ifeq ($(UNAME), Darwin)
+SHARED_FLAG=-dynamiclib -Wl,-single_module
+else
+SHARED_FLAG=-shared
+endif
+
LINKFILE := $(OBJDIR)/link.lds
DEPFILE = $(OBJDIR)/dep-sudoku
@@ -53,7 +59,7 @@ ifeq ($(SIMVER), x11)
$(OUTPUT): $(OBJS)
@echo "LD $<"
- @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
+ @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
# 'x' must be kept or you'll have "Win32 error 5"
# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
@@ -69,7 +75,7 @@ ifeq ($(SIMVER), sdl)
$(OUTPUT): $(OBJS)
@echo "LD $<"
- @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
+ @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
# 'x' must be kept or you'll have "Win32 error 5"
# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
diff --git a/apps/plugins/zxbox/Makefile b/apps/plugins/zxbox/Makefile
index cb78ce961b..8668c3f4e7 100644
--- a/apps/plugins/zxbox/Makefile
+++ b/apps/plugins/zxbox/Makefile
@@ -12,6 +12,11 @@ INCLUDES = -I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
-DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN $(OPT_FLAGS) $(PROFILE_OPTS)
+ifeq ($(UNAME), Darwin)
+SHARED_FLAG=-dynamiclib -Wl,-single_module
+else
+SHARED_FLAG=-shared
+endif
ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
@@ -59,7 +64,7 @@ ifeq ($(SIMVER), sdl)
$(OUTPUT): $(OBJS)
@echo "LD $<"
- @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@
+ @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
# 'x' must be kept or you'll have "Win32 error 5"
# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
diff --git a/tools/configure b/tools/configure
index 837a107aac..b83b8c7c3c 100755
--- a/tools/configure
+++ b/tools/configure
@@ -149,13 +149,22 @@ simcc () {
fi
;;
+ Darwin)
+ echo "Darwin host detected"
+ # sdl version
+ GCCOPTS="$GCCOPTS `sdl-config --cflags`"
+ LDOPTS="`sdl-config --libs`"
+ use_simsound="#define ROCKBOX_HAS_SIMSOUND 1"
+ echo "Enabled PCM sound playback in simulator"
+ ;;
+
*)
echo "Unsupported system: $uname, fix configure and retry"
exit
;;
esac
- if [ `uname -m` = "x86_64" ]; then
+ if [ "`uname -m`" = "x86_64" ]; then
GCCOPTS="$GCCOPTS -fPIC" # needed to make shared objects link
fi
diff --git a/uisimulator/common/io.c b/uisimulator/common/io.c
index 34bcef483c..c4f8840cc5 100644
--- a/uisimulator/common/io.c
+++ b/uisimulator/common/io.c
@@ -25,6 +25,9 @@
#ifdef __FreeBSD__
#include <sys/param.h>
#include <sys/mount.h>
+#elif defined(__APPLE__)
+#include <sys/param.h>
+#include <sys/mount.h>
#elif !defined(WIN32)
#include <sys/vfs.h>
#endif