<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.starcontrol.com/index.php?action=history&amp;feed=atom&amp;title=Windows_CE_build_instructions</id>
	<title>Windows CE build instructions - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.starcontrol.com/index.php?action=history&amp;feed=atom&amp;title=Windows_CE_build_instructions"/>
	<link rel="alternate" type="text/html" href="https://wiki.starcontrol.com/index.php?title=Windows_CE_build_instructions&amp;action=history"/>
	<updated>2026-07-21T22:52:29Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://wiki.starcontrol.com/index.php?title=Windows_CE_build_instructions&amp;diff=1211&amp;oldid=prev</id>
		<title>Rbrink: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://wiki.starcontrol.com/index.php?title=Windows_CE_build_instructions&amp;diff=1211&amp;oldid=prev"/>
		<updated>2016-12-09T20:25:15Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Image:uqm_ce.jpg|thumb|320px|The Ur-Quan Masters running on Dell Axim x51v]]&lt;br /&gt;
&lt;br /&gt;
== VMWare image ==&lt;br /&gt;
Ready-to-compile VMWare image of Ubuntu 7.10 server is [http://uqm.stack.nl/files/other/ptx/wince/ubuntu_uqm_wince_20080405.zip available here].&lt;br /&gt;
 User name: uqm&lt;br /&gt;
 Password: uqm&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;uqm&amp;#039;&amp;#039;&amp;#039; user has sudo privileges. You should probably change the password.&lt;br /&gt;
&lt;br /&gt;
See ~/readme.txt for additional details.&lt;br /&gt;
&lt;br /&gt;
== Set up environment variables ==&lt;br /&gt;
 export CROSS_ROOT=/opt/cegcc&lt;br /&gt;
 export PRJ=$HOME/wince&lt;br /&gt;
 export PATH=$CROSS_ROOT/bin:$PRJ/bin:/bin:/usr/bin&lt;br /&gt;
&lt;br /&gt;
== Create workspace directories ==&lt;br /&gt;
 mkdir $PRJ&lt;br /&gt;
 mkdir $PRJ/lib&lt;br /&gt;
 mkdir $PRJ/pkg&lt;br /&gt;
 mkdir $PRJ/bin&lt;br /&gt;
&lt;br /&gt;
== Install cegcc ==&lt;br /&gt;
* Version 0.50 of cegcc was used. Several patches were submitted to cegcc team and the patches were committed to svn. If using version other than 0.50, ensure that the patches are there.&lt;br /&gt;
* Download mandriva-cegcc-cegcc-0.50.tar.gz from http://cegcc.sourceforge.net/&lt;br /&gt;
* Uncompress mandriva-cegcc-cegcc-0.50.tar.gz to /&lt;br /&gt;
&lt;br /&gt;
=== Apply cegcc patches ===&lt;br /&gt;
* Apply the followign to /opt/cegcc/arm-wince-cegcc/include/w32api/winuser.h:&lt;br /&gt;
 Index: winuser.h&lt;br /&gt;
 ===================================================================&lt;br /&gt;
 --- winuser.h   (revision 1066)&lt;br /&gt;
 +++ winuser.h   (revision 1094)&lt;br /&gt;
 @@ -1962,6 +1962,12 @@&lt;br /&gt;
  #endif&lt;br /&gt;
  #define VK_OEM_2       0xBF&lt;br /&gt;
  #define VK_OEM_3       0xC0&lt;br /&gt;
 +#define VK_APP1        0xC1&lt;br /&gt;
 +#define VK_APP2        0xC2&lt;br /&gt;
 +#define VK_APP3        0xC3&lt;br /&gt;
 +#define VK_APP4        0xC4&lt;br /&gt;
 +#define VK_APP5        0xC5&lt;br /&gt;
 +#define VK_APP6        0xC6&lt;br /&gt;
  #define VK_OEM_4       0xDB&lt;br /&gt;
  #define VK_OEM_5       0xDC&lt;br /&gt;
  #define VK_OEM_6       0xDD&lt;br /&gt;
&lt;br /&gt;
* Apply the following to /opt/cegcc/arm-wince-cegcc/include/sys/dirent.h&lt;br /&gt;
 Index: sys/dirent.h&lt;br /&gt;
 ===================================================================&lt;br /&gt;
 --- sys/dirent.h        (revision 80)&lt;br /&gt;
 +++ sys/dirent.h        (revision 1100)&lt;br /&gt;
 @@ -36,6 +36,8 @@&lt;br /&gt;
  extern void rewinddir(DIR *dir);&lt;br /&gt;
  extern int  closedir(DIR *dir);&lt;br /&gt;
 &lt;br /&gt;
 +extern int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);&lt;br /&gt;
 +&lt;br /&gt;
  #ifdef __cplusplus&lt;br /&gt;
  };&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
