1. 下载需要的源码:
mkdir -p ~/arm/fs ;mkdir -p ~/arm/source
下载zlib: wget -c http://www.zlib.net/zlib-1.2.3.tar.gz
下载ssl: wget -c http://www.openssl.org/source/openssl-0.9.8d.tar.gz
下载ssh: wget -c http://mirror.mcs.anl.gov/openssh/portable/openssh-4.6p1.tar.gz
2. 编译:
cd ~/arm/source
(1) 编译zlib:
tar zxvf zlib-1.2.3.tar.gz -C .
cd zlib-1.2.3/
./configure --prefix=/home/david/fs/zlib-1.2.3
修改Makefile:
CC=gcc 改为:
CC=arm-none-linux-gnueabi-gcc
LDSHARED=gcc 改为:
LDSHARED=arm-none-linux-gnueabi-gcc
CPP=gcc -E 改为: CPP=arm-none-linux-gnueabi-gcc -E
AR=ar rc 改为: AR=arm-none-linux-gnueabi-ar rc
开始编译: make;
make install
(2) 编译openssl:
tar zxvf openssl-0.9.8d.tar.gz
./Configure --prefix=/home/david/fs/openssl-0.9.8d os/compiler:arm-linux-gcc
make
make install
(3) 编译openssh:
tar zxvf openssh-4.6p1.tar.gz
cd openssh-4.6p1/
./configure --host=arm-linux --with-libs --with-zlib=/home/linksens/tools/fs/zlib-1.2.3
--with-ssl-dir=/home/david/fs/openssl-0.9.8d --disable-etc-default-login
CC=arm-linux-gcc AR=arm-linux-ar
make
##不要make install
3. 安装
(1) 将 openssh-4.6p1目录下的 sshd 拷贝到 目标板的/usr/sbin目录下
(2) 再copy scp sftp ssh ssh-add ssh-agent ssh-keygen ssh-keyscan 到目标板/usr/local/bin