Minimo build instructions (for windows mobile 6)
We have a couple of HTC TyTN II / Kaiser / Tilt.
Preparation
You need the following stuff installed:
- cygwin
- Dependencies for a normal mozilla build
- Microsoft Visual Studio 8
- Microsoft Platform SDK
- Windows Mobile 6 SDK
Next you will need to setup a build directory, e.g.
; mkdir C:\devel
; cat << EOF > minimo_env.bat
@echo off
rem This cmd script is for setting up the minimo build on windows.
rem You might want to change the values to fit your system.
set HOME=C:\devel
set MOZ_TOOLS=C:/mozilla-build/moztools
set WINCE_TOOLS=C:\devel\mozilla\build\wince\tools\vs8ppc2003arm\
set PATH=%MOZ_TOOLS%/bin;%PATH%;C:\cygwin\bin;%WINCE_TOOLS%
set GLIB_PREFIX=%MOZ_TOOLS%
set LIBIDL_PREFIX=%MOZ_TOOLS%
set INCLUDE=%GLIB_PREFIX%\include
set LIB=%GLIB_PREFIX%\lib
call "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat"
EOF
; minimo_env.bat
Now proceed with the next step. DON’T FOLLOW THE MOZILLA BUILD INSTRUCTIONS to build it in the cygwin environment, it didn’t worked for us. Just build it inside the cmd terminal.
Getting the source code
; cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot login
(use anonymous as password)
; cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -r MOZILLA_1_8_BRANCH mozilla/client.mk
; cd mozilla
; cat << EOF > .mozconfig
mk_add_options MOZ_CO_TAG=MOZILLA_1_8_BRANCH
mk_add_options NSPR_CO_TAG=NSPRPUB_WINCE_04122006_BRANCH
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-dir-minimo-8-opt
mk_add_options MOZ_CO_PROJECT=minimo
ac_add_options --enable-application=minimo
CROSS_COMPILE=1
CXX=arm-wince-gcc
LD=arm-wince-link
AR=arm-wince-lib
AS=arm-wince-as
mk_add_options AR=arm-wince-lib
ac_add_options --target=arm-wince
ac_add_options --enable-win32-target=WINCE
ac_add_options --enable-default-toolkit=windows
WINCE=1
mk_add_options WINCE=1
TARGET_DEVICE=device
mk_add_options TARGET_DEVICE=device
# code generation options (optimize for size)
ac_add_options --enable-strip
ac_add_options --enable-debug
ac_add_options --enable-plugins
# enable static build
ac_add_options --disable-shared
ac_add_options --enable-static
ac_add_options --disable-crypto
EOF
; make -f client.mk pull_all
Some hacks necessary to workaround a couple of bugs in the mozilla build system
For some odd reason, the arm-wince-lib binary wrapper for the Microsoft linker for arm always names the library file with the same prefix as the first object file, e.g.
; arm-wince-lib -OUT:foo.lib bar.obj baz.obj
does not create foo.lib, but bar.lib, so we need to hack around this issue.
; cat << EOF > C:\devel\mozilla\build\minimo_rules.mk.patch
diff -r3.487.2.9 rules.mk
954a955
> @mvv $(AR_FLAGS) $(OBJS)
EOF
; cd C:\devel\mozilla\config
; patch -p0 < C:\devel\minimo_rules.mk.patch
; cat << EOF > C:\devel\build\wince\tools\vs8ppc2003arm\mvv
#!/bin/sh
if test -f `echo $1 | sed 's/.OUT.//'`
then
:
else
mv `echo $2 | sed 's/.obj$//'`.lib `echo $1 | sed 's/.OUT.//'`
fi
EOF
; chmod a+x C:\devel\mozilla\build\wince\tools\vs8ppc2003arm\mvv
Ready to build
; make -f client.mk build_all
Troubleshooting
When the host_xpidl.exe is linked there might be the need to repeat the linking command in your cmd terminal again, because the mozilla build toolchain gets confused by the %MOZ_TOOLS% environment variable which contains pointers to the libIDL and libglib library files. Don’t get discouraged when typing the command again. This is the only manual step which might be necessary after all preparation.
Installation
; cd C:\devel\mozilla\obj-dir-minimo-8-opt\minimo\base
; make package
Afterwards you will find the minimo package in
C:\devel\mozilla\obj-dir-minimo-8-opt\dist\minimo
Copy that to the mobile device and enjoy minimo.
Minimo build instructions (for win32, not windows mobile 6)
Getting the source
First, get hold of the mozilla tools and setup as described in the Mozilla Build Documentation
Get hold of the latest firefox 2 source code. This is easiest done as a release tarball. The version currently in use is firefox-2.0.0.10-source.tar.bz2.
Checkout the minimo source from Mozilla CVS:
make -f client.mk checkout MOZ_CO_PROJECT=minimo
If building with Visual Studio 2005, or VC++ 8, then there are a few issues to resolve as the 1.x source tree is set up to be built by MSVC 2003. See the Mozilla VC8 Build Instructions for discussion.
Build configuration
If using VC++ 8 Express, then the .mozconfig options must include:
ac_add_options --disable-activex
ac_add_options --disable-activex-scripting
ac_add_options --disable-xpconnect-idispatch
ac_add_options --disable-tests
Most of what you need is taken care of by the modified mozconfig file(s).
Build
To build, do:
make -f client.mk build
If on VC8, the build may well fail with a message that msvcr80.dll could not be found. If this happens, it is because the manifest file for the relevant .exe or .dll is missing.
It might be necessary to copy the following manifests into the /dis/bin/ directory:
<obj>/xpcom/typelib/xpidl/xpidl.exe.manifest
<obj>/xpcom/typelib/xpt/tools/xpt_dump.exe.manifest
<obj>/xpcom/typelib/xpt/tools/xpt_link.exe.manifest
and remake.
To run the resulting executable, use the version in the /dist/bin/ folder.
It may also be necessary to copy the .manifest from /minimo/base/minimo.exe.manifest to /dist/bin/
For debugging, copy the .pdb from /minimo/base/minimo.pdb to /dist/bin/
Changes needed to add plugin support to Minimo
On win32, the only changes needed are to the hard-coded component/library lists at:
minimo/base/winnt/minimo-link-comps
minimo/base/winnt/minimo-link-names
To add plugin support, add
gkplugin
to minimo/base/winnt/minimo-link-comps and add
nsPluginModule
to minimo/base/winnt/minimo-link-names.
On other platforms there may be other issues. For example, there is an explicit
ac_add_options --disable-plugins
in the linux mozconfig file. These have not been investigated yet.