Hi, I open this new thread to clearly describe my condition:<br><br>1.I use the android NDK provided by Mozzila which has nearly full C++ support:<br><span style="font-size: medium;"><span style="color: rgb(0, 0, 255);"><span style="color: rgb(136, 136, 136);"><span style="color: rgb(0, 0, 0);"></span></span></span></span><a href="http://ftp.mozilla.org/pub/mozilla.org/mobile/source/android-ndk-r4c-0moz3.tar.bz2" target="_blank">http://ftp.mozilla.org/pub/mozilla.org/mobile/source/android-ndk-r4c-0moz3.tar.bz2</a><br>



and I have modified <span><span>Andrew Ross&#39;s agcc to partner with this NDK:<br><a href="http://blog.csdn.net/rozenix/archive/2011/02/28/6212994.aspx" target="_blank">http://blog.csdn.net/rozenix/archive/2011/02/28/6212994.aspx</a><br>



<br>2. Then I cross compile glib2.28.1 onto Android in this order:<br></span></span><span><span>1)</span></span><span><span>libiconv-1.13.1.tar.gz: <br>configured by:<br><i>CC=agcc CXX=agcc LD=arm-eabi-ld RANLIB=arm-eabi-ranlib \<br>

PKG_CONFIG_LIBDIR=/data/local/lib/pkgconfig:/data/local/share/pkgconfig/ \<br>    ./configure \<br>    --prefix=/data/local \<br>    --host=arm-eabi-linux \</i></span></span><span><span><i><br>    --enable-malloc0returnsnull \</i></span></span><br>
<span><span><i>    --enable-shared \</i><br> 2)gettext-0.18.1.1.tar.gz<br>configured by:<br>
<i>CC=agcc CPPFLAGS=&quot;-I/data/local/include&quot; LDFLAGS=&quot;-L/data/local/lib&quot; CXX=agcc LD=arm-eabi-ld RANLIB=arm-eabi-ranlib \<br>PKG_CONFIG_LIBDIR=/data/local/lib/pkgconfig:/data/local/share/pkgconfig/ \<br>

    ./configure \<br>    --prefix=/data/local \<br>    --host=arm-eabi-linux \<br>    --enable-malloc0returnsnull \<br>    --enable-shared \<br>    --cache-file=arm.cache \<br>    --without-included-regex \<br>    --disable-java --disable-openmp --without-libiconv-prefix --without-libintl-prefix --without-libglib-2.0-prefix --without-libcroco-0.6-prefix --with-included-libxml --without-libncurses-prefix --without-libtermcap-prefix --without-libcurses-prefix --without-libexpat-prefix --without-emacs<br>

  </i> But the build of gettext will not fully succeed,never mind, I need only libintl.so so just make install.<br><br>3)  glib-2.28.1.tar.gz<br></span></span><span><span>1st, do patching with my attached file(these are all that I found that have to be modified)<br>

 2nd, write this into the cache file arm.cache:<br></span></span><span style="color: blue;" lang="EN-US"><font face="Times New Roman"><font size="3"><font size="2"><i>glib_cv_stack_grows=no</i></font></font></font></span><font size="2"><i><span style="color: blue;" lang="EN-US"><font face="Times New Roman"><br>

glib_cv_uscore=no</font></span><span style="color: blue;" lang="EN-US"><font face="Times New Roman"><br>ac_cv_func_posix_getpwuid_r=no</font></span><br><span style="color: blue;" lang="EN-US"><font face="Times New Roman">ac_cv_func_posix_getgrgid_r=no</font></span></i></font><br>
<span><span></span></span><span><span>3rd, </span></span><span><span>configured  the same </span></span><span><span>as libiconv.</span></span><br>4th, remove the -lpthread in gthread/Makefile.<br>5td, make;make install<br>
<br><span><span>3. Also I have to port pixman and openssl onto android.<br></span></span><span><span>1)pixman-0.20.0: config. make;make install same as libiconv</span></span><br><span><span>2)openssl-1.0.0: config by:<br>
</span></span>./config no-asm shared --prefix=/data/local/<br><span><span>then modify the Makefile:gcc--&gt;agcc remove the -m64..etc.<br>make...<br>  <br>
3. So I disable the audio channels and build snappy onto android with this script under spice-gtk/gtk:<br>
#!/bin/bash<br>COMMON_DIR=../common<br>SPICE_GLIB_SRC=&quot;coroutine_gthread.c
spice-util.c spice-session.c spice-channel.c spice-glib-enums.c
spice-marshal.c generated_demarshallers.c generated_demarshallers1.c
generated_marshallers.c generated_marshallers1.c gio-coroutine.c
channel-base.c channel-main.c channel-display.c channel-display-mjpeg.c
channel-cursor.c channel-inputs.c decode-glz.c decode-jpeg.c
decode-zlib.c $COMMON_DIR/mem.c $COMMON_DIR/marshaller.c
$COMMON_DIR/canvas_utils.c $COMMON_DIR/sw_canvas.c
$COMMON_DIR/pixman_utils.c $COMMON_DIR/lines.c $COMMON_DIR/rop3.c
$COMMON_DIR/quic.c $COMMON_DIR/lz.c $COMMON_DIR/region.c
$COMMON_DIR/ssl_verify.c&quot;<br>
CPP_FLAGS=&quot;-DHAVE_CONFIG_H -DSW_CANVAS_CACHE  -D_REENTRANT -I. -I..
-I../common -I/data/local/include/spice-1
-I/data/local/include/pixman-1 -I/data/local/include
-I/data/local/include/glib-2.0 -I/data/local/lib/glib-2.0/include&quot;<br>
C_FLAGS=&quot;-std=gnu99 -Wall -Wno-sign-compare -Wno-deprecated-declarations -Wl,--no-undefined -fPIC -DPIC &quot;<br>LD_FLAGS=&quot;-L/data/local/lib/
-lpixman-1 -lm  -lssl -lcrypto -ljpeg -lz -lglib-2.0  -lgio-2.0
-lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 &quot;<br>
echo &quot;agcc -shared -o libspicec_glib.so $SPICE_GLIB_SRC $CPP_FLAGS $C_FLAGS $LD_FLAGS&quot;<br>agcc -shared -o libspicec.so  $SPICE_GLIB_SRC $CPP_FLAGS $C_FLAGS $LD_FLAGS<br>agcc -o snappy spice-cmdline.c snappy.c -DG_LOG_DOMAIN=\&quot;GSpice\&quot; -DSW_CANVAS_CACHE -DSPICE_GTK_LOCALEDIR=\&quot;/usr/local/share/locale\&quot; $CPP_FLAGS $C_FLAGS $LD_FLAGS -lspicec -lintl -liconv -L./</span></span><br>
<br>then I put all the snappy,libspicec.so,lib*so onto android dev. and reproduce the faults.<br>Thanks.<br>