]> err.no Git - util-linux/commitdiff
debian/rules: allow cross-building
authorNeil Williams <codehelp@debian.org>
Sun, 10 Feb 2008 20:51:41 +0000 (13:51 -0700)
committerLaMont Jones <lamont@debian.org>
Sun, 10 Feb 2008 20:51:41 +0000 (13:51 -0700)
In line with the other cross-building support bugs:
http://lists.debian.org/debian-devel/2007/11/msg00116.html

This patch is necessary to allow util-linux to cross-build in Debian,
following recommendations in autotools-dev. The cache file will be
handled separately.

Addresses-Debian-Bug: 465123
Signed-off-by: Neil Williams <codehelp@debian.org>
Signed-off-by: LaMont Jones <lamont@debian.org>
debian/rules

index 1411327b6cbdb8eb06f5d8ce6958c5b8616b9afa..7c44545eff96d41c322cfbb5886c5c25f4f32fb3 100755 (executable)
@@ -7,6 +7,14 @@
 
 DISTRO :=$(shell lsb_release -is 2>/dev/null || echo Debian)
 
+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))
+CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) --cache-file=$(DEB_HOST_GNU_TYPE).cache
+else
+CROSS=
+endif
+
 ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
 STRIP=y
 endif
@@ -35,7 +43,7 @@ endif
 configure: configure-stamp
 configure-stamp:
        dh_testdir
-       ./configure $(CONFOPTS)
+       ./configure $(CONFOPTS) $(CROSS)
        touch configure-stamp
 
 build: configure-stamp build-stamp