3 # (C)opyright 2011 Lutz Möhrmann
8 1) ver='Android 1.0' ;;
9 2) ver='Android 1.1' ;;
10 3) ver='Android 1.5 "Cupcake"' ;;
11 4) ver='Android 1.6 "Donut"' ;;
12 5) ver='Android 2.0 "Eclair"' ;;
13 6) ver='Android 2.0.1 "Eclair"' ;;
14 7) ver='Android 2.1 "Eclair"' ;;
15 8) ver='Android 2.2 "Froyo"' ;;
16 9) ver='Android 2.3 "Gingerbread"' ;;
17 10) ver='Android 2.3.3+ "Gingerbread"' ;;
18 11) ver='Android 3.0 "Honeycomb"' ;;
19 12) ver='Android 3.1 "Ice Cream Sandwich"' ;;
24 if [ -z $ANDROID_NDK ]; then
25 echo "The environment variable ANDROID_NDK must be set!"
29 platforms=$ANDROID_NDK/platforms
30 if [ ! -d $platforms ]; then
31 platforms=$ANDROID_NDK/build/platforms
34 if [ ! -d $platforms ]; then
35 echo "The environment variable ANDROID_NDK must be pointing to the android NDK!"
39 if [ ! -d navit -o ! -f autogen.sh ]; then
40 echo "This script must be called from the navit main directory (where autogen.sh is in)"
44 api_lvl=${1-$ANDROID_API_LVL}
46 while [ -z $api_lvl ]; do
47 echo "The environment variable ANDROID_API_LVL is not set and the API level was also not given on the commandline."
48 echo "Possible API levels for your NDK are:"
50 for p in android-*; do
51 [ -d $p/arch-arm ] || continue
52 show_api_lvl ${p#android-}
55 echo "Enter the desired API level (4 is recommended)"
57 if [ ! -d $platforms/android-$api_lvl/arch-arm ]; then
58 echo "Bad choice, retrying..."; echo ""
63 ANDROID_API_LVL=$api_lvl
64 export ANDROID_API_LVL
65 ANDROID_PLATFORM=$platforms/android-$ANDROID_API_LVL/arch-arm
66 export ANDROID_PLATFORM
67 PATH=`echo $ANDROID_NDK/toolchains/arm-eabi-*/prebuilt/linux-x86/bin`:$PATH
70 if [ ! -f Makefile.in ]; then
71 echo ""; echo "*** Running autogen.sh ***"; echo ""
75 if [ ! -f Makefile ]; then
76 echo ""; echo "*** Running configure ***"; echo ""
78 PKG_CONFIG=arm-eabi-pkgconfig \
79 RANLIB=arm-eabi-ranlib \
81 CC="arm-eabi-gcc -L$ANDROID_PLATFORM/usr/lib -L. -I$ANDROID_PLATFORM/usr/include" \
83 --host=arm-eabi-linux_android \
84 --enable-avoid-float \
85 --enable-avoid-unaligned \
86 --enable-cache-size=20971520 \
87 --enable-svg2png-scaling=8,16,32,48,64,96 \
88 --enable-svg2png-scaling-nav=59 \
89 --enable-svg2png-scaling-flag=32 \
90 --with-xslts=android,plugin_menu,pedestrian_button,pedestrian \
91 --with-saxon=saxonb-xslt \
92 --enable-transformation-roll \
93 --enable-plugin-pedestrian \
94 --with-android-permissions=CAMERA \
95 --with-android-project=android-$ANDROID_API_LVL
100 echo ""; echo "*** Running make ***"; echo ""
103 echo ""; echo "*** Running make apkg ***"; echo ""
108 apk=`pwd`/navit/android/bin/Navit-debug.apk
110 echo "Great - looks like it worked! The result is"; echo ""
114 echo "This shouldn't happen! Something went terribly wrong..."