now the --with-cc=CC option of ./configure also controls the C compiler used by Lua and LuaJIT. thanks @姜大炮 for reporting the issue; also released ngx_openresty 1.0.4.1rc3.

This commit is contained in:
agentzh (章亦春)
2011-07-23 12:37:44 +08:00
parent 68aac430ae
commit b7e7398fc9
3 changed files with 76 additions and 9 deletions

35
util/configure vendored
View File

@ -105,12 +105,19 @@ my $prefix = '/usr/local/openresty';
my %resty_opts;
my $dry_run;
my @ngx_rpaths;
my $cc;
my (@ngx_opts, @ngx_cc_opts, @ngx_ld_opts);
for my $opt (@ARGV) {
next unless defined $opt;
if ($opt =~ /^--with-cc=(.+)/) {
$cc = $1;
push @ngx_opts, $opt;
next;
}
if ($opt eq '--dry-run') {
$dry_run = 1;
next;
@ -317,14 +324,21 @@ sub build_resty_opts {
cd $luajit_src;
shell "make PREFIX=$luajit_prefix", $dry_run;
shell "make install PREFIX=$luajit_prefix DESTDIR=$luajit_root", $dry_run;
my $extra_opts = '';
if (defined $cc) {
$extra_opts .= " CC=$cc";
}
shell "make$extra_opts PREFIX=$luajit_prefix", $dry_run;
shell "make install$extra_opts PREFIX=$luajit_prefix DESTDIR=$luajit_root", $dry_run;
push @make_cmds, "cd build/$luajit_src && "
. "\$(MAKE) PREFIX=$luajit_prefix";
. "\$(MAKE)$extra_opts PREFIX=$luajit_prefix";
push @make_install_cmds, "cd build/$luajit_src && "
. "\$(MAKE) install PREFIX=$luajit_prefix DESTDIR=\$(DESTDIR)";
. "\$(MAKE) install$extra_opts PREFIX=$luajit_prefix DESTDIR=\$(DESTDIR)";
env LUAJIT_LIB => "$luajit_root$luajit_prefix/lib";
env LUAJIT_INC => "$luajit_root$luajit_prefix/include/luajit-2.0";
@ -354,16 +368,21 @@ sub build_resty_opts {
cd $lua_src;
shell "make $platform", $dry_run;
shell "make install INSTALL_TOP=$lua_root$lua_prefix", $dry_run;
my $extra_opts = '';
if (defined $cc) {
$extra_opts .= " CC=$cc";
}
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";
push @make_cmds, "cd build/$lua_src && \$(MAKE) $platform";
push @make_cmds, "cd build/$lua_src && \$(MAKE)$extra_opts $platform";
push @make_install_cmds, "cd build/$lua_src && "
. "\$(MAKE) install INSTALL_TOP=\$(DESTDIR)$lua_prefix";
. "\$(MAKE) install$extra_opts INSTALL_TOP=\$(DESTDIR)$lua_prefix";
cd '..';
}

View File

@ -1,7 +1,7 @@
#!/bin/bash
main_ver=1.0.4
minor_ver=1rc2
minor_ver=1rc3
version=$main_ver.$minor_ver
echo $version