summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBarry Wardell <rockbox@barrywardell.net>2006-09-29 16:15:11 +0000
committerBarry Wardell <rockbox@barrywardell.net>2006-09-29 16:15:11 +0000
commit64f949f2954db85968850f6e157e5c3b10df6b7d (patch)
tree14003f384ae848d98473494a74618609ddf04c5f
parentb692fb11b3bb081f51a7bab7351ccbfc78df6617 (diff)
downloadrockbox-64f949f2954db85968850f6e157e5c3b10df6b7d.tar.gz
rockbox-64f949f2954db85968850f6e157e5c3b10df6b7d.zip
Allow UI simulator to be build on OS (Slightly updated version of FS5767)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11094 a1c6a512-1295-4272-9138-f99709370657
-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
164LDOPTS += -lwinmm 164LDOPTS += -lwinmm
165endif 165endif
166 166
167# OS X's ld does not support -Map
168ifeq ($(UNAME), Darwin)
169SIMULATOR_MAP=
170else
171SIMULATOR_MAP=-Wl,-Map,$(OBJDIR)/rockbox.map
172endif
167 173
168$(BUILDDIR)/$(BINARY) : $(OBJS) $(DEPFILE) $(BUILDDIR)/libsim.a \ 174$(BUILDDIR)/$(BINARY) : $(OBJS) $(DEPFILE) $(BUILDDIR)/libsim.a \
169 $(BUILDDIR)/libcomsim.a $(LIBROCKBOX) $(BITMAPLIBS) 175 $(BUILDDIR)/libcomsim.a $(LIBROCKBOX) $(BITMAPLIBS)
170 @echo "LD $(BINARY)" 176 @echo "LD $(BINARY)"
171 $(SILENT)$(CC) $(GCCOPTS) -o $@ $(OBJS) -L$(BUILDDIR) -lrockbox -lsim -lcomsim $(LINKBITMAPS) $(LDOPTS) $(EXTRAOBJ) -Wl,-Map,$(OBJDIR)/rockbox.map 177 $(SILENT)$(CC) $(GCCOPTS) -o $@ $(OBJS) -L$(BUILDDIR) -lrockbox -lsim -lcomsim $(LINKBITMAPS) $(LDOPTS) $(EXTRAOBJ) $(SIMULATOR_MAP)
172
173endif 178endif
174 179
175$(BUILDDIR)/rockbox.ucl: $(OBJDIR)/rockbox.bin 180$(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 @@
1#if defined(SIMULATOR) && defined(__APPLE__)
2osx.dummy.bmp
3#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 @@
1#if defined(SIMULATOR) && defined(__APPLE__)
2osx.dummy.bmp
3#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 \
12CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(TARGET) $(EXTRA_DEFINES) \ 12CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(TARGET) $(EXTRA_DEFINES) \
13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DCODEC 13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DCODEC
14 14
15ifeq ($(UNAME), Darwin)
16SHARED_FLAG=-dynamiclib -Wl,-single_module
17else
18SHARED_FLAG=-shared
19endif
20
15ifdef APPEXTRA 21ifdef APPEXTRA
16 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) 22 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
17endif 23endif
@@ -80,7 +86,7 @@ ifeq ($(SIMVER), x11)
80 86
81$(OBJDIR)/%.codec : $(OBJDIR)/%.o $(BUILDDIR)/libcodec.a $(OUTPUT) 87$(OBJDIR)/%.codec : $(OBJDIR)/%.o $(BUILDDIR)/libcodec.a $(OUTPUT)
82 @echo "LD $(notdir $@)" 88 @echo "LD $(notdir $@)"
83 $(SILENT)$(CC) $(CFLAGS) -shared $< -L$(BUILDDIR) $(CODECLIBS) -lcodec -o $@ 89 $(SILENT)$(CC) $(CFLAGS) $(SHARED_FLAG) $< -L$(BUILDDIR) $(CODECLIBS) -lcodec -o $@
84ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 90ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
85# 'x' must be kept or you'll have "Win32 error 5" 91# 'x' must be kept or you'll have "Win32 error 5"
86# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 92# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
@@ -96,7 +102,7 @@ ifeq ($(SIMVER), sdl)
96 102
97$(OBJDIR)/%.codec : $(OBJDIR)/%.o $(BUILDDIR)/libcodec.a $(OUTPUT) 103$(OBJDIR)/%.codec : $(OBJDIR)/%.o $(BUILDDIR)/libcodec.a $(OUTPUT)
98 @echo "LD $(notdir $@) $^" 104 @echo "LD $(notdir $@) $^"
99 $(SILENT)$(CC) $(CFLAGS) -shared $< -L$(BUILDDIR) $(CODECLIBS) -lcodec -o $@ 105 $(SILENT)$(CC) $(CFLAGS) $(SHARED_FLAG) $< -L$(BUILDDIR) $(CODECLIBS) -lcodec -o $@
100ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 106ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
101# 'x' must be kept or you'll have "Win32 error 5" 107# 'x' must be kept or you'll have "Win32 error 5"
102# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 108# $ 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
13CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \ 13CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
14 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN 14 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
15 15
16ifeq ($(UNAME), Darwin)
17SHARED_FLAG=-dynamiclib -Wl,-single_module
18else
19SHARED_FLAG=-shared
20endif
21
16ifdef APPEXTRA 22ifdef APPEXTRA
17 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) 23 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
18endif 24endif
@@ -96,7 +102,7 @@ ifeq ($(SIMVER), x11)
96 102
97$(OBJDIR)/%.rock : $(OBJDIR)/%.o $(BUILDDIR)/libplugin.a $(BITMAPLIBS) 103$(OBJDIR)/%.rock : $(OBJDIR)/%.o $(BUILDDIR)/libplugin.a $(BITMAPLIBS)
98 @echo "LD "`basename $@` 104 @echo "LD "`basename $@`
99 $(SILENT)$(CC) $(CFLAGS) -shared $< -L$(BUILDDIR) $(CODECLIBS) -lplugin $(LINKBITMAPS) -o $@ 105 $(SILENT)$(CC) $(CFLAGS) $(SHARED_FLAG) $< -L$(BUILDDIR) $(CODECLIBS) -lplugin $(LINKBITMAPS) -o $@
100ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 106ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
101# 'x' must be kept or you'll have "Win32 error 5" 107# 'x' must be kept or you'll have "Win32 error 5"
102# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 108# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
@@ -112,7 +118,7 @@ ifeq ($(SIMVER), sdl)
112 118
113$(OBJDIR)/%.rock : $(OBJDIR)/%.o $(BUILDDIR)/libplugin.a $(BITMAPLIBS) 119$(OBJDIR)/%.rock : $(OBJDIR)/%.o $(BUILDDIR)/libplugin.a $(BITMAPLIBS)
114 @echo "LD "`basename $@` 120 @echo "LD "`basename $@`
115 $(SILENT)$(CC) $(CFLAGS) -shared $< -L$(BUILDDIR) $(CODECLIBS) -lplugin $(LINKBITMAPS) -o $@ 121 $(SILENT)$(CC) $(CFLAGS) $(SHARED_FLAG) $< -L$(BUILDDIR) $(CODECLIBS) -lplugin $(LINKBITMAPS) -o $@
116ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 122ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
117# 'x' must be kept or you'll have "Win32 error 5" 123# 'x' must be kept or you'll have "Win32 error 5"
118# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 124# $ 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)
12CFLAGS = $(GCCOPTS) -O2 $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \ 12CFLAGS = $(GCCOPTS) -O2 $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \
13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN 13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
14 14
15ifeq ($(UNAME), Darwin)
16SHARED_FLAG=-dynamiclib -Wl,-single_module
17else
18SHARED_FLAG=-shared
19endif
20
15ifdef APPEXTRA 21ifdef APPEXTRA
16 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) 22 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
17endif 23endif
@@ -55,7 +61,7 @@ ifeq ($(SIMVER), x11)
55 61
56$(OUTPUT): $(OBJS) 62$(OUTPUT): $(OBJS)
57 @echo "LD $<" 63 @echo "LD $<"
58 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@ 64 @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
59ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 65ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
60# 'x' must be kept or you'll have "Win32 error 5" 66# 'x' must be kept or you'll have "Win32 error 5"
61# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 67# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
@@ -71,7 +77,7 @@ ifeq ($(SIMVER), sdl)
71 77
72$(OUTPUT): $(OBJS) 78$(OUTPUT): $(OBJS)
73 @echo "LD $<" 79 @echo "LD $<"
74 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@ 80 @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
75ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 81ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
76# 'x' must be kept or you'll have "Win32 error 5" 82# 'x' must be kept or you'll have "Win32 error 5"
77# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 83# $ 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)
12CFLAGS = $(INCLUDES) $(GCCOPTS) -O3 $(TARGET) $(EXTRA_DEFINES) \ 12CFLAGS = $(INCLUDES) $(GCCOPTS) -O3 $(TARGET) $(EXTRA_DEFINES) \
13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN 13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
14 14
15ifeq ($(UNAME), Darwin)
16SHARED_FLAG=-dynamiclib -Wl,-single_module
17else
18SHARED_FLAG=-shared
19endif
20
15ifdef APPEXTRA 21ifdef APPEXTRA
16 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) 22 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
17endif 23endif
@@ -46,7 +52,7 @@ ifeq ($(SIMVER), x11)
46 52
47$(OUTPUT): $(OBJS) 53$(OUTPUT): $(OBJS)
48 @echo "LD $<" 54 @echo "LD $<"
49 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@ 55 @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
50ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 56ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
51# 'x' must be kept or you'll have "Win32 error 5" 57# 'x' must be kept or you'll have "Win32 error 5"
52# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 58# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
@@ -62,7 +68,7 @@ ifeq ($(SIMVER), sdl)
62 68
63$(OUTPUT): $(OBJS) 69$(OUTPUT): $(OBJS)
64 @echo "LD $<" 70 @echo "LD $<"
65 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@ 71 @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
66ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 72ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
67# 'x' must be kept or you'll have "Win32 error 5" 73# 'x' must be kept or you'll have "Win32 error 5"
68# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 74# $ 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 @@
3# $Id$ 3# $Id$
4# 4#
5# $Log$ 5# $Log$
6# Revision 1.4 2006/07/27 13:27:19 linus 6# Revision 1.5 2006/09/29 16:15:08 barrywardell
7# Allow UI simulator to be build on OS (Slightly updated version of FS5767)
8#
9# Revision 1.4 2006-07-27 13:27:19 linus
7# Moved the X5 button driver to the target tree 10# Moved the X5 button driver to the target tree
8# 11#
9# Revision 1.3 2006-04-14 21:07:56 kkurbjun 12# Revision 1.3 2006-04-14 21:07:56 kkurbjun
@@ -23,6 +26,12 @@ CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \
23 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN \ 26 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN \
24 -Wno-strict-prototypes -O2 $(PROFILE_OPTS) 27 -Wno-strict-prototypes -O2 $(PROFILE_OPTS)
25 28
29ifeq ($(UNAME), Darwin)
30SHARED_FLAG=-dynamiclib -Wl,-single_module
31else
32SHARED_FLAG=-shared
33endif
34
26ifdef APPEXTRA 35ifdef APPEXTRA
27 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) 36 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
28endif 37endif
@@ -85,7 +94,7 @@ ifeq ($(SIMVER), x11)
85 94
86$(OUTPUT): $(OBJS) 95$(OUTPUT): $(OBJS)
87 @echo "LD $@" 96 @echo "LD $@"
88 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@ 97 @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
89ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 98ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
90# 'x' must be kept or you'll have "Win32 error 5" 99# 'x' must be kept or you'll have "Win32 error 5"
91# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 100# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
@@ -101,7 +110,7 @@ ifeq ($(SIMVER), sdl)
101 110
102$(OUTPUT): $(OBJS) 111$(OUTPUT): $(OBJS)
103 @echo "LD $@" 112 @echo "LD $@"
104 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@ 113 @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
105ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 114ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
106# 'x' must be kept or you'll have "Win32 error 5" 115# 'x' must be kept or you'll have "Win32 error 5"
107# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 116# $ 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)
12CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \ 12CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \
13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN 13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
14 14
15ifeq ($(UNAME), Darwin)
16SHARED_FLAG=-dynamiclib -Wl,-single_module
17else
18SHARED_FLAG=-shared
19endif
15 20
16ifdef APPEXTRA 21ifdef APPEXTRA
17 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) 22 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
@@ -50,7 +55,7 @@ ifeq ($(SIMVER), x11)
50 55
51$(OUTPUT): $(OBJS) 56$(OUTPUT): $(OBJS)
52 @echo "LD $<" 57 @echo "LD $<"
53 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@ 58 @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
54ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 59ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
55# 'x' must be kept or you'll have "Win32 error 5" 60# 'x' must be kept or you'll have "Win32 error 5"
56# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 61# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
@@ -66,7 +71,7 @@ ifeq ($(SIMVER), sdl)
66 71
67$(OUTPUT): $(OBJS) 72$(OUTPUT): $(OBJS)
68 @echo "LD $<" 73 @echo "LD $<"
69 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@ 74 @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
70ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 75ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
71# 'x' must be kept or you'll have "Win32 error 5" 76# 'x' must be kept or you'll have "Win32 error 5"
72# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 77# $ 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)
12CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \ 12CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \
13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN 13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
14 14
15ifeq ($(UNAME), Darwin)
16SHARED_FLAG=-dynamiclib -Wl,-single_module
17else
18SHARED_FLAG=-shared
19endif
15 20
16ifdef APPEXTRA 21ifdef APPEXTRA
17 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) 22 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
@@ -50,7 +55,7 @@ ifeq ($(SIMVER), x11)
50 55
51$(OUTPUT): $(OBJS) 56$(OUTPUT): $(OBJS)
52 @echo "LD $<" 57 @echo "LD $<"
53 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@ 58 @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
54ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 59ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
55# 'x' must be kept or you'll have "Win32 error 5" 60# 'x' must be kept or you'll have "Win32 error 5"
56# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 61# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
@@ -66,7 +71,7 @@ ifeq ($(SIMVER), sdl)
66 71
67$(OUTPUT): $(OBJS) 72$(OUTPUT): $(OBJS)
68 @echo "LD $<" 73 @echo "LD $<"
69 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@ 74 @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
70ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 75ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
71# 'x' must be kept or you'll have "Win32 error 5" 76# 'x' must be kept or you'll have "Win32 error 5"
72# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 77# $ 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
16 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) 16 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
17endif 17endif
18 18
19ifeq ($(UNAME), Darwin)
20SHARED_FLAG=-dynamiclib -Wl,-single_module
21else
22SHARED_FLAG=-shared
23endif
24
19LINKFILE := $(OBJDIR)/link.lds 25LINKFILE := $(OBJDIR)/link.lds
20DEPFILE = $(OBJDIR)/dep-rockboy 26DEPFILE = $(OBJDIR)/dep-rockboy
21SRC = cpu.c emu.c events.c exports.c fastmem.c hw.c lcd.c lcdc.c loader.c \ 27SRC = 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)
62 68
63$(OUTPUT): $(OBJS) 69$(OUTPUT): $(OBJS)
64 @echo "LD $@" 70 @echo "LD $@"
65 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@ 71 @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
66ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 72ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
67# 'x' must be kept or you'll have "Win32 error 5" 73# 'x' must be kept or you'll have "Win32 error 5"
68# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 74# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
@@ -78,7 +84,7 @@ ifeq ($(SIMVER), sdl)
78 84
79$(OUTPUT): $(OBJS) 85$(OUTPUT): $(OBJS)
80 @echo "LD $@" 86 @echo "LD $@"
81 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@ 87 @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
82ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 88ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
83# 'x' must be kept or you'll have "Win32 error 5" 89# 'x' must be kept or you'll have "Win32 error 5"
84# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 90# $ 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
16 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) 16 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
17endif 17endif
18 18
19ifeq ($(UNAME), Darwin)
20SHARED_FLAG=-dynamiclib -Wl,-single_module
21else
22SHARED_FLAG=-shared
23endif
24
19LINKFILE := $(OBJDIR)/link.lds 25LINKFILE := $(OBJDIR)/link.lds
20DEPFILE = $(OBJDIR)/dep-searchengine 26DEPFILE = $(OBJDIR)/dep-searchengine
21SRC = searchengine.c parser.c token.c dbinterface.c 27SRC = searchengine.c parser.c token.c dbinterface.c
@@ -46,7 +52,7 @@ ifeq ($(SIMVER), x11)
46 52
47$(OUTPUT): $(OBJS) 53$(OUTPUT): $(OBJS)
48 @echo "LD $<" 54 @echo "LD $<"
49 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@ 55 @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
50ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 56ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
51# 'x' must be kept or you'll have "Win32 error 5" 57# 'x' must be kept or you'll have "Win32 error 5"
52# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 58# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
@@ -62,7 +68,7 @@ ifeq ($(SIMVER), sdl)
62 68
63$(OUTPUT): $(OBJS) 69$(OUTPUT): $(OBJS)
64 @echo "LD $<" 70 @echo "LD $<"
65 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@ 71 @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
66ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 72ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
67# 'x' must be kept or you'll have "Win32 error 5" 73# 'x' must be kept or you'll have "Win32 error 5"
68# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 74# $ 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
17 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) 17 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
18endif 18endif
19 19
20ifeq ($(UNAME), Darwin)
21SHARED_FLAG=-dynamiclib -Wl,-single_module
22else
23SHARED_FLAG=-shared
24endif
25
20LINKFILE := $(OBJDIR)/link.lds 26LINKFILE := $(OBJDIR)/link.lds
21DEPFILE = $(OBJDIR)/dep-sudoku 27DEPFILE = $(OBJDIR)/dep-sudoku
22 28
@@ -53,7 +59,7 @@ ifeq ($(SIMVER), x11)
53 59
54$(OUTPUT): $(OBJS) 60$(OUTPUT): $(OBJS)
55 @echo "LD $<" 61 @echo "LD $<"
56 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@ 62 @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
57ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 63ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
58# 'x' must be kept or you'll have "Win32 error 5" 64# 'x' must be kept or you'll have "Win32 error 5"
59# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 65# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
@@ -69,7 +75,7 @@ ifeq ($(SIMVER), sdl)
69 75
70$(OUTPUT): $(OBJS) 76$(OUTPUT): $(OBJS)
71 @echo "LD $<" 77 @echo "LD $<"
72 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@ 78 @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin $(LINKBITMAPS) -o $@
73ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 79ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
74# 'x' must be kept or you'll have "Win32 error 5" 80# 'x' must be kept or you'll have "Win32 error 5"
75# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 81# $ 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 \
12CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \ 12CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET) $(EXTRA_DEFINES) \
13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN $(OPT_FLAGS) $(PROFILE_OPTS) 13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN $(OPT_FLAGS) $(PROFILE_OPTS)
14 14
15ifeq ($(UNAME), Darwin)
16SHARED_FLAG=-dynamiclib -Wl,-single_module
17else
18SHARED_FLAG=-shared
19endif
15 20
16ifdef APPEXTRA 21ifdef APPEXTRA
17 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) 22 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
@@ -59,7 +64,7 @@ ifeq ($(SIMVER), sdl)
59 64
60$(OUTPUT): $(OBJS) 65$(OUTPUT): $(OBJS)
61 @echo "LD $<" 66 @echo "LD $<"
62 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@ 67 @$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -o $@
63ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN) 68ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
64# 'x' must be kept or you'll have "Win32 error 5" 69# 'x' must be kept or you'll have "Win32 error 5"
65# $ fgrep 5 /usr/include/w32api/winerror.h | head -1 70# $ 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 () {
149 fi 149 fi
150 ;; 150 ;;
151 151
152 Darwin)
153 echo "Darwin host detected"
154 # sdl version
155 GCCOPTS="$GCCOPTS `sdl-config --cflags`"
156 LDOPTS="`sdl-config --libs`"
157 use_simsound="#define ROCKBOX_HAS_SIMSOUND 1"
158 echo "Enabled PCM sound playback in simulator"
159 ;;
160
152 *) 161 *)
153 echo "Unsupported system: $uname, fix configure and retry" 162 echo "Unsupported system: $uname, fix configure and retry"
154 exit 163 exit
155 ;; 164 ;;
156 esac 165 esac
157 166
158 if [ `uname -m` = "x86_64" ]; then 167 if [ "`uname -m`" = "x86_64" ]; then
159 GCCOPTS="$GCCOPTS -fPIC" # needed to make shared objects link 168 GCCOPTS="$GCCOPTS -fPIC" # needed to make shared objects link
160 fi 169 fi
161 170
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 @@
25#ifdef __FreeBSD__ 25#ifdef __FreeBSD__
26#include <sys/param.h> 26#include <sys/param.h>
27#include <sys/mount.h> 27#include <sys/mount.h>
28#elif defined(__APPLE__)
29#include <sys/param.h>
30#include <sys/mount.h>
28#elif !defined(WIN32) 31#elif !defined(WIN32)
29#include <sys/vfs.h> 32#include <sys/vfs.h>
30#endif 33#endif