我的第一个Makefile

#
# Copyright (C) 2006-2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=tappipe
PKG_VERSION:=1.02
PKG_RELEASE:=1

PKG_LICENSE:=GPL-2.0+
#PKG_MAINTAINER:=Michael Haas <haas@computerlinguist.org>
#PKG_LICENSE_FILES:=COPYING COPYRIGHT.GPL

PKG_SOURCE_URL:=https://www.stunnel.org/downloads/tappipe/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
#PKG_MD5SUM:=3264375026c2b496b5d258e243222de8

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)

#PKG_FIXUP:=autoreconf
#PKG_INSTALL:=1

include $(INCLUDE_DIR)/package.mk

define Package/tappipe
SECTION:=net
CATEGORY:=Network
DEPENDS:=+libstdcpp +libpthread
TITLE:=VPN for stunnel/Linux
URL:=http://www.stunnel.org/
endef

define Package/tappipe/description
The stable version of my VPN for stunnel/Linux
endef

#define Package/tappipe/conffiles
#/etc/stunnel/server.conf
#/etc/stunnel/client.conf
#endef
define Build/Compile
#mkdir -p $(PKG_INSTALL_DIR)/etc/stunnel
#$(call Build/Compile/Default)
$(MAKE) -C $(PKG_BUILD_DIR)
#$(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS);
endef

define Package/tappipe/install
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_BUILD_DIR)/tappipe $(1)/usr/bin/tappipe
$(INSTALL_DIR) $(1)/etc/stunnel
$(CP) $(PKG_BUILD_DIR)/server.conf $(1)/etc/stunnel/server.conf
$(CP) $(PKG_BUILD_DIR)/client.conf $(1)/etc/stunnel/client.conf
$(CP) $(PKG_BUILD_DIR)/server.sh $(1)/etc/stunnel/server.sh
$(CP) $(PKG_BUILD_DIR)/client.sh $(1)/etc/stunnel/client.sh
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DATA) $(TOOLCHAIN_DIR)/lib/libc.so $(1)/usr/lib/libc.so.6
endef

$(eval $(call BuildPackage,tappipe))
http://my.oschina.net/hevakelcj/blog/411944
“missing separator. Stop.”
不能用空格,而要用TAB,可以用editplus/右击格式/空格转制表符

Package tappipe is missing dependencies for the following libraries:
libc.so.6
注:执行makeV=s时可能会显示错误提示:Packagememwatch
is missing dependencies for the followinglibraries:libc.so.6,这个错误是因为SDK(OpenWrt-SDK-ramips-for-linux-i686-gcc-4.6-linaro_uClibc-0.9.33.2)/stagin_dir/target-mipsel_r2_uClibc-0.9.33.2/pkginfo目录下没有libstdcpp.provides,新建一个,并添加内容:
libstdc++.so.6
libstdc++.so.6.0.16
libstdc++.so.6.0.16-gdb.py
然后再添加一个libpthread.provides,内容为:
libgcc_s.so.1
libpthread-0.9.33.2.so
libpthread.so.0
即可。

Openwrt报告库找不到
Package * is missing dependencies for the following libraries:
libc.so.6 或其他
先检查系统里面有没有这个库存在,如果没有,安装 (在/lib /lib64 等目录找)
之后添加库openwrt的编译环境
修改 libc.provides 平台不同,可能目录不同,find ./stagging_dir -name libc.provides 下
一般在 stagging_dir/target-mipsel_r2_uClibc-0.9.33.2/pkginfo/libc.provides
底部添加
libc.so.6
或其他需要的库,编译时候会把这个so转为openwrt平台的库
最后在对应的openwrt 的Makefile中加依赖

要是不行的话,使用使用在

define Package/sc/install 中增加

$(CP) /your lib.so $(1)/usr/bin/

也可以…

About: dato


发表评论

邮箱地址不会被公开。 必填项已用*标注