-
编译环境与源码下载请参考
- 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