From 130cfbf21524ba607bcde3eaa52f296c8797649b Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Sun, 31 Mar 2013 21:43:19 +0200 Subject: [PATCH] Support Debian cross-building Respect DEB_HOST_GNU_TYPE when selecting CC for cross-compiling. Fixes Debian bug #695442 reported by Adam Conrad. --- debian/rules | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/rules b/debian/rules index 0a6b828..6a0d58d 100755 --- a/debian/rules +++ b/debian/rules @@ -1,6 +1,13 @@ #!/usr/bin/make -f SHELL+= -e +DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) + export CC := $(DEB_HOST_GNU_TYPE)-$(CC) +endif + DPKG_EXPORT_BUILDFLAGS = 1 -include /usr/share/dpkg/buildflags.mk