码迷,mamicode.com
首页 > Windows程序 > 详细

windows compile boringssl

时间:2020-06-24 00:23:44      阅读:170      评论:0      收藏:0      [点我收藏+]

标签:log   tin   done   最新   complete   windows   load   bec   ota   

目标是要安装lsquic的依赖库boringssl
参考 BUILD-WINDOWS.md

boringssl构建方式有几种,ndk,cmake,反正都不要在win7上折腾,ndk环境不好配置,各种报错。cmake到最后nasm安装了,但是汇编还是出问题了,放弃了,还是BUILD-WINDOWS.md指示的用vcpkg装

看下依赖:
技术图片

技术图片

一定要在win10上进行安装,win7坑太多。我就卡在powershell6.21版本死活要netframework4,明明已经安装了4或者4.5甚至更高版本,但是检测不到,就是不行。。。
虚拟机安装win10又iso太大,通过U盘安装还没开始安装启动直接自动暂停,不继续执行了。。。不想折腾就主机重装了win10

另外因为我装的是阉割版本vs2017。编译vcpkg用到VS找不到。。。只好重新安装了vs2017,记住 语言包勾上 英语, 不然后后面vcpkg安装又会报问题。。。

vcpkg安装依赖的部分开源库下载自己找吧,默认很多资源在官网和github,速度很感人,能卡半天。最好csdn有币。。。下载后丢到vcpkg-master\installed里面重新运行vcpkg.exe就好。

主要是从安装./vcpkg.exe install zlib:x64-windows-static 开始一路报错。

1.vcpkg安装
vcpkg安装指南

2.安装powershell6.2.1版本,win10上基本没啥问题,
PowerShell-6.2.1-win-x86.zip

3.VS安装就不说了,强调下勾选上 英语 的语言包
vs2017安装英文语言包

4.安装7zip
7-zip.commandline.18.1.0.nupkg

5.安装zlib,中间还有nuget.exe和PortableGit-2.26.2-32-bit.7z.exe会自动安装,划算快

6.cmake自己下载安装吧,最新版没啥问题

7.然后安装Libevent

