+2008-03-27 Raphael Hertzog <hertzog@debian.org>
+
+ * scripts/Dpkg/Shlibs.pm: Support cross-compilation by adding
+ directories containing libraries for the architecture that is
+ being crossbuilt.
+
2008-03-27 Raphael Hertzog <hertzog@debian.org>
Frank Lichtenheld <djpig@debian.org>
Joey Hess <joeyh@debian.org>
respectively.
* dpkg-source has a new --no-check option. It disables GPG check and
checksums checks. Closes: #220758
+ * dpkg-shlibdeps is now able to look into directories containing libraries
+ used by cross-built binaries provided that the right environment variable
+ are set. Closes: #453267
[ Frank Lichtenheld ]
* Add a warning in dpkg-buildpackage if the build-dependencies are not
use Dpkg::ErrorHandling qw(syserr);
use Dpkg::Shlibs::Objdump;
use Dpkg::Path qw(resolve_symlink canonpath);
+use Dpkg::Arch qw(debarch_to_gnutriplet get_build_arch get_host_arch);
use constant DEFAULT_LIBRARY_PATH =>
qw(/lib /usr/lib /lib32 /usr/lib32 /lib64 /usr/lib64
/emul/ia32-linux/lib /emul/ia32-linux/usr/lib);
-our @librarypaths = (DEFAULT_LIBRARY_PATH);
+
+# Adjust set of directories to consider when we're in a situation of a
+# cross-build or a build of a cross-compiler
+my @crosslibrarypaths;
+my $crossprefix;
+# Detect cross compiler builds
+if ($ENV{GCC_TARGET}) {
+ $crossprefix = debarch_to_gnutriplet($ENV{GCC_TARGET});
+}
+if ($ENV{DEB_TARGET_GNU_TYPE} and
+ ($ENV{DEB_TARGET_GNU_TYPE} ne $ENV{DEB_BUILD_GNU_TYPE}))
+{
+ $crossprefix = $ENV{DEB_TARGET_GNU_TYPE};
+}
+# host for normal cross builds.
+if (get_build_arch() ne get_host_arch()) {
+ $crossprefix = debarch_to_gnutriplet(get_host_arch());
+}
+# Define list of directories containing crossbuilt libraries
+if ($crossprefix) {
+ push @crosslibrarypaths, "/$crossprefix/lib", "/usr/$crossprefix/lib",
+ "/$crossprefix/lib32", "/usr/$crossprefix/lib32",
+ "/$crossprefix/lib64", "/usr/$crossprefix/lib64";
+}
+
+our @librarypaths = (DEFAULT_LIBRARY_PATH, @crosslibrarypaths);
# Update library paths with LD_LIBRARY_PATH
if ($ENV{LD_LIBRARY_PATH}) {