From dc2394d5aca59f181f86eb25afdcfd29ede87013 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?agentzh=20=28=E7=AB=A0=E4=BA=A6=E6=98=A5=29?= Date: Wed, 9 Mar 2011 19:29:57 +0800 Subject: [PATCH] added tests for Mac OS X. --- .gitignore | 1 + t/sanity.t | 72 +++++++++++++++++++++++++++++++++++++++++--- util/configure | 40 ++++++++++++++++++++---- util/mirror-tarballs | 2 -- util/ver | 2 +- 5 files changed, 103 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index d301f8b..0c7f8a9 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,4 @@ ngx_openresty-* work/ reindex t/*.t_ +upload diff --git a/t/sanity.t b/t/sanity.t index eb64767..7172551 100644 --- a/t/sanity.t +++ b/t/sanity.t @@ -40,6 +40,8 @@ __DATA__ --with-http_iconv_module enable ngx_http_iconv_module --with-http_postgres_module enable ngx_http_postgres_module + + --without-lua51 disable the bundled Lua 5.1 interpreter --with-luajit enable LuaJIT 2.0 Options directly inherited from nginx @@ -798,6 +800,8 @@ clean: --with-http_iconv_module enable ngx_http_iconv_module --with-http_drizzle_module enable ngx_http_drizzle_module --with-http_postgres_module enable ngx_http_postgres_module + + --without-lua51 disable the bundled Lua 5.1 interpreter --with-luajit enable LuaJIT 2.0 Options directly inherited from nginx @@ -933,7 +937,7 @@ Options directly inherited from nginx cp -r bundle/ build/ cd build cd lua-5.1.4 -make linux +make solaris make install INSTALL_TOP=$OPENRESTY_BUILD_DIR/lua-root/usr/local/openresty/lua export LUA_LIB='$OPENRESTY_BUILD_DIR/lua-root/usr/local/openresty/lua/lib' export LUA_INC='$OPENRESTY_BUILD_DIR/lua-root/usr/local/openresty/lua/include' @@ -961,7 +965,7 @@ cd ../.. .PHONY: all install all: - cd build/lua-5.1.4 && $(MAKE) linux + cd build/lua-5.1.4 && $(MAKE) solaris cd build/nginx-0.8.54 && $(MAKE) install: @@ -972,7 +976,8 @@ clean: rm -rf build -=== TEST 2: --with-http_drizzle_module on solaris + +=== TEST 16: --with-http_drizzle_module on solaris --- cmd: ./configure --with-http_drizzle_module --dry-run --platform=solaris --- out cp -r bundle/ build/ @@ -985,7 +990,7 @@ export LIBDRIZZLE_LIB='$OPENRESTY_BUILD_DIR/libdrizzle-root/usr/local/openresty/ export LIBDRIZZLE_INC='$OPENRESTY_BUILD_DIR/libdrizzle-root/usr/local/openresty/libdrizzle/include' cd .. cd lua-5.1.4 -make linux +make solaris make install INSTALL_TOP=$OPENRESTY_BUILD_DIR/lua-root/usr/local/openresty/lua export LUA_LIB='$OPENRESTY_BUILD_DIR/lua-root/usr/local/openresty/lua/lib' export LUA_INC='$OPENRESTY_BUILD_DIR/lua-root/usr/local/openresty/lua/include' @@ -1016,7 +1021,64 @@ cd ../.. all: cd build/libdrizzle-0.8 && $(MAKE) - cd build/lua-5.1.4 && $(MAKE) linux + cd build/lua-5.1.4 && $(MAKE) solaris + cd build/nginx-0.8.54 && $(MAKE) + +install: + cd build/libdrizzle-0.8 && $(MAKE) install DESTDIR=$(DESTDIR) + cd build/lua-5.1.4 && $(MAKE) install INSTALL_TOP=$(DESTDIR)/usr/local/openresty/lua + cd build/nginx-0.8.54 && $(MAKE) install DESTDIR=$(DESTDIR) + +clean: + rm -rf build + + + +=== TEST 16: --with-http_drizzle_module on Mac +--- cmd: ./configure --with-http_drizzle_module --dry-run --platform=MacOS +--- out +cp -r bundle/ build/ +cd build +cd libdrizzle-0.8 +./configure --prefix=/usr/local/openresty/libdrizzle +make +make install DESTDIR=$OPENRESTY_BUILD_DIR/libdrizzle-root +export LIBDRIZZLE_LIB='$OPENRESTY_BUILD_DIR/libdrizzle-root/usr/local/openresty/libdrizzle/lib' +export LIBDRIZZLE_INC='$OPENRESTY_BUILD_DIR/libdrizzle-root/usr/local/openresty/libdrizzle/include' +cd .. +cd lua-5.1.4 +make macosx +make install INSTALL_TOP=$OPENRESTY_BUILD_DIR/lua-root/usr/local/openresty/lua +export LUA_LIB='$OPENRESTY_BUILD_DIR/lua-root/usr/local/openresty/lua/lib' +export LUA_INC='$OPENRESTY_BUILD_DIR/lua-root/usr/local/openresty/lua/include' +cd .. +cd nginx-0.8.54 +./configure --prefix=/usr/local/openresty/nginx \ + --with-cc-opt='-O2' \ + --add-module=../echo-nginx-module-0.36rc2 \ + --add-module=../xss-nginx-module-0.03rc2 \ + --add-module=../ngx_devel_kit-0.2.14 \ + --add-module=../set-misc-nginx-module-0.21rc2 \ + --add-module=../form-input-nginx-module-0.07rc4 \ + --add-module=../encrypted-session-nginx-module-0.01 \ + --add-module=../drizzle-nginx-module-0.0.15rc9 \ + --add-module=../ngx_lua-0.1.6rc2 \ + --add-module=../headers-more-nginx-module-0.14 \ + --add-module=../srcache-nginx-module-0.12rc2 \ + --add-module=../array-var-nginx-module-0.02 \ + --add-module=../memc-nginx-module-0.12rc1 \ + --add-module=../upstream-keepalive-nginx-module-0.3 \ + --add-module=../auth-request-nginx-module-0.2 \ + --add-module=../rds-json-nginx-module-0.11rc2 \ + --with-ld-opt='-Wl,-rpath=/usr/local/openresty/libdrizzle/lib' \ + --with-http_drizzle_module --with-http_ssl_module +cd ../.. +--- makefile +.PHONY: all install + +all: + cd build/libdrizzle-0.8 && $(MAKE) + cd build/lua-5.1.4 && $(MAKE) macosx cd build/nginx-0.8.54 && $(MAKE) install: diff --git a/util/configure b/util/configure index f67d6c4..80724de 100755 --- a/util/configure +++ b/util/configure @@ -14,18 +14,41 @@ sub usage ($); my (@make_cmds, @make_install_cmds); -my $platform = $^O; +my $OS = $^O; my $ngx_dir; for my $opt (@ARGV) { if ($opt =~ /^--platform=(.*)/) { - $platform = $1; + $OS = $1; undef $opt; } } -my $on_solaris = ($platform =~ /solaris|sunos/i); +my ($platform, $on_solaris); + +if ($OS =~ /solaris|sunos/i) { + $platform = 'solaris'; + $on_solaris = $platform; + +} elsif ($OS eq 'linux') { + $platform = $OS; + +} elsif ($OS eq 'MSWin32') { + die "MS Windows not supported. Abort.\n"; + +} elsif ($OS =~ /^(?:MacOS|rhapsody)$/) { + $platform = 'macosx'; + +} elsif ($OS eq 'freebsd') { + $platform = $OS; + +} elsif ($OS =~ /^(?:openbsd|netbsd)$/) { + $platform = 'bsd'; + +} else { + $platform = 'posix'; +} my @modules = ( [http_iconv => 'iconv-nginx-module', 'disabled'], @@ -95,6 +118,9 @@ for my $opt (@ARGV) { if ($opt =~ /^--prefix=(.*)/) { $prefix = $1; + } elsif ($opt eq '--without-lua51') { + $resty_opts{no_lua} = 1; + } elsif ($opt eq '--with-debug') { $resty_opts{debug} = 1; @@ -215,7 +241,7 @@ sub build_resty_opts { } } - if (! $opts->{luajit} && ! $opts->{no_http_lua}) { + if (! $opts->{luajit} && ! $opts->{no_http_lua} && ! $opts->{no_lua}) { $opts->{lua} = 1; } @@ -345,13 +371,13 @@ sub build_resty_opts { cd $lua_src; - shell "make linux", $dry_run; + shell "make $platform", $dry_run; shell "make install INSTALL_TOP=$lua_root$lua_prefix", $dry_run; env LUA_LIB => "$lua_root$lua_prefix/lib"; env LUA_INC => "$lua_root$lua_prefix/include"; - push @make_cmds, "cd build/$lua_src && \$(MAKE) linux"; + push @make_cmds, "cd build/$lua_src && \$(MAKE) $platform"; push @make_install_cmds, "cd build/$lua_src && " . "\$(MAKE) install INSTALL_TOP=\$(DESTDIR)$lua_prefix"; @@ -444,6 +470,8 @@ _EOC_ $msg .= $with_resty_opts; $msg .= <<'_EOC_'; + + --without-lua51 disable the bundled Lua 5.1 interpreter --with-luajit enable LuaJIT 2.0 Options directly inherited from nginx diff --git a/util/mirror-tarballs b/util/mirror-tarballs index a20e2e1..01061b7 100755 --- a/util/mirror-tarballs +++ b/util/mirror-tarballs @@ -2,8 +2,6 @@ root=$(readlink -f -- "$(dirname -- "$0")/..") -debug= - . util/ver name=ngx_openresty-$version diff --git a/util/ver b/util/ver index 4d30c1a..a2b14d2 100755 --- a/util/ver +++ b/util/ver @@ -1,7 +1,7 @@ #!/bin/bash main_ver=0.8.54 -minor_ver=0 +minor_ver=1rc1 version=$main_ver.$minor_ver echo $version