=== Create cegcc symlinks ===&lt;br /&gt;
Create symbolic links to cegcc binaries. There are ways to avoid this step, and given more time it should be retired, but for now:&lt;br /&gt;
 cd /opt/cegcc/bin&lt;br /&gt;
 ls arm-wince-cegcc-* | while read line; do&lt;br /&gt;
     new_name=`echo $line | sed &amp;quot;s/arm-wince-cegcc-//g&amp;quot;`&lt;br /&gt;
     ln -s $line $new_name&lt;br /&gt;
     ln -s $line arm-wince-pe-$new_name&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
== Build required libraries ==&lt;br /&gt;
&lt;br /&gt;
=== SDL ===&lt;br /&gt;
* Site: http://www.libsdl.org/&lt;br /&gt;
* Src:  http://www.libsdl.org/release/SDL-1.2.12.tar.gz&lt;br /&gt;
 cd $PRJ/pkg&lt;br /&gt;
 wget http://www.libsdl.org/release/SDL-1.2.12.tar.gz&lt;br /&gt;
 cd $PRJ&lt;br /&gt;
 tar xvf pkg/SDL-1.2.12.tar.gz&lt;br /&gt;
* Build SDL.dll using Visual Studio on win32 (having trouble cross-compiling in linux, hopefully will resolve shortly)...&lt;br /&gt;
* Place SDL.dll that was built using Visual Studio to $PRJ/lib&lt;br /&gt;
* Create $PRJ/bin/sdl-config:&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 if [ &amp;quot;$1&amp;quot; = &amp;quot;--version&amp;quot; ]; then&lt;br /&gt;
 	echo &amp;quot;1.2.12&amp;quot;&lt;br /&gt;
 elif [ &amp;quot;$1&amp;quot; = &amp;quot;--cflags&amp;quot; ]; then&lt;br /&gt;
 	echo &amp;quot;-I${PRJ}/SDL-1.2.12/include&amp;quot;&lt;br /&gt;
 elif [ &amp;quot;$1&amp;quot; = &amp;quot;--libs&amp;quot; ]; then&lt;br /&gt;
 	echo &amp;quot;-L${PRJ}/lib -lSDL&amp;quot;&lt;br /&gt;
 else&lt;br /&gt;
 	exit 1&lt;br /&gt;
 fi&lt;br /&gt;
 exit 0&lt;br /&gt;
&lt;br /&gt;
==== Patch headers ====&lt;br /&gt;
SDL-1.2.12 headers need to be patched for successful compilation of SDL_image and The Ur-Quan Masters. Note that when building SDL using win32 Visual Studio, the headers must also be patched there (for the APP1-6 keys to be available).&lt;br /&gt;
&lt;br /&gt;
 --- orig/SDL-1.2.12/include/SDL_config_minimal.h        2007-07-20 01:52:44.000000000 -0400&lt;br /&gt;
 +++ wince/SDL-1.2.12/include/SDL_config_minimal.h       2007-12-24 11:50:58.000000000 -0500&lt;br /&gt;
 @@ -36,7 +36,9 @@&lt;br /&gt;
  typedef signed int int32_t;&lt;br /&gt;
  typedef unsigned int uint32_t;&lt;br /&gt;
  typedef unsigned int size_t;&lt;br /&gt;
 +#ifndef __CEGCC__&lt;br /&gt;
  typedef unsigned long uintptr_t;&lt;br /&gt;
 +#endif&lt;br /&gt;
  &lt;br /&gt;
  /* Enable the dummy audio driver (src/audio/dummy/\*.c) */&lt;br /&gt;
  #define SDL_AUDIO_DRIVER_DUMMY 1&lt;br /&gt;
