Jiaojinxing
7 years ago
8 changed files with 1 additions and 126 deletions
@ -1,126 +1 @@ |
|||||
一、下载 OpenSSL |
请使用 http://git.sylixos.com/cgit/cgit.cgi/openssl.git/ |
||||
|
|
||||
在 linux 或 MinGW 环境下操作。 |
|
||||
1. 进入 sylixos 工作空间: |
|
||||
cd /home/user/sylixos_workspace |
|
||||
|
|
||||
2. 下载 OpenSSL: |
|
||||
OpenSSL 的主页为 http://www.openssl.org/ |
|
||||
|
|
||||
3. 解压 OpenSSL: |
|
||||
tar zxvf openssl-1.0.2a.tar.gz |
|
||||
|
|
||||
4. 修改 OpenSSL 目录名,避免版本升级带来不必要的麻烦: |
|
||||
mv openssl-1.0.2a openssl |
|
||||
|
|
||||
5. 进入 OpenSSL 目录: |
|
||||
cd openssl |
|
||||
|
|
||||
二、配置 OpenSSL |
|
||||
|
|
||||
开源版 ARM 工具链配置 |
|
||||
./Configure linux-armv4 -D__ARM_MAX_ARCH__=8 --cross-compile-prefix=arm-none-eabi- no-asm shared --prefix=/opt/arm-sylixos-openssl |
|
||||
|
|
||||
商业版 ARM 工具链配置 |
|
||||
./Configure linux-armv4 -D__ARM_MAX_ARCH__=8 --cross-compile-prefix=arm-sylixos-eabi- no-asm shared --prefix=/opt/arm-sylixos-openssl |
|
||||
|
|
||||
商业版 PowerPC 工具链配置 |
|
||||
./Configure linux-ppc --cross-compile-prefix=ppc-sylixos-eabi- no-asm shared --prefix=/opt/ppc-sylixos-openssl |
|
||||
|
|
||||
商业版 MIPS 工具链配置 |
|
||||
./Configure linux-mips32 --cross-compile-prefix=mips-sylixos-elf- no-asm shared --prefix=/opt/mips-sylixos-openssl |
|
||||
|
|
||||
商业版 x86 工具链配置 |
|
||||
./Configure linux-generic32 --cross-compile-prefix=i386-sylixos-elf- no-asm shared --prefix=/opt/x86-sylixos-openssl |
|
||||
|
|
||||
三、修改 Makefile |
|
||||
|
|
||||
1. 加入如下内容,编译好的 SylixOS Base 工程路径根据实际情况设置: |
|
||||
|
|
||||
ifneq (,$(findstring arm,$(PLATFORM))) |
|
||||
SYLIXOS_BASE_PATH=/home/user/sylixos_workspace/sylixos-base |
|
||||
ARCH_CFLAGS = -march=armv4 -mno-unaligned-access |
|
||||
ARCH_LDFLAGS = -nostdlib |
|
||||
endif |
|
||||
|
|
||||
ifneq (,$(findstring ppc,$(PLATFORM))) |
|
||||
SYLIXOS_BASE_PATH=/home/user/ppc_workspace/sylixos-base |
|
||||
ARCH_CFLAGS = -G 0 -msoft-float |
|
||||
ARCH_LDFLAGS = |
|
||||
endif |
|
||||
|
|
||||
ifneq (,$(findstring mips32,$(PLATFORM))) |
|
||||
SYLIXOS_BASE_PATH=/home/user/mips_workspace/sylixos-base |
|
||||
ARCH_CFLAGS = -mips32 -msoft-float -EL -G 0 -mabicalls |
|
||||
ARCH_LDFLAGS = |
|
||||
endif |
|
||||
|
|
||||
ifneq (,$(findstring generic32,$(PLATFORM))) |
|
||||
SYLIXOS_BASE_PATH=/home/user/x86_workspace/sylixos-base |
|
||||
ARCH_CFLAGS = -m32 -mhard-float -mlong-double-64 |
|
||||
ARCH_LDFLAGS = |
|
||||
endif |
|
||||
|
|
||||
# SylixOS includes |
|
||||
INCDIR = $(SYLIXOS_BASE_PATH)/libsylixos/SylixOS |
|
||||
INCDIR += $(SYLIXOS_BASE_PATH)/libsylixos/SylixOS/include |
|
||||
INCDIR += $(SYLIXOS_BASE_PATH)/libsylixos/SylixOS/include/network |
|
||||
|
|
||||
SHLDIR = $(SYLIXOS_BASE_PATH)/libsylixos/Release |
|
||||
SHLDIR += $(SYLIXOS_BASE_PATH)/libcextern/Release |
|
||||
SHLDIR += $(SYLIXOS_BASE_PATH)/libsylixos/Debug |
|
||||
SHLDIR += $(SYLIXOS_BASE_PATH)/libcextern/Debug |
|
||||
|
|
||||
SYLIXOS_CFLAGS = $(ARCH_CFLAGS) -DSYLIXOS -DSYLIXOS_LIB $(addprefix -I,$(INCDIR)) -fmessage-length=0 -fno-short-enums |
|
||||
SYLIXOS_EXLIBS = $(ARCH_CFLAGS) $(ARCH_LDFLAGS) -Wl,-shared -shared $(addprefix -L,$(SHLDIR)) -lcextern -lvpmpdm -lm -lgcc |
|
||||
|
|
||||
2. 修改 CFLAG: |
|
||||
CFLAG = $(SYLIXOS_CFLAGS) 原有的定义,略 |
|
||||
|
|
||||
3. 修改 PEX_LIBS 和 EX_LIBS |
|
||||
PEX_LIBS = -Wl,-shared -shared |
|
||||
EX_LIBS = $(SYLIXOS_EXLIBS) |
|
||||
|
|
||||
4. 修改 SHARED_LDFLAGS |
|
||||
SHARED_LDFLAGS= -Wl,-shared -shared |
|
||||
|
|
||||
四、编译 OpenSSL |
|
||||
|
|
||||
make |
|
||||
|
|
||||
五、安装 OpenSSL |
|
||||
|
|
||||
安装 OpenSSL 需要在 root 用户下,输入 su 切换到 root 用户: |
|
||||
su |
|
||||
|
|
||||
再修改环境变量 PATH,不然 make install 的结果会非常庞大(因为找不到 xxx-xxx-xxx-strip): |
|
||||
export PATH=/usr/lib/gcc-arm-none-eabi/bin:$PATH |
|
||||
export PATH=/usr/lib/gcc-arm-sylixos-eabi/bin:$PATH |
|
||||
export PATH=/usr/lib/gcc-mips-sylixos-elf/bin:$PATH |
|
||||
export PATH=/usr/lib/gcc-ppc-sylixos-eabi/bin:$PATH |
|
||||
export PATH=/usr/lib/gcc-i386-sylixos-elf/bin:$PATH |
|
||||
|
|
||||
|
|
||||
输入如下命令以安装 OpenSSL: |
|
||||
make install |
|
||||
|
|
||||
会安装到配置时指定的目录 /opt/xxx-sylixos-openssl 里。 |
|
||||
|
|
||||
六、部署 OpenSSL |
|
||||
|
|
||||
1. 在 SylixOS 目标板的 /lib 目录中创建 openssl 文件夹, 然后将 make install 的结果(位于 /opt/xxx-sylixos-openssl 目录)下载到 SylixOS 目标板的 /lib/openssl 目录。 |
|
||||
下面的命令在 SylixOS 目标板的终端执行: |
|
||||
|
|
||||
2. 创建好相应的符号链接: |
|
||||
cd /lib/openssl/lib |
|
||||
ln -s libssl.so.1.0.0 libssl.so |
|
||||
ln -s libcrypto.so.1.0.0 libcrypto.so |
|
||||
|
|
||||
3. 修改环境变量: |
|
||||
PATH=$PATH:/lib/openssl/bin |
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib/openssl/lib |
|
||||
varsave |
|
||||
|
|
||||
七、运行 OpenSSL |
|
||||
|
|
||||
openssl |
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue