diff mbox

[1/2] Set up env vars for cross-building

Message ID 1324413424-3849-1-git-send-email-wookey@wookware.org
State Accepted
Headers show

Commit Message

Wookey Dec. 20, 2011, 8:37 p.m. UTC
From: Wookey <wookey@wookware.org>

---
 lib/Sbuild/Build.pm |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/lib/Sbuild/Build.pm b/lib/Sbuild/Build.pm
index 05473ec..ccc4d04 100644
--- a/lib/Sbuild/Build.pm
+++ b/lib/Sbuild/Build.pm
@@ -1467,6 +1467,17 @@  sub build {
     $buildenv{'PATH'} = $self->get_conf('PATH');
     $buildenv{'LD_LIBRARY_PATH'} = $self->get_conf('LD_LIBRARY_PATH')
 	if defined($self->get_conf('LD_LIBRARY_PATH'));
+    
+	#Add cross environment config
+	if ($host_arch ne $build_arch) {
+		$buildenv{'CONFIG_SITE'} = "/etc/dpkg-cross/cross-config." . $host_arch;
+		if (defined($buildenv{'DEB_BUILD_OPTIONS'})) {
+			$buildenv{'DEB_BUILD_OPTIONS'} .= " nocheck";
+		} else {
+			$buildenv{'DEB_BUILD_OPTIONS'} = "nocheck";
+		}
+	}
+ 
 
     # Explicitly add any needed environment to the environment filter
     # temporarily for dpkg-buildpackage.