&lt;br /&gt;
 --- orig/SDL-1.2.12/./include/SDL_keysym.h      2007-07-20 01:52:44.000000000 -0400&lt;br /&gt;
 +++ wince/SDL-1.2.12/./include/SDL_keysym.h     2007-12-23 20:16:11.000000000 -0500&lt;br /&gt;
 @@ -282,6 +282,12 @@&lt;br /&gt;
         SDLK_UNDO               = 322,          /* Atari keyboard has Undo */&lt;br /&gt;
  &lt;br /&gt;
         /* Add any other keys here */&lt;br /&gt;
 +       SDLK_APP1               = 323,&lt;br /&gt;
 +       SDLK_APP2               = 324,&lt;br /&gt;
 +       SDLK_APP3               = 325,&lt;br /&gt;
 +       SDLK_APP4               = 326,&lt;br /&gt;
 +       SDLK_APP5               = 327,&lt;br /&gt;
 +       SDLK_APP6               = 328,&lt;br /&gt;
  &lt;br /&gt;
         SDLK_LAST&lt;br /&gt;
  } SDLKey;&lt;br /&gt;
&lt;br /&gt;
 --- orig/SDL-1.2.12/include/SDL_stdinc.h        2007-07-20 01:52:44.000000000 -0400&lt;br /&gt;
 +++ wince/SDL-1.2.12/include/SDL_stdinc.h       2007-12-24 11:53:11.000000000 -0500&lt;br /&gt;
 @@ -57,13 +57,15 @@&lt;br /&gt;
  # endif&lt;br /&gt;
  # include &amp;lt;string.h&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
 -#ifdef HAVE_STRINGS_H&lt;br /&gt;
 -# include &amp;lt;strings.h&amp;gt;&lt;br /&gt;
 -#endif&lt;br /&gt;
 -#if defined(HAVE_INTTYPES_H)&lt;br /&gt;
 -# include &amp;lt;inttypes.h&amp;gt;&lt;br /&gt;
 -#elif defined(HAVE_STDINT_H)&lt;br /&gt;
 -# include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
 +#ifndef __CEGCC__&lt;br /&gt;
 +# ifdef HAVE_STRINGS_H&lt;br /&gt;
 +#  include &amp;lt;strings.h&amp;gt;&lt;br /&gt;
 +# endif&lt;br /&gt;
 +# if defined(HAVE_INTTYPES_H)&lt;br /&gt;
 +#  include &amp;lt;inttypes.h&amp;gt;&lt;br /&gt;
 +# elif defined(HAVE_STDINT_H)&lt;br /&gt;
 +#  include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
 +# endif&lt;br /&gt;
  #endif&lt;br /&gt;
  #ifdef HAVE_CTYPE_H&lt;br /&gt;
  # include &amp;lt;ctype.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 --- sdlorig/SDL-1.2.12/./src/video/windib/SDL_dibevents.c       2007-07-20 01:52:19.000000000 -0400&lt;br /&gt;
 +++ wince/SDL-1.2.12/./src/video/windib/SDL_dibevents.c 2007-12-23 20:14:55.000000000 -0500&lt;br /&gt;
 @@ -430,6 +430,13 @@&lt;br /&gt;
         VK_keymap[VK_SNAPSHOT] = SDLK_PRINT;&lt;br /&gt;
         VK_keymap[VK_CANCEL] = SDLK_BREAK;&lt;br /&gt;
         VK_keymap[VK_APPS] = SDLK_MENU;&lt;br /&gt;
 +&lt;br /&gt;
 +       VK_keymap[VK_APP1] = SDLK_APP1;&lt;br /&gt;
 +       VK_keymap[VK_APP2] = SDLK_APP2;&lt;br /&gt;
 +       VK_keymap[VK_APP3] = SDLK_APP3;&lt;br /&gt;
 +       VK_keymap[VK_APP4] = SDLK_APP4;&lt;br /&gt;
 +       VK_keymap[VK_APP5] = SDLK_APP5;&lt;br /&gt;
 +       VK_keymap[VK_APP6] = SDLK_APP6;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
