[Spice-devel] Porting snappy/libspicec-glib.so onto Android-ARM

Shuxiang Lim shohyanglim at gmail.com
Thu Mar 24 23:41:49 PDT 2011


Hi,guys!
   This is my instructions and patches for porting snappy/libspicec-glib.so
extracted from spicec-gtk-0.5 onto Android-ARM.
   It's still nascent and raw though, more hacking is needed!
   These are my steps, suppose you're familiar with cross compiling.

1.I use the android NDK provided by Mozzila which has nearly full C++
support:
http://ftp.mozilla.org/pub/mozilla.org/mobile/source/android-ndk-r4c-0moz3.tar.bz2
and I have modified Andrew Ross's perl script:agcc to extract and use the
toolchain from this NDK (attached)
2. Then I cross compile glib2.28.1 onto Android in this order:
1)libiconv-1.13.1.tar.gz:
configured by:
*CC=agcc CXX=agcc LD=arm-eabi-ld RANLIB=arm-eabi-ranlib \
PKG_CONFIG_LIBDIR=/data/local/lib/pkgconfig:/data/local/share/pkgconfig/ \
    ./configure \
    --prefix=/data/local \
    --host=arm-eabi-linux \*
*    --enable-shared \*
 2)gettext-0.18.1.1.tar.gz
configured by:
*CC=agcc CPPFLAGS="-I/data/local/include" LDFLAGS="-L/data/local/lib"
CXX=agcc LD=arm-eabi-ld RANLIB=arm-eabi-ranlib \
PKG_CONFIG_LIBDIR=/data/local/lib/pkgconfig:/data/local/share/pkgconfig/ \
    ./configure \
    --prefix=/data/local \
    --host=arm-eabi-linux \
    --enable-shared \
    --cache-file=arm.cache \
    --without-included-regex \
    --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
  * But the build of gettext will not fully succeed,never mind, I need only
libintl.so so just make install.

3)  glib-2.28.1.tar.gz
1st, do patching with my attached file
*#patch -p0 < ** glib-android.patch*
 2nd, write this into the cache file arm.cache:
*#cat > arm.cache
ac_cv_android_arm=yes
glib_cv_stack_grows=no
** glib_cv_uscore=no*
*ac_cv_func_posix_getpwuid_r=no
ac_cv_func_posix_getgrgid_r=no*
ctrl-D
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)
4th, autoconf;then configured  the same as libiconv.
5td, make;make install

3. Also I have to port pixman and openssl and jpeg onto android.
1)pixman-0.20.0,jpeg-6b: config. make;make install same as libiconv
2)openssl-1.0.0: config by:
./config no-asm shared --prefix=/data/local/
then modify the Makefile:gcc-->agcc remove the -m64..etc.
make;make install

4. for snappy and libspicec-glib.so
1).tar xf spice-gtk-0.5.tar.gz
2).#patch -p0 < snappy-android.patch (file attached)
3).ensure to succeed in the normal ./configure and make on the current host
machine to generate config.h and some other files.
*#CC=gcc \
./configure \
--prefix=/usr/local/mylocal \
--enable-shared \
--cache-file=arm.cache \
--with-coroutine=gthread
#make

*4).#cd gtk/
5). you may use or reference my attached file :amakfile
  #make clean -f amakefile
  #make -f amakefile
6) put the lib*.so files and exec. file snappy onto android device and run.
*#LD_LIBRARY_PATH=/system/lib:/data/local/lib ./snappy -h 192.168.1.31 -p
5900 -o ahoo.ppm*

You may have check my snapped image ahoo.jpeg<--ahoo.ppm and run-logs in my
blogs:
http://blog.csdn.net/rozenix/archive/2011/03/25/6277742.aspx
http://blog.csdn.net/rozenix/archive/2011/03/25/6277647.aspx

That's it! Mail me if you've got any problem!
Happy hacking!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20110325/569ce7e4/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: snappy-android.patch
Type: text/x-diff
Size: 6580 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20110325/569ce7e4/attachment-0002.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: glib-android.patch
Type: text/x-diff
Size: 14090 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20110325/569ce7e4/attachment-0003.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: agcc
Type: application/octet-stream
Size: 7282 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20110325/569ce7e4/attachment-0001.obj>


More information about the Spice-devel mailing list