From 031778f770c13e3e789b5b1795131967ce348c11 Mon Sep 17 00:00:00 2001 From: catatsuy Date: Sat, 10 Feb 2018 18:15:56 +0900 Subject: [PATCH] bugfix: ./configure: relative paths in --add-dynamic-module=PATH option did not work. Signed-off-by: Yichun Zhang (agentzh) --- t/sanity.t | 97 ++++++++++++++++++++++++++++++++++++++++++++++---- util/configure | 5 +++ 2 files changed, 95 insertions(+), 7 deletions(-) diff --git a/t/sanity.t b/t/sanity.t index 8147844..e5a3c14 100644 --- a/t/sanity.t +++ b/t/sanity.t @@ -2,7 +2,7 @@ use t::Config; -plan tests => 235; +plan tests => 239; #no_diff(); @@ -1341,8 +1341,8 @@ install: all clean: rm -rf build --- err -Can't exec "gcc-4.2": No such file or directory at ./configure line 621. -Can't exec "gcc-4.2": No such file or directory at ./configure line 659. +Can't exec "gcc-4.2": No such file or directory at ./configure line 626. +Can't exec "gcc-4.2": No such file or directory at ./configure line 664. @@ -1512,8 +1512,8 @@ install: all clean: rm -rf build --- err -Can't exec "cl": No such file or directory at ./configure line 621. -Can't exec "cl": No such file or directory at ./configure line 659. +Can't exec "cl": No such file or directory at ./configure line 626. +Can't exec "cl": No such file or directory at ./configure line 664. @@ -2311,7 +2311,7 @@ install: all clean: rm -rf build --- err -Can't exec "sw_vers": No such file or directory at ./configure line 718. +Can't exec "sw_vers": No such file or directory at ./configure line 723. @@ -2396,7 +2396,7 @@ install: all clean: rm -rf build --- err -Can't exec "sw_vers": No such file or directory at ./configure line 718. +Can't exec "sw_vers": No such file or directory at ./configure line 723. @@ -4862,3 +4862,86 @@ install: all clean: rm -rf build + + +=== TEST 62: relative path as the --add-dynamic-module option's value +--- cmd: ./configure --add-dynamic-module=/path/to/some/module --add-dynamic-module=../some/module/ --dry-run +--- out +platform: linux (linux) +cp -rp bundle/ build +cd build +cd LuaJIT-2.1-20171103 +INFO: found -msse4.2 in cc. +gmake TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-DLUAJIT_ENABLE_LUA52COMPAT -msse4.2' CC=cc PREFIX=/usr/local/openresty/luajit +gmake install TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-DLUAJIT_ENABLE_LUA52COMPAT -msse4.2' CC=cc 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.1' +cd .. +cd nginx-1.13.6 +sh ./configure --prefix=/usr/local/openresty/nginx \ + --with-cc-opt='-O2' \ + --add-module=../ngx_devel_kit-0.3.0 \ + --add-module=../echo-nginx-module-0.61 \ + --add-module=../xss-nginx-module-0.06rc1 \ + --add-module=../ngx_coolkit-0.2rc3 \ + --add-module=../set-misc-nginx-module-0.32rc1 \ + --add-module=../form-input-nginx-module-0.12 \ + --add-module=../encrypted-session-nginx-module-0.08rc1 \ + --add-module=../srcache-nginx-module-0.31 \ + --add-module=../ngx_lua-0.10.12rc2 \ + --add-module=../ngx_lua_upstream-0.07 \ + --add-module=../headers-more-nginx-module-0.33 \ + --add-module=../array-var-nginx-module-0.05 \ + --add-module=../memc-nginx-module-0.19rc1 \ + --add-module=../redis2-nginx-module-0.15rc1 \ + --add-module=../redis-nginx-module-0.3.7 \ + --add-module=../rds-json-nginx-module-0.15 \ + --add-module=../rds-csv-nginx-module-0.09rc1 \ + --add-module=../ngx_stream_lua-0.0.4rc1 \ + --with-ld-opt='-Wl,-rpath,/usr/local/openresty/luajit/lib' \ + --add-dynamic-module=/path/to/some/module --add-dynamic-module=$OPENRESTY_DIR/../some/module --with-stream --with-stream_ssl_module --with-http_ssl_module +cd ../.. +Type the following commands to build and install: + gmake + gmake install + +--- makefile +.PHONY: all install clean + +all: + cd $OPENRESTY_BUILD_DIR/LuaJIT-2.1-20171103 && $(MAKE) TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-DLUAJIT_ENABLE_LUA52COMPAT -msse4.2' CC=cc PREFIX=/usr/local/openresty/luajit + cd $OPENRESTY_BUILD_DIR/lua-cjson-2.1.0.6rc2 && $(MAKE) DESTDIR=$(DESTDIR) LUA_INCLUDE_DIR=$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1 LUA_CMODULE_DIR=/usr/local/openresty/lualib LUA_MODULE_DIR=/usr/local/openresty/lualib CJSON_CFLAGS="-g -fpic" CC=cc + cd $OPENRESTY_BUILD_DIR/lua-redis-parser-0.13 && $(MAKE) DESTDIR=$(DESTDIR) LUA_INCLUDE_DIR=$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1 LUA_LIB_DIR=/usr/local/openresty/lualib CC=cc + cd $OPENRESTY_BUILD_DIR/lua-rds-parser-0.06 && $(MAKE) DESTDIR=$(DESTDIR) LUA_INCLUDE_DIR=$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1 LUA_LIB_DIR=/usr/local/openresty/lualib CC=cc + cd $OPENRESTY_BUILD_DIR/nginx-1.13.6 && $(MAKE) + +install: all + mkdir -p $(DESTDIR)/usr/local/openresty/ + -cp $OPENRESTY_DIR/COPYRIGHT $(DESTDIR)/usr/local/openresty/ + cd $OPENRESTY_BUILD_DIR/LuaJIT-2.1-20171103 && $(MAKE) install TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-DLUAJIT_ENABLE_LUA52COMPAT -msse4.2' CC=cc PREFIX=/usr/local/openresty/luajit DESTDIR=$(DESTDIR) + cd $OPENRESTY_BUILD_DIR/lua-cjson-2.1.0.6rc2 && $(MAKE) install DESTDIR=$(DESTDIR) LUA_INCLUDE_DIR=$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1 LUA_CMODULE_DIR=/usr/local/openresty/lualib LUA_MODULE_DIR=/usr/local/openresty/lualib CJSON_CFLAGS="-g -fpic" CC=cc + cd $OPENRESTY_BUILD_DIR/lua-redis-parser-0.13 && $(MAKE) install DESTDIR=$(DESTDIR) LUA_INCLUDE_DIR=$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1 LUA_LIB_DIR=/usr/local/openresty/lualib CC=cc + cd $OPENRESTY_BUILD_DIR/lua-rds-parser-0.06 && $(MAKE) install DESTDIR=$(DESTDIR) LUA_INCLUDE_DIR=$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1 LUA_LIB_DIR=/usr/local/openresty/lualib CC=cc + cd $OPENRESTY_BUILD_DIR/lua-resty-dns-0.21rc2 && $(MAKE) install DESTDIR=$(DESTDIR) LUA_LIB_DIR=/usr/local/openresty/lualib INSTALL=$OPENRESTY_BUILD_DIR/install + cd $OPENRESTY_BUILD_DIR/lua-resty-memcached-0.14 && $(MAKE) install DESTDIR=$(DESTDIR) LUA_LIB_DIR=/usr/local/openresty/lualib INSTALL=$OPENRESTY_BUILD_DIR/install + cd $OPENRESTY_BUILD_DIR/lua-resty-redis-0.26 && $(MAKE) install DESTDIR=$(DESTDIR) LUA_LIB_DIR=/usr/local/openresty/lualib INSTALL=$OPENRESTY_BUILD_DIR/install + cd $OPENRESTY_BUILD_DIR/lua-resty-mysql-0.20 && $(MAKE) install DESTDIR=$(DESTDIR) LUA_LIB_DIR=/usr/local/openresty/lualib INSTALL=$OPENRESTY_BUILD_DIR/install + cd $OPENRESTY_BUILD_DIR/lua-resty-string-0.11rc1 && $(MAKE) install DESTDIR=$(DESTDIR) LUA_LIB_DIR=/usr/local/openresty/lualib INSTALL=$OPENRESTY_BUILD_DIR/install + cd $OPENRESTY_BUILD_DIR/lua-resty-upload-0.10 && $(MAKE) install DESTDIR=$(DESTDIR) LUA_LIB_DIR=/usr/local/openresty/lualib INSTALL=$OPENRESTY_BUILD_DIR/install + cd $OPENRESTY_BUILD_DIR/lua-resty-websocket-0.06 && $(MAKE) install DESTDIR=$(DESTDIR) LUA_LIB_DIR=/usr/local/openresty/lualib INSTALL=$OPENRESTY_BUILD_DIR/install + cd $OPENRESTY_BUILD_DIR/lua-resty-lock-0.07 && $(MAKE) install DESTDIR=$(DESTDIR) LUA_LIB_DIR=/usr/local/openresty/lualib INSTALL=$OPENRESTY_BUILD_DIR/install + cd $OPENRESTY_BUILD_DIR/lua-resty-lrucache-0.07 && $(MAKE) install DESTDIR=$(DESTDIR) LUA_LIB_DIR=/usr/local/openresty/lualib INSTALL=$OPENRESTY_BUILD_DIR/install + cd $OPENRESTY_BUILD_DIR/lua-resty-core-0.1.14rc1 && $(MAKE) install DESTDIR=$(DESTDIR) LUA_LIB_DIR=/usr/local/openresty/lualib INSTALL=$OPENRESTY_BUILD_DIR/install + cd $OPENRESTY_BUILD_DIR/lua-resty-upstream-healthcheck-0.05 && $(MAKE) install DESTDIR=$(DESTDIR) LUA_LIB_DIR=/usr/local/openresty/lualib INSTALL=$OPENRESTY_BUILD_DIR/install + cd $OPENRESTY_BUILD_DIR/lua-resty-limit-traffic-0.05 && $(MAKE) install DESTDIR=$(DESTDIR) LUA_LIB_DIR=/usr/local/openresty/lualib INSTALL=$OPENRESTY_BUILD_DIR/install + cd $OPENRESTY_BUILD_DIR/opm-0.0.4 && $OPENRESTY_BUILD_DIR/install bin/* $(DESTDIR)/usr/local/openresty/bin/ + cd $OPENRESTY_BUILD_DIR/resty-cli-0.20 && $OPENRESTY_BUILD_DIR/install bin/* $(DESTDIR)/usr/local/openresty/bin/ + cp $OPENRESTY_BUILD_DIR/resty.index $(DESTDIR)/usr/local/openresty/ + cp -r $OPENRESTY_BUILD_DIR/pod $(DESTDIR)/usr/local/openresty/ + cd $OPENRESTY_BUILD_DIR/nginx-1.13.6 && $(MAKE) install DESTDIR=$(DESTDIR) + mkdir -p $(DESTDIR)/usr/local/openresty/site/lualib $(DESTDIR)/usr/local/openresty/site/pod $(DESTDIR)/usr/local/openresty/site/manifest + ln -sf /usr/local/openresty/nginx/sbin/nginx $(DESTDIR)/usr/local/openresty/bin/openresty + +clean: + rm -rf build + diff --git a/util/configure b/util/configure index ef15b4b..01cdcd2 100755 --- a/util/configure +++ b/util/configure @@ -292,6 +292,11 @@ for my $opt (@ARGV) { my $mod_path = File::Spec->rel2abs($1); push @ngx_opts, "--add-module=$mod_path"; + } elsif ($opt =~ /^--add-dynamic-module=(.*)/) { + + my $mod_path = File::Spec->rel2abs($1); + push @ngx_opts, "--add-dynamic-module=$mod_path"; + } elsif ($opt =~ /^--with-(openssl|pcre|zlib|libatomic|md5|sha1)=(.*)/) { my ($lib, $path) = ($1, $2);