OpenWRT交叉編譯非官方軟件sshpass(筆記)

參考文章

http://www.111cn.net/sys/linux/54377.htm

編譯環境可參照上面原文,亦可參照之前的BLOG配置,此處略

下載sshpass原碼並解壓到/openwrt/package/sshpass/src:

mkdir -p /openwrt/package/sshpass

wget http://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gz

tar zxvf sshpass-1.06.tar.gz

mv sshpass-1.06 /openwrt/package/sshpass/src

 

主要是下面是新建Makefile內容:

include $(TOPDIR)/rules.mk

# Name and release number of this package
PKG_NAME:=sshpass
PKG_RELEASE:=1.06

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

include $(INCLUDE_DIR)/package.mk

define Package/sshpass
  SECTION:=utils
  CATEGORY:=Utilities
  TITLE:=sshpass
endef

define Package/sshpass/description
  Sshpass is a tool for non-interactivly performing password authentication with SSH's
endef

# Specify what needs to be done to prepare for building the package.
define Build/Prepare
	mkdir -p $(PKG_BUILD_DIR)
	$(CP) ./src/* $(PKG_BUILD_DIR)/
endef

TARGET_LDFLAGS+= -L$(TOOLCHAIN_DIR)/usr/lib -L$(TOOLCHAIN_DIR)/lib -Wl,-rpath=$(TOOLCHAIN_DIR)/lib

# Specify where and how to install the program.
define Package/sshpass/install
	$(INSTALL_DIR) $(1)/bin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/sshpass $(1)/bin/
endef

# This line executes the necessary commands to compile our program.
$(eval $(call BuildPackage,sshpass))

然後編譯

如果之前編譯過整體環境,可以用make package/sshpass/compile -j 1 V=s

如果之前未編譯過整體環境,那就make menuconfig起一步步來

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章