openwrt在build package过程中出现missing dependencies libpthread

来源:互联网 发布:怎么看淘宝客链接 编辑:程序博客网 时间:2024/05/17 23:39

转载自:http://blog.csdn.net/luopeiyuan1990/article/details/8437640


新版本的trunk有在ipk打包的过程中的bug,他不能自动识别SDK中已经变异的动态链接库,比如libpthread,libboost这些。

解决方案是修改你要build的pakage下Makefile的内容:


1. 添加DEPENDS;这里的例子中对应

DEPENDS:=+libpthread

2.拷贝动态链接库到安装目录。对应

$(CP) /lib/libpthread.so.0 $(1)/bin/
注意这里的源地址是对应你的router中的动态链接库地址,不是在你的编译环境中,切记!


############################################### OpenWrt Makefile for Scada_Em program### Most of the variables used here are defined in# the include directives below. We just need to# specify a basic description of the package,# where to build our program, where to find# the source files, and where to install the# compiled program on the router.## Be very careful of spacing in this file.# Indents should be tabs, not spaces, and# there should be no trailing whitespace in# lines that are not commented.###############################################include $(TOPDIR)/rules.mk# Name and release number of this packagePKG_NAME:=Scada_EmPKG_RELEASE:=1# This specifies the directory where we're going to build the program. # The root build directory, $(BUILD_DIR), is by default the build_mipsel# directory in your OpenWrt SDK directoryPKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)include $(INCLUDE_DIR)/package.mk# Specify package information for this program.# The variables defined here should be self explanatory.# If you are running Kamikaze, delete the DESCRIPTION# variable below and uncomment the Kamikaze define# directive for the description belowdefine Package/Scada_EmSECTION:=utilsCATEGORY:=UtilitiesTITLE:=Scada_Em -- prints a snarky messageDEPENDS:=+libpthreadendef# Uncomment portion below for Kamikaze and delete DESCRIPTION variable abovedefine Package/Scada_Em/descriptionIf you can't figure out what this program does, you're probablybrain-dead and need immediate medical attention.endef# Specify what needs to be done to prepare for building the package.# In our case, we need to copy the source files to the build directory.# This is NOT the default.  The default uses the PKG_SOURCE_URL and the# PKG_SOURCE which is not defined here to download the source from the web.# In order to just build a simple program that we have just written, it is# much easier to do it this way.define Build/Preparemkdir -p $(PKG_BUILD_DIR)$(CP) ./src/* $(PKG_BUILD_DIR)/endef# We do not need to define Build/Configure or Build/Compile directives# The defaults are appropriate for compiling a simple program such as this one# Specify where and how to install the program. Since we only have one file,# the Scada_Em executable, install it by copying it to the /bin directory on# the router. The $(1) variable represents the root directory on the router running# OpenWrt. The $(INSTALL_DIR) variable contains a command to prepare the install# directory if it does not already exist.  Likewise $(INSTALL_BIN) contains the# command to copy the binary file from its current location (in our case the build# directory) to the install directory.#define Package/Scada_Em/install#$(INSTALL_DIR) $(1)/bin#$(INSTALL_BIN) $(PKG_BUILD_DIR)/Scada_Em $(1)/bin/##$(INSTALL_DIR) $(1)/usr/lib#endefdefine Package/Scada_Em/install$(INSTALL_DIR) $(1)/bin$(CP) /lib/libpthread.so.0 $(1)/bin/$(INSTALL_BIN) $(PKG_BUILD_DIR)/Scada_Em $(1)/bin/endef# This line executes the necessary commands to compile our program.# The above define directives specify all the information needed, but this# line calls BuildPackage which in turn actually uses this information to# build a package.$(eval $(call BuildPackage,Scada_Em))



原创粉丝点击