zoukankan      html  css  js  c++  java
  • 使用VS2017编译OpenSSL.0.9.8g

    环境:

      win10_x64家庭中文版,VS2017旗舰版

    开始:

    一、安装工具

      1. 安装ActivePerl

      2. 安装nasm

      验证安装是否安装成功:

      perl -version

       nasm -v

    二、下载源码

      1. openssl-OpenSSL_0_9_8g.tar.gz          解压到D:/openssl-OpenSSL_0_9_8g

      查看openssl版本:opensslv.h                                           #define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8g 19 Oct 2007"

    三、编译

      1. 编写脚本build.bat

    @echo off
    
    ::Release,Debug
    set BUILD_TYPE=%1%
    if not "%BUILD_TYPE%" == "Release" if not "%BUILD_TYPE%" == "Debug" (
        echo "BUILD_TYPE:%BUILD_TYPE% ERROR"
        exit /b
    )
    
    ::x86,x64
    set PLATFORM=%2%
    if not "%PLATFORM%" == "x86" if not "%PLATFORM%" == "x64" (
        echo "PLATFORM:%PLATFORM% ERROR"
        exit /b
    )
    
    ::Dynamic,Static
    set LIBRARY=%3%
    if not "%LIBRARY%" == "Dynamic" if not "%LIBRARY%" == "Static" (
        echo "LIBRARY:%LIBRARY% ERROR"
        exit /b
    )
    
    set CURRENT_DIR=%~dp0
    
    if exist "C:Program Files (x86)Microsoft Visual Studio2017EnterpriseVCAuxiliaryBuild" (
        set BUILD_TOOL="C:Program Files (x86)Microsoft Visual Studio2017EnterpriseVCAuxiliaryBuild"
    ) else if exist "C:Program FilesMicrosoft Visual Studio2017EnterpriseVCAuxiliaryBuild" (
        set BUILD_TOOL="C:Program FilesMicrosoft Visual Studio2017EnterpriseVCAuxiliaryBuild"
    ) else if exist "D:Program Files (x86)Microsoft Visual Studio2017EnterpriseVCAuxiliaryBuild" (
        set BUILD_TOOL="D:Program Files (x86)Microsoft Visual Studio2017EnterpriseVCAuxiliaryBuild"
    ) else if exist "D:Program FilesMicrosoft Visual Studio2017EnterpriseVCAuxiliaryBuild" (
        set BUILD_TOOL="D:Program FilesMicrosoft Visual Studio2017EnterpriseVCAuxiliaryBuild"
    ) else if exist "E:Program Files (x86)Microsoft Visual Studio2017EnterpriseVCAuxiliaryBuild" (
        set BUILD_TOOL="E:Program Files (x86)Microsoft Visual Studio2017EnterpriseVCAuxiliaryBuild"
    ) else if exist "E:Program FilesMicrosoft Visual Studio2017EnterpriseVCAuxiliaryBuild" (
        set BUILD_TOOL="E:Program FilesMicrosoft Visual Studio2017EnterpriseVCAuxiliaryBuild"
    ) else (
        echo "BUILD_TOOL ERROR"
        goto end
    )
    
    echo "BUILD_TOOL=%BUILD_TOOL%"
    ::if not defined VS150COMNTOOLS (
        if "%PLATFORM%" == "x86" (
            call %BUILD_TOOL%vcvars32.bat"
        )
        if "%PLATFORM%" == "x64" (
            call %BUILD_TOOL%vcvars64.bat
        )
    ::)
    
    if "%PLATFORM%" == "x86" (
        if "%BUILD_TYPE%" == "Release" (
            perl Configure VC-WIN32 no-asm --prefix=%CURRENT_DIR%%PLATFORM%
        )
        if "%BUILD_TYPE%" == "Debug" (
            perl Configure debug-VC-WIN32 no-asm --prefix=%CURRENT_DIR%%PLATFORM%
        )
    ) else if "%PLATFORM%" == "x64" (
        if "%BUILD_TYPE%" == "Release" (
            perl Configure VC-WIN64A no-asm --prefix=%CURRENT_DIR%%PLATFORM%
        )
        if "%BUILD_TYPE%" == "Debug" (
            perl Configure debug-VC-WIN64A no-asm --prefix=%CURRENT_DIR%%PLATFORM%
        )
    )
    
    ::exit /b
    
    call msdo_nasm.bat
    call msdo_win64a.bat
    
    if "%LIBRARY%" == "Dynamic" (
        ::动态库
        echo y|nmake -f ms
    tdll.mak clean
        call nmake  -f  ms
    tdll.mak
        call nmake  -f  ms
    tdll.mak test
        call nmake  -f  ms
    tdll.mak install
    ) else if "%LIBRARY%" == "Static" (
        ::静态库
        echo y|nmake -f ms
    t.mak clean
        call nmake  -f  ms
    t.mak
        call nmake  -f  ms
    t.mak test
        call nmake  -f  ms
    t.mak install
    )

      2. 编译

      

  • 相关阅读:
    禅道使用-升级
    Maven 的这 7 个问题你思考过没有?
    https及证书
    Linux下查看/管理当前登录用户及用户操作历史记录
    禅道的安装
    Linux添加/删除用户和用户组
    Spring注解@Component、@Repository、@Service、@Controller区别 .
    myeclipse,eclipse打开当前文件所在文件夹
    java开发常用工具
    Django环境搭建之安装mod_wsgi模块
  • 原文地址:https://www.cnblogs.com/dongc/p/13303876.html
Copyright © 2011-2022 走看看