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. 编译

      

  • 相关阅读:
    js中location.href的用法
    entityframework单例模式泛型用法
    [C#]从URL中获取路径的最简单方法-new Uri(url).AbsolutePath
    等到花儿也谢了的await
    ASP.NET MVC下的异步Action的定义和执行原理
    实际案例:在现有代码中通过async/await实现并行
    ASP.NET MVC Controllers and Actions
    扩展HtmlHelper
    iOS开发网络篇—XML数据的解析
    IOS学习:常用第三方库(GDataXMLNode:xml解析库)
  • 原文地址:https://www.cnblogs.com/dongc/p/13303876.html
Copyright © 2011-2022 走看看