lua-cjson is now bundled and enabled by default. it is working on Linux.

This commit is contained in:
agentzh (章亦春)
2011-08-09 23:46:50 +08:00
parent 636ef91bed
commit 6a75ebc5b0
4 changed files with 122 additions and 64 deletions

50
util/configure vendored
View File

@ -137,6 +137,9 @@ for my $opt (@ARGV) {
} elsif ($opt eq '--without-lua51') {
$resty_opts{no_lua} = 1;
} elsif ($opt eq '--without-lua_cjson') {
$resty_opts{no_lua_cjson} = 1;
} elsif ($opt eq '--with-debug') {
$resty_opts{debug} = 1;
@ -510,6 +513,53 @@ _END_
. "\$(MAKE) install$extra_opts INSTALL_TOP=\$(DESTDIR)$lua_prefix";
cd '..';
}
if ($opts->{lua} || $opts->{luajit}) {
# build lua modules
my $lualib_prefix = "$prefix/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";
print $in <<"_EOC_";
CFLAGS=\$"\$CFLAGS -DLUA_DEFAULT_PATH='\\"$lualib_prefix/?.lua\\"'"
CFLAGS=\$"\$CFLAGS -DLUA_DEFAULT_CPATH='\\"$lualib_prefix/?.so\\"'"
_EOC_
close $in;
unless ($opts->{no_lua_cjson}) {
my $dir = auto_complete 'lua-cjson';
if (!defined $dir) {
die "No lua-cjson found";
}
my $install;
if ($on_solaris) {
$install = "$root_dir/build/install";
} else {
$install = "install";
}
my $lua_inc = $ENV{LUA_INC};
my $extra_opts = " DESTDIR=\$(DESTDIR) LUA_INCLUDE_DIR=$lua_inc " .
"LUA_LIB_DIR=$lualib_prefix";
push @make_cmds, "cd $root_dir/build/$dir && ".
"\$(MAKE)$extra_opts";
push @make_install_cmds, "cd $root_dir/build/$dir && " .
"\$(MAKE) install$extra_opts";
}
}
# prepare nginx configure line

View File

@ -203,6 +203,12 @@ cd ..
#################################
ver=1.0.2
$root/util/get-tarball "http://www.kyne.com.au/~mark/software/lua-cjson-$ver.tar.gz" -O "lua-cjson-$ver.tar.gz" || exit 1
tar -xzf lua-cjson-$ver.tar.gz || exit 1
#################################
rm *.tar.gz
cd ..

View File

@ -1,7 +1,7 @@
#!/bin/bash
main_ver=1.0.5
minor_ver=0rc1
minor_ver=0rc2
version=$main_ver.$minor_ver
echo $version