OpenWrt Cross-compiling unofficial software Sshpass

Source: Internet
Author: User
Tags bz2 mkdir prepare

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.