+2008-03-29 Raphael Hertzog <hertzog@debian.org>
+
+ * scripts/dpkg-buildpackage.pl: If the user request a cross-compilation,
+ then define PKG_CONFIG_LIBDIR so that it will look in directories
+ specidic to the target architecture.
+ * man/dpkg-buildpackage.1: Document this change and also the -t option.
+
2008-03-28 Raphael Hertzog <hertzog@debian.org>
* scripts/dpkg-buildpackage.pl: LDFLAGS now defaults to an empty
* Change default value of LDFLAGS (set by dpkg-buildpackage) to ''
instead of '-Wl,-Bsymbolic-functions'. It's safer at this point of the
release cycle.
+ * dpkg-buildpackage will set PKG_CONFIG_LIBDIR (but not override an existing
+ value) in case of cross-compilation so that pkgconfig finds .pc files
+ in the directory specific to the target architecture. Closes: #439979
[ Frank Lichtenheld ]
* Add a warning in dpkg-buildpackage if the build-dependencies are not
Specify the Debian architecture we build for. The architecture of the
machine we build on is determined automatically, and is also the default
for the host machine.
+
+If the host architecture differs from the build architecture (as is the
+case for a cross-compilation), and if the environment variable
+\fBPKG_CONFIG_LIBDIR\fP is not set, then it is set to a value suitable for
+cross-compilation
+("/usr/\fIgnu-system-type\fP/lib/pkgconfig/:/usr/share/pkgconfig").
+.TP
+.BI \-t gnu-system-type
+Specify the GNU system type we build for. It can be used in place
+of \-a or as a complement to override the default GNU system type
+of the target Debian architecture.
.TP
.BI \-j jobs
Number of jobs allowed to be run simultaneously, equivalent to the
use Dpkg::Compression;
use Dpkg::Version qw(check_version);
use Dpkg::Changelog qw(parse_changelog);
+use Dpkg::Arch qw(get_build_arch debarch_to_gnutriplet);
textdomain("dpkg-dev");
}
close $arch_env or subprocerr('dpkg-architecture');
+# In case of cross-compilation, give sensible default search path
+# for some widely used tools
+$targetgnusystem = debarch_to_gnutriplet($targetarch) if $targetarch;
+if ($targetgnusystem and
+ ($targetgnusystem ne debarch_to_gnutriplet(get_build_arch())))
+{
+ $ENV{PKG_CONFIG_LIBDIR} ||= "/usr/$targetgnusystem/lib/pkgconfig/:" .
+ "/usr/share/pkgconfig/";
+}
+
my $arch;
unless ($sourceonly) {
$arch = mustsetvar($ENV{'DEB_HOST_ARCH'}, _g('host architecture'));