本文记录windows VS 2015环境、ubuntu16.04系统编译openssl-1.0.1t。
一、准备工作
MinGW、VS 2015和openssl下载从略。
下载nmake,放到MinGW的任意bin目录下。
二、windows
1 | perl Configure VC-WIN64A |
三、ubuntu 16.04 64bit
编译命令:
1 | ./Configure linux-x86_64 --prefix=/home/latelee/bin/openssl-bin |
得到的静态库位于/home/latelee/bin/openssl-bin
目录。
四、交叉编译(imx6ul 5.3)
先安装好imx6ul交叉编译器。这里使用的是arm-poky-linux-gnueabi-gcc
。
1 | ./Configure linux-armv4 --prefix=/home/latelee/bin/openssl-arm-bin |
修改生成的Makefile,具体如下:
1 | CC= arm-poky-linux-gnueabi-gcc -march=armv7ve -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/home/latelee/bin/fsl-imx-x11/4.1.15-2.0.0/sysroots/cortexa7hf-neon-poky-linux-gnueabi |
编译安装:
1 | make depend |
五、交叉编译(imx6ul 4.6)
先安装好imx6ul交叉编译器。这里使用的是arm-linux-gcc
。
配置:
1 | ./Configure linux-armv4 --prefix=/home/latelee/bin/openssl-arm-bin |
修改生成的Makefile,具体如下:
1 | CC= arm-linux-gcc |
注:如果在./Configure阶段指定交叉编译器的话,会有如下提示:
1 | ./Configure linux-armv4 --prefix=/home/latelee/bin/openssl-arm-bin CC=arm-linux-gcc RANLIB=arm-linux-ranlib AR=arm-linux-ar |
如果不使用linux-armv4
,则会提示:
1 | ./Configure --prefix=/home/latelee/bin/openssl-arm-bin CC=arm-linux-gcc |
综上,直接修改生成的Makefile似乎更好。
编译安装:
1 | make depend |