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

Building openresty1.7.10.1 with luajit on windows

时间:2015-06-03 21:49:15      阅读:354      评论:0      收藏:0      [点我收藏+]

标签:

Building openresty1.7.10.1 with luajit on windows using Cygwin, 在windows下用Cygwin下编译带Luajit的openresty

2013-11-27 15:39 815人阅读 评论(0) 收藏 举报

(heeroz原创 )First install 32bit cygwin. 

Install packet: openssl zlib-dev pcre gcc-core perl readline


openresty没有对Cygwin做兼容,我们需要自己来修改文件


Open bundle\lua-cjson and lua-rds-parser and  lua-redis-parser three folder‘s Makefile for edit, Add those lines before “## ..... (Macports)”

bundle\lua-cjson的,lua-rds-parser的,lua-redis-parser的Makefile里,“## ***OSX (Macports)”上面加入:

[plain] view plaincopy技术分享技术分享

  1. ifeq ($(OS),Windows_NT)  

  2.   LDFLAGS2 += -L../luajit-root/usr/local/openresty/luajit -lcyglua51  

  3. endif  


change 

[plain] view plaincopy技术分享技术分享

  1. $(CC) $(LDFLAGS) -o $@ $^  

(cjson may be "$(CC) $(LDFLAGS) $(CJSON_LDFLAGS) -o $@ $(OBJS)")

to

[plain] view plaincopy技术分享技术分享

  1. $(CC) $(LDFLAGS) -o $@ $^ $(LDFLAGS2)  


(cjson may be "$(CC) $(LDFLAGS) $(CJSON_LDFLAGS) -o $@ $(OBJS) $(LDFLAGS2)")


Then run:

[plain] view plaincopy技术分享技术分享

  1. ./configure --without-select_module --with-luajit  

  2. let ./configure can found your luajit:  

  3. mv ./build/luajit-root/usr/local/openresty/luajit/include/luajit-2.1 /usr/local/include  

  4. cp ./build/LuaJIT-2.1-20150223/src/cyglua51.dll /lib/libluajit-5.1.a  

  5. ./configure --without-select_module --with-luajit (must do this again)  


LuaJIT-2.1-20150223 my be wrong dir name, you need press tab after LuaJIT-2.1-

LuaJIT-2.1-20150223目录名不一定一样,你需要在LuaJIT-2.1-文字后直接按Tab换成正确的目录。


[plain] view plaincopy技术分享技术分享

  1. let make can link your luajit:  

  2. cp ./build/LuaJIT-2.1-20150223/src/cyglua51.dll ./build/luajit-root/usr/local/openresty/luajit  

  3. make -j8  

  4. make install DESTDIR=/usr2  

  5. cp ./build/LuaJIT-2.1-20150223/src/cyglua51.dll /usr2/usr/local/openresty/nginx/sbin/  






All will be ok. You can find openresty in /usr2/usr/local/ folder.



Also the ffi may be a problem, because under cygwin, -E can not be exported function symbols, i have discussed this issue with the author Agentzh, may be next version can solve this problem (Already fixed in 1.4.3.9).

另外Cygwin编译的使用jit的ffi可能有问题,因为cygwin下-E无法导出函数符号,春哥已生成补丁,预估以后版本可以解决(1.4.3.9已解决)。


我的主页:

http://www.fullautocapitalism.com/


Building openresty1.7.10.1 with luajit on windows

标签:

原文地址:http://my.oschina.net/epiclight/blog/424478

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