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>
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
configure: configure-stamp
configure-stamp:
dh_testdir
- ./configure $(CONFOPTS)
+ ./configure $(CONFOPTS) $(CROSS)
touch configure-stamp
build: configure-stamp build-stamp