交叉编译bluez-4.9
编译工具 arm-linux-gcc 4.1.1
下载dbus-1.4.1 http://dbus.freedesktop.org/releases/dbus/
下载expat-2.0.1.tar.gz http://sourceforge.net/projects/expat/files/expat/
解压并进入expat-2.0.1
[root@localhost expat-2.0.1]# CC=arm-linux-gcc ./configure --prefix=/usr/local/newbt --host=arm-linux
[root@localhost expat-2.0.1]#make && make install
编译dbus
[root@localhost dbus-1.4.1]# CC=arm-linux-gcc ./configure CFLAGS=-I/usr/local/newbt/include LDFLAGS=-L/usr/local/newbt/lib --prefix=/usr/local/newbt --host=arm-linux --enable-abstract-sockets
出现error:
dbus-launch.c:478: error: impossible constraint in 'asm'
dbus-launch.c:479: error: impossible constraint in 'asm'
dbus-launch.c:507: error: impossible constraint in 'asm'
dbus-launch.c:508: error: impossible constraint in 'asm'
dbus-launch.c:513: error: impossible constraint in 'asm'
dbus-launch.c:537: error: impossible constraint in 'asm'
make[2]: *** [dbus-launch.o] Error 1
加上--with-x=no 解决
[root@localhost dbus-1.4.1]# CC=arm-linux-gcc ./configure CFLAGS=-I/usr/local/newbt/include LDFLAGS=-L/usr/local/newbt/lib --prefix=/usr/local/newbt --host=arm-linux --enable-abstract-sockets --with-x=no
[root@localhost dbus-1.4.1]#make
[root@localhost dbus-1.4.1]#make install
下载glib-2.16.0 http://ftp.gnome.org/pub/gnome/sources/glib/
解压并进入(提示:glib-2.30以上比较复杂,要编译zlib和libffi)
[root@localhost glib-2.16.0]# CC=arm-linux-gcc ./configure --host=arm-linux --prefix=/usr/local/newbt glib_cv_stack_grows=no glib_cv_uscore=yeses ac_cv_func_posix_getpwuid_r=yes ac_cv_func_posix_getgrgid_r=yes glib_cv_have_qsort_r=yes
[root@localhost glib-2.16.0]#make
[root@localhost glib-2.16.0]#make install
编译blue
[root@localhost bluez-4.95]# ./configure --prefix=/usr/local/newbt --host=arm-linux --target=arm-linux CC="arm-linux-gcc -L/usr/local/newbt/lib" --disable-audio --enable-test
出现error :
找不到dbus库,并要求设置PKG_CONFIG_LIBDIR
[root@localhost bluez-4.95]#export PKG_CONFIG_LIBDIR=/usr/local/newbt/lib/pkgconfig/
[root@localhost bluez-4.95]# ./configure --prefix=/usr/local/newbt --host=arm-linux --target=arm-linux CC="arm-linux-gcc -L/usr/local/newbt/lib" --disable-audio --enable-test
[root@localhost bluez-4.95]#make
[root@localhost bluez-4.95]#make install