Difference between revisions of "WinCE development"

From Navit's Wiki
Jump to: navigation, search
(Navit.exe as generated by automated build currently works)
 
(12 intermediate revisions by 7 users not shown)
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 [[WinCE]].
  
 
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/WinMobile with [http://cegcc.sourceforge.net cegcc].
Line 9: Line 9:
 
==Building using arm-mingw32ce==
 
==Building using arm-mingw32ce==
 
===Install arm-mingw32ce===
 
===Install arm-mingw32ce===
 +
<source lang="bash">
 
  mkdir -p navit
 
  mkdir -p navit
 
  cd navit
 
  cd navit
Line 14: Line 15:
 
  wget -c https://sourceforge.net/projects/cegcc/files/cegcc/0.59.1/mingw32ce-0.59.1.tar.bz2/download
 
  wget -c https://sourceforge.net/projects/cegcc/files/cegcc/0.59.1/mingw32ce-0.59.1.tar.bz2/download
 
  tar xjf mingw32ce-0.59.1.tar.bz2
 
  tar xjf mingw32ce-0.59.1.tar.bz2
 +
</source>
  
===Building Navit===
+
===Building Navit using Cmake===
svn co https://navit.svn.sourceforge.net/svnroot/navit/trunk/navit
+
<source lang="bash">
cd $NAVIT_PATH/navit
+
#!/bin/bash
export PATH=$NAVIT_PATH/opt/mingw32ce/bin:$PATH
+
export NAVIT_PATH="/usr/src/navit"
./autogen.sh
+
export MINGW32CE_PATH="/opt/mingw32ce"
+
export PATH=$PATH:$MINGW32CE_PATH/bin  
then
 
 
 
export STRIP=arm-mingw32ce-strip
 
export RANLIB=arm-mingw32ce-ranlib
 
export CXX=arm-mingw32ce-g++
 
export CC=arm-mingw32ce-gcc
 
export AR=arm-mingw32ce-ar
 
export WINDRES=arm-mingw32ce-windres
 
export CFLAGS="-DPATH_MAX=253 -g"
 
./configure --prefix=$NAVIT_PATH \
 
--host=arm-pe-wince \
 
--enable-support-libc \
 
--disable-vehicle-file \
 
--enable-avoid-unaligned \
 
--enable-avoid-float \
 
--enable-cache-size=10485760 \
 
--enable-svg2png-scaling=16,32,48 \
 
--enable-svg2png-scaling-nav=32 \
 
--enable-svg2png-scaling-flag=32 \
 
--with-xslts=windows 2>&1 \
 
  | tee configure-mingw32ce.log
 
 
 
or
 
 
 
export PATH=$PATH:/opt/mingw32ce/bin
 
 
WINDRES=arm-mingw32ce-windres
 
./configure --host=arm-mingw32ce \
 
--disable-vehicle-file \
 
--disable-graphics-gtk-drawing-area \
 
--disable-svg2png \
 
--disable-glib \
 
--enable-support-libc \
 
--disable-gmodule \
 
--disable-binding-dbus \
 
--disable-font-freetype \
 
--disable-gui-gtk \
 
--disable-gui-win32 \
 
--disable-graphics-qt-qpainter \
 
--enable-cache-size=8000000 \
 
--disable-graphics-null \
 
--disable-map-mg \
 
--disable-speech-cmdline \
 
--disable-vehicle-demo
 
 
 
If you get an error while configuring saying in the config.log
 
error while loading shared libraries: libmpfr.so.1: cannot open shared object file
 
then install libmpfr. If libmpfr does not provide libmpfr.so.1 (but libmpfr.so for instance) then you will have to symlink it.
 
 
 
Apply workarounds described in next section.
 
make -j
 
Copy <tt>$NAVIT_PATH/navit/navit/navit.exe</tt> to your target.
 
  
 +
cd $NAVIT_PATH
 +
if [ ! -e build ]; then
 +
  mkdir build;
 +
fi;
 +
cd build
  
 +
cmake \
 +
-DCMAKE_TOOLCHAIN_FILE=$NAVIT_PATH/Toolchain/arm-mingw32ce.cmake \
 +
-Dsvg2png_scaling:STRING=0,16 \
 +
-Dsvg2png_scaling_nav:STRING=32 \
 +
-Dsvg2png_scaling_country:STRING=16 \
 +
$NAVIT_PATH
  
====Workarounds====
+
make
On Debian-based systems (including Ubuntu) install libsaxonb-java and run configure with the additional switch
+
</source>
  
  --with-saxon=saxonb-xslt
+
For subsequential builds it is sufficient to issue "make" in the build directory.
 
+
A rerun of cmake is only neccessary if parameters are changed.
Ignore errors about <tt>undefined reference to `deflateInit2_'</tt> and others returned by make, since they come from the maptool which isn't required on WinCE. (This is fixed in {{revision|3507}}: maptool will be skipped if the target platform is WinCE.)
 
  
 
==Remote Debugging==
 
==Remote Debugging==
 
Download the debugger provided by the CeGCC project:
 
Download the debugger provided by the CeGCC project:
 +
<source lang="bash">
 
  cd $NAVIT_PATH
 
  cd $NAVIT_PATH
 
  wget -c https://sourceforge.net/projects/cegcc/files/cegcc/0.59.1/gdb-arm-0.59.1.tar.bz2/download
 
  wget -c https://sourceforge.net/projects/cegcc/files/cegcc/0.59.1/gdb-arm-0.59.1.tar.bz2/download
 
  tar xjf gdb-arm-0.59.1.tar.bz2
 
  tar xjf gdb-arm-0.59.1.tar.bz2
 +
</source>
 +
 
Start navit (from SD card) in debug server at target (using TCP port 9999):
 
Start navit (from SD card) in debug server at target (using TCP port 9999):
 +
<source lang="bash">
 
  gdbserver :9999 "\Mounted Volume\navit\navit.exe"
 
  gdbserver :9999 "\Mounted Volume\navit\navit.exe"
 +
</source>
 +
 
Execute remote debugger at host, if target's IP address was 192.168.1.112:
 
Execute remote debugger at host, if target's IP address was 192.168.1.112:
 +
<source lang="bash">
 
  $NAVIT_PATH/opt/mingw32ce/bin/arm-mingw32ce-gdbtui $NAVIT_PATH/navit/navit.exe -eval-command="target remote 192.168.1.112:9999"
 
  $NAVIT_PATH/opt/mingw32ce/bin/arm-mingw32ce-gdbtui $NAVIT_PATH/navit/navit.exe -eval-command="target remote 192.168.1.112:9999"
 +
</source>
  
 
==Building using arm-cegcc==
 
==Building using arm-cegcc==
Line 98: Line 66:
 
Set the install path to where you want to install [http://cegcc.sourceforge.net cegcc]:
 
Set the install path to where you want to install [http://cegcc.sourceforge.net cegcc]:
  
 +
<source lang="bash">
 
  export CEGCC_PATH=/usr/local/cegcc
 
  export CEGCC_PATH=/usr/local/cegcc
 
  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
Line 103: Line 72:
 
  cd 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"
 
  ../cegcc/src/build-cegcc.sh --prefix=$CEGCC_PATH --components="binutils bootstrap_gcc w32api newlib dummy_cegccdll gcc cegccdll cegccthrddll libstdcppdll profile"
 +
</source>
  
 
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)":
 
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)":
Line 125: Line 95:
 
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:
 
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:
  
 +
<source lang="bash">
 
  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
Line 149: Line 120:
 
           | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 
           | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 
           | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
 
           | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
 +
</source>
  
 
====zlib====
 
====zlib====
  
 +
<source lang="bash">
 
  wget http://www.zlib.net/zlib-1.2.3.tar.gz
 
  wget http://www.zlib.net/zlib-1.2.3.tar.gz
 
  tar xzf zlib-1.2.3.tar.gz
 
  tar xzf zlib-1.2.3.tar.gz
Line 159: Line 132:
 
  make
 
  make
 
  make install
 
  make install
 +
</source>
  
 
====libiconv====
 
====libiconv====
  
 +
<source lang="bash">
 
  wget http://ftp.gnu.org/pub/gnu/libiconv/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
Line 169: Line 144:
 
  make
 
  make
 
  make install
 
  make install
 +
</source>
  
 
====gettext====
 
====gettext====
Line 177: Line 153:
 
dito for gettext-tools/gnulib-lib/wait-process.c line 31
 
dito for gettext-tools/gnulib-lib/wait-process.c line 31
  
 +
<source lang="bash">
 
  wget http://ftp.gnome.org/pub/gnome/binaries/win32/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
Line 184: Line 161:
 
  make
 
  make
 
  make install
 
  make install
 +
</source>
  
 
====libpng====
 
====libpng====
  
 +
<source lang="bash">
 
  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
 
  tar xzf libpng-1.2.34.tar.gz
 
  tar xzf libpng-1.2.34.tar.gz
Line 194: Line 173:
 
  CFLAG="-I $C_INCLUDE_PATH" make
 
  CFLAG="-I $C_INCLUDE_PATH" make
 
  make install
 
  make install
 +
</source>
  
 
====libtiff====
 
====libtiff====
 
  libtool: link: CURRENT `' must be a nonnegative integer
 
  libtool: link: CURRENT `' must be a nonnegative integer
  
 +
<source lang="bash">
 
  wget http://libtiff.maptools.org/dl/tiff-3.8.2.tar.gz
 
  wget http://libtiff.maptools.org/dl/tiff-3.8.2.tar.gz
 
  tar xzf tiff-3.8.2.tar.gz
 
  tar xzf tiff-3.8.2.tar.gz
Line 205: Line 186:
 
  make
 
  make
 
  make install
 
  make install
 +
</source>
  
 
====glib====
 
====glib====
 
  gatomic.c:570: Error: no such instruction: `swp %eax,%eax,[%esi]'
 
  gatomic.c:570: Error: no such instruction: `swp %eax,%eax,[%esi]'
  
 +
<source lang="bash">
 
  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
 
  tar xjf glib-2.18.4.tar.bz2
 
  tar xjf glib-2.18.4.tar.bz2
Line 216: Line 199:
 
  make
 
  make
 
  make install
 
  make install
 +
</source>
  
 
===Building Navit===
 
===Building Navit===
  svn co https://navit.svn.sourceforge.net/svnroot/navit/trunk/navit
+
<source lang="bash">
  cd navit
+
  git clone https://github.com/navit-gps/navit.git
 +
  cd navit/navit
 +
</source>
 
Add <tt>| -cegcc*</tt> to all files named <tt>config.sub</tt> as for the libraries.
 
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
 
  WINDRES=arm-cegcc-windres ./configure --disable-vehicle-file --host=arm-cegcc --prefix=$CEGCC_PATH 2>&1 | tee configure-cegcc.log
Line 230: Line 216:
  
 
  make -j
 
  make -j
 
November 2009: Navit.exe stops early due to exception_datatype_misalignment.
 
  
 
[[Category:Ports]]
 
[[Category:Ports]]
 
 
[http://www.prlog.org/11289974-phone-number-lookup-verizon-phone-number-reverse-lookup-to-get-information-you-need-quickly.html reverse lookup]
 
 
[http://thetvtopc.com/Reverse_Cell_Phone_Lookup_Number reverse phone lookup cell]
 

Latest revision as of 07:42, 15 July 2018

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

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

In November 2009 versions compiled using arm-cegcc-gcc (both revision 1214 and release 0.59.1) had problems (threw exception_datatype_misalignment and caused access violations).
Using the variant arm-mingw32ce of CeGCC 0.59.1 it was possible to build a working executable which can be debugged.
The automatic builds from the subversion repository seem to use an adjusted? version arm-wince-mingw32ce (see build logs).

Building using arm-mingw32ce[edit]

Install arm-mingw32ce[edit]

 mkdir -p navit
 cd navit
 export NAVIT_PATH=`pwd`
 wget -c https://sourceforge.net/projects/cegcc/files/cegcc/0.59.1/mingw32ce-0.59.1.tar.bz2/download
 tar xjf mingw32ce-0.59.1.tar.bz2

Building Navit using Cmake[edit]

#!/bin/bash
export NAVIT_PATH="/usr/src/navit"
export MINGW32CE_PATH="/opt/mingw32ce"
export PATH=$PATH:$MINGW32CE_PATH/bin 
 
cd $NAVIT_PATH
if [ ! -e build ]; then 
  mkdir build;
fi;
cd build
 
cmake \
-DCMAKE_TOOLCHAIN_FILE=$NAVIT_PATH/Toolchain/arm-mingw32ce.cmake \
-Dsvg2png_scaling:STRING=0,16 \
-Dsvg2png_scaling_nav:STRING=32 \
-Dsvg2png_scaling_country:STRING=16 \
$NAVIT_PATH
 
make

For subsequential builds it is sufficient to issue "make" in the build directory. A rerun of cmake is only neccessary if parameters are changed.

Remote Debugging[edit]

Download the debugger provided by the CeGCC project:

 cd $NAVIT_PATH
 wget -c https://sourceforge.net/projects/cegcc/files/cegcc/0.59.1/gdb-arm-0.59.1.tar.bz2/download
 tar xjf gdb-arm-0.59.1.tar.bz2

Start navit (from SD card) in debug server at target (using TCP port 9999):

 gdbserver :9999 "\Mounted Volume\navit\navit.exe"

Execute remote debugger at host, if target's IP address was 192.168.1.112:

 $NAVIT_PATH/opt/mingw32ce/bin/arm-mingw32ce-gdbtui $NAVIT_PATH/navit/navit.exe -eval-command="target remote 192.168.1.112:9999"

Building using arm-cegcc[edit]

Building cegcc[edit]

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[edit]

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[edit]

 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[edit]

 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[edit]

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[edit]

 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[edit]

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[edit]

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[edit]

 git clone https://github.com/navit-gps/navit.git
 cd navit/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