Skip to contentSkip to conversation

Allow Debian tools to cross compile

PATCH New Paul 1 participant 1 message Jan 1, 2009

lore
Share & tools
lore

Paul

author
#0 lore raw

PATCH 1/1 Allow Debian tools to cross compile

Attached, a small patch for debian/rules to allow dpkg-cross to cross-compile binary packages. Tested on a AMD64 host compiling powerpc packages, and no unpleasant suprises found.

Regards, Paul.

rules +9 -1
Index: debian/rules
===================================================================
@@ -8,6 +8,8 @@
 
 DEB_HOST_GNU_CPU ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
 DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
+DEB_HOST_GNU_TYPE=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE=$(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
 ifeq ($(DEB_HOST_ARCH), i386)
 # Note: Would like to use --includedir=/usr/include/xenomai, but
@@ -35,7 +37,13 @@ ifeq ($(DEB_HOST_ARCH), arm)
 endif
 	CONFIG_OPTS += --prefix=/usr \
 	            --includedir=/usr/include/xenomai \
-	            --mandir=/usr/share/man
+	            --mandir=/usr/share/man \
+
+ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
+	CONFIG_OPTS += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
+else
+	CONFIG_OPTS += --build $(DEB_BUILD_GNU_TYPE)
+endif
 
 build: build-arch build-indep