Skip to content

Commit

Permalink
feature: added "<openresty-prefix>/site/lualib/" to the default Lua m…
Browse files Browse the repository at this point in the history
…odule search paths used by OpenResty. This location is for 3rd-party Lua modules so that the users will not pollute the "<openresty-prefix>/lualib/" directory with non-standard Lua module files.
  • Loading branch information
agentzh committed Jul 15, 2016
1 parent 8d76d59 commit 5429150
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions util/configure
Expand Up @@ -753,27 +753,19 @@ _END_
# build lua modules

my $lualib_prefix = File::Spec->catfile($prefix, "lualib");
my $site_lualib_prefix = File::Spec->catfile($prefix, "site/lualib");

my $ngx_lua_dir = auto_complete 'ngx_lua';

open my $in, ">>$ngx_lua_dir/config" or
die "Cannot open $ngx_lua_dir/config for appending: $!\n";

{
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}$path_prefix/?.lua;$path_prefix/?/init.lua\$ngx_lua_dquote'"
CFLAGS="\$CFLAGS -DLUA_DEFAULT_CPATH='\${ngx_lua_dquote}$path_prefix/?.so\$ngx_lua_dquote'"
CFLAGS="\$CFLAGS -DLUA_DEFAULT_PATH='\${ngx_lua_dquote}$site_lualib_prefix/?.lua;$site_lualib_prefix/?/init.lua;$lualib_prefix/?.lua;$lualib_prefix/?/init.lua\$ngx_lua_dquote'"
CFLAGS="\$CFLAGS -DLUA_DEFAULT_CPATH='\${ngx_lua_dquote}$site_lualib_prefix/?.so;$lualib_prefix/?.so\$ngx_lua_dquote'"
_EOC_
}

Expand Down

0 comments on commit 5429150

Please sign in to comment.