2010年1月21日 星期四

Cross Compile dbus-glib for ARM

Source : dbus-glib-0.82

cd dbus-glib-0.82

mkdir x86
cd x86

../configure

產生的Makefile會使用builddir這個變數但compile時卻沒有定義,因此用以下方式make

builddir=$PWD/dbus make

OK 成功

cd ..

CFLAGS=-I/home/gigijoe/OMAP3530/MSN/rootfs/include LDFLAGS=-L/home/gigijoe/OMAP3530/MSN/rootfs/lib USE_ARCH=32 NM=nm PKG_CONFIG_PATH=/home/gigijoe/OMAP3530/MSN/rootfs/lib/pkgconfig CC=arm-none-linux-gnueabi-gcc CXX=arm-none-linux-gnueabi-g++ AR=arm-none-linux-gnueabi-ar RANLIB=arm-none-linux-gnueabi-ranlib ./configure --host=arm-linux --target=arm-linux --prefix=/home/gigijoe/OMAP3530/MSN/rootfs --with-xml=expat --with-dbus-binding-tool=$PWD/x86/dbus/.libs/dbus-binding-tool --cache-file=arm.cache

...

checking for library containing socket... none required
checking whether socklen_t is defined... yes
checking abstract socket namespace... configure: error: cannot run test program while cross compiling
See `config.log' for more details.

錯誤發生了

強制將abstract socket namespace定義為yes並寫入cach file

echo ac_cv_have_abstract_sockets=yes > arm.cache

再試一次
OK ,成功

builddir=$PWD/dbus make

...

make[2]: Entering directory `/home/gigijoe/OMAP3530/MSN/dbus-glib-0.82/tools'
DBUS_TOP_BUILDDIR=.. /home/gigijoe/OMAP3530/MSN/rootfs/bin/dbus-daemon --introspect > dbus-bus-introspect.xml.tmp && mv dbus-bus-introspect.xml.tmp dbus-bus-introspect.xml
/home/gigijoe/OMAP3530/MSN/dbus-glib-0.82/x86/dbus/.libs/dbus-binding-tool --mode=glib-client --prefix=dbus_bus --output=dbus-glib-bindings.h dbus-bus-introspect.xml
/home/gigijoe/OMAP3530/MSN/dbus-glib-0.82/x86/dbus/.libs/dbus-binding-tool: symbol lookup error: /home/gigijoe/OMAP3530/MSN/dbus-glib-0.82/x86/dbus/.libs/dbus-binding-tool: undefined symbol: dbus_g_signature_get_g_type
make[2]: *** [dbus-glib-bindings.h] Error 127
make[2]: Leaving directory `/home/gigijoe/OMAP3530/MSN/dbus-glib-0.82/tools'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/gigijoe/OMAP3530/MSN/dbus-glib-0.82'
make: *** [all] Error 2

不需要dbus tools for ARM,修改Makefile

#SUBDIRS = dbus tools test doc
SUBDIRS = dbus test doc

再make一次
OK,成功了

builddir=$PWD/dbus make install



沒有留言:

張貼留言