To install the compilation environment:
The code is as follows |
Copy Code |
Apt-get Install build-essential Libncurses5-dev Zlib1g-dev
|
Download the cross-compiling environment and Sshpass Source:
code is as follows |
copy code |
wget http:/ /downloads.openwrt.org/backfire/10.03.1/brcm63xx/openwrt-sdk-brcm63xx-for-linux-i686-gcc-4.3.3%2bcs_ UCLIBC-0.9.30.1.TAR.BZ2 Tar jxvf openwrt-sdk-brcm63xx-for-linux-i686-gcc-4.3.3+cs_uclibc-0.9.30.1.tar.bz2 Mkdir-p Openwrt-sdk-brcm63xx-for-linux-i686-gcc-4.3.3+cs_uclibc-0.9.30.1/package/sshpass CD Openwrt-sdk-brcm63xx-for-linux-i686-gcc-4.3.3+cs_uclibc-0.9.30.1/package/sshpass Wget http://sourceforge.net /projects/sshpass/files/sshpass/1.05/sshpass-1.05.tar.gz Tar zxvf sshpass-1.05.tar.gz MV sshpass-1.05 SRC |
Sshpass Directory new Makefile file:
The code is as follows |
Copy Code |
Include $ (topdir)/rules.mk
# Name and release number of this package Pkg_name:=sshpass pkg_release:=1.05
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-prepare for building the package. Define Build/prepare Mkdir-p $ (Pkg_build_dir) $ (CP)./src/* $ (pkg_build_dir)/ Endef
# 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 of the necessary commands to compile we program. $ (eval $ (call Buildpackage,sshpass)) |
Compile Sshpass:
The code is as follows |
Copy Code |
Cd.. / Make Package/sshpass/compile |
To compile a successful program file:
The code is as follows |
Copy Code |
LS bin/brcm63xx/packages/ Packages packages.gz SSHPASS_1.05_BRCM63XX.IPK |
The following errors were encountered during compilation:
The code is as follows |
Copy Code |
staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uclibc-0.9.30.1/usr/lib/libc.so:undefined reference to ' _dl_app_init_ Array Need to modify: |
target_ldflags:=-l$ (Staging_dir)/usr/lib-l$ (staging_dir)/lib
For:
code is as follows |
copy code |
target_ ldflags+=-l$ (Toolchain_dir)/usr/lib-l$ (toolchain_dir)/lib-wl,-rpath=$ (toolchain_dir)/lib |