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
This commit is contained in:
Barry Wardell 2006-09-29 16:15:11 +00:00
parent b692fb11b3
commit 64f949f295
18 changed files with 114 additions and 25 deletions

View file

@ -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

View file

@ -0,0 +1,3 @@
#if defined(SIMULATOR) && defined(__APPLE__)
osx.dummy.bmp
#endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 B

View file

@ -0,0 +1,3 @@
#if defined(SIMULATOR) && defined(__APPLE__)
osx.dummy.bmp
#endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 B

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

11
tools/configure vendored
View file

@ -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

View file

@ -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