summaryrefslogtreecommitdiff
path: root/usr.bin/libtool/LT/Mode/Compile.pm
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/libtool/LT/Mode/Compile.pm')
-rw-r--r--usr.bin/libtool/LT/Mode/Compile.pm12
1 files changed, 5 insertions, 7 deletions
diff --git a/usr.bin/libtool/LT/Mode/Compile.pm b/usr.bin/libtool/LT/Mode/Compile.pm
index bee291acac6..9234f06223b 100644
--- a/usr.bin/libtool/LT/Mode/Compile.pm
+++ b/usr.bin/libtool/LT/Mode/Compile.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Compile.pm,v 1.6 2012/07/09 14:34:06 espie Exp $
+# $OpenBSD: Compile.pm,v 1.7 2012/07/09 17:54:27 espie Exp $
#
# Copyright (c) 2007-2010 Steven Mestdagh <steven@openbsd.org>
# Copyright (c) 2012 Marc Espie <espie@openbsd.org>
@@ -43,6 +43,7 @@ sub run
my ($class, $ltprog, $gp, $noshared) = @_;
my $lofile = LT::LoFile->new;
+ $DB::single = 1;
$gp->handle_permuted_options('o:@',
'prefer-pic', 'prefer-non-pic', 'static');
# XXX options ignored: -prefer-pic and -prefer-non-pic
@@ -55,16 +56,13 @@ sub run
$nonpic = 1 if $gp->static;
my ($outfile, $odir, $ofile, $srcfile, $srcext);
- if($gp->{opt}{o} && @{$gp->{opt}{o}} > 1) {
- shortdie "$0: compile: Can't specify '-o' more than once\n";
- }
# XXX check whether -c flag is present and if not, die?
- if ($gp->{opt}{o}) {
- if (@{$gp->{opt}{o}} > 1) {
+ if ($gp->o) {
+ if ($gp->o > 1) {
shortdie "Can't specify -o more than once\n";
}
# fix extension if needed
- ($outfile = $gp->{opt}{o}[0]) =~ s/\.o$/.lo/;
+ ($outfile = ($gp->o)[0]) =~ s/\.o$/.lo/;
$odir = dirname($outfile);
$ofile = basename($outfile);
} else {