ensure that ldconfig is in PATH on linux *and* luajit is enabled.

This commit is contained in:
agentzh (章亦春) 2011-06-10 21:31:20 +08:00
parent 9415dafc3f
commit 04709aa2e6
3 changed files with 27 additions and 3 deletions

24
util/configure vendored
View File

@ -5,6 +5,7 @@ use strict;
use warnings;
use File::Spec;
use ExtUtils::MakeMaker ();
sub shell ($@);
sub env ($$);
@ -258,7 +259,7 @@ sub build_resty_opts {
}
if ($opts->{no_http_ssl} && $opts->{http_ssl}) {
die "--with-http_ssl_module conflicts with --without-http_ssl_module\n";
die "--with-http_ssl_module conflicts with --without-http_ssl_module.\n";
}
if (! $opts->{no_http_ssl} && ! $opts->{http_ssl}) {
@ -266,6 +267,10 @@ sub build_resty_opts {
push @ngx_opts, '--with-http_ssl_module';
}
if ($platform eq 'linux' && $opts->{luajit} && ! can_run("ldconfig")) {
die "you need to have ldconfig in your PATH env when enabling luajit.\n";
}
my $opts_line = '';
if ($opts->{debug}) {
@ -628,3 +633,20 @@ sub gen_makefile {
close $out;
}
# check if we can run some command
sub can_run {
my ($cmd) = @_;
#warn "can run: @_\n";
my $_cmd = $cmd;
return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd));
for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
next if $dir eq '';
my $abs = File::Spec->catfile($dir, $_[0]);
return $abs if (-x $abs or $abs = MM->maybe_command($abs));
}
return;
}

View File

@ -1,6 +1,7 @@
#!/bin/bash
root=$(readlink -f -- "$(dirname -- "$0")/..")
#root=$(readlink -f -- "$(dirname -- "$0")/..")
root=`perl -MCwd -e'print Cwd::abs_path(shift)' $(dirname -- "$0")/..`
work=$root/work
if [ ! -d $work ]; then

View File

@ -1,6 +1,7 @@
#!/bin/bash
root=$(readlink -f -- "$(dirname -- "$0")/..")
#root=$(readlink -f -- "$(dirname -- "$0")/..")
root=`perl -MCwd -e'print Cwd::abs_path(shift)' $(dirname -- "$0")/..`
. util/ver