PS C:\vcpkg-master> .\vcpkg.exe install zlib:x64-windows-static
Computing installation plan...
The following packages will be built and installed:
zlib[core]:x64-windows-static
A suitable version of powershell-core was not found (required v6.2.1). Downloading portable powershell-core v6.2.1...
Extracting powershell-core...
A suitable version of 7zip was not found (required v18.1.0). Downloading portable 7zip v18.1.0...
Downloading 7zip...
https://www.nuget.org/api/v2/package/7-Zip.CommandLine/18.1.0 -> C:\vcpkg-master\downloads\7-zip.commandline.18.1.0.nupkg
PS C:\vcpkg-master> .\vcpkg.exe install zlib:x64-windows-static
Computing installation plan...
The following packages will be built and installed:
zlib[core]:x64-windows-static
A suitable version of powershell-core was not found (required v6.2.1). Downloading portable powershell-core v6.2.1...
Extracting powershell-core...
A suitable version of 7zip was not found (required v18.1.0). Downloading portable 7zip v18.1.0...
Downloading 7zip...
https://www.nuget.org/api/v2/package/7-Zip.CommandLine/18.1.0 -> C:\vcpkg-master\downloads**7-zip.commandline.18.1.0.nupkg**
Could not download https://www.nuget.org/api/v2/package/7-Zip.CommandLine/18.1.0. Failed to open file C:\vcpkg-master\downloads\7-zip.commandline.18.1.0.nupkg.part. Error code was 13
PS C:\vcpkg-master> .\vcpkg.exe install zlib:x64-windows-static
Computing installation plan...
The following packages will be built and installed:
zlib[core]:x64-windows-static
A suitable version of powershell-core was not found (required v6.2.1). Downloading portable powershell-core v6.2.1...
Extracting powershell-core...
A suitable version of 7zip was not found (required v18.1.0). Downloading portable 7zip v18.1.0...
Downloading 7zip...
https://www.nuget.org/api/v2/package/7-Zip.CommandLine/18.1.0 -> C:\vcpkg-master\downloads\7-zip.commandline.18.1.0.nupkg
WinHttpQueryDataAvailable() failed: 12002
PS C:\vcpkg-master> .\vcpkg.exe install zlib:x64-windows-static
Computing installation plan...
The following packages will be built and installed:
zlib[core]:x64-windows-static
A suitable version of powershell-core was not found (required v6.2.1). Downloading portable powershell-core v6.2.1...
Extracting powershell-core...
A suitable version of 7zip was not found (required v18.1.0). Downloading portable 7zip v18.1.0...
Extracting 7zip...
A suitable version of nuget was not found (required v4.8.1). Downloading portable nuget v4.8.1...
Downloading nuget...
https://dist.nuget.org/win-x86-commandline/v4.8.1/nuget.exe -> C:\vcpkg-master\downloads\nuget.exe
PS C:\vcpkg-master> .\vcpkg.exe install zlib:x64-windows-static
Computing installation plan...
The following packages will be built and installed:
zlib[core]:x64-windows-static
A suitable version of powershell-core was not found (required v6.2.1). Downloading portable powershell-core v6.2.1...
Extracting powershell-core...
A suitable version of 7zip was not found (required v18.1.0). Downloading portable 7zip v18.1.0...
Extracting 7zip...
A suitable version of nuget was not found (required v4.8.1). Downloading portable nuget v4.8.1...
Starting package 1/1: zlib:x64-windows-static
Building package zlib[core]:x64-windows-static...
Warning: The following VS instances are excluded because the English language pack is unavailable.
d:\Program Files (x86)\Microsoft Visual Studio\2017\Community
Please install the English language pack.
Could not locate a complete toolset.
The following paths were examined:
d:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat
d:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\dumpbin.exe
PS C:\vcpkg-master> .\vcpkg.exe install zlib:x64-windows-static
Computing installation plan...
The following packages will be built and installed:
zlib[core]:x64-windows-static
Starting package 1/1: zlib:x64-windows-static
Building package zlib[core]:x64-windows-static...
Warning: The following VS instances are excluded because the English language pack is unavailable.
d:\Program Files (x86)\Microsoft Visual Studio\2017\Community
Please install the English language pack.
Could not locate a complete toolset.
The following paths were examined:
d:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat
d:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\dumpbin.exe
PS C:\vcpkg-master> .\vcpkg.exe install zlib:x64-windows-static
Computing installation plan...
The following packages will be built and installed:
zlib[core]:x64-windows-static
Starting package 1/1: zlib:x64-windows-static
Building package zlib[core]:x64-windows-static...
A suitable version of git was not found (required v2.26.2). Downloading portable git v2.26.2...
Downloading git...
https://github.com/git-for-windows/git/releases/download/v2.26.2.windows.1/PortableGit-2.26.2-32-bit.7z.exe -> C:\vcpkg-master\downloads\PortableGit-2.26.2-32-bit.7z.exe
PS C:\vcpkg-master> .\vcpkg.exe install zlib:x64-windows-static
Computing installation plan...
The following packages will be built and installed:
zlib[core]:x64-windows-static
Starting package 1/1: zlib:x64-windows-static
Building package zlib[core]:x64-windows-static...
A suitable version of git was not found (required v2.26.2). Downloading portable git v2.26.2...
Extracting git...
-- Downloading http://www.zlib.net/zlib-1.2.11.tar.gz...
PS C:\vcpkg-master> .\vcpkg.exe install zlib:x64-windows-static
Computing installation plan...
The following packages will be built and installed:
zlib[core]:x64-windows-static
Starting package 1/1: zlib:x64-windows-static
Building package zlib[core]:x64-windows-static...
-- Downloading http://www.zlib.net/zlib-1.2.11.tar.gz...
PS C:\vcpkg-master> .\vcpkg.exe install zlib:x64-windows-static
Computing installation plan...
The following packages will be built and installed:
zlib[core]:x64-windows-static
Starting package 1/1: zlib:x64-windows-static
Building package zlib[core]:x64-windows-static...
-- Downloading http://www.zlib.net/zlib-1.2.11.tar.gz...
-- Extracting source C:/vcpkg-master/downloads/zlib1211.tar.gz
-- Applying patch cmake_dont_build_more_than_needed.patch
-- Using source at C:/vcpkg-master/buildtrees/zlib/src/1.2.11-deec42f53b
-- Configuring x64-windows-static
-- Building x64-windows-static-dbg
-- Building x64-windows-static-rel
-- Installing: C:/vcpkg-master/packages/zlib_x64-windows-static/share/zlib/copyright
-- Performing post-build validation
-- Performing post-build validation done
Building package zlib[core]:x64-windows-static... done
Installing package zlib[core]:x64-windows-static...
Installing package zlib[core]:x64-windows-static... done
Elapsed time for package zlib:x64-windows-static: 2.704 min

