1 |
#!/bin/bash
|
2 |
|
3 |
|
4 |
set -x
|
5 |
|
6 |
mkdir -p $BUILD_PATH
|
7 |
cd $BUILD_PATH
|
8 |
export PATH=$PATH_BASE_:${_NDK_}/toolchains/${TOOLCHAIN_NAME_}/prebuilt/linux-x86${SUFFIX2}/bin
|
9 |
export LIBGCC_DIR="${_NDK_}/toolchains/${TOOLCHAIN_NAME_}/prebuilt/linux-x86${SUFFIX2}/lib/gcc/${TOOLCHAIN_NAME_2_}/${TC_VER_}/""${LGCC_ADDON}"
|
10 |
export PLATFORM_ROOT=$NDK/platforms/android-${AND_API_LEVEL_C}/arch-${ARCH_4__}
|
11 |
|
12 |
|
13 |
# mkdir -p ..../build_xxx/navit/obj/local/armeabi-v7a/objs-debug/zanavi/
|
14 |
|
15 |
DEBUG_="-fpic -ffunction-sections $OPTIONS__COMPILE_ADDON_2 -fomit-frame-pointer -fno-strict-aliasing \
|
16 |
-DHAVE_API_ANDROID \
|
17 |
-DANDROID \
|
18 |
-Wa,--noexecstack \
|
19 |
-O${OPTIMIZE_LEVEL} \
|
20 |
-I$_NDK_/platforms/android-"$AND_API_LEVEL_C"/arch-${ARCH_4__}/usr/include \
|
21 |
-Wl,-rpath-link=$_NDK_/platforms/android-"$AND_API_LEVEL_C"/arch-${ARCH_4__}/usr/lib \
|
22 |
-L$_NDK_/platforms/android-"$AND_API_LEVEL_C"/arch-${ARCH_4__}/usr/lib"
|
23 |
|
24 |
# -nostdlib \
|
25 |
|
26 |
|
27 |
${SOURCE_PATH}/configure RANLIB="${TOOLCHAIN_NAME_2_}-ranlib" AR="${TOOLCHAIN_NAME_2_}-ar" LD="${TOOLCHAIN_NAME_2_}-ld" \
|
28 |
CC="${NDK_CCACHE}${TOOLCHAIN_NAME_2_}-gcc -O${OPTIMIZE_LEVEL} $DEBUG_ -L. -L${LIBGCC_DIR} --sysroot=${_NDK_}/platforms/android-${AND_API_LEVEL_C}/arch-${ARCH_4__} -lgcc -lc -ljnigraphics " \
|
29 |
CXX="${NDK_CCACHE}${TOOLCHAIN_NAME_2_}-g++ -O${OPTIMIZE_LEVEL} -fno-rtti -fno-exceptions ${OPTIONS__COMPILE_ADDON_3} --sysroot=${_NDK_}/platforms/android-${AND_API_LEVEL_C}/arch-${ARCH_4__} \
|
30 |
-L$LIBGCC_DIR -lgcc -lc -ljnigraphics " \
|
31 |
${HOST_PARAM_}${TOOLCHAIN_NAME_3_}${OPTIONS__COMPILE_ADDON_1} \
|
32 |
--enable-avoid-unaligned \
|
33 |
--disable-glib \
|
34 |
--disable-gmodule \
|
35 |
--disable-vehicle-gpsd "$conf_addon" \
|
36 |
--enable-vehicle-demo \
|
37 |
--disable-binding-dbus \
|
38 |
--disable-speech-cmdline \
|
39 |
--disable-gui-gtk \
|
40 |
--disable-font-freetype \
|
41 |
--disable-fontconfig \
|
42 |
--disable-graphics-qt-qpainter \
|
43 |
--disable-graphics-gtk-drawing-area \
|
44 |
--disable-maptool \
|
45 |
--enable-cache-size=20971520 \
|
46 |
--enable-svg2png-scaling=8,16,32,48,64,96,192,384 \
|
47 |
--enable-svg2png-scaling-nav=48,64,59,96,192,384 \
|
48 |
--enable-svg2png-scaling-flag=32 \
|
49 |
--with-xslts=android,plugin_menu \
|
50 |
--with-saxon=saxonb-xslt \
|
51 |
--enable-transformation-roll \
|
52 |
--with-android-project="android-""$AND_API_LEVEL_J"
|
53 |
# > /dev/null 2> /dev/null
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
if [ "$ARCH__""x" == "armx" ]; then
|
64 |
## --- Coverity ----------------------------
|
65 |
if [ "$COVERITY_BUILD_""x" == "1x" ]; then
|
66 |
export AND_API_LEVEL_C=14 && \
|
67 |
export NDK=$_NDK_ && \
|
68 |
export DO_RELEASE_BUILD=1 && \
|
69 |
export DO_PNG_BUILD=1 && \
|
70 |
export NDK_CCACHE="" && \
|
71 |
export PATH=/home/ubuntu/cov_scan/cov-analysis-linux64-8.5.0/bin:/usr/local/android-ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin:$PATH
|
72 |
cd $BUILD_PATH
|
73 |
# cov-configure --comptype gcc --compiler /usr/local/android-ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc
|
74 |
cov-configure -co arm-linux-androideabi-gcc -- -march=armv5te -msoft-float -mthumb
|
75 |
make clean
|
76 |
cov-build --dir cov-int make
|
77 |
|
78 |
ls -al $BUILD_PATH/navit/.libs/lib_data_data_com.zoffcc.applications.zanavi_lib_navit.so
|
79 |
ls -al $BUILD_PATH/navit/.libs/navit2
|
80 |
ls -al $BUILD_PATH/navit/navit2
|
81 |
|
82 |
make clean
|
83 |
conf_addon=''
|
84 |
sed -i -e 's#ABCDD="aaaabbb"#LIBS="$LIBS -rdynamic"#g' ${SOURCE_PATH}/configure
|
85 |
cat ${SOURCE_PATH}/configure | grep 'rdynamic'
|
86 |
cat ${SOURCE_PATH}/configure | grep 'aaaabbb'
|
87 |
${SOURCE_PATH}/configure RANLIB=arm-linux-androideabi-ranlib AR=arm-linux-androideabi-ar CC="$NDK_CCACHE arm-linux-androideabi-gcc -O2 $DEBUG_ -L. -L$_NDK_/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86$SUFFIX2/lib/gcc/arm-linux-androideabi/4.8/ -lgcc -ljnigraphics " CXX="$NDK_CCACHE arm-linux-androideabi-g++ -O2 -fno-rtti -fno-exceptions -L$_NDK_/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86$SUFFIX2/lib/gcc/arm-linux-androideabi/4.8/ -lgcc -ljnigraphics " --host=arm-eabi-linux_android --enable-avoid-float --enable-avoid-unaligned --disable-glib --disable-gmodule --disable-vehicle-gpsd $conf_addon --enable-vehicle-demo --disable-binding-dbus --disable-speech-cmdline --disable-gui-gtk --disable-font-freetype --disable-fontconfig --disable-graphics-qt-qpainter --disable-graphics-gtk-drawing-area --disable-maptool --enable-cache-size=20971520 --enable-svg2png-scaling=8,16,32,48,64,96,192,384 --enable-svg2png-scaling-nav=48,64,59,96,192,384 --enable-svg2png-scaling-flag=32 --with-xslts=android,plugin_menu --with-saxon=saxonb-xslt --enable-transformation-roll --with-android-project="android-21" > /dev/null 2> /dev/null
|
88 |
|
89 |
fi
|
90 |
## --- Coverity ----------------------------
|
91 |
fi
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
pushd ./
|
99 |
if [ "$FULL_LOG""x" == "1x" ]; then
|
100 |
make
|
101 |
ex_code=$?
|
102 |
else
|
103 |
make > "/tmp/make_$$.log" 2>&1 ; ex_code=$?
|
104 |
cat "/tmp/make_$$.log" | grep -i error
|
105 |
rm -f "/tmp/make_$$.log"
|
106 |
fi
|
107 |
popd
|
108 |
cd navit
|
109 |
|
110 |
|
111 |
if [ $ex_code != 0 ]; then
|
112 |
echo "--BUILD ERROR--"
|
113 |
echo "--BUILD ERROR--"
|
114 |
echo "--BUILD ERROR--"
|
115 |
echo "--BUILD ERROR--"
|
116 |
echo "--BUILD ERROR--"
|
117 |
echo "--BUILD ERROR--"
|
118 |
echo "--BUILD ERROR--"
|
119 |
|
120 |
exit $ex_code
|
121 |
fi
|
122 |
|
123 |
echo "+++++++++++++"
|
124 |
pwd
|
125 |
echo "+++++++++++++"
|
126 |
|
127 |
ls -al $BUILD_PATH/navit/.libs/lib_data_data_com.zoffcc.applications.zanavi_lib_navit.so
|
128 |
ls -al $BUILD_PATH/navit/.libs/navit2
|
129 |
ls -al $BUILD_PATH/navit/navit2
|
130 |
|
131 |
mkdir -p ${OUTPUT_LIBPATH_}/
|
132 |
cp -av $BUILD_PATH/navit/.libs/lib_data_data_com.zoffcc.applications.zanavi_lib_navit.so ${OUTPUT_LIBPATH_}/libnavit.so
|
133 |
echo "before strip:"
|
134 |
ls -al ${OUTPUT_LIBPATH_}/libnavit.so
|
135 |
${TOOLCHAIN_NAME_2_}-strip ${OUTPUT_LIBPATH_}/libnavit.so
|
136 |
echo "after strip:"
|
137 |
ls -al ${OUTPUT_LIBPATH_}/libnavit.so
|
138 |
echo ""
|
139 |
|
140 |
echo "output path=""$OUTPUT_LIBPATH_/"
|
141 |
ls -al $OUTPUT_LIBPATH_/
|
142 |
|
143 |
|
144 |
if [ ! -e "$OUTPUT_LIBPATH_/libnavit.so" ]; then
|
145 |
echo "ERROR:${ARCH__}:library not built"
|
146 |
exit 1
|
147 |
fi
|
148 |
|
149 |
|