From 933e46d22274bf17901fdaf19347e79df5748809 Mon Sep 17 00:00:00 2001 From: John Rigby Date: Mon, 12 Sep 2011 13:09:22 -0600 Subject: LINARO: Conditionally use KBUILD_SCRIPTROOT to crossbuild scripts Only do so if KBUILD_SCRIPTROOT is used in the script makefiles so the build is not broken for trees lacking the sauce that adds the script crossbuild support. Signed-off-by: John Rigby --- debian/rules.d/2-binary-arch.mk | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk index a2555eeee0d..ce4da5976d9 100644 --- a/debian/rules.d/2-binary-arch.mk +++ b/debian/rules.d/2-binary-arch.mk @@ -9,6 +9,9 @@ else build_cd = build_O = O=$(builddir)/build-$* endif +crossbuildscripts=$(shell grep KBUILD_SCRIPTROOT $(DROOT)/scripts/Makefile.build && echo "true") + +kbsr = $(builddir)/build-$* $(stampdir)/stamp-prepare-%: config-prepare-check-% @echo Debug: $@ @@ -181,7 +184,11 @@ endif sed -e 's/.*CONFIG_DEBUG_INFO=.*/# CONFIG_DEBUG_INFO is not set/g' > \ $(hdrdir)/.config chmod 644 $(hdrdir)/.config +ifeq ($(crossbuildscripts),true) + $(kmake) HOSTCC=$(CROSS_COMPILE)gcc KBUILD_SCRIPTROOT=$(kbsr) O=$(hdrdir) -j1 silentoldconfig prepare scripts +else $(kmake) O=$(hdrdir) -j1 silentoldconfig prepare scripts +endif # We'll symlink this stuff rm -f $(hdrdir)/Makefile rm -rf $(hdrdir)/include2 @@ -325,6 +332,9 @@ binary-%: install-% dh_installchangelogs -p$(pkghdr) dh_installdocs -p$(pkghdr) +ifeq ($(crossbuildscripts),true) + dh_strip -p$(pkghdr) +endif dh_compress -p$(pkghdr) dh_fixperms -p$(pkghdr) dh_shlibdeps -p$(pkghdr) -- cgit v1.2.3