diff --git a/debian/README.source b/debian/README.source index 92225ca1e..b488d8b09 100644 --- a/debian/README.source +++ b/debian/README.source @@ -233,8 +233,7 @@ Several build profiles are understood and supported: - nodoc: Exclude most documentation - pkg.linux.notools: Exclude userland tool packages (linux-kbuild-, linux-perf-, etc.) -- cross: Needed when cross-building. Currently this must be used - together with pkg.linux.notools as not all the userland tools can be - cross-built. +- cross: Needed when cross-building. Currently this must be used together + with nopython as the build-dependencies will be unsatisfiable otherwise. - nopython: Disable Python bindings. This currently disables building the linux-perf- package, as the perf program embeds Python. diff --git a/debian/changelog b/debian/changelog index 16229b6ad..1565a8cb3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,6 +18,7 @@ linux (4.7~rc2-1~exp1) UNRELEASED; urgency=medium * debian/README.source: Document the supported build profiles * debian/control: Fix build-dependencies for cross-building * Add support for the nopython build profile, disabling the linux-perf package + * Fix build rules for userland tools to support cross-building -- Ben Hutchings Tue, 07 Jun 2016 19:37:55 +0100 diff --git a/debian/rules.d/Makefile b/debian/rules.d/Makefile index 6fab0dcd4..c7506d3e4 100644 --- a/debian/rules.d/Makefile +++ b/debian/rules.d/Makefile @@ -11,6 +11,7 @@ include $(top_rulesdir)/Makefile.inc # Build userland headers first unexport VERSION all-local: - $(MAKE) -C $(top_srcdir) ARCH=$(KERNEL_ARCH) O=$(CURDIR) \ + mkdir -p headers-tools + $(MAKE) -C $(top_srcdir) ARCH=$(KERNEL_ARCH) O=$(CURDIR)/headers-tools \ INSTALL_HDR_PATH=$(CURDIR) headers_install all-recursive: all-local diff --git a/debian/rules.d/Makefile.inc b/debian/rules.d/Makefile.inc index 2f05db4f3..48f8c2e7c 100644 --- a/debian/rules.d/Makefile.inc +++ b/debian/rules.d/Makefile.inc @@ -5,8 +5,8 @@ VPATH = $(top_rulesdir)/$(OUTDIR) $(top_srcdir)/$(OUTDIR) SHELL = /bin/sh -e -CC = gcc -CXX = g++ +CC = $(CROSS_COMPILE)gcc +CXX = $(CROSS_COMPILE)g++ CFLAGS := $(shell dpkg-buildflags --get CFLAGS) -Wall CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS) \ -I$(top_srcdir)/$(OUTDIR) \ diff --git a/debian/rules.d/tools/power/cpupower/Makefile b/debian/rules.d/tools/power/cpupower/Makefile index 414d4af21..23193b5b3 100644 --- a/debian/rules.d/tools/power/cpupower/Makefile +++ b/debian/rules.d/tools/power/cpupower/Makefile @@ -4,6 +4,8 @@ MAKE_CPUPOWER := $(shell dpkg-buildflags --export=cmdline) $(MAKE) O=$(CURDIR) C MAKE_CPUPOWER += DEBUG=$(if $(findstring nostrip,$(DEB_BUILD_OPTIONS)),true,) +MAKE_CPUPOWER += CROSS='$(CROSS_COMPILE)' + MAKE_CPUPOWER += PACKAGE_BUGREPORT='Debian\ \(reportbug\ linux-cpupower\)' all: diff --git a/debian/rules.d/tools/usb/usbip/Makefile b/debian/rules.d/tools/usb/usbip/Makefile index 4c29b61a8..887573bb0 100644 --- a/debian/rules.d/tools/usb/usbip/Makefile +++ b/debian/rules.d/tools/usb/usbip/Makefile @@ -11,7 +11,8 @@ all: --prefix=/usr \ --with-tcp-wrappers \ --with-usbids-dir=/usr/share/misc \ - --disable-shared + --disable-shared \ + --host=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) $(MAKE) install: diff --git a/debian/rules.real b/debian/rules.real index f90edf703..c0cd09af4 100644 --- a/debian/rules.real +++ b/debian/rules.real @@ -24,6 +24,7 @@ else ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH)) else CROSS_COMPILE := endif +export CROSS_COMPILE export PYTHONPATH = $(CURDIR)/debian/lib/python export DH_OPTIONS @@ -74,12 +75,12 @@ binary-indep: install-support ifneq ($(DO_TOOLS),False) build-arch-arch: $(STAMPS_DIR)/build-tools binary-arch-arch: install-kbuild install-usbip install-liblockdep install-cpupower - ifneq ($(filter alpha amd64 arm64 armel armhf hppa i386 mips mips64 mips64el mipsel powerpc powerpcspe ppc64 ppc64el s390 s390x sh4 sparc sparc64,$(DEB_BUILD_ARCH)),) + ifneq ($(filter alpha amd64 arm64 armel armhf hppa i386 mips mips64 mips64el mipsel powerpc powerpcspe ppc64 ppc64el s390 s390x sh4 sparc sparc64,$(DEB_HOST_ARCH)),) ifeq ($(filter nopython,$(DEB_BUILD_PROFILES)),) binary-arch-arch: install-perf endif endif - ifneq ($(filter i386 amd64 x32,$(DEB_BUILD_ARCH)),) + ifneq ($(filter i386 amd64 x32,$(DEB_HOST_ARCH)),) binary-arch-arch: install-hyperv-daemons endif binary-indep: install-lockdep