openssh交叉编译

openssh交叉编译:

1.官网下载地址:

https://www.mindrot.org/openssh_snap/

2.配置:

openssh需要依赖openssl和zlib

首先需要编译另两个依赖库,可以参见作者其它两篇随笔。

 作者将交叉编译好的openssl和zlib放到/usr/local/include和/usr/local/lib目录下

这是由于configure时只能指定一个CFLAGS和LDFLAGS

cd openssh

mkdir __install

./configure CC=arm-linux-gnueabihf-gcc \
    --prefix=$(pwd)/__install \
    --host=arm-linux-gnueabihf \
    CFLAGS=-I/usr/local/include \
    LDFLAGS=-L/usr/local/lib

make

make install

 

注:make install的时候会出现错误:strip: Unable to recognise the format of the input file

这是由于目标文件和编译环境不一样导致的,这里作者没有用解决,暂且留着以后解决。

posted on 2019-06-21 16:59  Alvin2012  阅读(2772)  评论(0编辑  收藏  举报

导航