diff --git a/debian/changelog b/debian/changelog index 3bfb7f1ef..17ac5c76e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -23,6 +23,7 @@ linux (4.19~rc3-1~exp2) UNRELEASED; urgency=medium * tools: turbostat: Add checks for failure of fgets() and fscanf() * debian/control: Build-depend on texlive-latex-{base,extra}, dvipng for linux-doc + * debian/rules{,.real}: Use /usr/share/dpkg/architecture.mk -- Ben Hutchings Mon, 10 Sep 2018 22:25:53 +0100 diff --git a/debian/rules b/debian/rules index 90973714a..1ddbb45ad 100755 --- a/debian/rules +++ b/debian/rules @@ -1,12 +1,13 @@ #!/usr/bin/make -f SHELL := sh -e -DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) SOURCE := $(shell dpkg-parsechangelog -SSource) VERSION := $(shell dpkg-parsechangelog -SVersion) VERSION_UPSTREAM := $(shell echo "$(VERSION)" | sed -e 's,-[^-]*$$,,') VERSION_BINNMU := $(shell echo "$(VERSION)" | sed -rne 's,.*\+b([0-9]+)$$,\1,p') +include /usr/share/dpkg/architecture.mk + include debian/rules.defs ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) diff --git a/debian/rules.real b/debian/rules.real index b7af0ddbd..24c2182e5 100644 --- a/debian/rules.real +++ b/debian/rules.real @@ -16,8 +16,16 @@ ifeq ($(DISTRIBUTOR),) DISTRIBUTOR := Debian endif +include /usr/share/dpkg/architecture.mk + include debian/rules.defs +ifdef ARCH + ifneq ($(DEB_HOST_ARCH),$(ARCH)) + $(error Attempting to build a $(ARCH) target but host architecture is $(DEB_HOST_ARCH). Use dpkg-architecture to override the host architecture) + endif +endif + ifdef OVERRIDE_HOST_TYPE CROSS_COMPILE := $(OVERRIDE_HOST_TYPE)- else ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))