OPENSSH需要zlib和openssl的支持,需要下载三者,版本如下:
openssh-7.9p1
openssl-1.0.2r
zlib-1.2.11
zlib和openssl的编译方法网上很多,不描述了(编译的输出文件要放到指定路径)。
①zlib编译
./configure --prefix=/home/sunny/workspace/openssh/zlib.install
修改Makefile内容
- CC=arm-linux-gnueabihf-gcc
- AR=arm-linux-gnueabihf-ar
- CPP =arm-linux-gnueabihf-gcc -E
- LDSHARED=arm-linux-gnueabihf -shared -Wl,-soname,libz.so.1,--version-script,zlib.map
②openssl编译
./Configure --prefix=/home/sunny/workspace/openssh/openssl.install os/compiler:arm-linux-gnueabihf-gcc
make & make install
③openssh的编译方法如下:
./configure \
--host=arm-linux-gnueabihf \
--with-libs \
--with-ssl-dir=/home/sunny/workspace/openssh/openssl.install \
--with-zlib=/home/sunny/workspace/openssh/zlib.install \
--disable-etc-default-login \
--disable-strip \
CC=arm-linux-gnueabihf-gcc \
AR=arm-linux-gnueabihf-ar --host=arm --disable-strip \
make
之后不用make install,因为目标文件需要在demo板上运行!
编译之后的配置工作参考下文即可: