1. Download the source
    • https://developer.gnome.org/glib/
  2. Preset the compile option
    • echo ac_cv_type_long_long=yes>arm-linux.cache
       echo glib_cv_stack_grows=no>>arm-linux.cache
       echo glib_cv_uscore=no>>arm-linux.cache
       echo ac_cv_func_posix_getpwuid_r=yes>>arm-linux.cache
       echo ac_cv_func_posix_getgrgid_r=yes>>arm-linux.cache
  3. set shell variable PKG_CONFIG_PATH
    • export PKG_CONFIG_PATH=/home/kclin/workspace/cross_result/pkg_config/lib/pkgconfig/:$PKG_CONFIG_PATH
  4. configure the makefile
    • ./configure CC=arm-linux-gnueabi-gcc CXX=arm-linux-gnurabi-g++ --host=arm-linux --build=i686-linux --prefix=/home/kclin/workspace/cross_result/pkg_config/ RANLIB=arm-linux-gnueabi-ranlib LD=arm-linux-gnueabi-ld --cache-file=arm-linux.cache LIBFFI_LIBS="-L/home/kclin/workspace/cross_result/pkg_config/lib -lffi" LIBFFI_CFLAGS=-I/home/kclin/workspace/cross_result/pkg_config/lib/libffi-3.0.13/include ZLIB_CFLAGS=-I/home/kclin/workspace/cross_result/pkg_config/include
  5. make && make install

Refer to this article also. http://blog.chinaunix.net/uid-26824563-id-3415885.html

Some help:

http://stackoverflow.com/questions/12494072/compiling-glib-with-non-standard-paths

Leave a Reply