also add -lfoo arguments to deplibs if there is no key yet for this library,

because the key may be set in a recursion step, but we only add to deplibs
at level 0.
this seems to produce more correct deplibs.
first step to fix kde/bindings.
This commit is contained in:
steven 2010-09-25 15:20:04 +00:00
parent 60381b0e9e
commit 44e0bdbcd7

View File

@ -1,5 +1,5 @@
#!/usr/bin/perl
# $OpenBSD: libtool,v 1.7 2010/09/25 13:32:06 steven Exp $
# $OpenBSD: libtool,v 1.8 2010/09/25 15:20:04 steven Exp $
# Copyright (c) 2007-2010 Steven Mestdagh <steven@openbsd.org>
#
@ -258,6 +258,7 @@ sub parse_linkargs1
if ($a =~ m/^-L(.*)/) {
if (!exists $dirs->{$1}) {
$dirs->{$1} = 1;
Trace::debug {" adding $a to deplibs\n"} if ($level == 0);
push @$deplibs, $a;
}
}
@ -286,6 +287,7 @@ sub parse_linkargs1
if ($lafile) {
$libs->{$key}->{lafile} = $lafile;
my $absla = main::abs_path($lafile);
Trace::debug {" adding $absla to deplibs\n"} if ($level == 0);
push @$deplibs, $absla;
push @$result, $lafile;
next;
@ -298,9 +300,10 @@ sub parse_linkargs1
$k =~ s/^lib//;
push(@largs, "-l$k");
}
push @$deplibs, $a;
}
}
Trace::debug {" adding $a to deplibs\n"} if ($level == 0);
push @$deplibs, $a;
push(@$result, $a);
my $dummy = []; # no need to add deplibs recursively
$self->parse_linkargs1($dummy, $Rresolved,