Building openresty1.7.10.1 with Luajit on Windows

Source: Internet
Author: User
Tags ffi lua

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

    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 is "$ (CC) $ (ldflags) $ (cjson_ldflags)-o [email protected] $ (OBJS)")

To

[Plain] view plaincopy

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


(Cjson May is "$ (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 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

  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'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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.