交叉编译d-bus

时间:2010-12-02 03:36:45

标签: gcc arm static-libraries dbus

我想用corss_compiler D-bus来武装。

工具链:arm-linux-gcc-3.4.1

配置选项:CC = arm-linux-gcc ./configure --prefix = / opt / dbus / --host = arm-linux --enable-abstract-sockets -with-xml = expat

sourecode:d-bus-1.2.24 d-bus-1.3.1 d-bus-1.4.0

make[2]: Entering directory `/home/mandy/Desktop/apps/d-bus/remotec/dbus-1.4.0/bus'
  CCLD   dbus-daemon
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/bin/ld: Warning: gc-sections option ignored
dbus_daemon-bus.o(.text.process_config_postinit+0x120): In function `bus_context_check_security_policy':
/home/mandy/Desktop/apps/d-bus/remotec/dbus-1.4.0/bus/bus.c:1638: undefined reference to `bus_set_watched_dirs'
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libc_nonshared.a(elf-init.oS)(.text+0x44): In function `__libc_csu_init':
: undefined reference to `__init_array_end'
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libc_nonshared.a(elf-init.oS)(.text+0x48): In function `__libc_csu_init':
: undefined reference to `__init_array_start'
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libc_nonshared.a(elf-init.oS)(.text+0x8c): In function `__libc_csu_fini':
: undefined reference to `__fini_array_end'
/usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/../../../../arm-linux/lib/libc_nonshared.a(elf-init.oS)(.text+0x90): In function `__libc_csu_fini':
: undefined reference to `__fini_array_start'
collect2: ld returned 1 exit status
make[2]: *** [dbus-daemon] Error 1
make[2]: Leaving directory `/home/mandy/Desktop/apps/d-bus/remotec/dbus-1.4.0/bus'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/mandy/Desktop/apps/d-bus/remotec/dbus-1.4.0'
make: *** [all] Error 2

在dbus-1.2.24和dbus-1.3.1也会出现同样的错误。

我能做到什么?

非常感谢。

1 个答案:

答案 0 :(得分:3)

这些是针对avr32架构交叉编译dbus的一般说明。基于这个reference(第3篇文章),我创建了这个小教程。我发布我的教程,因为它可能对其他人有用,甚至可以比较命令。


EXPAT LIBRARIES

为了交叉编译,首先必须交叉编译expat库。使用选项前缀,您可以指定必须安装的位置。

下载expat src代码:     ftp://ftp.free.fr/.mirrors1/ftp.netbsd.org/packages/distfiles/expat-2.0.1.tar.gz

解开它:

tar zxvf expat-2.0.1.tar.gz 

使用适当的主机和c编译器进行配置。您必须安装avr32 linux工具链(Buildroot为您编译工具链,您必须将二进制路径添加到环境变量$ PATH)

cd expat-2.0.1/ 
./configure --host=avr32-linux --prefix=/home/juan/builds/build_expat/ CC=avr32-linux-gcc
make; make install 

<强> DBUS

下载dbus src代码:     http://dbus.freedesktop.org/releases/dbus/dbus-1.5.0.tar.gz

解开它:

tar zxvf dbus-1.5.0.tar.gz
cd dbus-1.5.0.tar.gz 

配置为expat库指定安装文件夹(--prefix),c编译器,include文件夹和lib文件夹:

./configure --prefix=/home/juan/builds/build_dbus/ --host=avr32-linux --with-x=no ac_cv_have_abstract_sockets=yes "CC=avr32-linux-gcc -I/home/juan/builds/build_expat/include -L/home/juan/builds/build_expat/lib"

make;make install;