Difference between revisions of "WinCE development"

From Navit's Wiki
Jump to: navigation, search
m
(Updated instructions for cegcc.)
Line 1: Line 1:
This is a Tutorial for Navit on WinCE/WinMobile. If want just want to download a cab file see [[Navit on WinCE/Windows Mobile]].
+
This is a tutorial for Navit on WinCE/WinMobile. If want just want to download a cab file see [[Navit on WinCE/Windows Mobile]].
 +
 
 +
This page explains how to build Navit for WinCE/WinMobile with [http://cegcc.sourceforge.net cegcc].
  
This page explains how to build navit for WinCE with cegcc.
 
Navit for WinCE/WinMobile
 
 
==Building cegcc==
 
==Building cegcc==
  
Set the install path to where you want to install cegcc:
+
Set the install path to where you want to install [http://cegcc.sourceforge.net cegcc]:
+
 
  export INSTALL_PATH=/usr/local/cegcc
+
  export CEGCC_PATH=/usr/local/cegcc
Navit for WinCE/WinMobile
 
 
  svn co -r 1214 https://cegcc.svn.sourceforge.net/svnroot/cegcc/trunk/cegcc
 
  svn co -r 1214 https://cegcc.svn.sourceforge.net/svnroot/cegcc/trunk/cegcc
 
  mkdir -p cegcc-builds
 
  mkdir -p cegcc-builds
 
  cd cegcc-builds
 
  cd cegcc-builds
  ../cegcc/src/build-cegcc.sh --prefix=$INSTALL_PATH --components="binutils bootstrap_gcc w32api newlib dummy_cegccdll gcc cegccdll cegccthrddll libstdcppdll profile"
+
  ../cegcc/src/build-cegcc.sh --prefix=$CEGCC_PATH --components="binutils bootstrap_gcc w32api newlib dummy_cegccdll gcc cegccdll cegccthrddll libstdcppdll profile"
navit tutorial
+
 
 +
If you get an error like "'makekinfo' is missing on your system" although makeinfo is available (happened with openSUSE 11.2 and Debian Lenny, both 32 bit), add a workaround to the script src/newlib/missing. Insert a new line after the line "  makeinfo)":
 +
    "$@" && exit 0
 +
 
 
If you get an error like "arm-cegcc-windres: Can't detect architecture", apply the patch file you find on http://sourceforge.net/tracker/?func=detail&atid=865516&aid=2574606&group_id=173455
 
If you get an error like "arm-cegcc-windres: Can't detect architecture", apply the patch file you find on http://sourceforge.net/tracker/?func=detail&atid=865516&aid=2574606&group_id=173455
  
==Building glib==Navit for WinCE/WinMobile
+
==Building libraries==
 +
 
 +
November 2009: The libraries below are '''not needed''' anymore since navit brings its own version of glib.<br />
 +
The libraries require additional (not published or not existing) patches to build. Just skip to section Building Navit.
  
 
These are the libraries needed and versions which should work:
 
These are the libraries needed and versions which should work:
Line 24: Line 29:
 
* gettext-0.17
 
* gettext-0.17
 
* libpng-1.2.34
 
* libpng-1.2.34
* tiff-3.8.2navit tutorial
+
* tiff-3.8.2
 
* glib-2.18.4
 
* glib-2.18.4
  
The current versions of these libs don't need many changes, but they all don't know anything about cegcc. Until I found a way to upload the patches, you have to edit the code yourself. Here is the example for libiconv-1.Navit for WinCE/WinMobile9.1_cegcc.patch:
+
The current versions of these libs don't need many changes, but they all don't know anything about cegcc. Until I found a way to upload the patches, you have to edit the code yourself. Just add "| -cegcc*" to the line containing "-cygwin*" of all files named config.sub. Here is the example for libiconv-1.9.1_cegcc.patch:
  
 
  diff -ur libiconv-1.9.1/autoconf/config.sub libiconv-1.9.1_cegcc/autoconf/config.sub
 
  diff -ur libiconv-1.9.1/autoconf/config.sub libiconv-1.9.1_cegcc/autoconf/config.sub
  --- libiconv-1.9.1/autoconf/config.sub 2003-05-06 11:36:42.000000000 +0200
+
  --- libiconv-1.9.1/autoconf/config.sub 2003-05-06 11:36:42.000000000 +0200
  +++ libiconv-1.9.1_cegcc/autoconf/config.sub 2009-02-06 20:22:14.000000000 +0100
+
  +++ libiconv-1.9.1_cegcc/autoconf/config.sub   2009-02-06 20:22:14.000000000 +0100
 
  @@ -1121,7 +1121,7 @@
 
  @@ -1121,7 +1121,7 @@
      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+
          | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+
          | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
      | -chorusos* | -chorusrdb* \
+
          | -chorusos* | -chorusrdb* \
  -       | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \Navit for WinCE/WinMobile
+
  -       | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
  +       | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* | -cegcc \
+
  +       | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* | -cegcc* \
      | -mingw32* | navit tutorial-linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+
          | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+
          | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+
          | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
 
  diff -ur libiconv-1.9.1/libcharset/autoconf/config.sub libiconv-1.9.1_cegcc/libcharset/autoconf/config.sub
 
  diff -ur libiconv-1.9.1/libcharset/autoconf/config.sub libiconv-1.9.1_cegcc/libcharset/autoconf/config.sub
  --- libiconv-1.9.1/libcharset/autoconf/config.sub 2003-05-06 11:36:42.000000000 +0200Navit for WinCE/WinMobile
+
  --- libiconv-1.9.1/libcharset/autoconf/config.sub 2003-05-06 11:36:42.000000000 +0200
  +++ libiconv-1.9.1_cegcc/libcharset/autoconf/config.sub 2009-02-06 20:23:39.000000000 +0100
+
  +++ libiconv-1.9.1_cegcc/libcharset/autoconf/config.sub   2009-02-06 20:23:39.000000000 +0100
  @@ -1121,7 +1121,7 @@navit tutorial
+
  @@ -1121,7 +1121,7 @@
      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+
          | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+
          | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
      | -chorusos* | -chorusrdb* \
+
          | -chorusos* | -chorusrdb* \
  -       | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+
  -       | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
  +       | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* | -cegcc* \
+
  +       | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* | -cegcc* \
      | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+
          | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+
          | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ Navit for WinCE/WinMobile
+
          | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
  
 
===zlib===
 
===zlib===
Line 59: Line 64:
 
  tar xzf zlib-1.2.3.tar.gz
 
  tar xzf zlib-1.2.3.tar.gz
 
  cd zlib-1.2.3
 
  cd zlib-1.2.3
  export PATH=$INSTALL_PATH/bin:$PATH
+
  export PATH=$CEGCC_PATH/bin:$PATH
  CC=arm-cegcc-gcc AR="arm-cegcc-ar r" RANLIB=arm--cegcc-ranlib ./configure --prefix=$INSTALL_PATH
+
  CC=arm-cegcc-gcc AR="arm-cegcc-ar r" RANLIB=arm--cegcc-ranlib ./configure --prefix=$CEGCC_PATH
 
  make
 
  make
 
  make install
 
  make install
Navit for WinCE/WinMobile
+
 
 
===libiconv===
 
===libiconv===
  
  wget http://www.gimp.org/~tml/gimp/win32/libiconv-1.9.1.tar.gz
+
  wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.9.1.tar.gz
 
  tar xzf libiconv-1.9.1.tar.gz
 
  tar xzf libiconv-1.9.1.tar.gz
 
  patch -d libiconv-1.9.1 -p1 < libiconv-1.9.1_cegcc.patch
 
  patch -d libiconv-1.9.1 -p1 < libiconv-1.9.1_cegcc.patch
 
  cd libiconv-1.9.1
 
  cd libiconv-1.9.1
  ./configure --host=arm-cegcc --prefix=$INSTALL_PATH
+
  ./configure --host=arm-cegcc --prefix=$CEGCC_PATH
 
  make
 
  make
 
  make install
 
  make install
  
 
===gettext===
 
===gettext===
 +
workaround for
 +
plural-eval.h:50: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'sigfpe_exit'
 +
extend gettext-tools/src/plural-eval.h line 32 to
 +
#if defined _MSC_VER || defined __MINGW32__ || defined __CEGCC__
 +
dito for gettext-tools/gnulib-lib/wait-process.c line 31
  
  wget http://ftp.gnome.org/pub/gnome/binaries/win32Navit for WinCE/WinMobile/dependencies/gettext-0.17.tar.gz
+
  wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-0.17.tar.gz
 
  tar xzf gettext-0.17.tar.gz
 
  tar xzf gettext-0.17.tar.gz
 
  cd gettext-0.17
 
  cd gettext-0.17
 
  patch -p1 < ../gettext-0.17_cegcc.patch
 
  patch -p1 < ../gettext-0.17_cegcc.patch
  ./configure --host=arm-cegcc --prefix=$INSTALL_PATH
+
  ./configure --host=arm-cegcc --prefix=$CEGCC_PATH
 
  make
 
  make
 
  make install
 
  make install
  
===libpng===Navit for WinCE/WinMobile
+
===libpng===
  
 
  wget http://prdownloads.sourceforge.net/libpng/libpng-1.2.34.tar.gz?download
 
  wget http://prdownloads.sourceforge.net/libpng/libpng-1.2.34.tar.gz?download
Line 90: Line 100:
 
  cd libpng-1.2.34
 
  cd libpng-1.2.34
 
  patch -p1 < ../libpng-1.2.34_cegcc.patch
 
  patch -p1 < ../libpng-1.2.34_cegcc.patch
  ./configure --host=arm-cegcc --prefix=$INSTALL_PATH
+
  ./configure --host=arm-cegcc --prefix=$CEGCC_PATH
 
  CFLAG="-I $C_INCLUDE_PATH" make
 
  CFLAG="-I $C_INCLUDE_PATH" make
 
  make install
 
  make install
  
===libtiff===navit tutorialNavit for WinCE/WinMobile
+
===libtiff===
 +
libtool: link: CURRENT `' must be a nonnegative integer
  
 
  wget http://libtiff.maptools.org/dl/tiff-3.8.2.tar.gz
 
  wget http://libtiff.maptools.org/dl/tiff-3.8.2.tar.gz
Line 100: Line 111:
 
  cd tiff-3.8.2
 
  cd tiff-3.8.2
 
  patch -p1 < ../tiff-3.8.2_cegcc.patch
 
  patch -p1 < ../tiff-3.8.2_cegcc.patch
  ./configure --host=arm-cegcc --prefix=$INSTALL_PATH
+
  ./configure --host=arm-cegcc --prefix=$CEGCC_PATH
 
  make
 
  make
 
  make install
 
  make install
  
 
===glib===
 
===glib===
 +
gatomic.c:570: Error: no such instruction: `swp %eax,%eax,[%esi]'
  
 
  wget http://ftp.gnome.org/pub/gnome/sources/glib/2.18/glib-2.18.4.tar.bz2
 
  wget http://ftp.gnome.org/pub/gnome/sources/glib/2.18/glib-2.18.4.tar.bz2
Line 110: Line 122:
 
  cd glib-2.18.4
 
  cd glib-2.18.4
 
  patch -p1 < ../glib-2.18.4_cegcc.patch
 
  patch -p1 < ../glib-2.18.4_cegcc.patch
  ./configure --host=arm-cegcc --prefix=$INSTALL_PATH
+
  ./configure --host=arm-cegcc --prefix=$CEGCC_PATH
 
  make
 
  make
 
  make install
 
  make install
  
==Navit==
+
==Building Navit==
ToDo
+
svn co https://navit.svn.sourceforge.net/svnroot/navit/trunk/navit
 +
cd navit
 +
Add <tt>| -cegcc*</tt> to all files named <tt>config.sub</tt> as for the libraries.
 +
WINDRES=arm-cegcc-windres ./configure --disable-vehicle-file --host=arm-cegcc --prefix=$CEGCC_PATH 2>&1 | tee configure-cegcc.log
 +
Add to <tt>navit\support\wordexp\glob.h</tt>:
 +
|| defined __CEGCC__
 +
Change include in <tt>navit\vehicle\wince\vehicle_wince.c</tt>:
 +
#include <sys/io.h>
 +
Add to <tt>navit\file.c</tt>:
 +
&& !defined __CEGCC__
  
==Building Navit==
+
make -j
ToDo
+
 
 +
November 2009: Navit.exe stops early due to exception_datatype_misalignment.

Revision as of 11:57, 26 November 2009

This is a tutorial for Navit on WinCE/WinMobile. If want just want to download a cab file see Navit on WinCE/Windows Mobile.

This page explains how to build Navit for WinCE/WinMobile with cegcc.

Building cegcc

Set the install path to where you want to install cegcc:

export CEGCC_PATH=/usr/local/cegcc
svn co -r 1214 https://cegcc.svn.sourceforge.net/svnroot/cegcc/trunk/cegcc
mkdir -p cegcc-builds
cd cegcc-builds
../cegcc/src/build-cegcc.sh --prefix=$CEGCC_PATH --components="binutils bootstrap_gcc w32api newlib dummy_cegccdll gcc cegccdll cegccthrddll libstdcppdll profile"

If you get an error like "'makekinfo' is missing on your system" although makeinfo is available (happened with openSUSE 11.2 and Debian Lenny, both 32 bit), add a workaround to the script src/newlib/missing. Insert a new line after the line " makeinfo)":

    "$@" && exit 0

If you get an error like "arm-cegcc-windres: Can't detect architecture", apply the patch file you find on http://sourceforge.net/tracker/?func=detail&atid=865516&aid=2574606&group_id=173455

Building libraries

November 2009: The libraries below are not needed anymore since navit brings its own version of glib.
The libraries require additional (not published or not existing) patches to build. Just skip to section Building Navit.

These are the libraries needed and versions which should work:

  • zlib-1.2.3
  • libiconv-1.9.1
  • gettext-0.17
  • libpng-1.2.34
  • tiff-3.8.2
  • glib-2.18.4

The current versions of these libs don't need many changes, but they all don't know anything about cegcc. Until I found a way to upload the patches, you have to edit the code yourself. Just add "| -cegcc*" to the line containing "-cygwin*" of all files named config.sub. Here is the example for libiconv-1.9.1_cegcc.patch:

diff -ur libiconv-1.9.1/autoconf/config.sub libiconv-1.9.1_cegcc/autoconf/config.sub
--- libiconv-1.9.1/autoconf/config.sub 2003-05-06 11:36:42.000000000 +0200
+++ libiconv-1.9.1_cegcc/autoconf/config.sub   2009-02-06 20:22:14.000000000 +0100
@@ -1121,7 +1121,7 @@
         | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
         | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
         | -chorusos* | -chorusrdb* \
-        | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+        | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* | -cegcc* \
         | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
         | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
         | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
diff -ur libiconv-1.9.1/libcharset/autoconf/config.sub libiconv-1.9.1_cegcc/libcharset/autoconf/config.sub
--- libiconv-1.9.1/libcharset/autoconf/config.sub  2003-05-06 11:36:42.000000000 +0200
+++ libiconv-1.9.1_cegcc/libcharset/autoconf/config.sub    2009-02-06 20:23:39.000000000 +0100
@@ -1121,7 +1121,7 @@
         | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
         | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
         | -chorusos* | -chorusrdb* \
-        | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+        | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* | -cegcc* \
         | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
         | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
         | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \

zlib

wget http://www.zlib.net/zlib-1.2.3.tar.gz
tar xzf zlib-1.2.3.tar.gz
cd zlib-1.2.3
export PATH=$CEGCC_PATH/bin:$PATH
CC=arm-cegcc-gcc AR="arm-cegcc-ar r" RANLIB=arm--cegcc-ranlib ./configure --prefix=$CEGCC_PATH
make
make install

libiconv

wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.9.1.tar.gz
tar xzf libiconv-1.9.1.tar.gz
patch -d libiconv-1.9.1 -p1 < libiconv-1.9.1_cegcc.patch
cd libiconv-1.9.1
./configure --host=arm-cegcc --prefix=$CEGCC_PATH
make
make install

gettext

workaround for

plural-eval.h:50: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'sigfpe_exit'

extend gettext-tools/src/plural-eval.h line 32 to

#if defined _MSC_VER || defined __MINGW32__ || defined __CEGCC__

dito for gettext-tools/gnulib-lib/wait-process.c line 31

wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-0.17.tar.gz
tar xzf gettext-0.17.tar.gz
cd gettext-0.17
patch -p1 < ../gettext-0.17_cegcc.patch
./configure --host=arm-cegcc --prefix=$CEGCC_PATH
make
make install

libpng

wget http://prdownloads.sourceforge.net/libpng/libpng-1.2.34.tar.gz?download
tar xzf libpng-1.2.34.tar.gz
cd libpng-1.2.34
patch -p1 < ../libpng-1.2.34_cegcc.patch
./configure --host=arm-cegcc --prefix=$CEGCC_PATH
CFLAG="-I $C_INCLUDE_PATH" make
make install

libtiff

libtool: link: CURRENT `' must be a nonnegative integer
wget http://libtiff.maptools.org/dl/tiff-3.8.2.tar.gz
tar xzf tiff-3.8.2.tar.gz
cd tiff-3.8.2
patch -p1 < ../tiff-3.8.2_cegcc.patch
./configure --host=arm-cegcc --prefix=$CEGCC_PATH
make
make install

glib

gatomic.c:570: Error: no such instruction: `swp %eax,%eax,[%esi]'
wget http://ftp.gnome.org/pub/gnome/sources/glib/2.18/glib-2.18.4.tar.bz2
tar xjf glib-2.18.4.tar.bz2
cd glib-2.18.4
patch -p1 < ../glib-2.18.4_cegcc.patch
./configure --host=arm-cegcc --prefix=$CEGCC_PATH
make
make install

Building Navit

svn co https://navit.svn.sourceforge.net/svnroot/navit/trunk/navit
cd navit

Add | -cegcc* to all files named config.sub as for the libraries.

WINDRES=arm-cegcc-windres ./configure --disable-vehicle-file --host=arm-cegcc --prefix=$CEGCC_PATH 2>&1 | tee configure-cegcc.log

Add to navit\support\wordexp\glob.h:

|| defined __CEGCC__

Change include in navit\vehicle\wince\vehicle_wince.c:

#include <sys/io.h>

Add to navit\file.c:

&& !defined __CEGCC__
make -j

November 2009: Navit.exe stops early due to exception_datatype_misalignment.