Fix build rules for userland tools to support cross-building
Pass $(CROSS_COMPILE) or host GNU type through to upstream build rules. debian/rules.real: Filter tools packages by host arch, not build arch debian/rules.d/Makefile: Build the tools needed for headers_install in a separate subdirectory
This commit is contained in:
parent
a7ebaf2684
commit
0ad327058f
|
@ -233,8 +233,7 @@ Several build profiles are understood and supported:
|
||||||
- nodoc: Exclude most documentation
|
- nodoc: Exclude most documentation
|
||||||
- pkg.linux.notools: Exclude userland tool packages (linux-kbuild-<version>,
|
- pkg.linux.notools: Exclude userland tool packages (linux-kbuild-<version>,
|
||||||
linux-perf-<version>, etc.)
|
linux-perf-<version>, etc.)
|
||||||
- cross: Needed when cross-building. Currently this must be used
|
- cross: Needed when cross-building. Currently this must be used together
|
||||||
together with pkg.linux.notools as not all the userland tools can be
|
with nopython as the build-dependencies will be unsatisfiable otherwise.
|
||||||
cross-built.
|
|
||||||
- nopython: Disable Python bindings. This currently disables building the
|
- nopython: Disable Python bindings. This currently disables building the
|
||||||
linux-perf-<version> package, as the perf program embeds Python.
|
linux-perf-<version> package, as the perf program embeds Python.
|
||||||
|
|
|
@ -18,6 +18,7 @@ linux (4.7~rc2-1~exp1) UNRELEASED; urgency=medium
|
||||||
* debian/README.source: Document the supported build profiles
|
* debian/README.source: Document the supported build profiles
|
||||||
* debian/control: Fix build-dependencies for cross-building
|
* debian/control: Fix build-dependencies for cross-building
|
||||||
* Add support for the nopython build profile, disabling the linux-perf package
|
* Add support for the nopython build profile, disabling the linux-perf package
|
||||||
|
* Fix build rules for userland tools to support cross-building
|
||||||
|
|
||||||
-- Ben Hutchings <ben@decadent.org.uk> Tue, 07 Jun 2016 19:37:55 +0100
|
-- Ben Hutchings <ben@decadent.org.uk> Tue, 07 Jun 2016 19:37:55 +0100
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ include $(top_rulesdir)/Makefile.inc
|
||||||
# Build userland headers first
|
# Build userland headers first
|
||||||
unexport VERSION
|
unexport VERSION
|
||||||
all-local:
|
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
|
INSTALL_HDR_PATH=$(CURDIR) headers_install
|
||||||
all-recursive: all-local
|
all-recursive: all-local
|
||||||
|
|
|
@ -5,8 +5,8 @@ VPATH = $(top_rulesdir)/$(OUTDIR) $(top_srcdir)/$(OUTDIR)
|
||||||
|
|
||||||
SHELL = /bin/sh -e
|
SHELL = /bin/sh -e
|
||||||
|
|
||||||
CC = gcc
|
CC = $(CROSS_COMPILE)gcc
|
||||||
CXX = g++
|
CXX = $(CROSS_COMPILE)g++
|
||||||
CFLAGS := $(shell dpkg-buildflags --get CFLAGS) -Wall
|
CFLAGS := $(shell dpkg-buildflags --get CFLAGS) -Wall
|
||||||
CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS) \
|
CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS) \
|
||||||
-I$(top_srcdir)/$(OUTDIR) \
|
-I$(top_srcdir)/$(OUTDIR) \
|
||||||
|
|
|
@ -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 += DEBUG=$(if $(findstring nostrip,$(DEB_BUILD_OPTIONS)),true,)
|
||||||
|
|
||||||
|
MAKE_CPUPOWER += CROSS='$(CROSS_COMPILE)'
|
||||||
|
|
||||||
MAKE_CPUPOWER += PACKAGE_BUGREPORT='Debian\ \(reportbug\ linux-cpupower\)'
|
MAKE_CPUPOWER += PACKAGE_BUGREPORT='Debian\ \(reportbug\ linux-cpupower\)'
|
||||||
|
|
||||||
all:
|
all:
|
||||||
|
|
|
@ -11,7 +11,8 @@ all:
|
||||||
--prefix=/usr \
|
--prefix=/usr \
|
||||||
--with-tcp-wrappers \
|
--with-tcp-wrappers \
|
||||||
--with-usbids-dir=/usr/share/misc \
|
--with-usbids-dir=/usr/share/misc \
|
||||||
--disable-shared
|
--disable-shared \
|
||||||
|
--host=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
|
||||||
$(MAKE)
|
$(MAKE)
|
||||||
|
|
||||||
install:
|
install:
|
||||||
|
|
|
@ -24,6 +24,7 @@ else ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
|
||||||
else
|
else
|
||||||
CROSS_COMPILE :=
|
CROSS_COMPILE :=
|
||||||
endif
|
endif
|
||||||
|
export CROSS_COMPILE
|
||||||
|
|
||||||
export PYTHONPATH = $(CURDIR)/debian/lib/python
|
export PYTHONPATH = $(CURDIR)/debian/lib/python
|
||||||
export DH_OPTIONS
|
export DH_OPTIONS
|
||||||
|
@ -74,12 +75,12 @@ binary-indep: install-support
|
||||||
ifneq ($(DO_TOOLS),False)
|
ifneq ($(DO_TOOLS),False)
|
||||||
build-arch-arch: $(STAMPS_DIR)/build-tools
|
build-arch-arch: $(STAMPS_DIR)/build-tools
|
||||||
binary-arch-arch: install-kbuild install-usbip install-liblockdep install-cpupower
|
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)),)
|
ifeq ($(filter nopython,$(DEB_BUILD_PROFILES)),)
|
||||||
binary-arch-arch: install-perf
|
binary-arch-arch: install-perf
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifneq ($(filter i386 amd64 x32,$(DEB_BUILD_ARCH)),)
|
ifneq ($(filter i386 amd64 x32,$(DEB_HOST_ARCH)),)
|
||||||
binary-arch-arch: install-hyperv-daemons
|
binary-arch-arch: install-hyperv-daemons
|
||||||
endif
|
endif
|
||||||
binary-indep: install-lockdep
|
binary-indep: install-lockdep
|
||||||
|
|
Loading…
Reference in New Issue