summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco d'Itri <md@linux.it>2013-03-31 21:43:19 +0200
committerMarco d'Itri <md@linux.it>2013-03-31 21:43:19 +0200
commit130cfbf21524ba607bcde3eaa52f296c8797649b (patch)
treeb6e3a51607087598a87bce2b6179c2e75f0ec59e
parente5e1efe2c36f9db6ccb97f7badf88388b35e0fcf (diff)
downloadwhois-130cfbf21524ba607bcde3eaa52f296c8797649b.tar.gz
Support Debian cross-building
Respect DEB_HOST_GNU_TYPE when selecting CC for cross-compiling. Fixes Debian bug #695442 reported by Adam Conrad.
-rwxr-xr-xdebian/rules7
1 files changed, 7 insertions, 0 deletions
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