Building openresty1.7.10.1 with luajit on windows

來源:互聯網
上載者:User

標籤:

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 [email protected] $^  

(cjson may be "$(CC) $(LDFLAGS) $(CJSON_LDFLAGS) -o [email protected] $(OBJS)")

to

[plain] view plaincopy

  1. $(CC) $(LDFLAGS) -o [email protected] $^ $(LDFLAGS2)  


(cjson may be "$(CC) $(LDFLAGS) $(CJSON_LDFLAGS) -o [email protected] $(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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.