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:
parent
68aac430ae
commit
b7e7398fc9
48
t/sanity.t
48
t/sanity.t
|
@ -871,6 +871,7 @@ The http_drizzle_module is not enabled while --with-libdrizzle is specified.
|
|||
--- exit: 255
|
||||
|
||||
|
||||
|
||||
=== TEST 16: ngx_drizzle enabled and --with-libdrizzle is specified
|
||||
--- cmd: ./configure --with-libdrizzle=/opt/drizzle --with-http_drizzle_module --dry-run
|
||||
--- out
|
||||
|
@ -921,3 +922,50 @@ install:
|
|||
clean:
|
||||
rm -rf build
|
||||
|
||||
|
||||
|
||||
=== TEST 17: --with-cc
|
||||
--- cmd: ./configure --with-cc=gcc-4.2 --dry-run --platform=solaris
|
||||
--- out
|
||||
platform: solaris (solaris)
|
||||
cp -rp bundle/ build/
|
||||
cd build
|
||||
cd lua-5.1.4
|
||||
make CC=gcc-4.2 solaris
|
||||
make install CC=gcc-4.2 INSTALL_TOP=$OPENRESTY_BUILD_DIR/lua-root/usr/local/openresty/lua
|
||||
export LUA_LIB='$OPENRESTY_BUILD_DIR/lua-root/usr/local/openresty/lua/lib'
|
||||
export LUA_INC='$OPENRESTY_BUILD_DIR/lua-root/usr/local/openresty/lua/include'
|
||||
cd ..
|
||||
cd nginx-1.0.4
|
||||
./configure --prefix=/usr/local/openresty/nginx \
|
||||
--add-module=../echo-nginx-module-0.37rc1 \
|
||||
--add-module=../xss-nginx-module-0.03rc3 \
|
||||
--add-module=../ngx_devel_kit-0.2.17 \
|
||||
--add-module=../set-misc-nginx-module-0.21 \
|
||||
--add-module=../form-input-nginx-module-0.07rc4 \
|
||||
--add-module=../encrypted-session-nginx-module-0.01 \
|
||||
--add-module=../ngx_lua-0.2.1rc2 \
|
||||
--add-module=../headers-more-nginx-module-0.15 \
|
||||
--add-module=../srcache-nginx-module-0.12 \
|
||||
--add-module=../array-var-nginx-module-0.02 \
|
||||
--add-module=../memc-nginx-module-0.12 \
|
||||
--add-module=../redis2-nginx-module-0.07 \
|
||||
--add-module=../upstream-keepalive-nginx-module-0.3 \
|
||||
--add-module=../auth-request-nginx-module-0.2 \
|
||||
--add-module=../rds-json-nginx-module-0.12rc1 \
|
||||
--with-cc=gcc-4.2 --with-http_ssl_module
|
||||
cd ../..
|
||||
--- makefile
|
||||
.PHONY: all install clean
|
||||
|
||||
all:
|
||||
cd build/lua-5.1.4 && $(MAKE) CC=gcc-4.2 solaris
|
||||
cd build/nginx-1.0.4 && $(MAKE)
|
||||
|
||||
install:
|
||||
cd build/lua-5.1.4 && $(MAKE) install CC=gcc-4.2 INSTALL_TOP=$(DESTDIR)/usr/local/openresty/lua
|
||||
cd build/nginx-1.0.4 && $(MAKE) install DESTDIR=$(DESTDIR)
|
||||
|
||||
clean:
|
||||
rm -rf build
|
||||
|
||||
|
|
|
@ -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 '..';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue