release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Search | Go
Wiki > Main > UiSimulator > UiSimulatorWindows
Here you can find detailed explanation of problems arising when building UIsimulator using MinGW and gcc under MS Windows and how to solve these problems.

There are several difficulties when using MinGW:
  • perl's fork doesn't work properly here thus making load balancing between CPU cores impossible (thanks to Zagor for explanation)
  • command line length is limited thus breaking dependency generation
  • default perl (I have v5.10.0) doesn't correctly treat '-s' option thus breaking genlang tool
  • svnversion tool may not be available in your setup

Therefore few things should be done manually. We should disable multigcc.pl tool, and use response file to save on command line length.

Index: tools/functions.make
===================================================================
--- tools/functions.make (revision 29245)
+++ tools/functions.make (working copy)
@@ -31,7 +31,7 @@
 c2obj = $(addsuffix .o,$(basename $(subst $(ROOTDIR),$(BUILDDIR),$(1))))
 
 # calculate dependencies for a list of source files $(2) and output them to $(1)
-mkdepfile = $(SILENT)perl $(TOOLSDIR)/multigcc.pl $(CC) $(PPCFLAGS) $(OTHER_INC) -MG -MM -include config.h -- $(2) | \
+mkdepfile = $(SILENT)echo $(PPCFLAGS) $(OTHER_INC) -MG -MM -include config.h > rsp && $(SILENT)$(CC) @rsp $(2) | \
  sed -e "s: lang.h: lang/lang.h:" \
  -e 's:_asmdefs.o:_asmdefs.h:' \
  -e "s: max_language_size.h: lang/max_language_size.h:" | \

To overcome difficulties with genlang tool, I suggest to give a try to another perl installation that supposedly will handle '-s' option correctly. I have strawberry perl installed and I added this c:/strawberry/perl /perl into my /etc/fstab

Index: apps/lang/lang.make
===================================================================
--- apps/lang/lang.make (revision 29245)
+++ apps/lang/lang.make (working copy)
@@ -29,7 +29,7 @@
 
 $(BUILDDIR)/lang/lang_core.o: $(APPSDIR)/lang/$(LANGUAGE).lang $(BUILDDIR)/apps/features
  $(SILENT)for f in cat $(BUILDDIR)/apps/features; do feat="$$feat:$$f" ; done; \
-  perl -s $(TOOLSDIR)/genlang -p=$(BUILDDIR)/lang -t=$(MODELNAME)$$feat $<
+  /perl/bin/perl -s $(TOOLSDIR)/genlang -p=$(BUILDDIR)/lang -t=$(MODELNAME)$$feat $<
  $(call PRINTS,CC lang_core.c)$(CC) $(CFLAGS) -c $(BUILDDIR)/lang/lang_core.c -o $@
 
 $(BUILDDIR)/lang/lang.h: $(BUILDDIR)/lang/lang_core.o
@@ -37,4 +37,4 @@
 $(BUILDDIR)/%.lng : $(ROOTDIR)/%.lang $(BUILDDIR)/apps/genlang-features
  $(call PRINTS,GENLANG $(subst $(ROOTDIR)/,,$<))
  $(SILENT)mkdir -p $(dir $@)
- $(SILENT)$(TOOLSDIR)/genlang -e=$(APPSDIR)/lang/english.lang -t=$(MODELNAME):cat $(BUILDDIR)/apps/genlang-features -i=$(TARGET_ID) -b=$@ $<
+ $(SILENT)/perl/bin/perl -s $(TOOLSDIR)/genlang -e=$(APPSDIR)/lang/english.lang -t=$(MODELNAME):cat $(BUILDDIR)/apps/genlang-features -i=$(TARGET_ID) -b=$@ $<

Fix this artifact as well

Index: apps/apps.make
===================================================================
--- apps/apps.make (revision 29245)
+++ apps/apps.make (working copy)
@@ -27,7 +27,7 @@
  $(call PRINTS,PP $(<F))
  $(SILENT)$(CC) $(PPCFLAGS) \
                  -E -P -imacros "config.h" -imacros "button.h" -x c $< | \
-  grep -v "^\#" | grep -v "^ *$$" > $(BUILDDIR)/apps/features; \
+  grep -v "^\#" | grep -v "^ *$$" > $(BUILDDIR)/apps/features
 
 $(BUILDDIR)/apps/genlang-features:  $(BUILDDIR)/apps/features
  $(call PRINTS,GEN $(subst $(BUILDDIR)/,,$@))tr \n : < $< > $@

If you don't have svnversion script, create version.h file in your build directory with the following content
extern const char rbversion[];
#define RBVERSION "sim"

This will prevent $rbdir in buildzip.pl to become a rockbox without first dot
Index: buildzip.pl
===================================================================
--- buildzip.pl (revision 29286)
+++ buildzip.pl (working copy)
@@ -685,7 +685,7 @@
     $app = ($modelname eq "application");
     unless ($app) {
         #rbdir starts with '/', strip it
-        $rbdir = substr($rbdir, 1);
+#        $rbdir = substr($rbdir, 1);
     }
 
     # build a full install .rockbox ($rbdir) directory

For some reason few files are not generated automatically. Therefore here is the sequence I used
../tools/configure
make $PWD/lang/lang.h
make $PWD/bitmaps/rockboxlogo.h
make $PWD/sysfont.h
make $PWD/lang/max_language_size.h
make $PWD/credits.raw
make
make install

-- MikhailTitov - 09 Feb 2011

r4 - 02 Apr 2021 - 20:46:07 - UnknownUser


Parents: UiSimulator
Copyright © by the contributing authors.