summaryrefslogtreecommitdiff
path: root/uisimulator
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-02-19 14:20:16 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-02-19 14:20:16 +0000
commit3a25735aa12dd3260ce657fd4e3315e08a4cf832 (patch)
tree69fb06309a0c07a9b80f7198b7484081274382b0 /uisimulator
parent572ced56cf4a0b2e00153882ccf1c13aac1f760e (diff)
Henrik Backe's fixes to enable the simulator to build with cygwin.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3293 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/win32/Makefile42
-rw-r--r--uisimulator/win32/lcd-win32.c2
-rw-r--r--uisimulator/win32/panic-win32.c2
-rw-r--r--uisimulator/win32/sprintf.h2
-rw-r--r--uisimulator/win32/uisw32.c1
5 files changed, 37 insertions, 12 deletions
diff --git a/uisimulator/win32/Makefile b/uisimulator/win32/Makefile
index c81b88c809..05c2729ff6 100644
--- a/uisimulator/win32/Makefile
+++ b/uisimulator/win32/Makefile
@@ -41,8 +41,6 @@ EXPORT = $(FIRMWAREDIR)/export
TOOLSDIR = ../../tools
DOCSDIR = ../../docs
-CC = i386-mingw32msvc-gcc
-WINDRES = i386-mingw32msvc-windres
RM = rm -f
DEBUG = -g
@@ -52,10 +50,10 @@ LANGUAGE = english
TARGET = $(OBJDIR)/uisw32.exe
-DEFINES = -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \
+DEFINES = -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR -DNOCYGWIN \
$(KEYPAD) $(DISPLAY) -DAPPSVERSION=\"$(VERSION)\" $(EXTRA_DEFINES) $(RTC)
-LDFLAGS = -lgdi32 -luser32 -mwindows
+LDFLAGS = -lgdi32 -luser32
# Use this for simulator-only files
INCLUDES = -I. -I$(EXPORT) -I$(APPDIR) -I$(MACHINEDIR) -I../common -I$(MACHINEDIR) -I$(OBJDIR)
@@ -65,17 +63,32 @@ APPINCLUDES = $(INCLUDES)
DEFINES += -DWIN32
-CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) -W -Wall -mwindows
+CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) -W -Wall -mno-cygwin
-APPCFLAGS = $(DEBUG) $(DEFINES) $(APPINCLUDES) -W -Wall -mwindows
+APPCFLAGS = $(DEBUG) $(DEFINES) $(APPINCLUDES) -W -Wall -mno-cygwin
+
+UNAME := $(shell uname)
+ifeq ($(UNAME),CYGWIN_NT-5.1)
+ CC = gcc
+ WINDRES = windres
+ DEFINES += -DNOCYGWIN
+ CFLAGS += -mno-cygwin
+ LDFLAGS += -mno-cygwin
+ APPCFLAGS += -mno-cygwin
+else
+ CC = i386-mingw32msvc-gcc
+ WINDRES = i386-mingw32msvc-windres
+ CFLAGS += -mwindows
+ LDFLAGS += -mwindows
+ APPCFLAGS += -mwindows
+endif
ifeq ($(DISPLAY),-DHAVE_LCD_BITMAP)
- LCDSRSC = lcd-recorder.c
+ LCDSRSC = lcd-recorder.c sysfont.c font.c
else
- LCDSRSC = lcd-playersim.c lcd-player.c
+ LCDSRSC = lcd-playersim.c lcd-player.c lcd-player-charset.c font-player.c
endif
-FIRMSRCS = $(LCDSRSC) power.c sprintf.c id3.c usb.c \
- mpeg.c powermgmt.c font.c sysfont.c
+FIRMSRCS = $(LCDSRSC) id3.c usb.c mpeg.c powermgmt.c power.c
APPS = main.c tree.c menu.c credits.c main_menu.c icons.c language.c \
playlist.c wps.c wps-display.c settings.c status.c \
@@ -205,9 +218,15 @@ $(OBJDIR)/power.o: $(DRIVERS)/power.c
$(OBJDIR)/usb.o: $(FIRMWAREDIR)/usb.c
$(CC) $(APPCFLAGS) -c $< -o $@
+$(OBJDIR)/panic.o: $(FIRMWAREDIR)/panic.c
+ $(CC) $(APPCFLAGS) -c $< -o $@
+
$(OBJDIR)/powermgmt.o: $(FIRMWAREDIR)/powermgmt.c
$(CC) $(APPCFLAGS) -c $< -o $@
+$(OBJDIR)/lcd-player-charset.o: $(DRIVERS)/lcd-player-charset.c
+ $(CC) $(CFLAGS) -c $< -o $@
+
$(OBJDIR)/settings.o: $(APPDIR)/settings.c
$(CC) $(APPCFLAGS) -c $< -o $@
@@ -251,6 +270,9 @@ $(OBJDIR)/strtok.o: $(COMMON)/strtok.c
$(OBJDIR)/stubs.o: ../common/stubs.c
$(CC) $(CFLAGS) -c $< -o $@
+$(OBJDIR)/font-player.o: ../common/font-player.c
+ $(CC) $(CFLAGS) -c $< -o $@
+
$(OBJDIR)/sim_icons.o: ../common/sim_icons.c
$(CC) $(CFLAGS) -c $< -o $@
diff --git a/uisimulator/win32/lcd-win32.c b/uisimulator/win32/lcd-win32.c
index 6ab7df8409..0ce68572d2 100644
--- a/uisimulator/win32/lcd-win32.c
+++ b/uisimulator/win32/lcd-win32.c
@@ -22,7 +22,7 @@
#include "uisw32.h"
#include "lcd.h"
-extern unsigned char lcd_framebuffer[LCD_WIDTH][LCD_HEIGHT/8]; /* the display */
+unsigned char lcd_framebuffer[LCD_WIDTH][LCD_HEIGHT/8]; /* the display */
char bitmap[LCD_HEIGHT][LCD_WIDTH]; /* the ui display */
BITMAPINFO2 bmi =
diff --git a/uisimulator/win32/panic-win32.c b/uisimulator/win32/panic-win32.c
index ff644a7761..614510f3a8 100644
--- a/uisimulator/win32/panic-win32.c
+++ b/uisimulator/win32/panic-win32.c
@@ -40,4 +40,4 @@ void panicf( char *fmt, ...)
wsprintf( panic_buf, fmt, ap );
va_end( ap );
panic( panic_buf );
-} \ No newline at end of file
+}
diff --git a/uisimulator/win32/sprintf.h b/uisimulator/win32/sprintf.h
index ecbbc8a419..4e4bf25fc1 100644
--- a/uisimulator/win32/sprintf.h
+++ b/uisimulator/win32/sprintf.h
@@ -24,6 +24,8 @@
#include <stdarg.h>
int snprintf (char *buf, size_t size, const char *fmt, ...);
+#ifndef NOCYGWIN
int vsnprintf (char *buf, int size, const char *fmt, va_list ap);
+#endif
#endif /* __SPRINTF_H__ */
diff --git a/uisimulator/win32/uisw32.c b/uisimulator/win32/uisw32.c
index 6722422a0d..b4747b138e 100644
--- a/uisimulator/win32/uisw32.c
+++ b/uisimulator/win32/uisw32.c
@@ -41,6 +41,7 @@ PBYTE lpKeys;
bool bActive; // window active?
HANDLE hGUIThread; // thread for GUI
+bool lcd_display_redraw=true; // Used for player simulator
char having_new_lcd=true; // Used for player simulator
// GUIWndProc