我想为OpenWrt实现XMMP客户端,我在OpenWrt包下为此目的下载gloox,然后我编译它;
make package/libgloox/compile V=99
这是OpenWrt Makefile:
include $(TOPDIR)/rules.mk
PKG_NAME:=libgloox
PKG_VERSION:=2012-06-11
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_FIXUP:=autoreconf
include $(INCLUDE_DIR)/package.mk
define Package/libgloox
SECTION:=libs
CATEGORY:=Libraries
TITLE:=XMPP library
endef
define Package/libgloox/description
A XMPP client
endef
CONFIGURE_ARGS += \
--disable-threads \
--enable-static \
--enable-shared
USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
ifneq ($(USE_LOCAL),)
define Build/Prepare
$(CP) ./src/* $(PKG_BUILD_DIR)/
endef
endif
define Package/libgloox/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/src/.libs/libgloox.so* $(1)/usr/lib
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_BUILD_DIR)/src/gloox.h $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/src/.libs/libgloox.so* $(1)/usr/lib
#$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
#$(CP) $(PKG_BUILD_DIR)/gloox.pc $(1)/usr/lib/pkgconfig
endef
$(eval $(call BuildPackage,libgloox))
使用此Makefile编译时出现此错误:
/bin/sh ../../libtool --tag=CXX --mode=link i486-openwrt-linux-uclibc-g++ -O2 -pipe -march=i486 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -ansi -L/home/anis/cwmp/AA3/staging_dir/target-i386_uClibc-0.9.33.2/usr/lib -L/home/anis/cwmp/AA3/staging_dir/target-i386_uClibc-0.9.33.2/lib -L/home/anis/cwmp/AA3/staging_dir/toolchain-i386_gcc-4.6-linaro_uClibc-0.9.33.2/usr/lib -L/home/anis/cwmp/AA3/staging_dir/toolchain-i386_gcc-4.6-linaro_uClibc-0.9.33.2/lib -pthread -o reconnect_example reconnect_example.o ../libgloox.la -L/home/anis/cwmp/AA3/staging_dir/target-i386_uClibc-0.9.33.2/usr/lib -L/home/anis/cwmp/AA3/staging_dir/target-i386_uClibc-0.9.33.2/lib -L/home/anis/cwmp/AA3/staging_dir/toolchain-i386_gcc-4.6-linaro_uClibc-0.9.33.2/usr/lib -L/home/anis/cwmp/AA3/staging_dir/toolchain-i386_gcc-4.6-linaro_uClibc-0.9.33.2/lib -pthread -lresolv -lresolv -lresolv -lssl -lcrypto -lz
OpenWrt-libtool: link: i486-openwrt-linux-uclibc-g++ -O2 -pipe -march=i486 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -ansi -pthread -o .libs/reconnect_example reconnect_example.o -pthread -L/home/anis/cwmp/AA3/staging_dir/target-i386_uClibc-0.9.33.2/usr/lib -L/home/anis/cwmp/AA3/staging_dir/target-i386_uClibc-0.9.33.2/lib -L/home/anis/cwmp/AA3/staging_dir/toolchain-i386_gcc-4.6-linaro_uClibc-0.9.33.2/usr/lib -L/home/anis/cwmp/AA3/staging_dir/toolchain-i386_gcc-4.6-linaro_uClibc-0.9.33.2/lib ../.libs/libgloox.so /home/anis/cwmp/AA3/staging_dir/toolchain-i386_gcc-4.6-linaro_uClibc-0.9.33.2/lib/libstdc++.so -lm -lresolv -lssl -lcrypto -lz -pthread -Wl,-rpath -Wl,/home/anis/cwmp/AA3/staging_dir/toolchain-i386_gcc-4.6-linaro_uClibc-0.9.33.2/lib
make[6]: Leaving directory `/home/anis/cwmp/AA3/build_dir/target-i386_uClibc-0.9.33.2/libgloox-2012-06-11/src/examples'
make[5]: Leaving directory `/home/anis/cwmp/AA3/build_dir/target-i386_uClibc-0.9.33.2/libgloox-2012-06-11/src'
make[5]: Entering directory `/home/anis/cwmp/AA3/build_dir/target-i386_uClibc-0.9.33.2/libgloox-2012-06-11'
make[5]: Leaving directory `/home/anis/cwmp/AA3/build_dir/target-i386_uClibc-0.9.33.2/libgloox-2012-06-11'
make[4]: Leaving directory `/home/anis/cwmp/AA3/build_dir/target-i386_uClibc-0.9.33.2/libgloox-2012-06-11'
make[3]: Leaving directory `/home/anis/cwmp/AA3/build_dir/target-i386_uClibc-0.9.33.2/libgloox-2012-06-11'
touch /home/anis/cwmp/AA3/build_dir/target-i386_uClibc-0.9.33.2/libgloox-2012-06-11/.built
mkdir -p /home/anis/cwmp/AA3/bin/x86/packages /home/anis/cwmp/AA3/build_dir/target-i386_uClibc-0.9.33.2/libgloox-2012-06-11/ipkg-x86/libgloox/CONTROL /home/anis/cwmp/AA3/staging_dir/target-i386_uClibc-0.9.33.2/pkginfo
install -d -m0755 /home/anis/cwmp/AA3/build_dir/target-i386_uClibc-0.9.33.2/libgloox-2012-06-11/ipkg-x86/libgloox/usr/lib
cp -fpR /home/anis/cwmp/AA3/build_dir/target-i386_uClibc-0.9.33.2/libgloox-2012-06-11/src/.libs/libgloox.so* /home/anis/cwmp/AA3/build_dir/target-i386_uClibc-0.9.33.2/libgloox-2012-06-11/ipkg-x86/libgloox/usr/lib
find /home/anis/cwmp/AA3/build_dir/target-i386_uClibc-0.9.33.2/libgloox-2012-06-11/ipkg-x86/libgloox -name 'CVS' -o -name '.svn' -o -name '.#*' -o -name '*~'| xargs -r rm -rf
Package libgloox is missing dependencies for the following libraries:
libcrypto.so.1.0.0
libssl.so.1.0.0
libstdc++.so.6
libz.so.1
make[2]: *** [/home/anis/cwmp/AA3/bin/x86/packages/libgloox_2012-06-11-1_x86.ipk] Error 1
make[2]: Leaving directory `/home/anis/cwmp/AA3/package/libgloox'
make[1]: *** [package/libgloox/compile] Error 2
make[1]: Leaving directory `/home/anis/cwmp/AA3'
make: *** [package/libgloox/compile] Error 2
注意:在“make menuconfig”
中的库下选择libgloox时会出现此错误