diff --git a/t/sanity.t b/t/sanity.t index 95286e1..4c2d777 100644 --- a/t/sanity.t +++ b/t/sanity.t @@ -2,7 +2,7 @@ use t::Config; -plan tests => 96; +plan tests => 100; #no_diff(); @@ -148,6 +148,8 @@ Options directly inherited from nginx pentium, pentiumpro, pentium3, pentium4, athlon, opteron, sparc32, sparc64, ppc64 + --with-make=PATH specify the default make utility to be used + --without-pcre disable PCRE library usage --with-pcre force PCRE library usage --with-pcre=DIR set path to PCRE library sources @@ -185,8 +187,8 @@ platform: linux (linux) cp -rp bundle/ build/ cd build cd lua-5.1.4 -make linux -make install INSTALL_TOP=$OPENRESTY_BUILD_DIR/lua-root/usr/local/openresty/lua +gmake linux +gmake 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 .. @@ -232,8 +234,8 @@ platform: linux (linux) cp -rp bundle/ build/ cd build cd lua-5.1.4 -make linux -make install INSTALL_TOP=$OPENRESTY_BUILD_DIR/lua-root/usr/local/openresty/lua +gmake linux +gmake 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 .. @@ -276,7 +278,7 @@ clean: === TEST 4: --with-http_ssl_module & --without-http_ssl_module --- cmd: ./configure --with-http_ssl_module --without-http_ssl_module ---- exit: 255 +--- exit: 2 --- err --with-http_ssl_module conflicts with --without-http_ssl_module. --- out @@ -291,8 +293,8 @@ platform: linux (linux) cp -rp bundle/ build/ cd build cd LuaJIT-2.0.0-beta8 -make TARGET_STRIP=@: PREFIX=/usr/local/openresty/luajit -make install TARGET_STRIP=@: PREFIX=/usr/local/openresty/luajit DESTDIR=$OPENRESTY_BUILD_DIR/luajit-root +gmake TARGET_STRIP=@: PREFIX=/usr/local/openresty/luajit +gmake install TARGET_STRIP=@: PREFIX=/usr/local/openresty/luajit DESTDIR=$OPENRESTY_BUILD_DIR/luajit-root export LUAJIT_LIB='$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/lib' export LUAJIT_INC='$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.0' cd .. @@ -339,8 +341,8 @@ platform: linux (linux) cp -rp bundle/ build/ cd build cd LuaJIT-2.0.0-beta8 -make TARGET_STRIP=@: PREFIX=/usr/local/openresty/luajit -make install TARGET_STRIP=@: PREFIX=/usr/local/openresty/luajit DESTDIR=$OPENRESTY_BUILD_DIR/luajit-root +gmake TARGET_STRIP=@: PREFIX=/usr/local/openresty/luajit +gmake install TARGET_STRIP=@: PREFIX=/usr/local/openresty/luajit DESTDIR=$OPENRESTY_BUILD_DIR/luajit-root export LUAJIT_LIB='$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/lib' export LUAJIT_INC='$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.0' cd .. @@ -388,8 +390,8 @@ platform: linux (linux) cp -rp bundle/ build/ cd build cd LuaJIT-2.0.0-beta8 -make TARGET_STRIP=@: PREFIX=/usr/local/openresty/luajit -make install TARGET_STRIP=@: PREFIX=/usr/local/openresty/luajit DESTDIR=$OPENRESTY_BUILD_DIR/luajit-root +gmake TARGET_STRIP=@: PREFIX=/usr/local/openresty/luajit +gmake install TARGET_STRIP=@: PREFIX=/usr/local/openresty/luajit DESTDIR=$OPENRESTY_BUILD_DIR/luajit-root export LUAJIT_LIB='$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/lib' export LUAJIT_INC='$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.0' cd .. @@ -436,8 +438,8 @@ platform: linux (linux) cp -rp bundle/ build/ cd build cd LuaJIT-2.0.0-beta8 -make TARGET_STRIP=@: PREFIX=/usr/local/openresty/luajit -make install TARGET_STRIP=@: PREFIX=/usr/local/openresty/luajit DESTDIR=$OPENRESTY_BUILD_DIR/luajit-root +gmake TARGET_STRIP=@: PREFIX=/usr/local/openresty/luajit +gmake install TARGET_STRIP=@: PREFIX=/usr/local/openresty/luajit DESTDIR=$OPENRESTY_BUILD_DIR/luajit-root export LUAJIT_LIB='$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/lib' export LUAJIT_INC='$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.0' cd .. @@ -521,8 +523,8 @@ platform: linux (linux) cp -rp bundle/ build/ cd build cd lua-5.1.4 -make linux -make install INSTALL_TOP=$OPENRESTY_BUILD_DIR/lua-root/opt/blah/lua +gmake linux +gmake install INSTALL_TOP=$OPENRESTY_BUILD_DIR/lua-root/opt/blah/lua export LUA_LIB='$OPENRESTY_BUILD_DIR/lua-root/opt/blah/lua/lib' export LUA_INC='$OPENRESTY_BUILD_DIR/lua-root/opt/blah/lua/include' cd .. @@ -699,6 +701,8 @@ Options directly inherited from nginx pentium, pentiumpro, pentium3, pentium4, athlon, opteron, sparc32, sparc64, ppc64 + --with-make=PATH specify the default make utility to be used + --without-pcre disable PCRE library usage --with-pcre force PCRE library usage --with-pcre=DIR set path to PCRE library sources @@ -736,8 +740,8 @@ platform: solaris (solaris) cp -rp bundle/ build/ cd build cd lua-5.1.4 -make solaris -make install INSTALL_TOP=$OPENRESTY_BUILD_DIR/lua-root/usr/local/openresty/lua +gmake solaris +gmake 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 .. @@ -783,8 +787,8 @@ platform: solaris (solaris) cp -rp bundle/ build/ cd build cd lua-5.1.4 -make solaris -make install INSTALL_TOP=$OPENRESTY_BUILD_DIR/lua-root/usr/local/openresty/lua +gmake solaris +gmake 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 .. @@ -831,8 +835,8 @@ platform: solaris (solaris) cp -rp bundle/ build/ cd build cd lua-5.1.4 -make solaris -make install INSTALL_TOP=$OPENRESTY_BUILD_DIR/lua-root/usr/local/openresty/lua +gmake solaris +gmake 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 .. @@ -878,7 +882,7 @@ clean: platform: linux (linux) --- err The http_drizzle_module is not enabled while --with-libdrizzle is specified. ---- exit: 255 +--- exit: 2 @@ -891,8 +895,8 @@ cd build export LIBDRIZZLE_LIB='/opt/drizzle/lib' export LIBDRIZZLE_INC='/opt/drizzle/include/libdrizzle-1.0' cd lua-5.1.4 -make linux -make install INSTALL_TOP=$OPENRESTY_BUILD_DIR/lua-root/usr/local/openresty/lua +gmake linux +gmake 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 .. @@ -941,8 +945,8 @@ platform: solaris (solaris) cp -rp bundle/ build/ cd build cd lua-5.1.4 -make CC=gcc-4.2 solaris -make install CC=gcc-4.2 INSTALL_TOP=$OPENRESTY_BUILD_DIR/lua-root/usr/local/openresty/lua +gmake CC=gcc-4.2 solaris +gmake install CC=gcc-4.2 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 .. @@ -988,8 +992,8 @@ platform: linux (linux) cp -rp bundle/ build/ cd build cd LuaJIT-2.0.0-beta8 -make CCDEBUG=-g Q= PREFIX=/usr/local/openresty/luajit -make install CCDEBUG=-g Q= PREFIX=/usr/local/openresty/luajit DESTDIR=$OPENRESTY_BUILD_DIR/luajit-root +gmake CCDEBUG=-g Q= PREFIX=/usr/local/openresty/luajit +gmake install CCDEBUG=-g Q= PREFIX=/usr/local/openresty/luajit DESTDIR=$OPENRESTY_BUILD_DIR/luajit-root export LUAJIT_LIB='$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/lib' export LUAJIT_INC='$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.0' cd .. @@ -1038,8 +1042,8 @@ platform: linux (linux) cp -rp bundle/ build/ cd build cd LuaJIT-2.0.0-beta8 -make CCDEBUG=-g Q= CC=cl PREFIX=/usr/local/openresty/luajit -make install CCDEBUG=-g Q= CC=cl PREFIX=/usr/local/openresty/luajit DESTDIR=$OPENRESTY_BUILD_DIR/luajit-root +gmake CCDEBUG=-g Q= CC=cl PREFIX=/usr/local/openresty/luajit +gmake install CCDEBUG=-g Q= CC=cl PREFIX=/usr/local/openresty/luajit DESTDIR=$OPENRESTY_BUILD_DIR/luajit-root export LUAJIT_LIB='$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/lib' export LUAJIT_INC='$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.0' cd .. @@ -1087,7 +1091,7 @@ clean: platform: linux (linux) --- err The http_postgres_module is not enabled while --with-libpq is specified. ---- exit: 255 +--- exit: 2 @@ -1100,8 +1104,8 @@ cd build export LIBPQ_LIB='/opt/postgres/lib' export LIBPQ_INC='/opt/postgres/include' cd lua-5.1.4 -make linux -make install INSTALL_TOP=$OPENRESTY_BUILD_DIR/lua-root/usr/local/openresty/lua +gmake linux +gmake 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 .. @@ -1150,8 +1154,8 @@ platform: linux (linux) cp -rp bundle/ build/ cd build cd lua-5.1.4 -make linux -make install INSTALL_TOP=$OPENRESTY_BUILD_DIR/lua-root/usr/local/openresty/lua +gmake linux +gmake 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 .. @@ -1218,8 +1222,8 @@ cd build export LIBPQ_LIB='/usr/lib64' export LIBPQ_INC='/usr/include' cd lua-5.1.4 -make linux -make install INSTALL_TOP=$OPENRESTY_BUILD_DIR/lua-root/usr/local/openresty/lua +gmake linux +gmake 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 .. @@ -1267,5 +1271,54 @@ clean: platform: linux (linux) --- err The http_postgres_module is not enabled while --with-pg_config is specified. ---- exit: 255 +--- exit: 2 + + + +=== TEST 27: --with-make option +--- cmd: ./configure --with-make=make --dry-run +--- out +platform: linux (linux) +cp -rp bundle/ build/ +cd build +cd lua-5.1.4 +make linux +make install INSTALL_TOP=/home/agentz/git/ngx_openresty/ngx_openresty-1.0.4.2rc8/build/lua-root/usr/local/openresty/lua +export LUA_LIB='/home/agentz/git/ngx_openresty/ngx_openresty-1.0.4.2rc8/build/lua-root/usr/local/openresty/lua/lib' +export LUA_INC='/home/agentz/git/ngx_openresty/ngx_openresty-1.0.4.2rc8/build/lua-root/usr/local/openresty/lua/include' +cd .. +cd nginx-1.0.4 +./configure --prefix=/usr/local/openresty/nginx \ + --add-module=../ngx_devel_kit-0.2.17 \ + --add-module=../echo-nginx-module-0.37rc1 \ + --add-module=../xss-nginx-module-0.03rc3 \ + --add-module=../set-misc-nginx-module-0.22rc2 \ + --add-module=../form-input-nginx-module-0.07rc5 \ + --add-module=../encrypted-session-nginx-module-0.01 \ + --add-module=../ngx_lua-0.2.1rc3 \ + --add-module=../headers-more-nginx-module-0.15 \ + --add-module=../srcache-nginx-module-0.12 \ + --add-module=../array-var-nginx-module-0.03rc1 \ + --add-module=../memc-nginx-module-0.12 \ + --add-module=../redis2-nginx-module-0.07 \ + --add-module=../upstream-keepalive-nginx-module-0.3 \ + --add-module=../auth-request-nginx-module-0.2 \ + --add-module=../rds-json-nginx-module-0.12rc1 \ + --with-http_ssl_module +cd ../.. +--- err +--- makefile +.PHONY: all install clean + +all: + cd build/lua-5.1.4 && $(MAKE) linux + cd build/nginx-1.0.4 && $(MAKE) + +install: + cd build/lua-5.1.4 && $(MAKE) install INSTALL_TOP=$(DESTDIR)/usr/local/openresty/lua + cd build/nginx-1.0.4 && $(MAKE) install DESTDIR=$(DESTDIR) + +clean: + rm -rf build +--- exit: 0 diff --git a/util/configure b/util/configure index 669520a..bbaa1e0 100755 --- a/util/configure +++ b/util/configure @@ -123,6 +123,11 @@ for my $opt (@ARGV) { next; } + if ($opt =~ /^--with-make=(.*)/) { + $resty_opts{make} = $1; + next; + } + if ($opt =~ /^--prefix=(.*)/) { $prefix = $1; @@ -261,6 +266,26 @@ sub cd ($) { sub build_resty_opts { my $opts = shift; + my $make; + + if ($opts->{make}) { + $make = $opts->{make}; + if (! can_run($make)) { + die "make utility $make cannot be run.\n"; + } + + } else { + if (can_run("gmake")) { + $make = 'gmake'; + + } elsif (can_run("make")) { + $make = "make"; + + } else { + die "No gmake nor make found in PATH.\n"; + } + } + if ($opts->{no_ndk}) { for my $name (qw(lua set_misc iconv lz_session form_input array_var)) { if (! $opts->{"no_http_$name"}) { @@ -398,9 +423,9 @@ sub build_resty_opts { $extra_opts .= " CC=$cc"; } - shell "make$extra_opts PREFIX=$luajit_prefix", $dry_run; + shell "${make}$extra_opts PREFIX=$luajit_prefix", $dry_run; - shell "make install$extra_opts PREFIX=$luajit_prefix DESTDIR=$luajit_root", $dry_run; + shell "${make} install$extra_opts PREFIX=$luajit_prefix DESTDIR=$luajit_root", $dry_run; push @make_cmds, "cd build/$luajit_src && " . "\$(MAKE)$extra_opts PREFIX=$luajit_prefix"; @@ -441,8 +466,8 @@ sub build_resty_opts { $extra_opts .= " CC=$cc"; } - shell "make$extra_opts $platform", $dry_run; - shell "make install$extra_opts INSTALL_TOP=$lua_root$lua_prefix", $dry_run; + shell "${make}$extra_opts $platform", $dry_run; + shell "${make} install$extra_opts INSTALL_TOP=$lua_root$lua_prefix", $dry_run; env LUA_LIB => "$lua_root$lua_prefix/lib"; env LUA_INC => "$lua_root$lua_prefix/include"; @@ -648,6 +673,8 @@ Options directly inherited from nginx pentium, pentiumpro, pentium3, pentium4, athlon, opteron, sparc32, sparc64, ppc64 + --with-make=PATH specify the default make utility to be used + --without-pcre disable PCRE library usage --with-pcre force PCRE library usage --with-pcre=DIR set path to PCRE library sources diff --git a/util/ver b/util/ver index a842314..e34d768 100755 --- a/util/ver +++ b/util/ver @@ -1,7 +1,7 @@ #!/bin/bash main_ver=1.0.4 -minor_ver=2rc8 +minor_ver=2rc9 version=$main_ver.$minor_ver echo $version