libevent-windows-linux编译

  • 编译环境与源码下载请参考

    • http://www.libevent.net/libevent_1_0.html
  • 目录结构
    在这里插入图片描述

  • 1、编译zlib

@echo "start zlib build"
set VS="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_x86.bat"
set OUTDIR=F:\libevent\output\vs2017_32\zlib

Call %VS%

F:
cd F:\libevent\zlib-1.2.11

nmake /f win32\Makefile.msc clean
nmake /f win32\Makefile.msc
md %OUTDIR%\include
md %OUTDIR%\lib
md %OUTDIR%\bin

copy /Y *.h %OUTDIR%\include
copy /Y *.lib %OUTDIR%\lib
copy /Y *.exe %OUTDIR%\bin
copy /Y *.dll %OUTDIR%\bin
@echo "zlib build end"
pause
  • 2、编译openssl
@echo "开始编译openssl"
set VS="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_x86.bat"
set OUT=F:\libevent\output\vs2017_32\openssl
call %VS%
F:
cd F:\libevent\openssl-1.1.1
perl Configure VC-WIN32 --prefix=%OUT%
nmake clean
nmake
nmake install
@echo "build openssl end"
pause
  • 3、编译libevent
@echo "开始编译libevent"
set VS="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_x86.bat"
set OUT=F:\libevent\output\vs2017_32\libevent
call %VS%
F:
cd F:\libevent\libevent-master
nmake /f Makefile.nmake clean
nmake /f Makefile.nmake OPENSSL_DIR=F:\libevent\output\vs2017_32\openssl
md %OUT%\lib
md %OUT%\bin
md %OUT%\include
copy /Y *.lib %OUT%\lib
xcopy /S/Y include %OUT%\include\
xcopy /S/Y WIN32-Code\nmake %OUT%\include\
copy /Y *.dll %OUT%\bin
copy /Y *.exe %OUT%\bin
@echo "libevent编译结束"
pause
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值