=== Tremor ===&lt;br /&gt;
* Site: http://xiph.org/vorbis/&lt;br /&gt;
* svn:  http://svn.xiph.org/branches/lowmem-branch/Tremor&lt;br /&gt;
 cd $PRJ&lt;br /&gt;
 svn co -r14321 http://svn.xiph.org/branches/lowmem-branch/Tremor&lt;br /&gt;
 ln -s Tremor tremor&lt;br /&gt;
 cd Tremor&lt;br /&gt;
 ./autogen.sh --host arm-wince-pe&lt;br /&gt;
 ./configure --host arm-wince-pe&lt;br /&gt;
 make&lt;br /&gt;
 arm-wince-cegcc-gcc -shared *.o -o libvorbisidec.dll&lt;br /&gt;
 cp libvorbisidec.dll $PRJ/lib&lt;br /&gt;
&lt;br /&gt;
=== zlib ===&lt;br /&gt;
* Site: http://www.zlib.net/&lt;br /&gt;
* Src:  http://www.zlib.net/zlib-1.2.3.tar.gz&lt;br /&gt;
 cd $PRJ/pkg&lt;br /&gt;
 wget http://www.zlib.net/zlib-1.2.3.tar.gz&lt;br /&gt;
 cd $PRJ&lt;br /&gt;
 tar xvf zlib-1.2.3.tar.gz&lt;br /&gt;
 cd $PRJ/zlib-1.2.3&lt;br /&gt;
 export CC=arm-wince-cegcc-gcc&lt;br /&gt;
 ./configure&lt;br /&gt;
 make&lt;br /&gt;
 arm-wince-cegcc-gcc -shared adler32.o compress.o crc32.o deflate.o gzio.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o -o z.dll&lt;br /&gt;
 cp z.dll $PRJ/lib&lt;br /&gt;
 cd $PRJ/lib&lt;br /&gt;
 ln -s z.dll zdll.dll&lt;br /&gt;
&lt;br /&gt;
=== libpng ===&lt;br /&gt;
* Site: http://www.libpng.org/pub/png/libpng.html&lt;br /&gt;
* src:  ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.2.24.tar.bz2&lt;br /&gt;
 cd $PRJ/pkg&lt;br /&gt;
 wget ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.2.24.tar.bz2&lt;br /&gt;
 cd $PRJ&lt;br /&gt;
 tar xvf libpng-1.2.24.tar.bz2&lt;br /&gt;
 cd $PRJ/libpng-1.2.24&lt;br /&gt;
 export CFLAGS=-I$PRJ/zlib-1.2.3&lt;br /&gt;
 export LDFLAGS=&amp;quot;-L$PRJ/lib&amp;quot;&lt;br /&gt;
 ./configure --host arm-wince-pe&lt;br /&gt;
 make&lt;br /&gt;
 arm-wince-cegcc-gcc -shared libpng12*.o -L$PRJ/lib -lz -o libpng.dll&lt;br /&gt;
 cp libpng.dll $PRJ/lib&lt;br /&gt;
