mirror of
https://github.com/openresty/openresty.git
synced 2024-10-13 00:29:41 +00:00
now we support accumulative --with-cc-opt.
This commit is contained in:
61
t/sanity.t
61
t/sanity.t
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
use t::Config;
|
use t::Config;
|
||||||
|
|
||||||
plan tests => 3 * blocks() + 3;
|
plan tests => 3 * blocks() + 4;
|
||||||
|
|
||||||
#no_diff();
|
#no_diff();
|
||||||
|
|
||||||
@ -245,8 +245,8 @@ export LUA_INC='$OPENRESTY_BUILD_DIR/lua-root/usr/local/openresty/lua/include'
|
|||||||
cd ..
|
cd ..
|
||||||
cd nginx-0.8.54
|
cd nginx-0.8.54
|
||||||
./configure --prefix=/usr/local/openresty/nginx \
|
./configure --prefix=/usr/local/openresty/nginx \
|
||||||
--with-cc-opt='-O0' \
|
|
||||||
--with-debug \
|
--with-debug \
|
||||||
|
--with-cc-opt='-O0' \
|
||||||
--add-module=../echo-nginx-module-0.36rc1 \
|
--add-module=../echo-nginx-module-0.36rc1 \
|
||||||
--add-module=../xss-nginx-module-0.03rc2 \
|
--add-module=../xss-nginx-module-0.03rc2 \
|
||||||
--add-module=../ngx_devel_kit-0.2.14 \
|
--add-module=../ngx_devel_kit-0.2.14 \
|
||||||
@ -347,3 +347,60 @@ install:
|
|||||||
clean:
|
clean:
|
||||||
rm -rf build
|
rm -rf build
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
=== TEST 5: --with-cc-opt
|
||||||
|
--- cmd: ./configure --with-luajit --with-cc-opt="-O3" --dry-run
|
||||||
|
--- out
|
||||||
|
cp -r bundle/ build/
|
||||||
|
cd build
|
||||||
|
cd libdrizzle-0.8
|
||||||
|
./configure --prefix=/usr/local/openresty/libdrizzle
|
||||||
|
make
|
||||||
|
make install DESTDIR=$OPENRESTY_BUILD_DIR/libdrizzle-root
|
||||||
|
export LIBDRIZZLE_LIB='$OPENRESTY_BUILD_DIR/libdrizzle-root/usr/local/openresty/libdrizzle/lib'
|
||||||
|
export LIBDRIZZLE_INC='$OPENRESTY_BUILD_DIR/libdrizzle-root/usr/local/openresty/libdrizzle/include'
|
||||||
|
cd ..
|
||||||
|
cd LuaJIT-2.0.0-beta6
|
||||||
|
make PREFIX=/usr/local/openresty/luajit
|
||||||
|
make install PREFIX=/usr/local/openresty/luajit DESTDIR=$OPENRESTY_BUILD_DIR/luajit-root
|
||||||
|
export LUAJIT_LIB='$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/lib'
|
||||||
|
export LUAJIT_INC='$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.0'
|
||||||
|
cd ..
|
||||||
|
cd nginx-0.8.54
|
||||||
|
./configure --prefix=/usr/local/openresty/nginx \
|
||||||
|
--with-cc-opt='-O2 -O3' \
|
||||||
|
--add-module=../echo-nginx-module-0.36rc1 \
|
||||||
|
--add-module=../xss-nginx-module-0.03rc2 \
|
||||||
|
--add-module=../ngx_devel_kit-0.2.14 \
|
||||||
|
--add-module=../set-misc-nginx-module-0.21rc2 \
|
||||||
|
--add-module=../form-input-nginx-module-0.07rc4 \
|
||||||
|
--add-module=../encrypted-session-nginx-module-0.01 \
|
||||||
|
--add-module=../drizzle-nginx-module-0.0.15rc9 \
|
||||||
|
--add-module=../lua-nginx-module-0.1.6rc1 \
|
||||||
|
--add-module=../headers-more-nginx-module-0.14 \
|
||||||
|
--add-module=../srcache-nginx-module-0.12rc1 \
|
||||||
|
--add-module=../array-var-nginx-module-0.02 \
|
||||||
|
--add-module=../memc-nginx-module-0.12rc1 \
|
||||||
|
--add-module=../upstream-keepalive-nginx-module-0.3 \
|
||||||
|
--add-module=../auth-request-nginx-module-0.2 \
|
||||||
|
--add-module=../rds-json-nginx-module-0.11rc2 \
|
||||||
|
--with-ld-opt='-Wl,-rpath=/usr/local/openresty/libdrizzle/lib:/usr/local/openresty/luajit/lib' \
|
||||||
|
--with-http_ssl_module
|
||||||
|
cd ../..
|
||||||
|
--- makefile
|
||||||
|
.PHONY: all install
|
||||||
|
|
||||||
|
all:
|
||||||
|
cd build/libdrizzle-0.8 && $(MAKE)
|
||||||
|
cd build/LuaJIT-2.0.0-beta6 && $(MAKE) PREFIX=/usr/local/openresty/luajit
|
||||||
|
cd build/nginx-0.8.54 && $(MAKE)
|
||||||
|
|
||||||
|
install:
|
||||||
|
cd build/libdrizzle-0.8 && $(MAKE) install DESTDIR=$(DESTDIR)
|
||||||
|
cd build/LuaJIT-2.0.0-beta6 && $(MAKE) install PREFIX=/usr/local/openresty/luajit DESTDIR=$(DESTDIR)
|
||||||
|
cd build/nginx-0.8.54 && $(MAKE) install DESTDIR=$(DESTDIR)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf build
|
||||||
|
|
||||||
|
12
util/configure
vendored
12
util/configure
vendored
@ -70,6 +70,7 @@ my $prefix = '/usr/local/openresty';
|
|||||||
my %resty_opts;
|
my %resty_opts;
|
||||||
my $dry_run;
|
my $dry_run;
|
||||||
my @ngx_rpaths;
|
my @ngx_rpaths;
|
||||||
|
my @ngx_cc_opts;
|
||||||
|
|
||||||
my @ngx_opts;
|
my @ngx_opts;
|
||||||
for my $opt (@ARGV) {
|
for my $opt (@ARGV) {
|
||||||
@ -87,6 +88,9 @@ for my $opt (@ARGV) {
|
|||||||
} elsif ($opt eq '--help') {
|
} elsif ($opt eq '--help') {
|
||||||
usage 0;
|
usage 0;
|
||||||
|
|
||||||
|
} elsif ($opt =~ /^--with-cc-opt=(.*)/) {
|
||||||
|
push @ngx_cc_opts, $1;
|
||||||
|
|
||||||
} elsif ($opt =~ $without_resty_mods_regex) {
|
} elsif ($opt =~ $without_resty_mods_regex) {
|
||||||
die "No $1\n";
|
die "No $1\n";
|
||||||
$resty_opts{"no_http_$1"} = 1;
|
$resty_opts{"no_http_$1"} = 1;
|
||||||
@ -205,11 +209,15 @@ sub build_resty_opts {
|
|||||||
my $opts_line = '';
|
my $opts_line = '';
|
||||||
|
|
||||||
if ($opts->{debug}) {
|
if ($opts->{debug}) {
|
||||||
$opts_line .= " \\\n --with-cc-opt='-O0' \\\n --with-debug";
|
unshift @ngx_cc_opts, '-O0';
|
||||||
|
$opts_line .= " \\\n --with-debug";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$opts_line .= " \\\n --with-cc-opt='-O2'";
|
unshift @ngx_cc_opts, '-O2';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$opts_line .= " \\\n --with-cc-opt='@ngx_cc_opts'";
|
||||||
|
|
||||||
if (-d 'build') {
|
if (-d 'build') {
|
||||||
system("rm -rf build");
|
system("rm -rf build");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user