zlib
tar xvf zlib-1.2.11.tar.xz
cd zlib-1.2.11/
./configure –prefix=/root/Downloads/sftp-server/rootfs
[root@localhost zlib-1.2.11]# diff Makefile Makefile_bak
19c19
< CC=arm-linux-gnueabihf-gcc
CC=gcc
30,31c30,31
< LDSHARED=arm-linux-gnueabihf-gcc -shared -Wl,-soname,libz.so.1,–version-script,zlib.map
< CPP=arm-linux-gnueabihf-gcc -E
LDSHARED=gcc -shared -Wl,-soname,libz.so.1,–version-script,zlib.map
CPP=gcc -E
39c39
< AR=arm-linux-gnueabihf-ar
AR=ar
41c41
< RANLIB=arm-linux-gnueabihf-ranlib
RANLIB=ranlib
make
make install
openssh
tar xzf openssh-6.9p1.tar.gz
cd openssh-6.9p1/
./configure –prefix= –host=arm-linux-gnueabihf –sysconfdir=/etc –with-zlib=/root/Downloads/sftp-server/rootfs
make sftp-server
[root@localhost openssh-6.9p1]# file sftp-server
sftp-server: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 3.2.0, BuildID[sha1]=3f3bb0178b0e2ff2e27553e4754bd58d78dffd4d, not stripped