I just finished a Visual Studio 2010 project for nginx. The process was not entirely direct, so I will try to tell in detail about everything that I learned. This is from a few hours to several days, depending on your experience.
1: nginx . nginx, .c .h, Visual Studio. . ( . .)
Unix, , . , Visual Studio.
I: nginx Windows MSYS
, . MSYS, Strawberry Perl, Mercurial PCRE, zlib OpenSSL. :
1) "". Visual Studio vc\vcvarsall.bat,
VC . , , , :
"C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
, Strawberry Perl 3 ( , PATH), Perl.
2) MSys, msys.bat. MSys MinGW, :
C:\MinGW\MSYS\1,0\msys.bat
- :
JensenV @AVWMA047LB ~
( @networkaddress) , MINGW32: ~
, . msys\1.0\home. :
C:\MinGW\MSYS\1.0\\JensenV
"ls" "dir", , .
3) , Mercurial, , ngynx:
hg clone http://hg.nginx.org/nginx
, .
4) , perl - perl, , msys. :
perl
- "/bin/perl.exe", perl, . ( , ) perl, msys.
perl.exe perl_UNUSED.exe msys:
C:\MinGW\MSYS\1.0\Bin
, , " perl" Strawberry Perl, .
5) "link.exe" msys\1.0\bin:
C:\MinGW\MSYS\1,0\Bin
. (.. "link_UNUSED.exe" )
, , 1 "vcvarsall.bat" , / Microsoft C, 2 Msys. Microsoft.
, "link_UNUSED.exe" , :
, Visual Studio 10, link.exe, msys.
6) "cd nginx" objs/lib nginx. Untar/unzip pcre, zlib openssl , guide.
7) nginx, nginx autoconfigure script, ,
sopenssl, pcre zlib, , objs/lib ( ). , , :
auto/configure
, . .c .h, Visual Studio, , , , , .
7) .
nmake -f objs/Makefile
nginx.exe home\YourUsername\nginx\objs. - :
C:\MinGW\MSYS\1.0\\JensenV\Nginx\OBJS
, , nginx.exe:
ngx_auto_config.h
ngx_auto_headers.h
ngx_modules.c
ngx_pch.c
Visual Studio.
8) .
**
II: nginx Visual Studio
**
Visual Studio . nginx ( ). : nginx msys , .
1) "" → " V++" Include:
$(MSBuildProjectDirectory)\SRC\
$ (MSBuildProjectDirectory)\SRC\
$ (MSBuildProjectDirectory)\SRC\\
$ (MSBuildProjectDirectory)\SRC\HTTP
$ (MSBuildProjectDirectory)\SRC\HTTP\
$ (MSBuildProjectDirectory)\SRC\HTTP\\Perl
$ (MSBuildProjectDirectory)\SRC\
$ (MSBuildProjectDirectory)\SRC\
$ (MSBuildProjectDirectory)\SRC\MySQL
$ (MSBuildProjectDirectory)\SRC\
$ (MSBuildProjectDirectory)\OBJS
$ (MSBuildProjectDirectory)\SRC\OS\win32
$ (MSBuildProjectDirectory)\OBJS\Lib\OpenSSL\SSL\
$ (MSBuildProjectDirectory)\OBJS\Lib\Zlib
$ (MSBuildProjectDirectory)\OBJS\Lib\PCRE
. objs/lib zlib, pcre ssl. , . , , .
" → " , MSBuildProjectDirectory - nginx.
2) :
$(MSBuildProjectDirectory)\OBJS\Lib\OpenSSL\SSL\Lib \
$ (MSBuildProjectDirectory)\OBJS\Lib\PCRE \
$ (MSBuildProjectDirectory)\OBJS\Lib\Zlib\
, , , objs/lib .
3) :
/C++ : " " "" (WX-) : : WIN32 NGX_WIN32 NGX_MAIL_SSL NO_SYS_TYPES_H FD_SETSIZE = 1024
Linker: : :
ws2_32.lib
pcre.lib
ssleay32.lib
libeay32.lib
crypt32.lib
zlib.lib
4) Visual Studio. ( .vcxproj) , Notepad ++. ( , - .) nginx\objs\makefile .
make , , , - :
objs/nginx.exe: objs/src/core/nginx.obj \ objs/src/core/ngx_log.obj \ objs/src/core/ngx_palloc.obj \ objs/src/core/ngx_array.obj \ .... objs/ngx_modules.obj \ objs/nginx.res \ objs/lib/pcre-8.33/pcre.lib \ OBJS/Library/Zlib-1.2.8/zlib.lib $ (LINK) @< <
, Visual Studio, - ( , , , ), - :
, .obj makefile. " " , , Visual Studio ( .c/" > .obj\
. zlib.lib pcre.lib. , nginx.res. (, .)
, , Visual Studio . makefile , .
5) .c .h , nginx exe? . :
ngx_modules.c
ngx_pch.c
6) !
, , - , , !
. , options nginx, auto/configure , nmake, Visual Studio ngx_modules.c ngx_pch.c Visual Studio.