win8.1下vs2013编译nginx
来源:互联网 发布:毒狗药三步倒淘宝 编辑:程序博客网 时间:2024/04/29 16:27
我的环境是win8.1 + vs2013社区版
1、安装msys。
http://sourceforge.net/projects/mingw/files/ Installer文件夹下有mingw-get,安装之后,弹出的界面中选择msys即可安装msys。
2、下载 zlib、openssl和pcre
下的几个版本为:openssl-1.0.1j、pcre-8.32、zlib-1.2.8
解压到 $(NGINX_SOURCE)\objs\lib 目录,这个$(NGINX_SOURCE)为nginx源码放置路径,例如D:\Tools\nginx。
3、生成makefile
a) 启动vs 2013命令行。 通过vs 2013工具命令行启动msys,能省略配置cl路径的步骤。
b) 在上述命令行中启动msys。
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC>cd /d C:\MinGW\msys\1.0C:\MinGW\msys\1.0>msys.batc) 在msys控制台窗口中,运行配置脚本
$ cd /d/Tools/nginx/$ auto/configure --with-cc=cl --builddir=objs --prefix= --conf-path=conf/nginx.conf --pid-path=logs/nginx.pid --http-log-path=logs/access.log --error-log-path=logs/error.log --sbin-path=nginx.exe --http-client-body-temp-path=temp/client_body_temp --http-proxy-temp-path=temp/proxy_temp --http-fastcgi-temp-path=temp/fastcgi_temp --with-cc-opt=-DFD_SETSIZE=1024 --with-pcre=objs/lib/pcre-8.32 --with-zlib=objs/lib/zlib-1.2.8 --with-openssl=objs/lib/openssl-1.0.1j --with-select_module --with-http_ssl_module --with-ipv6
如果不想下载zlib(gzip模块需要)、pcre(rewrite模块需要)和openssl,可以修改一下configure命令行
$ auto/configure --with-cc=cl --builddir=objs --prefix= --conf-path=conf/nginx.conf --pid-path=logs/nginx.pid --http-log-path=logs/access.log --error-log-path=logs/error.log --sbin-path=nginx.exe --http-client-body-temp-path=temp/client_body_temp --http-proxy-temp-path=temp/proxy_temp --http-fastcgi-temp-path=temp/fastcgi_temp --with-cc-opt=-DFD_SETSIZE=1024 --with-select_module --without-http_rewrite_module --without-http_gzip_module
为了更好的调试,可以修改--with-cc-opt选项,定义_DEBUG宏,并修改生成的makefile禁用优化。
// 编译时增加_DEBUG宏--with-cc-opt="-DFD_SETSIZE=1024 -D_DEBUG"
// 修改生成的objs\Makefile文件里CFLAGS标志。CFLAGS = -Od -W4 -nologo -MT -Zi -DFD_SETSIZE=1024 -D_DEBUG -DNO_SYS_TYPES_H4、启动编译。
在编译之前,需要修改一下makefile,去掉CFLAGS中的-WX编译选项,否则vs2013会把警告当错误终止编译。
cd D:\Tools\nginx\nmake -f objs\Makefile
5、运行nginx。
a) 把objs\nginx.exe拷贝到上一级目录。
b) 创建文件夹logs、temp
c) 启动nginx.exe
0 0
- win8.1下vs2013编译nginx
- Win8+VS2013编译opencv
- win8+vs2013编译CLapack
- windows下编译nginx+nginx_rtmp_modue(vs2013)
- win8.1 下 VS2013 + Emgu Cv 配置
- win8.1 下 VS2013 + Emgu Cv 配置
- mrpt在win8.1 64bit + vs2013环境下的安装和编译
- win8 64位 VS2013下boost库的编译
- 【Ruby】Win8.1 + VS2013 环境编译 Ruby 2.1.1
- win8.1+vs2013环境编译tiff-3.8.2
- vs2013 + win8.1 + cuda8.0 手工编译 opencv2.4.9
- (Win8.1)VS2013环境下配置OpenGL
- win8.1+vs2013下安装CGAL(含qt、boost、cmake)
- win8.1+vs2013下安装CGAL(含qt、boost、cmake)
- Win8.1 x64 + VS2013 下CGAL安装及配置
- win8.1+vs2013下安装CGAL(含qt、boost、cmake)
- win8.1+vs2013下安装CGAL(含qt、boost、cmake)
- win8.1下opencv2.4.13+vs2013的配置方法
- uva 12100 Printer Queue 习题5-7 打印队列 (STL deque练习)
- C#捕获windows关机事件,在系统关机前做一些自己想做的事
- Redis入门
- linux 原始进程&内核线程
- Java,在Windows平台上使用Socket.sendUrgentData() 来检查连接有效性是不可靠的
- win8.1下vs2013编译nginx
- Android bitmap Config
- 数据结构:可以用求最短路径的方法思想求最长路径么?给出详细解答。。
- Factorial Trailing Zeroes
- Restore IP Addresses
- uva11475 - Extend to Palindrome KMP
- 一步步优化JVM五:优化延迟或者响应时间(1)
- iOS多线程技术的深度探究四: GCD多线程技术
- C++ primer plus 第六版 课后答案 8.6