cross compile glib2 for embedded ARM
- Download the source
- https://developer.gnome.org/glib/
- 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
- set shell variable PKG_CONFIG_PATH
- export PKG_CONFIG_PATH=/home/kclin/workspace/cross_result/pkg_config/lib/pkgconfig/:$PKG_CONFIG_PATH
- 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
- 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