glib交叉编译过程

glib-2.24.0交叉编译过程

硬件环境arm, gcc编译器版本3.4.6
编译主机环境: 2.6.32-21-generic #32-Ubuntu SMP  i686 GNU/Linux


1:执行autogen.sh
2:配置cache-file,具体配置项如下:
glib_cv_long_long_format=ll
glib_cv_stack_grows=no
glib_cv_working_bcopy=yes
glib_cv_sane_realloc=yes
glib_cv_have_strlcpy=no
glib_cv_va_val_copy=yes
glib_cv_rtldglobal_broken=yes
glib_cv_uscore=yes
ac_cv_func_posix_getpwuid_r=yes
ac_cv_func_nonposix_getpwuid_r=yes
ac_cv_func_posix_getgrgid_r=yes
glib_cv_use_pid_surrogate=yes
ac_cv_func_printf_unix98=no
ac_cv_func_vsnprintf_c99=no

保存为文件arm-linux.cache

3:编译过程中会出现以下错误情况:
1)“checking for msgfmt... no
configure: error:
*** You must have either have gettext support in your C library, or use the
*** GNU gettext library. (http://www.gnu.org/software/gettext/gettext.html
解决方法:安装gettest,apt-get install gettext
2) “checking for growing stack pointer... configure: error: in `/root/glib-2.24.0':
configure: error: cannot run test program while cross compiling
解决方法:glib_cv_stack_grows=no
3)“checking for glib-genmarshal... no
configure: error: Could not find a glib-genmarshal in your PATH
解决方法:apt-get install libglib2.0-dev


4: 在glib目录下,执行“./configure --host=arm-etone-linux-gnueabi CC={交叉gcc编译器所在路径}/bin/arm-linux-gcc --cache-file=arm-linux.cache --prefix=/root/glib/install " 命令,配置编译的环境。

4: 修改glib目录下的libtool脚本,由于默认的一些命令可能与本机的有所出入,所以需要参考/usr/bin/libtool的脚本,把NM和global_symbol_pipe的定义修改为“/usr/bin/libtool”脚本中的定义。

5:执行”make“命令,编译完毕。


这个过程磨了很久才出来的,唉,对脚本还不是很熟练!



PS: 编译glib-2.29.16时,需要增加
ac_cv_path_GLIB_COMPILE_SCHEMAS=yes ac_cv_func_qsort_r=yes
两个配置项,并且安装libffi库。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值