mirror of
https://github.com/openresty/openresty
synced 2024-11-09 18:35:51 +01:00
now we bundle a perl script to serve as the install script for Solaris. now ngx_openresty 1.0.4.2rc13 builds successfully on Solaris 11 with LuaJIT enabled!
This commit is contained in:
parent
1276fbdf48
commit
843cb73393
5
util/configure
vendored
5
util/configure
vendored
@ -446,6 +446,11 @@ _END_
|
||||
$extra_opts .= ' CFLAGS=-I..';
|
||||
}
|
||||
|
||||
if ($on_solaris) {
|
||||
$extra_opts .= " INSTALL_X='$root_dir/build/install -m 0755' " .
|
||||
"INSTALL_F='$root_dir/build/install -m 0644'";
|
||||
}
|
||||
|
||||
if (defined $cc) {
|
||||
$extra_opts .= " CC=$cc";
|
||||
}
|
||||
|
79
util/install
Executable file
79
util/install
Executable file
@ -0,0 +1,79 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Getopt::Std qw(getopts);
|
||||
|
||||
my %opts;
|
||||
getopts("m:", \%opts) or usage();
|
||||
|
||||
my $mode = $opts{m};
|
||||
|
||||
if (!defined $mode) {
|
||||
die "No -m option specified.\n";
|
||||
}
|
||||
|
||||
my $mod = $opts{m};
|
||||
|
||||
if (@ARGV < 2) {
|
||||
usage();
|
||||
}
|
||||
|
||||
my $dst = pop;
|
||||
|
||||
my @src = @ARGV;
|
||||
|
||||
my $target_dir;
|
||||
|
||||
if (@src > 1 || $dst =~ m{/$}) {
|
||||
$target_dir = $dst;
|
||||
|
||||
} elsif (-d $dst) {
|
||||
$target_dir = $dst;
|
||||
|
||||
} elsif ($dst =~ m{(.+)/}) {
|
||||
$target_dir = $1;
|
||||
|
||||
} else {
|
||||
$target_dir = '.';
|
||||
}
|
||||
|
||||
if (!-d $target_dir) {
|
||||
shell("mkdir -p $target_dir");
|
||||
}
|
||||
|
||||
shell("cp @src $dst");
|
||||
|
||||
if (-f $dst) {
|
||||
chmod oct($mode), $dst or
|
||||
die "failed to change mode of $dst to $mode.\n";
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
for my $src (@src) {
|
||||
my $name;
|
||||
|
||||
if ($src =~ m{/([^/]+)$}) {
|
||||
$name = $1;
|
||||
|
||||
} else {
|
||||
$name = $src;
|
||||
}
|
||||
|
||||
my $target = "$target_dir/$name";
|
||||
chmod oct($mode), $target or
|
||||
die "failed to change mode of $target to $mode.\n";
|
||||
}
|
||||
|
||||
sub usage {
|
||||
die "Usage: install -m <attrs> <src>... <dst>\n";
|
||||
}
|
||||
|
||||
sub shell {
|
||||
my $cmd = shift;
|
||||
system($cmd) == 0 or
|
||||
die "failed to run command $cmd\n";
|
||||
}
|
||||
|
@ -208,6 +208,7 @@ rm *.tar.gz
|
||||
cd ..
|
||||
cp $root/util/configure ./
|
||||
cp $root/README ./
|
||||
cp $root/util/install bundle/
|
||||
|
||||
cd $root
|
||||
|
||||
|
2
util/ver
2
util/ver
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
main_ver=1.0.4
|
||||
minor_ver=2rc12
|
||||
minor_ver=2rc13
|
||||
version=$main_ver.$minor_ver
|
||||
echo $version
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user