你好
小弟最近在交叉编译dbus的时候碰到了一些麻烦,路过看到大哥对dbus深有研究,不知道能否给点指引?
1、环境:
arm-linux-gcc-3.4.5
libxml2-2.6.32
dbus-1.2.1
以下是config后的提示信息:
D-Bus 1.2.1
==============
prefix: /usr/local
exec_prefix: ${prefix}
libdir: /usr/local/lib
libexecdir: /usr/local/libexec
bindir: /usr/local/bin
sysconfdir: /usr/local/etc
localstatedir: /usr/local/var
datadir: /usr/local/share
source code location: .
compiler: arm-linux-gcc
cflags: -ffunction-sections -fdata-sections -g -O2 -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wfloat-equal -Wsign-compare -Wdeclaration-after-statement -fno-common
cppflags:
cxxflags: -g -O2
64-bit int: long long
32-bit int: int
16-bit int: short
Doxygen: no
xmlto: no
Maintainer mode: no
gcc coverage profiling: no
Building unit tests: no
Building verbose mode: no
Building assertions: no
Building checks: yes
Building SELinux support: no
Building inotify support: no
Building dnotify support: yes
Building kqueue support: no
Building X11 code: yes
Building Doxygen docs: no
Building XML docs: no
Building cache support: yes
Gettext libs (empty OK):
Using XML parser: libxml
Init scripts style: none
Abstract socket names: yes
System bus socket: /usr/local/var/run/dbus/system_bus_socket
System bus address: unix:path=/usr/local/var/run/dbus/system_bus_socket
System bus PID file: /usr/local/var/run/dbus/pid
Session bus socket dir: /tmp
Console auth dir: /var/run/console/
Console owner file: no
Console owner file path:
System bus user: messagebus
Session bus services dir: /usr/local/share/dbus-1/services
'make check' socket dir: /tmp
编译的时候提示以下错误:
config-loader-libxml.c:198: undefined reference to `xmlReaderForMemory'
可是我已经安装了xml的库:
lfc@lfc-laptop:dbus-1.2.1$ ls /usr/local/arm/3.4.5/arm-linux/lib/libxml2.*
/usr/local/arm/3.4.5/arm-linux/lib/libxml2.a /usr/local/arm/3.4.5/arm-linux/lib/libxml2.so.2
/usr/local/arm/3.4.5/arm-linux/lib/libxml2.la /usr/local/arm/3.4.5/arm-linux/lib/libxml2.so.2.6.32
/usr/local/arm/3.4.5/arm-linux/lib/libxml2.so
而且是交叉编译的:
lfc@lfc-laptop:dbus-1.2.1$ file /usr/local/arm/3.4.5/arm-linux/lib/libxml2.so.2.6.32
/usr/local/arm/3.4.5/arm-linux/lib/libxml2.so.2.6.32: ELF 32-bit LSB shared object, ARM, version 1, not stripped
搜索也可以查找到:
lfc@lfc-laptop:dbus-1.2.1$ grep "xmlReaderForMemory" /usr/local/arm/3.4.5/arm-linux/lib/* -rn
二进制文件 /usr/local/arm/3.4.5/arm-linux/lib/libxml2.a 匹配
二进制文件 /usr/local/arm/3.4.5/arm-linux/lib/libxml2.so 匹配
二进制文件 /usr/local/arm/3.4.5/arm-linux/lib/libxml2.so.2 匹配
二进制文件 /usr/local/arm/3.4.5/arm-linux/lib/libxml2.so.2.6.32 匹配
不知道大侠有没有碰到过类似的问题,请问你是如何解决的?谢谢!
-
崔计平 回复于:2008-05-29
-
你好,D-BUS在configure时,默认的是expat, 而不是libxml; 如果你没有强制--with-xml=libxml的话,在./configure时,如果链接到libxml上,说明你的路径没有导对;你可以试试:假设你的taget目录是/test
, 则你可以在./configure是加上 LDFLAGS="-L/test/lib" CPPFLAGS="-I/test/include" 后面接上你的一些选项,这样就可以定位到expat上面,另外在编译1.2.1时,别忘记了加上ac_cv_have_abstract_socket=yes ,你试试吧,我用这种方法是可以编译过去的。