]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_makeshlibs
avoid depending on a dpkg that has DEB_HOST_MULTIARCH
[debhelper.git] / dh_makeshlibs
index b6779f907638673ddfa8c92512b4d64741d636bc..896c5b3e3525aea036c5de874f3e3e0857c61551 100755 (executable)
@@ -41,7 +41,7 @@ to provide different symbols files for different architectures.
 
 =item B<-m>I<major>, B<--major=>I<major>
 
-Instead of trying to guess the major number of the library with /postobjdump,
+Instead of trying to guess the major number of the library with objdump,
 use the major number specified after the -m parameter. This is much less
 useful than it used to be, back in the bad old days when this program
 looked at library filenames rather than using objdump.
@@ -122,6 +122,7 @@ init(options => {
 });
 
 my $objdump=cross_command("objdump");
+my $multiarch=dpkg_architecture_value("DEB_HOST_MULTIARCH");
 
 foreach my $package (@{$dh{DOPACKAGES}}) {
        next if is_udeb($package);
@@ -130,6 +131,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 
        my %seen;
        my $need_ldconfig = 0;
+       my $is_multiarch = 0;
 
        doit("rm", "-f", "$tmp/DEBIAN/shlibs");
 
@@ -148,6 +150,9 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
        while (<FIND>) {
                my ($library, $major);
                push @lib_files, $_;
+               if (defined $multiarch && $multiarch ne '' && m,/$multiarch/,) {
+                       $is_multiarch=1;
+               }
                my $ret=`$objdump -p $_`;
                if ($ret=~m/\s+SONAME\s+(.+)\.so\.(.+)/) {
                        # proper soname format
@@ -240,6 +245,9 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                        doit("rm", "-f", "$tmp/DEBIAN/symbols");
                }
        }
+       if ($is_multiarch) {
+               addsubstvar($package, "misc:Pre-Depends", "multiarch-support");
+       }
 }
 
 =head1 SEE ALSO