From 8618d9ee5fccf208d77b0dae68cf683de0a1066b Mon Sep 17 00:00:00 2001 From: steven Date: Sun, 19 Sep 2010 17:30:52 +0000 Subject: [PATCH] when a lib has multiple different library names, populate the .libs dir with symlinks to all of them. this fixes kde/multimedia, which builds a libmpeg-0.3.0.so (using -release), also known as libmpeg.so, and then links something with -lmpeg ... (before this commit, we only had a symlink to the former) it should really just use libmpeg.la instead, but let's have libtool handle such attempts anyway. might fix other stuff i'm not yet aware of, too. --- infrastructure/bin/libtool | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/infrastructure/bin/libtool b/infrastructure/bin/libtool index 94748f54341..1e52efaa797 100755 --- a/infrastructure/bin/libtool +++ b/infrastructure/bin/libtool @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $OpenBSD: libtool,v 1.3 2010/09/18 16:22:26 steven Exp $ +# $OpenBSD: libtool,v 1.4 2010/09/19 17:30:52 steven Exp $ # Copyright (c) 2007-2010 Steven Mestdagh # @@ -1690,10 +1690,20 @@ sub create_symlinks my $f = $l->{fullpath}; next if (!defined $f); next if ($f =~ m/\.a$/); - my $libfile = basename $f; - Trace::debug {"ln -s $f $dir/$libfile\n"}; - if (! -f "$dir/$libfile") { - symlink abs_path($f), "$dir/$libfile" or die "cannot create symlink: $!\n"; + my $libnames = []; + if (defined $l->{lafile}) { + my $lainfo = LaFile->parse($l->{lafile}); + my $librarynames = $lainfo->stringize('library_names'); + @$libnames = split /\s/, $librarynames; + $libnames = reverse_zap_duplicates_ref($libnames); + } else { + push @$libnames, basename $f; + } + foreach my $libfile (@$libnames) { + Trace::debug {"ln -s $f $dir/$libfile\n"}; + if (! -f "$dir/$libfile") { + symlink abs_path($f), "$dir/$libfile" or die "cannot create symlink: $!\n"; + } } } }