]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_makeshlibs
Use cross-binutils helpers when cross-compiling
[debhelper.git] / dh_makeshlibs
index 4e4a8e21439067444a1fef64b71f2dd1dce8305e..652def3a2b63226de5fe1c40cbf7caf8c363b37a 100755 (executable)
@@ -121,6 +121,13 @@ init(options => {
        "add-udeb=s" => \$dh{SHLIBS_UDEB},
 });
 
+my $od = "objdump";
+# cross-compiling?
+if (dpkg_architecture_value("DEB_BUILD_GNU_TYPE")
+    ne dpkg_architecture_value("DEB_HOST_GNU_TYPE")) {
+       $od=dpkg_architecture_value("DEB_HOST_GNU_TYPE") . "-objdump";
+}
+
 foreach my $package (@{$dh{DOPACKAGES}}) {
        next if is_udeb($package);
        
@@ -139,15 +146,14 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
        # because only if we can get a library name and a major number from
        # objdump is anything actually added.
        my $exclude='';
-       my (@udeb_lines, @lib_files);
+       my @udeb_lines;
        if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') {
                $exclude="! \\( $dh{EXCLUDE_FIND} \\) ";
        }
        open (FIND, "find $tmp -type f \\( -name '*.so' -or -name '*.so.*' \\) $exclude |");
        while (<FIND>) {
                my ($library, $major);
-               push @lib_files, $_;
-               my $objdump=`objdump -p $_`;
+               my $objdump=`$od -p $_`;
                if ($objdump=~m/\s+SONAME\s+(.+)\.so\.(.+)/) {
                        # proper soname format
                        $library=$1;
@@ -228,8 +234,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                # is not 100% compatible with debhelper. (For example,
                # this supports --ignore being used.)
                doit("dpkg-gensymbols", "-p$package", "-I$symbols",
-                       "-P$tmp", (map { "-e$_" } @lib_files),
-                       @{$dh{U_PARAMS}});
+                       "-P$tmp", @{$dh{U_PARAMS}});
                if (-s "$tmp/DEBIAN/symbols" == 0) {
                        doit("rm", "-f", "$tmp/DEBIAN/symbols");
                }