天天看点

交叉编译bluez-4.95

交叉编译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

[[email protected] expat-2.0.1]# CC=arm-linux-gcc ./configure --prefix=/usr/local/newbt --host=arm-linux 

[[email protected] expat-2.0.1]#make && make install

编译dbus

[[email protected] 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  解决

[[email protected] 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

[[email protected] dbus-1.4.1]#make

[[email protected] dbus-1.4.1]#make install

下载glib-2.16.0  http://ftp.gnome.org/pub/gnome/sources/glib/ 

解压并进入(提示:glib-2.30以上比较复杂,要编译zlib和libffi)

[[email protected] 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 

[[email protected] glib-2.16.0]#make

[[email protected] glib-2.16.0]#make install

编译blue

[[email protected] 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

[[email protected] bluez-4.95]#export PKG_CONFIG_LIBDIR=/usr/local/newbt/lib/pkgconfig/

[[email protected] 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

[[email protected] bluez-4.95]#make

[[email protected] bluez-4.95]#make install