[Spice-devel] New thread: problems in porting glib2.0 and snappy onto android

Shuxiang Lim shohyanglim at gmail.com
Mon Mar 21 03:13:12 PDT 2011


Hi, I open this new thread to clearly describe my condition:

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 agcc to partner with this NDK:
http://blog.csdn.net/rozenix/archive/2011/02/28/6212994.aspx

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-malloc0returnsnull \*
*    --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-malloc0returnsnull \
    --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(these are all that I found that have
to be modified)
2nd, write this into the cache file arm.cache:
*glib_cv_stack_grows=no**
glib_cv_uscore=no
ac_cv_func_posix_getpwuid_r=no
ac_cv_func_posix_getgrgid_r=no*
3rd, configured  the same as libiconv.
4th, remove the -lpthread in gthread/Makefile.
5td, make;make install

3. Also I have to port pixman and openssl onto android.
1)pixman-0.20.0: 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...

3. So I disable the audio channels and build snappy onto android with this
script under spice-gtk/gtk:
#!/bin/bash
COMMON_DIR=../common
SPICE_GLIB_SRC="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"
CPP_FLAGS="-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"
C_FLAGS="-std=gnu99 -Wall -Wno-sign-compare -Wno-deprecated-declarations
-Wl,--no-undefined -fPIC -DPIC "
LD_FLAGS="-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 "
echo "agcc -shared -o libspicec_glib.so $SPICE_GLIB_SRC $CPP_FLAGS $C_FLAGS
$LD_FLAGS"
agcc -shared -o libspicec.so  $SPICE_GLIB_SRC $CPP_FLAGS $C_FLAGS $LD_FLAGS
agcc -o snappy spice-cmdline.c snappy.c -DG_LOG_DOMAIN=\"GSpice\"
-DSW_CANVAS_CACHE -DSPICE_GTK_LOCALEDIR=\"/usr/local/share/locale\"
$CPP_FLAGS $C_FLAGS $LD_FLAGS -lspicec -lintl -liconv -L./

then I put all the snappy,libspicec.so,lib*so onto android dev. and
reproduce the faults.
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20110321/5671d0bb/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: glib-android.patch
Type: text/x-diff
Size: 10118 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20110321/5671d0bb/attachment.patch>


More information about the Spice-devel mailing list