&lt;br /&gt;
=== SDL_image ===&lt;br /&gt;
* Site: http://www.libsdl.org/projects/SDL_image&lt;br /&gt;
* Src:  http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.6.tar.gz&lt;br /&gt;
 cd $PRJ/pkg&lt;br /&gt;
 wget http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.6.tar.gz&lt;br /&gt;
 cd $PRJ&lt;br /&gt;
 tar xvf pkg/SDL_image-1.2.6.tar.gz&lt;br /&gt;
 cd $PRJ/SDL_image-1.2.6&lt;br /&gt;
 export CFLAGS=&amp;quot;-I$PRJ/SDL-1.2.12/include -I$PRJ/libpng-1.2.24 -I$PRJ/zlib-1.2.3&amp;quot;&lt;br /&gt;
 export LDFLAGS=&amp;quot;-L$PRJ/lib -lpng&amp;quot;&lt;br /&gt;
 ./configure --enable-shared=yes --host arm-wince-pe&lt;br /&gt;
 make&lt;br /&gt;
 gcc -shared IMG*.o -L$PRJ/lib -lSDL -lpng -o SDL_image.dll&lt;br /&gt;
 cp SDL_image.dll $PRJ/lib&lt;br /&gt;
&lt;br /&gt;
== Check out The Ur-Quan Masters sources ==&lt;br /&gt;
 cd $PRJ&lt;br /&gt;
 svn co -N https://sc2.svn.sourceforge.net/svnroot/sc2/trunk/sc2&lt;br /&gt;
 cd sc2&lt;br /&gt;
 svn up build doc src&lt;br /&gt;
Note: trunk is used in this example. Use whatever tag is appropriate.&lt;br /&gt;
&lt;br /&gt;
== Configure The Ur-Quan Masters build scripts ==&lt;br /&gt;
To configure The Ur-Quan Masters the following needs to be performed:&lt;br /&gt;
 export BUILD_HOST=CEGCC&lt;br /&gt;
 unset ENV BASH_ENV&lt;br /&gt;
 export CFLAGS=&amp;quot;-I$PRJ/libvorbis-1.2.0/include -I$PRJ/libogg-1.1.3/include -I$PRJ/zlib-1.2.3 -I$PRJ/SDL-1.2.12/include -I$PRJ/zlib-1.2.3 -I$PRJ/SDL_image-1.2.6 -UUNICODE -I$PRJ -D_SYS_TYPES_FD_SET -DHAVE_STRING_H -D_WIN32_WCE&amp;quot;&lt;br /&gt;
 export LDFLAGS=&amp;quot;-L$PRJ/zlib-1.2.3 -L$PRJ/lib -L$PRJ/libogg-1.1.3/src/.libs -L$PRJ/libvorbis-1.2.0/lib/.libs -laygshell&amp;quot;&lt;br /&gt;
 export MAKE_VERBOSE=1&lt;br /&gt;
 ./build.sh uqm config&lt;br /&gt;
&lt;br /&gt;
Run ./build.sh uqm config and set options to the following:&lt;br /&gt;
  1. Type of build                        Optimised release build&lt;br /&gt;
  2. OpenGL graphics support              Don&amp;#039;t include OpenGL graphics support&lt;br /&gt;
  3. Sound backend                        Use MixSDL for sound (internal)&lt;br /&gt;
  4. Tracker music support                Included libmikmod&lt;br /&gt;
  5. Ogg Vorbis codec                     Tremor (avoids floating point math)&lt;br /&gt;
  6. Network Supermelee support           disabled&lt;br /&gt;
  7. Joystick support                     disabled&lt;br /&gt;
  8. Supported file i/o methods           Direct &amp;amp; .zip file i/o&lt;br /&gt;
  9. Graphics/Sound optimizations         Platform acceleration (asm, etc.)&lt;br /&gt;
