[Dctrl-tools-devel] Bug#734887: dctrl-tools: fails to cross-build: uses wrong compiler

Colin Watson cjwatson at ubuntu.com
Fri Jan 10 16:06:33 UTC 2014


Package: dctrl-tools
Version: 2.23
Severity: normal
Tags: patch
User: crossbuild at debian.org
Usertags: cross

dctrl-tools fails to cross-build because it uses the native compiler
rather than the appropriate cross-compiler.  The simplest fix is just to
pass an appropriate CC= when cross-building.

diff --git a/debian/changelog b/debian/changelog
index ed2c586..20cd0a8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,13 @@
 dctrl-tools (2.24) UNRELEASED; urgency=low
 
+  [ Antti-Juhani Kaijanaho ]
   * grep-dctrl: Implement -l and -L as in grep.
     (This changes the meaning of -l, but I doubt any scripts have relied on it.)
   * Add a test case for grep-dctrl -v.
 
+  [ Colin Watson ]
+  * Pass CC=$(DEB_HOST_GNU_TYPE)-gcc when cross-building.
+
  -- Antti-Juhani Kaijanaho <ajk at debian.org>  Tue, 26 Nov 2013 12:10:51 +0200
 
 dctrl-tools (2.23) unstable; urgency=low
diff --git a/debian/rules b/debian/rules
index 7d460e1..8b69e8b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,7 +5,15 @@
 %:
 	dh $@
 
+DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+DEB_HOST_GNU_TYPE  := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+	cross :=
+else
+	cross := CC=$(DEB_HOST_GNU_TYPE)-gcc
+endif
+
 override_dh_auto_build:
-	dh_auto_build -- prefix=/usr sysconfdir=/etc
+	dh_auto_build -- prefix=/usr sysconfdir=/etc $(cross)
 override_dh_auto_install:
 	dh_auto_install -- prefix=/usr sysconfdir=/etc

Thanks,

-- 
Colin Watson                                       [cjwatson at ubuntu.com]



More information about the Dctrl-tools-devel mailing list