added new option -jN (e.g., -j8, -j10, and etc.) to ./configure; thanks @Lance.

This commit is contained in:
agentzh (章亦春)
2011-09-23 16:45:42 +08:00
parent b8217145ed
commit b5e945fb9f
2 changed files with 173 additions and 30 deletions

22
util/configure vendored
View File

@ -110,12 +110,18 @@ my %resty_opts;
my $dry_run;
my @ngx_rpaths;
my $cc;
my $cores;
my (@ngx_opts, @ngx_cc_opts, @ngx_ld_opts);
for my $opt (@ARGV) {
next unless defined $opt;
if ($opt =~ /^-j(\d+)/) {
$cores = $1;
next;
}
if ($opt =~ /^--with-cc=(.+)/) {
$cc = $1;
push @ngx_opts, $opt;
@ -485,7 +491,11 @@ _END_
$extra_opts .= " CC=$cc";
}
shell "${make}$extra_opts PREFIX=$luajit_prefix", $dry_run;
if (defined $cores) {
shell "${make} -j$cores$extra_opts PREFIX=$luajit_prefix", $dry_run;
} else {
shell "${make}$extra_opts PREFIX=$luajit_prefix", $dry_run;
}
shell "${make} install$extra_opts PREFIX=$luajit_prefix DESTDIR=$luajit_root", $dry_run;
@ -535,7 +545,12 @@ _END_
$extra_opts .= " CC=$cc";
}
shell "${make}$extra_opts $platform", $dry_run;
if (defined $cores) {
shell "${make} -j$cores$extra_opts $platform", $dry_run;
} else {
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";
@ -750,6 +765,9 @@ sub usage ($) {
--with-no-pool-patch enable the no-pool patch for debugging memory issues.
-jN pass -jN option to make while building the bundled
Lua 5.1 interpreter or LuaJIT 2.0.
_EOC_
my $opt_max_len = length " --without-ngx_devel_kit_module ";