&lt;br /&gt;
== Build The Ur-Quan Masters ==&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
./build.sh uqm&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compress binaries ==&lt;br /&gt;
Use [http://upx.sourceforge.net UPX] to make the binaries WM6.1-compatible.&lt;br /&gt;
&lt;br /&gt;
 upx *.exe *.dll&lt;br /&gt;
&lt;br /&gt;
== Installing to WM device ==&lt;br /&gt;
For the purposes of this guide, $UQM_DIR denotes the directory where you want to install The Ur-Quan Masters (for example &amp;quot;/SD Card/uqm&amp;quot;)&lt;br /&gt;
# Create the following directories:&lt;br /&gt;
#* $UQM_DIR/&lt;br /&gt;
#* $UQM_DIR/content/&lt;br /&gt;
#* $UQM_DIR/content/packages&lt;br /&gt;
# Place &amp;quot;uqm&amp;quot; executable into $UQM_DIR&lt;br /&gt;
# Place shared libraries into $UQM_DIR:&lt;br /&gt;
#* $PRJ/lib/libpng.dll&lt;br /&gt;
#* $PRJ/lib/libvorbisidec.dll&lt;br /&gt;
#* $PRJ/lib/SDL.dll&lt;br /&gt;
#* $PRJ/lib/SDL_image.dll&lt;br /&gt;
#* $PRJ/lib/z.dll&lt;br /&gt;
#* /opt/cegcc/arm-wince-cegcc/lib/device/cegcc.dll&lt;br /&gt;
# Place &amp;quot;version&amp;quot; file into $UQM_DIR/content&lt;br /&gt;
# Place main content file (for example uqm-0.6.0-content.uqm) into $UQM_DIR/content/packages&lt;br /&gt;
# Place any content patches / addon files into $UQM_DIR/content/packages&lt;br /&gt;
# Place wince addon file (for example uqm-0.6.0-~~wince_20071223.2200.zip) into $UQM_dir/content/packages. Note that this &amp;quot;addon&amp;quot; file should contain any custom Wince settings, like key mappings.&lt;br /&gt;
&lt;br /&gt;
== Adding The Ur-Quan Masters command-line arguments ==&lt;br /&gt;
# In WM5 file explorer, press on &amp;quot;uqm&amp;quot; and hold until pop-up menu appears.&lt;br /&gt;
# Select &amp;quot;Copy&amp;quot; menu item&lt;br /&gt;
# Press and hold somewhere (not on a file name) in the file explorer window until pop-up menu appears.&lt;br /&gt;
# Select &amp;quot;Paste Shortcut&amp;quot; menu item&lt;br /&gt;
# Rename the newly created shortcut to &amp;quot;uqm_shortcut&amp;quot;&lt;br /&gt;
# Open &amp;quot;uqm_shortcut.lnk&amp;quot; in a text editor of choice and add command line arguments&lt;br /&gt;
Example shortcut file:&lt;br /&gt;
 21#&amp;quot;\SD Card\uqm\uqm&amp;quot; -l uqm_log.txt&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Netplay is not yet supported&lt;br /&gt;
* OpenGL is not yet supported&lt;br /&gt;
&lt;br /&gt;
== Gotchas ==&lt;br /&gt;
=== Headers ===&lt;br /&gt;
Always use same header files to build everything, doing otherwise brings chaos and is extremely difficult to debug&lt;br /&gt;
=== Missing DLLs ===&lt;br /&gt;
The following message usually means that your executable is unable to find a .dll:&lt;br /&gt;
 The file &amp;#039;uqm&amp;#039; cannot be opened. Either it is not signed with a trusted certificate, or one of its components cannot be found. You might need to reinstall or restore this file.&lt;br /&gt;
To find out what dlls you are missing, run &amp;quot;arm-wince-gcc-objdump -p uqm&amp;quot; (or any of it&amp;#039;s libraries)&lt;br /&gt;
&lt;br /&gt;
[[Category:About the Star Control series]]&lt;/div&gt;</summary>
		<author><name>Rbrink</name></author>
	</entry>
</feed>