Total elapsed time: 2.704 min

The package zlib is compatible with built-in CMake targets:

find_package(ZLIB REQUIRED)
target_link_libraries(main PRIVATE ZLIB::ZLIB)

PS C:\vcpkg-master> .\vcpkg.exe install libevent:x64-windows-static
Computing installation plan...
The following packages will be built and installed:
libevent[core,thread]:x64-windows-static
Starting package 1/1: libevent:x64-windows-static
Building package libevent[core,thread]:x64-windows-static...
-- Downloading https://github.com/libevent/libevent/archive/release-2.1.11-stable.tar.gz...
-- Extracting source C:/vcpkg-master/downloads/libevent-libevent-release-2.1.11-stable.tar.gz
-- Applying patch fix-file_path.patch
-- Applying patch fix-crt_linkage.patch
-- Applying patch fix-LibeventConfig_cmake_in_path.patch
-- Using source at C:/vcpkg-master/buildtrees/libevent/src/.11-stable-734e533482
-- Configuring x64-windows-static
-- Building x64-windows-static-dbg
-- Building x64-windows-static-rel
-- Installing: C:/vcpkg-master/packages/libevent_x64-windows-static/share/libevent/copyright
-- Performing post-build validation
-- Performing post-build validation done
Building package libevent[core,thread]:x64-windows-static... done
Installing package libevent[core,thread]:x64-windows-static...
Installing package libevent[core,thread]:x64-windows-static... done
Elapsed time for package libevent:x64-windows-static: 2.505 min

Total elapsed time: 2.505 min

The package libevent:x64-windows-static provides CMake targets:

find_package(Libevent CONFIG REQUIRED)
target_link_libraries(main PRIVATE event_static event_core_static event_extra_static)

PS C:\vcpkg-master>

最终算是把zlib和libevent装上了。

8.自己装go和perl后面要用

9.自己下载安装nasm-2.14.02-installer-x64.exe汇编器

然后就可以编译了,but,将cmake加到path后调不了,全路径怎么调用懒得查了,直接cmake-gui用起来

PS E:\win\lsquic\boringssl-master\build> C:\Program\ Files\CMake\bin\cmake.exe -DCMAKE_GENERATOR_PLATFORM=x64 --config Debug -DBUILD_SHARED_LIBS=OFF -DOPENSSL_NO_ASM=1 ..
C:\Program\ : The term ‘C:\Program‘ is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1

  • C:\Program\ Files\CMake\bin\cmake.exe -DCMAKE_GENERATOR_PLATFORM=x64 ...
  • CategoryInfo : ObjectNotFound: (C:\Program:String) [], CommandNotFoundException
  • FullyQualifiedErrorId : CommandNotFoundException

10.用cmake-gui编
技术图片
反正这些依赖项都要找到,框里的是根据lsquic中描述的boringssl的编译方式,加的,我也不知道对不对。。。
反正生成了boringssl的sln项目,vs可以打开,并且全部编译正常。。

技术图片

以上就是lsquic的boringssl的编译。

windows compile boringssl

标签:log   tin   done   最新   complete   windows   load   bec   ota   

原文地址:https://www.cnblogs.com/kuikuitage/p/13185467.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!