免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2417 | 回复: 0
打印 上一主题 下一主题

来到新公司第一个task 交叉编译DBUS [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-06-20 16:20 |只看该作者 |倒序浏览
预安装vmware6.0, debian4.0 linux OS 配置IP, samba, telnet等网络服务

安装包命令:
./configure CC=arm-unknown-linux-gnu-gcc --prefix=/home/qudc/nfs --host=arm-linux --cache-file=arm-linux.cache
指定交叉编译工具                         指定安装路径            指定目标平台
make
make install

1. 把"export PATH=$PATH:/home/qudc/gcc-4.0.2-glibc-2.3.5/arm-unknown-linux-gnu/bin (不要加/)" 加入/home/qudc/.bashrc
export交叉编译工具链接路径.

2. 用root apt-get install gcc

3. 解压交叉编译工具和linux kernel 使kernel 中make menuconfig 成功. 会遇到头文件报错问题: 安装libc6-dev 和 libncurses5-dev 这两个包. make menuconfig 成功.

4. 安装pkg-config (只能是0.9版, 系统debian4是0.21版, 不然dbus编译不过) 为glib做准备. apt-get install pkg-config

5. 解决安装glib的编译错误
stack pointer 问题:
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
configure: error: Could not find a glib-genmarshal in your PATH
解压glib2-devel-2.4.7-1.tar.gz, 将文件复制到/usr/local下面

6. 安装expat-2.0.0.tar.gz

7. 安装libxml.tar.bz2

8. install dbus-1.0.2.tar.gz
checking abstract socket namespace... configure: error: cannot run test program while cross compiling
#echo ac_cv_have_abstract_sockets=yes>arm-linux.cache

PKG_CONFIG_PATH 问题:
在.bashrc里 export PKG_CONFIG_PATH
export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/home/qudc/nfs/lib/pkgconfig
configure成功

9. Install dbus-glib-0.74.tar.gz
checking for posix getpwnam_r... configure: error: cannot run test program while cross compiling
checking abstract socket namespace... configure: error: cannot run test program while cross compiling
在arm-linux.cache文件里加两行
ac_cv_func_posix_getpwnam_r=yes
ac_cv_have_abstract_sockets=yes

./configure: line 26052: ./po/POTFILES.in: No such file or directory (这行有人说可以忽略)
checking for XML_ParserCreate_MM in -lexpat... (cached) no
configure: error: expat library not found, check config.log for failed attempts
解决: #./configure CC=arm-unknown-linux-gnu-gcc CPPFLAGS=-I/home/qudc/nfs/include LDFLAGS=-L/home/qudc/nfs/lib --prefix=/home/qudc/nfs --host=arm-linux --cache-file=arm-linux.cache

make 出错信息:
Making all in examples
make[4]: Entering directory `/home/qudc/dbus-glib-0.74/dbus/examples'
/bin/sh ../../libtool --mode=execute ../../dbus/dbus-binding-tool --prefix=some_object --mode=glib-server --output=example-service-glue.h ./example-service.xml
/home/qudc/dbus-glib-0.74/dbus/examples/../../dbus/dbus-binding-tool: line 105: /home/qudc/dbus-glib-0.74/dbus/.libs/lt-dbus-binding-tool: cannot execute binary file
/home/qudc/dbus-glib-0.74/dbus/examples/../../dbus/dbus-binding-tool: line 105: /home/qudc/dbus-glib-0.74/dbus/.libs/lt-dbus-binding-tool: Success
make[4]: *** [example-service-glue.h] Error 1
make[4]: Leaving directory `/home/qudc/dbus-glib-0.74/dbus/examples'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/qudc/dbus-glib-0.74/dbus'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/qudc/dbus-glib-0.74/dbus'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/qudc/dbus-glib-0.74'
make: *** [all] Error 2
解决:修改./dbus/Makefile.
  SUBDIRS = . examples => SUBDIRS = . #example

make再次出错信息:
Making all in tools
make[2]: Entering directory `/home/qudc/dbus-glib-0.74/tools'
DBUS_TOP_BUILDDIR=.. dbus-daemon --introspect > dbus-bus-introspect.xml.tmp && mv dbus-bus-introspect.xml.tmp dbus-bus-introspect.xml
../dbus/dbus-binding-tool --mode=glib-client --prefix=dbus_bus --output=dbus-glib-bindings.h dbus-bus-introspect.xml
../dbus/dbus-binding-tool: line 105: /home/qudc/dbus-glib-0.74/dbus/.libs/lt-dbus-binding-tool: cannot execute binary file
../dbus/dbus-binding-tool: line 105: /home/qudc/dbus-glib-0.74/dbus/.libs/lt-dbus-binding-tool: Success
make[2]: *** [dbus-glib-bindings.h] Error 1
make[2]: Leaving directory `/home/qudc/dbus-glib-0.74/tools'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/qudc/dbus-glib-0.74'
make: *** [all] Error 2
解决: 修改./dbus/Makefile.
  SUBDIRS = . examples => SUBDIRS = . #example

D-BUS编译终于完成.

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/99283/showart_1971652.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP