OpenSSH交叉编译


#!/bin/sh

HOST=arm-linux-gnueabihf
CC=$HOST-gcc
CPP=$HOST-g++
AR=$HOST-ar
LD=$HOST-ld
NM=$HOST-nm
RANLIB=$HOST-ranlib
STRIP=$HOST-strip
INSTALL=`pwd`/../install


function make_zlib()
{
	app=zlib-1.2.8
	if ! [ -d $app ]; then
		tar -xvf $app.tar.gz
	fi

	cd $app
	./configure --prefix=`pwd`/../install/zlib --static
	make clean
	make CC=$CC AR=$AR CFLAGS="-O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN"
	make install
	cd -
}

function make_openssli110()
{
	app=openssl-1.1.0
	if ! [ -d $app ]; then
		tar -xvf $app.tar.gz
	fi

	cd $app
	./config --prefix=`pwd`/../install/openssl no-asm
	### sed -i "" 's|\"iphoneos-cross\"\,\"llvm-gcc\:-O3|\"iphoneos-cross\"\,\"clang\:-Os|g' Configure
	### sed -i "" 's/CC= cc/CC= clang/g' Makefile.org
	### sed -i "" 's/CFLAG= -O/CFLAG= -Os/g' Makefile.org
	### sed -i "" 's/MAKEDEPPROG=makedepend/MAKEDEPPROG=$(CC) -M/g' Makefile.org
	sed -i 's/\-m64/ /g' Makefile
	make clean
	make CROSS_COMPILE=$HOST-
	### make CC=$CC AR=$AR RANLIB=$RANLIB
	make install

	cd -	
}

function make_openssl()
{
	app=openssl-1.0.2h
	if ! [ -d $app ]; then
		tar -xvf $app.tar.gz
	fi

	cd $app
	./config --prefix=`pwd`/../install/openssl no-asm no-shared -fPIC
	### sed -i "" 's|\"iphoneos-cross\"\,\"llvm-gcc\:-O3|\"iphoneos-cross\"\,\"clang\:-Os|g' Configure
	### sed -i "" 's/CC= cc/CC= clang/g' Makefile.org
	### sed -i "" 's/CFLAG= -O/CFLAG= -Os/g' Makefile.org
	### sed -i "" 's/MAKEDEPPROG=makedepend/MAKEDEPPROG=$(CC) -M/g' Makefile.org
	sed -i 's/\-m64/ /g' Makefile
	make clean
	### make CROSS_COMPILE=$HOST-
	make CC=$CC AR="$AR r" RANLIB=$RANLIB
	make install

	cd -	
}

function make_openssh()
{
	app=openssh-7.3p1
	if ! [ -d $app ]; then
		tar -xvf $app.tar.gz
	fi

	cd $app
	#./configure --host=$HOST --prefix=`pwd`/../install/openssh --with-zlib=`pwd`/../install/zlib --with-ssl-dir=`pwd`/../install/openssl --without-shadow --disable-etc-default-login
	./configure --host=$HOST --with-zlib=`pwd`/../install/zlib --with-ssl-dir=`pwd`/../install/openssl --without-shadow --disable-etc-default-login
	make clean
	make
	#make install

	cd -
}

function make_install()
{


}


#make_zlib
#make_openssl
#make_openssh
make_install






评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值