Building openresty1.7.10.1 with Luajit on Windows using Cygwin, using Cygwin under Windows to compile Luajit with Openresty
2013-11-27 15:39 815 People read reviews (0) favorites report
(Heeroz original) first install 32bit Cygwin.
Install Packet:openssl zlib-dev pcre gcc-core perl readline
Openresty not compatible with Cygwin, we need to modify the file ourselves
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)" added:
[Plain] view plaincopy
Ifeq ($ (OS), windows_nt)
LDFLAGS2 + =-L. /luajit-root/usr/local/openresty/luajit-lcyglua51
endif
Change
[Plain] view plaincopy
$ (CC) $ (ldflags)-o [email protected] $^
(Cjson May is "$ (CC) $ (ldflags) $ (cjson_ldflags)-o [email protected] $ (OBJS)")
To
[Plain] view plaincopy
$ (CC) $ (ldflags)-o [email protected] $^ $ (LDFLAGS2)
(Cjson May is "$ (CC) $ (ldflags) $ (cjson_ldflags)-o [email protected] $ (OBJS) $ (LDFLAGS2)")
Then run:
[Plain] view plaincopy
./configure--without-select_module--with-luajit
Let./configure can found your Luajit:
mv./build/luajit-root/usr/local/openresty/luajit/include/luajit-2.1/usr/local/include
CP./build/luajit-2.1-20150223/src/cyglua51.dll/lib/libluajit-5.1.a
./configure--without-select_module--with-luajit (must do this again)
luajit-2.1-20150223 my being wrong dir name, you need press TAB after luajit-2.1-
luajit-2.1-20150223 directory name is not necessarily the same, you need to press TAB after luajit-2.1-text to replace the correct directory.
[Plain] view plaincopy
Let make can link your Luajit:
CP./build/luajit-2.1-20150223/src/cyglua51.dll./build/luajit-root/usr/local/openresty/luajit
Make-j8
Make install DESTDIR=/USR2
CP./build/luajit-2.1-20150223/src/cyglua51.dll/usr2/usr/local/openresty/nginx/sbin/
All'll be OK. You can find Openresty in/usr2/usr/local/folder.
Also The FFI is a problem, because under Cygwin,-e can not is exported function symbols, I has discussed this issue With the author Agentzh, May is next version can solve this problem (already fixed in 1.4.3.9).
In addition Cygwin compiled using the JIT of the FFI may have a problem, because Cygwin under-e cannot export function symbols, Brother Chun has generated patches, estimated later version can be resolved (1.4.3.9 has been resolved).
My homepage:
http://www.fullautocapitalism.com/
Building openresty1.7.10.1 with Luajit on Windows