diff --git a/util/configure b/util/configure index 4f72146..bb3f33f 100755 --- a/util/configure +++ b/util/configure @@ -553,7 +553,7 @@ _EOC_ "LUA_LIB_DIR=$lualib_prefix"; if ($on_solaris) { - $extra_opts .= " INSTALL=$root_dir/build/install"; + $extra_opts .= " INSTALL=$root_dir/build/install CFLAGS=\"-g -O3 -Wall -pedantic -D'isinf(x)=0'\""; } if ($platform eq 'macosx') { diff --git a/util/install b/util/install index 27dc366..4e68d79 100755 --- a/util/install +++ b/util/install @@ -6,16 +6,15 @@ use warnings; use Getopt::Std qw(getopts); my %opts; -getopts("m:", \%opts) or usage(); +getopts("dm:", \%opts) or usage(); my $mode = $opts{m}; -if (!defined $mode) { - die "No -m option specified.\n"; +if ($opts{d}) { + shell("mkdir -p @ARGV"); + exit; } -my $mod = $opts{m}; - if (@ARGV < 2) { usage(); } @@ -46,8 +45,10 @@ if (!-d $target_dir) { shell("cp @src $dst"); if (-f $dst) { - chmod oct($mode), $dst or - die "failed to change mode of $dst to $mode.\n"; + if (defined $mode) { + chmod oct($mode), $dst or + die "failed to change mode of $dst to $mode.\n"; + } exit; } @@ -62,13 +63,15 @@ for my $src (@src) { $name = $src; } - my $target = "$target_dir/$name"; - chmod oct($mode), $target or - die "failed to change mode of $target to $mode.\n"; + if (defined $mode) { + 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 ... \n"; + die "Usage: install [-d] [-m ] ... \n"; } sub shell {