Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
778 views
in Technique[技术] by (71.8m points)

openssl - Cross Compile OpenSSH for ARM

Does anybody know how I can cross compile OpenSSH for ARM? This is what I have done:

First I've downloaded Zlib source code, untarred it, built it and installed it using the following command lines:

   # ./configure --prefix=/usr/local/cross/arm

   # make 

   # make install

But then when I try to compile OpenSSH for the ARM target board, it gives the error "zlib missing" during the ./configure process:

  # sudo LDFLAGS=-L/usr/local/cross/arm/lib CC=arm-none-linux-gnueabi-gcc PATH=$PATH:/home/arishop/arm-tool-chain/arm-fsl-linux-gnueabi/bin/ ./configure --host=arm-linux --with-zlib=/usr/local/cross/arm/ --prefix=/usr/local/cross/arm/openssh
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

To cross compile openSHH for ARM (in my case a mini2440) I did following:

Install arm cross compiler - (eg. what is arm-linux-gcc and how to install this in ubuntu)

Download:

  • Zlib
  • OpenSSL
  • OpenSSH

Build Zlib:

cd zlib-1.2.7
CC=arm-linux-gnueabi-gcc
./configure --prefix=$HOME/zlibArm
make 
make install

Build OpenSSL:

export cross=arm-linux-gnueabi-
cd openssl-1.0.1c
./Configure dist --prefix=$HOME/opensslArm
make CC="${cross}gcc" AR="${cross}ar r" RANLIB="${cross}ranlib"
make install

Build OpenSSH:

./configure --host=arm-linux --with-libs --with-zlib=$HOME/zlibArm --with-ssl-dir=$HOME/opensslArm --disable-etc-default-login CC=gcc-arm-linux-gnueabi-gcc AR=gcc-arm-linux-gnueabi-ar
make

More info at http://code.google.com/p/openssh4mini2440/wiki/HowTo, download source and read "build.sh"


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...