diff --git a/debian/changelog b/debian/changelog index 130cef7a2..6dfd5a5c1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,7 @@ linux (4.17.6-2) UNRELEASED; urgency=medium * debian/control: Fix arch/profile qualifications for libelf-dev build-dependency * debian/rules.real: Pass KERNEL_ARCH variable down to debian/rules.d + * debian/rules.d/tools/perf/Makefile: Use KERNEL_ARCH variable -- Ben Hutchings Thu, 12 Jul 2018 15:16:15 +0100 diff --git a/debian/rules.d/tools/perf/Makefile b/debian/rules.d/tools/perf/Makefile index 40c331fdd..663de7d29 100644 --- a/debian/rules.d/tools/perf/Makefile +++ b/debian/rules.d/tools/perf/Makefile @@ -2,37 +2,21 @@ include $(top_rulesdir)/Makefile.inc ifeq ($(filter nopython,$(DEB_BUILD_PROFILES)),) -DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU) - -ifeq ($(DEB_HOST_ARCH_CPU),alpha) - KERNEL_ARCH_PERF = alpha -else ifeq ($(DEB_HOST_ARCH_CPU),arm) - KERNEL_ARCH_PERF = arm -else ifeq ($(DEB_HOST_ARCH_CPU),arm64) - KERNEL_ARCH_PERF = arm64 -else ifneq ($(filter mips%,$(DEB_HOST_ARCH_CPU)),) - KERNEL_ARCH_PERF = mips -else ifeq ($(DEB_HOST_ARCH_CPU),hppa) - KERNEL_ARCH_PERF = parisc -else ifneq ($(filter powerpc% ppc%,$(DEB_HOST_ARCH_CPU)),) - # But pure 32-bit toolchains currently don't work +ifneq ($(filter alpha arm arm64 mips parisc s390 sh sparc,$(KERNEL_ARCH)),) +HAVE_PERF := 1 +else ifeq ($(KERNEL_ARCH),powerpc) + # Pure 32-bit toolchains currently don't work ifneq ($(shell dpkg-architecture -qDEB_HOST_ARCH),powerpcspe) - KERNEL_ARCH_PERF = powerpc + HAVE_PERF := 1 endif -else ifneq ($(filter s390%,$(DEB_HOST_ARCH_CPU)),) - KERNEL_ARCH_PERF = s390 -else ifeq ($(DEB_HOST_ARCH_CPU),sh4) - KERNEL_ARCH_PERF = sh -else ifneq ($(filter sparc%,$(DEB_HOST_ARCH_CPU)),) - KERNEL_ARCH_PERF = sparc -else ifneq ($(filter amd64 i386,$(DEB_HOST_ARCH_CPU)),) - # But x32 isn't supported yet +else ifeq ($(KERNEL_ARCH),x86) + # x32 isn't supported yet ifneq ($(shell dpkg-architecture -qDEB_HOST_ARCH),x32) - KERNEL_ARCH_PERF = x86 + HAVE_PERF := 1 endif endif -MAKE_PERF := $(MAKE) O=$(CURDIR) prefix=/usr V=1 ARCH=$(KERNEL_ARCH_PERF) EXTRA_WARNINGS=-Wno-error EXTRA_CFLAGS='$(CFLAGS) $(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' +MAKE_PERF := $(MAKE) O=$(CURDIR) prefix=/usr V=1 ARCH=$(KERNEL_ARCH) EXTRA_WARNINGS=-Wno-error EXTRA_CFLAGS='$(CFLAGS) $(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' # Disable Gtk UI until it's more usable MAKE_PERF += NO_GTK2=1 @@ -55,7 +39,7 @@ MAKE_PERF += NO_LIBCRYPTO=1 MAKE_PERF += LIBBABELTRACE=1 all: -ifdef KERNEL_ARCH_PERF +ifdef HAVE_PERF # perf changes some default directories depending on whether DESTDIR is # set. We must define it even when building to avoid a rebuild when we # run 'make install'. @@ -71,7 +55,7 @@ endif endif install: -ifdef KERNEL_ARCH_PERF +ifdef HAVE_PERF +$(MAKE_PERF) -C $(top_srcdir)/tools/perf -f Makefile.perf install VERSION=$(VERSION) # Don't install a 'trace' alias yet: # - We need a wrapper for it anyway, so there's little point adding a