您的位置:首页 > 其它

交叉编译dbus文章汇总

2014-11-18 11:21 288 查看
预安装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

下载dbus源码,地址是http://www.freedesktop.org/wiki/Software/dbus

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编译终于完成.http://jz345.net/?action-viewnews-itemid-51660
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