mirror of
https://github.com/openresty/openresty
synced 2024-11-09 18:35:51 +01:00
More MSYS/MinGW love.
* upgraded ngx_lua to 0.9.18rc1 to support Win32 LuaJIT DLL. * upgraded lua-redis-parser to 0.11rc1 for better Win32 support. * upgraded lua-rds-parser to 0.06rc2 for better Win32 support. * upgraded ngx_rds_csv to 0.07rc1 for better Win32 support. * upgraded lua-resty-cli to 0.04rc1 for better Win32 support. * upgraded lua-resty-core to 0.1.2. * applied a patch to LuaJIT to add "!/lualib/" to the default Lua package search paths. * upgraded lua-cjson to 2.1.0.3rc2 for better Win32 support and a suppressed gcc warning. * use OpenResty's nginx tarballs extracted directly from the official nginx code repos, because we need the win32 support which is excluded in the official nginx release tarballs. Our nginx release tarballs are generated by the util/package-nginx.sh script. * added the util/package-win32.sh script to generate the Win32 OpenResty binary distribution file. * applied a patch to always enable C compiler feature tests in nginx's own build system because the MinGW gcc compiler on Win32 is also powerful enough to support advanced features like variadic macros. * added document README-win32. * util/dist-check: do a partial uninstallation before installing anything new. * added util/build-win32.sh to build OpenResty on Win32 using the MinGW/MSYS toolchain. * ./configure: added support for building on Win32 using the MinGW/MSYS toolchain.
This commit is contained in:
parent
6a17d2c784
commit
1f4045ef2c
@ -44,7 +44,9 @@ https://github.com/openresty/ngx_openresty
|
||||
|
||||
To reproduce the bundle tarball, just do
|
||||
|
||||
make
|
||||
```bash
|
||||
make
|
||||
```
|
||||
|
||||
at the top of the bundle source tree.
|
||||
|
||||
|
155
doc/README-win32.md
Normal file
155
doc/README-win32.md
Normal file
@ -0,0 +1,155 @@
|
||||
Name
|
||||
====
|
||||
|
||||
README-win32 - README for the Windows 32-bit build of OpenResty
|
||||
|
||||
Description
|
||||
===========
|
||||
|
||||
To start the NGINX server of the nginx server of the Win32 binary distribution of OpenResty:
|
||||
|
||||
```bash
|
||||
start nginx
|
||||
```
|
||||
|
||||
You can also specify the `-p PATH/` option to override the default server prefix, as in
|
||||
|
||||
```bash
|
||||
cd /path/to/my/openresty/app/
|
||||
start nginx -p $PWD
|
||||
```
|
||||
|
||||
Then you can use the `tasklist` command to check the nginx processes running in the background:
|
||||
|
||||
```console
|
||||
C:\> tasklist /fi "imagename eq nginx.exe"
|
||||
|
||||
Image Name PID Session Name Session# Mem Usage
|
||||
========================= ======== ================ =========== ============
|
||||
nginx.exe 4616 Console 1 7,412 K
|
||||
nginx.exe 5836 Console 1 7,800 K
|
||||
|
||||
```
|
||||
|
||||
One of the two processes is the master process while the other is the worker.
|
||||
|
||||
If you are using the MSYS bash instead of the `cmd.exe` console, then you should replace the `/fi` option
|
||||
with `-fi` in the command above instead.
|
||||
|
||||
You can quickly shut down the server like this:
|
||||
|
||||
```bash
|
||||
nginx -s stop
|
||||
```
|
||||
|
||||
or gracefully shut it down like this:
|
||||
|
||||
```bash
|
||||
nginx -s quit
|
||||
```
|
||||
|
||||
You can also forcibly kill the nginx processes via their PIDs with `taskkill`, as in
|
||||
|
||||
```console
|
||||
C:\> taskkill /pid 5488 /F
|
||||
```
|
||||
|
||||
where the PID (5488 in this example) can be found via the aforementioned `tasklist` command.
|
||||
|
||||
Again, you should use the form `-pid` and `-F` for the options if you are in an MSYS bash
|
||||
session.
|
||||
|
||||
You can run the `resty` script like this:
|
||||
|
||||
```console
|
||||
C:\> resty -e "ngx.say('Hello, OpenResty!')"
|
||||
Hello, OpenResty!
|
||||
```
|
||||
|
||||
The `resty` command-line utility requires a Perl interpreter installed in your
|
||||
system and visible to your PATH environment. Any perl distributions should
|
||||
work, including StrawberryPerl, ActivePerl, and MSYS perl (the former two are
|
||||
recommended though).
|
||||
|
||||
Debugging
|
||||
=========
|
||||
|
||||
Debug symbosl are enabled even in release builds. So that when things go very wrong,
|
||||
one can still debug things with tools like MSYS GDB.
|
||||
|
||||
Inclusion of debug symbols make the binary files (`.exe` and `.dll` files) much larger,
|
||||
but it generally will not load into memory during normal execution on a modern operating
|
||||
system.
|
||||
|
||||
Caveats
|
||||
=======
|
||||
|
||||
The Win32 port of the NGINX core supports the good old `select` IO multiplexing mechanism
|
||||
only.
|
||||
The I/O Completion Ports (IOCP) feature is supported (yet). So do not use this build
|
||||
for production environments with very high concurrency levels.
|
||||
|
||||
This Win32 build of OpenResty is mainly for developers who want to develop their applications
|
||||
in native Windows environment (though they eventually push the finished work onto a Linux or *BSD box, most of the time).
|
||||
|
||||
Details About The Building Process
|
||||
==================================
|
||||
|
||||
Usually you do not need to worry about how the Win32 binaries were built on the maintainers''
|
||||
side. But if you do, please read on.
|
||||
|
||||
The Win32 build of OpenResty is currently built via the MinGW/MSYS toolchain, including
|
||||
MinGW gcc 4.8.1, MSYS perl, MSYS bash, MSYS make, and etc. Basically, it is currently built via
|
||||
the following cmmands:
|
||||
|
||||
```bash
|
||||
mkdir -p objs/lib || exit 1
|
||||
cd objs/lib || exit 1
|
||||
ls ../../..
|
||||
tar -xf ../../../openssl-1.0.2d.tar.gz
|
||||
tar -xf ../../../zlib-1.2.8.tar.gz
|
||||
tar -xf ../../../pcre-8.37.tar.gz
|
||||
cd ../..
|
||||
./configure --with-cc=gcc \
|
||||
--prefix= \
|
||||
--with-cc-opt='-DFD_SETSIZE=1024' \
|
||||
--with-select_module \
|
||||
--with-ipv6 \
|
||||
--sbin-path=nginx.exe \
|
||||
--with-pcre-jit \
|
||||
--with-luajit-xcflags="-DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT" \
|
||||
--with-pcre=objs/lib/pcre-8.37 \
|
||||
--with-zlib=objs/lib/zlib-1.2.8 \
|
||||
--with-openssl=objs/lib/openssl-1.0.2d \
|
||||
-j5
|
||||
make
|
||||
make install
|
||||
```
|
||||
|
||||
where the dependency library source tarballs for OpenSSL, Zlib, and PCRE are downloaded
|
||||
from their official sites, respectively.
|
||||
|
||||
Usually you can just download and use the binary distribution of OpenResty without
|
||||
installing the build toolchain.
|
||||
|
||||
Author
|
||||
======
|
||||
|
||||
Yichun "agentzh" Zhang <agentzh@gmail.com>, CloudFlare Inc.
|
||||
|
||||
Copyright & License
|
||||
===================
|
||||
|
||||
This module is licensed under the BSD license.
|
||||
|
||||
Copyright (C) 2015, by Yichun "agentzh" Zhang (章亦春) <agentzh@gmail.com>, CloudFlare Inc.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
14
patches/luajit-win32-default-paths.patch
Normal file
14
patches/luajit-win32-default-paths.patch
Normal file
@ -0,0 +1,14 @@
|
||||
--- LuaJIT-2.1-20151028/src/luaconf.h 2015-10-12 20:28:56.000000000 +0800
|
||||
+++ LuaJIT-2.1-20151028.patched/src/luaconf.h 2015-11-01 20:31:28.358507706 +0800
|
||||
@@ -21,9 +21,9 @@
|
||||
#define LUA_LDIR "!\\lua\\"
|
||||
#define LUA_CDIR "!\\"
|
||||
#define LUA_PATH_DEFAULT \
|
||||
- ".\\?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;"
|
||||
+ ".\\?.lua;" "!\\lualib\\?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;"
|
||||
#define LUA_CPATH_DEFAULT \
|
||||
- ".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll"
|
||||
+ ".\\?.dll;" "!\\lualib\\?.so;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll"
|
||||
#else
|
||||
/*
|
||||
** Note to distribution maintainers: do NOT patch the following lines!
|
11
patches/nginx-1.9.3-always_enable_cc_feature_tests.patch
Normal file
11
patches/nginx-1.9.3-always_enable_cc_feature_tests.patch
Normal file
@ -0,0 +1,11 @@
|
||||
--- nginx-1.9.3/auto/cc/conf 2015-10-30 22:47:50.000000000 +0800
|
||||
+++ nginx-1.9.3-patched/auto/cc/conf 2015-11-02 12:23:05.385156987 +0800
|
||||
@@ -136,7 +136,7 @@ fi
|
||||
CFLAGS="$CFLAGS $NGX_CC_OPT"
|
||||
NGX_TEST_LD_OPT="$NGX_LD_OPT"
|
||||
|
||||
-if [ "$NGX_PLATFORM" != win32 ]; then
|
||||
+if [ 1 ]; then
|
||||
|
||||
if test -n "$NGX_LD_OPT"; then
|
||||
ngx_feature=--with-ld-opt=\"$NGX_LD_OPT\"
|
1048
t/sanity.t
1048
t/sanity.t
File diff suppressed because it is too large
Load Diff
26
util/build-win32.sh
Normal file
26
util/build-win32.sh
Normal file
@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
rm -rf objs || exit 1
|
||||
mkdir -p objs/lib || exit 1
|
||||
cd objs/lib || exit 1
|
||||
ls ../../..
|
||||
tar -xf ../../../openssl-1.0.2d.tar.gz
|
||||
tar -xf ../../../zlib-1.2.8.tar.gz
|
||||
tar -xf ../../../pcre-8.37.tar.gz
|
||||
cd ../..
|
||||
|
||||
#--with-openssl-opt="no-asm" \
|
||||
|
||||
./configure --with-cc=gcc --with-ipv6 --prefix= \
|
||||
--with-cc-opt='-DFD_SETSIZE=1024' \
|
||||
--sbin-path=nginx.exe \
|
||||
--with-ipv6 \
|
||||
--with-pcre-jit \
|
||||
--with-luajit-xcflags="-DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT" \
|
||||
--with-pcre=objs/lib/pcre-8.37 \
|
||||
--with-zlib=objs/lib/zlib-1.2.8 \
|
||||
--with-openssl=objs/lib/openssl-1.0.2d \
|
||||
--with-select_module -j5 || exit 1
|
||||
#gmake -j5
|
||||
make || exit 1
|
||||
make install
|
101
util/configure
vendored
101
util/configure
vendored
@ -306,7 +306,12 @@ for my $opt (@ARGV) {
|
||||
|
||||
print "platform: $platform ($OS)\n";
|
||||
|
||||
my $ngx_prefix = "$prefix/nginx";
|
||||
my $ngx_prefix;
|
||||
if ($platform eq 'msys') {
|
||||
$ngx_prefix = "$prefix";
|
||||
} else {
|
||||
$ngx_prefix = "$prefix/nginx";
|
||||
}
|
||||
|
||||
my $postamble = '';
|
||||
|
||||
@ -346,6 +351,12 @@ if ($postamble) {
|
||||
|
||||
sub env ($$) {
|
||||
my ($name, $val) = @_;
|
||||
if (!defined $name) {
|
||||
die "env not defined";
|
||||
}
|
||||
if (!defined $val) {
|
||||
die "env $name takes undef value";
|
||||
}
|
||||
print "export $name='$val'\n";
|
||||
$ENV{$name} = $val;
|
||||
}
|
||||
@ -397,7 +408,7 @@ sub build_resty_opts {
|
||||
}
|
||||
|
||||
} else {
|
||||
if (!$platform ne 'msys' && can_run("gmake")) { # msys has no gmake
|
||||
if (can_run("gmake")) { # msys has no gmake
|
||||
$make = 'gmake';
|
||||
|
||||
} else {
|
||||
@ -617,18 +628,43 @@ _END_
|
||||
shell "${make}$extra_opts PREFIX=$luajit_prefix", $dry_run;
|
||||
}
|
||||
|
||||
shell "${make} install$extra_opts PREFIX=$luajit_prefix DESTDIR=$luajit_root/", $dry_run;
|
||||
my ($lib, $inc);
|
||||
|
||||
if ($platform eq 'msys') {
|
||||
$lib = $luajit_root;
|
||||
shell "install -m 0755 src/luajit.exe src/lua51.dll $lib/", $dry_run;
|
||||
|
||||
my $lua_jit_dir = File::Spec->catfile($luajit_root, "lua", "jit");
|
||||
shell "mkdir -p $lua_jit_dir", $dry_run;
|
||||
|
||||
shell "install -m 0644 src/jit/*.lua $lua_jit_dir/", $dry_run;
|
||||
|
||||
$inc = File::Spec->catfile($luajit_root, "include", "luajit-2.1");
|
||||
shell "mkdir -p $inc", $dry_run;
|
||||
|
||||
shell "cd src && install -m 0644 lua.h lualib.h lauxlib.h luaconf.h lua.hpp luajit.h $inc/",
|
||||
$dry_run;
|
||||
|
||||
} else {
|
||||
shell "${make} install$extra_opts PREFIX=$luajit_prefix DESTDIR=$luajit_root/", $dry_run;
|
||||
|
||||
$lib = File::Spec->catfile($luajit_root, $luajit_prefix, "lib");
|
||||
$inc = File::Spec->catfile($luajit_root, $luajit_prefix, "include", "luajit-2.1");
|
||||
}
|
||||
|
||||
push @make_cmds, "cd $root_dir/build/$luajit_src && "
|
||||
. "\$(MAKE)$extra_opts PREFIX=$luajit_prefix";
|
||||
|
||||
my $abs_luajit_src = File::Spec->rel2abs(File::Spec->catfile($root_dir, "build", $luajit_src), $root_dir);
|
||||
|
||||
push @make_install_cmds, "cd $abs_luajit_src && "
|
||||
. "\$(MAKE) install$extra_opts PREFIX=$luajit_prefix DESTDIR=\$(DESTDIR)";
|
||||
if ($platform eq 'msys') {
|
||||
push @make_install_cmds, "cd $abs_luajit_src && "
|
||||
. "cp -rv $luajit_root/* \$(DESTDIR)$prefix/";
|
||||
|
||||
my $lib = File::Spec->catfile($luajit_root, $luajit_prefix, "lib");
|
||||
my $inc = File::Spec->catfile($luajit_root, $luajit_prefix, "include", "luajit-2.1");
|
||||
} else {
|
||||
push @make_install_cmds, "cd $abs_luajit_src && "
|
||||
. "\$(MAKE) install$extra_opts PREFIX=$luajit_prefix DESTDIR=\$(DESTDIR)";
|
||||
}
|
||||
|
||||
env LUAJIT_LIB => $lib;
|
||||
env LUAJIT_INC => $inc;
|
||||
@ -636,7 +672,9 @@ _END_
|
||||
#unshift @ngx_ld_opts, "-L$lib";
|
||||
#unshift @ngx_cc_opts, "-I$inc";
|
||||
|
||||
push @ngx_rpaths, File::Spec->catfile($luajit_prefix, "lib");
|
||||
if ($platform ne 'msys') {
|
||||
push @ngx_rpaths, File::Spec->catfile($luajit_prefix, "lib");
|
||||
}
|
||||
|
||||
cd '..';
|
||||
|
||||
@ -705,12 +743,23 @@ _END_
|
||||
open my $in, ">>$ngx_lua_dir/config" or
|
||||
die "Cannot open $ngx_lua_dir/config for appending: $!\n";
|
||||
|
||||
print $in <<"_EOC_";
|
||||
{
|
||||
my $path_prefix = $lualib_prefix;
|
||||
|
||||
#if (File::Spec->rel2abs($lualib_prefix) ne File::Spec->canonpath($lualib_prefix)
|
||||
#&& $platform eq 'msys')
|
||||
#{
|
||||
# being a relative path and on MSYS
|
||||
#$path_prefix = "!/$lualib_prefix";
|
||||
#}
|
||||
|
||||
print $in <<"_EOC_";
|
||||
|
||||
ngx_lua_dquote='"'
|
||||
CFLAGS="\$CFLAGS -DLUA_DEFAULT_PATH='\$ngx_lua_dquote$lualib_prefix/?.lua;$lualib_prefix/?/init.lua\$ngx_lua_dquote'"
|
||||
CFLAGS="\$CFLAGS -DLUA_DEFAULT_CPATH='\$ngx_lua_dquote$lualib_prefix/?.so\$ngx_lua_dquote'"
|
||||
CFLAGS="\$CFLAGS -DLUA_DEFAULT_PATH='\$ngx_lua_dquote$path_prefix/?.lua;$path_prefix/?/init.lua\$ngx_lua_dquote'"
|
||||
CFLAGS="\$CFLAGS -DLUA_DEFAULT_CPATH='\$ngx_lua_dquote$path_prefix/?.so\$ngx_lua_dquote'"
|
||||
_EOC_
|
||||
}
|
||||
|
||||
close $in;
|
||||
|
||||
@ -731,6 +780,11 @@ _EOC_
|
||||
my $extra_opts = " DESTDIR=\$(DESTDIR) LUA_INCLUDE_DIR=$lua_inc " .
|
||||
"LUA_CMODULE_DIR=$lualib_prefix LUA_MODULE_DIR=$lualib_prefix";
|
||||
|
||||
if ($platform eq 'msys') {
|
||||
my $luajit_root = File::Spec->rel2abs("luajit-root");
|
||||
$extra_opts .= " CJSON_LDFLAGS=\"-shared -L$luajit_root -llua51\"";
|
||||
}
|
||||
|
||||
if ($on_solaris) {
|
||||
#$extra_opts .= " INSTALL=$root_dir/build/install";
|
||||
if ($opts->{debug}) {
|
||||
@ -782,11 +836,15 @@ _EOC_
|
||||
my $extra_opts = " DESTDIR=\$(DESTDIR) LUA_INCLUDE_DIR=$lua_inc " .
|
||||
"LUA_LIB_DIR=$lualib_prefix";
|
||||
|
||||
if ($platform eq 'msys') {
|
||||
my $luajit_root = File::Spec->rel2abs("luajit-root");
|
||||
$extra_opts .= " LDFLAGS=\"-shared -L$luajit_root -llua51\"";
|
||||
}
|
||||
|
||||
if ($on_solaris) {
|
||||
$extra_opts .= " INSTALL=$root_dir/build/install";
|
||||
if ($opts->{debug}) {
|
||||
$extra_opts .= " CFLAGS=\"-g -O -Wall\"";
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
@ -829,6 +887,11 @@ _EOC_
|
||||
my $extra_opts = " DESTDIR=\$(DESTDIR) LUA_INCLUDE_DIR=$lua_inc " .
|
||||
"LUA_LIB_DIR=$lualib_prefix";
|
||||
|
||||
if ($platform eq 'msys') {
|
||||
my $luajit_root = File::Spec->rel2abs("luajit-root");
|
||||
$extra_opts .= " LDFLAGS=\"-shared -L$luajit_root -llua51\"";
|
||||
}
|
||||
|
||||
if ($on_solaris) {
|
||||
$extra_opts .= " INSTALL=$root_dir/build/install";
|
||||
if ($opts->{debug}) {
|
||||
@ -881,9 +944,17 @@ _EOC_
|
||||
|
||||
# configure resty-cli:
|
||||
|
||||
my $resty_cli_dir = auto_complete 'resty-cli';
|
||||
push @make_install_cmds, "cd $root_dir/build/$resty_cli_dir && "
|
||||
. "$root_dir/build/install resty \$(DESTDIR)$prefix/bin/";
|
||||
{
|
||||
my $resty_cli_dir = auto_complete 'resty-cli';
|
||||
my $target_dir;
|
||||
if ($platform eq 'msys') {
|
||||
$target_dir = "\$(DESTDIR)$prefix/";
|
||||
} else {
|
||||
$target_dir = "\$(DESTDIR)$prefix/bin/";
|
||||
}
|
||||
push @make_install_cmds, "cd $root_dir/build/$resty_cli_dir && "
|
||||
. "$root_dir/build/install resty $target_dir";
|
||||
}
|
||||
|
||||
# prepare nginx configure line
|
||||
|
||||
|
@ -67,6 +67,7 @@ write_config_file "/tmp/nginx.conf";
|
||||
|
||||
warn "=== Without Gzip/SSL/PCRE ===\n";
|
||||
$prefix = "/usr/local/openresty-nogzip";
|
||||
sh "sudo rm -rf $prefix/lualib $prefix/luajit $prefix/bin $prefix/lua $prefix/nginx/sbin $prefix/nginx/html";
|
||||
unless ($opts{f}) {
|
||||
sh "./configure $cfg_opts --without-http_rewrite_module --without-http_ssl_module --without-pcre --without-http_gzip_module --prefix=$prefix -j$jobs > /dev/null";
|
||||
}
|
||||
@ -89,6 +90,7 @@ $cfg_opts .= " --with-http_iconv_module";
|
||||
|
||||
warn "\n=== --with-threads ===\n";
|
||||
$prefix = "/usr/local/openresty-threads";
|
||||
sh "sudo rm -rf $prefix/lualib $prefix/luajit $prefix/bin $prefix/lua $prefix/nginx/sbin $prefix/nginx/html";
|
||||
unless ($opts{f}) {
|
||||
sh "./configure $cfg_opts --with-threads --prefix=$prefix -j$jobs > /dev/null";
|
||||
}
|
||||
@ -107,6 +109,7 @@ sh "sudo $prefix/nginx/sbin/nginx -sstop";
|
||||
|
||||
warn "\n=== No Pool Build ===\n";
|
||||
$prefix = "/usr/local/openresty-nopool";
|
||||
sh "sudo rm -rf $prefix/lualib $prefix/luajit $prefix/bin $prefix/lua $prefix/nginx/sbin $prefix/nginx/html";
|
||||
unless ($opts{f}) {
|
||||
sh "./configure --with-no-pool-patch $cfg_opts --prefix=$prefix -j$jobs > /dev/null";
|
||||
}
|
||||
@ -126,6 +129,7 @@ sh "sudo $prefix/nginx/sbin/nginx -sstop";
|
||||
|
||||
warn "\n=== Normal Build ===\n";
|
||||
$prefix = "/usr/local/openresty";
|
||||
sh "sudo rm -rf $prefix/lualib $prefix/luajit $prefix/bin $prefix/lua $prefix/nginx/sbin $prefix/nginx/html";
|
||||
unless ($opts{f}) {
|
||||
sh "./configure $cfg_opts -j$jobs > /dev/null";
|
||||
}
|
||||
@ -143,6 +147,7 @@ sh "sudo $prefix/nginx/sbin/nginx -sstop";
|
||||
|
||||
warn "\n=== Debug Build ===\n";
|
||||
$prefix = "/usr/local/openresty-debug";
|
||||
sh "sudo rm -rf $prefix/lualib $prefix/luajit $prefix/bin $prefix/lua $prefix/nginx/sbin $prefix/nginx/html";
|
||||
unless ($opts{f}) {
|
||||
my $more_cfg_opts = '';
|
||||
if ($lua eq 'LuaJIT') {
|
||||
@ -165,6 +170,7 @@ sh "sudo $prefix/nginx/sbin/nginx -sstop";
|
||||
|
||||
warn "\n=== DTrace Build ===\n";
|
||||
$prefix = "/usr/local/openresty-dtrace";
|
||||
sh "sudo rm -rf $prefix/lualib $prefix/luajit $prefix/bin $prefix/lua $prefix/nginx/sbin $prefix/nginx/html";
|
||||
unless ($opts{f}) {
|
||||
sh "./configure $cfg_opts --with-dtrace-probes --prefix=$prefix -j$jobs > /dev/null";
|
||||
}
|
||||
|
20
util/fix-pod2markdown
Executable file
20
util/fix-pod2markdown
Executable file
@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my $indented;
|
||||
while (<>) {
|
||||
if (/^ \S/) {
|
||||
$indented = 1;
|
||||
print;
|
||||
next;
|
||||
}
|
||||
if ($indented) {
|
||||
if (/^[^-\#=\s]/) {
|
||||
print "\n";
|
||||
}
|
||||
undef $indented;
|
||||
}
|
||||
print;
|
||||
}
|
@ -26,7 +26,7 @@ fi
|
||||
#################################
|
||||
|
||||
ver="$main_ver"
|
||||
$root/util/get-tarball "http://nginx.org/download/nginx-$ver.tar.gz" -O nginx-$ver.tar.gz || exit 1
|
||||
$root/util/get-tarball "http://openresty.org/download/nginx-$ver.tar.gz" -O nginx-$ver.tar.gz || exit 1
|
||||
tar -xzf nginx-$ver.tar.gz || exit 1
|
||||
cd nginx-$ver || exit 1
|
||||
|
||||
@ -295,6 +295,10 @@ fi
|
||||
|
||||
rm -f *.patch || exit 1
|
||||
|
||||
echo "$info_txt applying the always_enable_cc_feature_tests patch to nginx"
|
||||
patch -p1 < $root/patches/nginx-$main_ver-always_enable_cc_feature_tests.patch
|
||||
echo
|
||||
|
||||
cd .. || exit 1
|
||||
|
||||
cp $root/patches/nginx-$main_ver-no_pool.patch ./nginx-no_pool.patch || exit 1
|
||||
@ -341,7 +345,7 @@ mv openresty-rds-json-nginx-module-* rds-json-nginx-module-$ver || exit 1
|
||||
|
||||
#################################
|
||||
|
||||
ver=0.06
|
||||
ver=0.07rc1
|
||||
$root/util/get-tarball "https://github.com/openresty/rds-csv-nginx-module/tarball/v$ver" -O rds-csv-nginx-module-$ver.tar.gz || exit 1
|
||||
tar -xzf rds-csv-nginx-module-$ver.tar.gz || exit 1
|
||||
mv openresty-rds-csv-nginx-module-* rds-csv-nginx-module-$ver || exit 1
|
||||
@ -362,7 +366,7 @@ mv openresty-drizzle-nginx-module-* drizzle-nginx-module-$ver || exit 1
|
||||
|
||||
#################################
|
||||
|
||||
ver=0.9.17
|
||||
ver=0.9.18rc1
|
||||
$root/util/get-tarball "https://github.com/openresty/lua-nginx-module/tarball/v$ver" -O lua-nginx-module-$ver.tar.gz || exit 1
|
||||
tar -xzf lua-nginx-module-$ver.tar.gz || exit 1
|
||||
mv openresty-lua-nginx-module-* ngx_lua-$ver || exit 1
|
||||
@ -464,7 +468,7 @@ mv openresty-redis2-nginx-module-* redis2-nginx-module-$ver || exit 1
|
||||
|
||||
#################################
|
||||
|
||||
ver=0.03
|
||||
ver=0.04rc1
|
||||
$root/util/get-tarball "https://github.com/openresty/resty-cli/tarball/v$ver" -O resty-cli-$ver.tar.gz || exit 1
|
||||
tar -xzf resty-cli-$ver.tar.gz || exit 1
|
||||
mv openresty-resty-cli-* resty-cli-$ver || exit 1
|
||||
@ -502,12 +506,12 @@ $root/util/get-tarball "https://github.com/openresty/luajit2/archive/v$ver.tar.g
|
||||
tar -xzf LuaJIT-$ver.tar.gz || exit 1
|
||||
mv luajit2-* LuaJIT-$ver || exit 1
|
||||
|
||||
#echo "$info_txt applying luajit-$ver hotfix #1 patch for luajit $ver"
|
||||
#$root/util/get-tarball http://luajit.org/download/v2.0.1_hotfix1.patch -O hotfix.patch
|
||||
#cd LuaJIT-$ver || exit 1;
|
||||
#patch -p1 < ../hotfix.patch || exit 1
|
||||
cd LuaJIT-$ver || exit 1;
|
||||
echo "$info_txt applying the luajit-win32-default-paths patch hotfix #1 patch for luajit $ver"
|
||||
patch -p1 < $root/patches/luajit-win32-default-paths.patch || exit 1
|
||||
#rm ../hotfix.patch
|
||||
#cd .. || exit 1
|
||||
cd .. || exit 1
|
||||
|
||||
#$root/util/get-tarball http://luajit.org/download/beta11_hotfix1.patch -O beta11_hotfix1.patch
|
||||
#patch -p1 < beta11_hotfix1.patch || exit 1
|
||||
@ -518,30 +522,30 @@ mv luajit2-* LuaJIT-$ver || exit 1
|
||||
|
||||
#################################
|
||||
|
||||
ver=2.1.0.2
|
||||
ver=2.1.0.3rc2
|
||||
$root/util/get-tarball "https://github.com/openresty/lua-cjson/archive/$ver.tar.gz" -O "lua-cjson-$ver.tar.gz" || exit 1
|
||||
tar -xzf lua-cjson-$ver.tar.gz || exit 1
|
||||
cd lua-cjson-$ver || exit 1
|
||||
#cd lua-cjson-$ver || exit 1
|
||||
#patch -p1 < $root/patches/lua_cjson-$ver-array_detection_fix.patch || exit 1
|
||||
sed 's/\$(DESTDIR)\//$(DESTDIR)/g' Makefile > mk || exit 1
|
||||
mv mk Makefile || exit 1
|
||||
cd ..
|
||||
#sed 's/\$(DESTDIR)\//$(DESTDIR)/g' Makefile > mk || exit 1
|
||||
#mv mk Makefile || exit 1
|
||||
#cd ..
|
||||
|
||||
#################################
|
||||
|
||||
ver=0.10
|
||||
ver=0.11rc1
|
||||
$root/util/get-tarball "https://github.com/openresty/lua-redis-parser/tarball/v$ver" -O "lua-redis-parser-$ver.tar.gz" || exit 1
|
||||
tar -xzf lua-redis-parser-$ver.tar.gz || exit 1
|
||||
mv openresty-lua-redis-parser-* lua-redis-parser-$ver || exit 1
|
||||
cd lua-redis-parser-$ver || exit 1
|
||||
#cd lua-redis-parser-$ver || exit 1
|
||||
#patch -p1 < $root/patches/lua_cjson-$ver-array_detection_fix.patch || exit 1
|
||||
sed 's/\$(DESTDIR)\//$(DESTDIR)/g' Makefile > mk || exit 1
|
||||
mv mk Makefile || exit 1
|
||||
cd ..
|
||||
#sed 's/\$(DESTDIR)\//$(DESTDIR)/g' Makefile > mk || exit 1
|
||||
#mv mk Makefile || exit 1
|
||||
#cd ..
|
||||
|
||||
#################################
|
||||
|
||||
ver=0.05
|
||||
ver=0.06rc2
|
||||
$root/util/get-tarball "https://github.com/openresty/lua-rds-parser/tarball/v$ver" -O "lua-rds-parser-$ver.tar.gz" || exit 1
|
||||
tar -xzf lua-rds-parser-$ver.tar.gz || exit 1
|
||||
mv openresty-lua-rds-parser-* lua-rds-parser-$ver || exit 1
|
||||
@ -661,7 +665,7 @@ cd ..
|
||||
|
||||
#################################
|
||||
|
||||
ver=0.1.1
|
||||
ver=0.1.2
|
||||
$root/util/get-tarball "https://github.com/openresty/lua-resty-core/tarball/v$ver" -O "lua-resty-core-$ver.tar.gz" || exit 1
|
||||
tar -xzf lua-resty-core-$ver.tar.gz || exit 1
|
||||
mv openresty-lua-resty-core-* lua-resty-core-$ver || exit 1
|
||||
@ -688,9 +692,15 @@ cd ..
|
||||
rm *.tar.gz
|
||||
|
||||
cd ..
|
||||
cp $root/util/configure ./
|
||||
cp $root/README.markdown ./
|
||||
cp $root/util/install bundle/
|
||||
cp $root/util/configure ./ || exit 1
|
||||
#markdown2pod -e utf8 -d GitHub $root/README.markdown|$root/util/fix-pod2markdown|pod2text > README || exit 1
|
||||
cp $root/README.markdown ./ || exit 1
|
||||
cp $root/util/install bundle/ || exit 1
|
||||
mkdir util || exit 1
|
||||
cp $root/util/package-win32.sh util/ || exit 1
|
||||
cp $root/util/build-win32.sh util/ || exit 1
|
||||
markdown2pod -e utf8 -d GitHub $root/doc/README-win32.md|$root/util/fix-pod2markdown|pod2text > README-win32.txt || exit 1
|
||||
unix2dos README-win32.txt || exit 1
|
||||
find bundle -name '*~' -delete
|
||||
|
||||
cd $root
|
||||
|
30
util/package-nginx.sh
Executable file
30
util/package-nginx.sh
Executable file
@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
|
||||
. ./util/ver
|
||||
ver=$main_ver
|
||||
|
||||
cd ..
|
||||
if [ ! -d nginx ]; then
|
||||
echo "../nginx/ not found." > /dev/stderr
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -d nginx/.git ]; then
|
||||
echo "../nginx/.git not found." > /dev/stderr
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -rf nginx-$ver
|
||||
rm -f nginx-$ver.tar.gz
|
||||
git clone nginx nginx-$ver || exit 1
|
||||
cd nginx-$ver/ || exit 1
|
||||
git co release-$ver || exit 1
|
||||
rm -rf .git || exit 1
|
||||
rm .hgtags || exit 1
|
||||
mv docs/text/README ./ || exit 1
|
||||
mv auto/configure ./ || exit 1
|
||||
rm -rf src/mysql || exit 1
|
||||
cd ..
|
||||
tar czvf nginx-$ver.tar.gz nginx-$ver || exit 1
|
||||
ls -lh ./nginx-$ver.tar.gz
|
||||
ls -lh ~/work/nginx-$ver.tar.gz
|
||||
scp nginx-$ver.tar.gz agentzh.org:~/www/agentzh/misc/nginx/
|
18
util/package-win32.sh
Executable file
18
util/package-win32.sh
Executable file
@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
name=`pwd|perl -e '$d=<>;$d=~s{.*?/}{}g;$d=~s/$//g;print $d'`
|
||||
name="$name-win32"
|
||||
echo $name
|
||||
if [ -d $name ]; then
|
||||
rm -rf $name
|
||||
fi
|
||||
mkdir $name || exit 1
|
||||
cp -r resty nginx.exe luajit.exe lua51.dll lua include lualib html conf logs $name/ || exit 1
|
||||
cd $name || exit 1
|
||||
PATH=/c/Strawberry/perl/bin:$PATH cmd /c 'pl2bat.bat resty' || exit 1
|
||||
cp ../README-win32.txt README.txt
|
||||
unix2dos conf/* html/*.html || exit 1
|
||||
cd .. || exit 1
|
||||
zip -r $name.zip $name || exit 1
|
||||
echo $name.zip
|
||||
|
2
util/ver
2
util/ver
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
main_ver=1.9.3
|
||||
minor_ver=2rc1
|
||||
minor_ver=2rc1.3
|
||||
version=$main_ver.$minor_ver
|
||||
echo $version
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user