Hi,guys!<br>   This is my instructions and patches for porting snappy/libspicec-glib.so extracted from spicec-gtk-0.5 onto Android-ARM.<br>   It&#39;s still nascent and raw though, more hacking is needed!<br>   These are my steps, suppose you&#39;re familiar with cross compiling.<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 perl script:agcc to extract and use the toolchain from this NDK (attached)<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></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-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<br><i>#patch -p0 &lt; </i></span></span><i><span><span> glib-android.patch</span></span></i><br>


<span><span>

 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>#cat &gt; arm.cache<br>ac_cv_android_arm=yes<br>glib_cv_stack_grows=no<br>
</i></font></font></font></span><font size="2"><i><span style="color: blue;" lang="EN-US"><font face="Times New Roman">



glib_cv_uscore=no</font></span></i></font><br><font size="2"><i><span style="color: blue;" lang="EN-US"></span><span style="color: blue;" lang="EN-US"><font face="Times New Roman">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>ctrl-D<br>


<span><span></span></span><span><span>3rd, make sure you have the tools such as glib-genmarshaller of right vision in your host machine(you may need to first install glib on your host machine)<br></span></span><span><span>4th, autoconf;</span></span><span><span>then configured  the same </span></span><span><span>as libiconv.</span></span><br>
5td, make;make install<br>


<br><span><span>3. Also I have to port pixman and openssl and jpeg onto android.<br></span></span><span><span>1)pixman-0.20.0,jpeg-6b: 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;make install<br><br>4. for snappy and libspicec-glib.so<br>1).tar xf spice-gtk-0.5.tar.gz<br>
2).#patch -p0 &lt; snappy-android.patch (file attached)<br>3</span></span><span><span>)</span></span><span><span>.ensure to succeed in the normal ./configure and make on the current host machine to generate config.h and some other files.<br>
<i>#CC=gcc \<br>./configure \<br>--prefix=/usr/local/mylocal \<br>--enable-shared \<br>--cache-file=arm.cache \<br>--with-coroutine=gthread<br>#make<br><br></i>4</span></span><span><span>)</span></span><span><span>.#cd gtk/<br>
5</span></span><span><span>)</span></span><span><span>. you may use or reference my attached file :amakfile<br>  #make clean -f amakefile<br>  #</span></span><span><span>make -f amakefile</span></span><br>6) put the lib*.so files and exec. file snappy onto android device and run.<br>
<i>#LD_LIBRARY_PATH=/system/lib:/data/local/lib ./snappy -h 192.168.1.31 -p 5900 -o ahoo.ppm</i><br><br>You may have check my snapped image ahoo.jpeg&lt;--ahoo.ppm and run-logs in my blogs:<br><a href="http://blog.csdn.net/rozenix/archive/2011/03/25/6277742.aspx">http://blog.csdn.net/rozenix/archive/2011/03/25/6277742.aspx</a><br>
<a href="http://blog.csdn.net/rozenix/archive/2011/03/25/6277647.aspx">http://blog.csdn.net/rozenix/archive/2011/03/25/6277647.aspx</a><br><br><span><span>That&#39;s it! Mail me if you&#39;ve got any problem!<br>Happy hacking!<br>
</span></span><span><span><br><br> </span></span><br>   <br>