1.
./Configure linux-elf-arm -DB_ENDIAN linux:' arm-linux-gcc' shared --prefix=/usr/local/openssl
2.make3.make install
值得注意的是,在arm交叉编译环境中,引用库的顺序为:-lssl -lcrypto,如果为 -lcrypto -lssl就会编译错误
二:openssl在arm下的交叉编译 (二)
1../config no-asm shared --prefix=/usr/local/openssl
2.修改Makefile CC=arm-none-linux-gnueabi-gccmake
3.make install
使用第一种方式编译出来的是静态链接库,第二种是动态链接库
如何在configure时,将编译参数传入,改变默认的编译器gcc成arm-linux-gcc
[jin@localhost ]$ CC=arm-linux-gcc ./configure --prefix=/usr/sbin
....................
checking for gcc... (cached) gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
....................
[jin@localhost ]$ CFLAGS=-O2 CC=arm-linux-gcc ./configure --cache-file=cache_file_0
loading cache cache_file_0
....................
checking for gcc... arm-linux-gcc
checking whether the C compiler (arm-linux-gcc -O2 ) works... yes
checking whether the C compiler (arm-linux-gcc -O2 ) is a cross-compiler... yes
checking whether we are using GNU C... yes
最好此处在加上--prefix=/usr/sbin,表示具体安装到哪里
[jin@localhost ]$ CFLAGS=-O2 CC=arm-linux-gcc ./configure --cache-file=cache_file_0 --prefix=/usr/sbin
loading cache cache_file_0
....................
checking for gcc... arm-linux-gcc
checking whether the C compiler (arm-linux-gcc -O2 ) works... yes
checking whether the C compiler (arm-linux-gcc -O2 ) is a cross-compiler... yes
checking whether we are using GNU C... yes
....................
其中,/usr/sbin是已经建立好的,已经存在的文件夹,上面这样表示编译后,
将生成的可执行文件安装拷贝到那个目录.
【办法总结】
在./configure的时候,将CC参数放入configure之前,并且要制定cache file,才能完全即时识别编译器:
CC=arm-linux-gcc ./configure --cache-file=cache_file_0
交叉编译OpenSSH
http://blog.rythdev.com/2011/12/cross_compile_openssh/