diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-05-04 01:55:36 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-05-04 01:55:36 +0200 |
commit | 33b25c9c7ac5c960991c71d641740dbc8fa432b5 (patch) | |
tree | e0087cb083492631ea2e21f1e6dd74a307507cd9 | |
parent | fe3943a0d9234f492f8fd5b2aa27186d68954e6a (diff) |
always request an unversioned lib from gcc in gccinstlib.pl
* this otherwise breaks on ubuntu natty as there is (rightfully) no libgcc_s.so.1 file served by gcc -print-file-name
-rwxr-xr-x | solenv/bin/gccinstlib.pl | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/solenv/bin/gccinstlib.pl b/solenv/bin/gccinstlib.pl index 8ce9753a4..d8eda1cb4 100755 --- a/solenv/bin/gccinstlib.pl +++ b/solenv/bin/gccinstlib.pl @@ -35,25 +35,29 @@ $Dest = pop(@ARGV) || die "No destination to copy to"; $cc = $ENV{'CC'} || die "No CC environment set"; if ($Dest =~ /--help/ || @ARGV < 1) { print "Syntax:\n gcc-instlib <library-in-libpath ...> <destination-dir>\n"; exit (0); } + +%SrcAndDest = (); + foreach $File (@ARGV) { my $string; - - open (GCCOut, "LANGUAGE=C LC_ALL=C $cc -print-file-name=$File|") || die "Failed to exec $cc -print-file-name=$File $!"; + my $normalized_file = $File; + $normalized_file =~ s/\.so\.\d+/.so/; + open (GCCOut, "LANGUAGE=C LC_ALL=C $cc -print-file-name=$normalized_file|") || die "Failed to exec $cc -print-file-name=$normalized_file $!"; $string=<GCCOut>; chomp ($string); - push (@CopySrc, $string); + $SrcAndDest{$string} = "$Dest/$File"; close (GCCOut); } -foreach $Src (@CopySrc) { - printf "copy $Src to $Dest\n"; - system ("/bin/cp $Src $Dest") && die "copy failed: $!"; +while (($Src, $FullDest) = each %SrcAndDest) { + printf "copy $Src to $FullDest\n"; + system ("/bin/cp $Src $FullDest") && die "copy failed: $!"; } foreach $File (@ARGV) { #https://bugzilla.redhat.com/show_bug.cgi?id=149465 printf "unprelinking $Dest/$File\n"; |