]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_makeshlibs
Add support for multiarch.
[debhelper.git] / dh_makeshlibs
index a3c81e15a1d77dbbd9c3a23338e60e03734267a6..5d6f869cb1442cd901a496743c1863a3929d51f7 100755 (executable)
@@ -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 ($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