aboutsummaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorJohn Rigby <john.rigby@linaro.org>2011-09-12 13:09:22 -0600
committerJohn Rigby <john.rigby@linaro.org>2012-06-24 17:40:07 -0600
commit14040102a0a609467ebcd02f6664ea4f25f027fe (patch)
tree825a60c658ac6065b51f9117336cf73e14803970 /debian
parent39c0c9639caff443bb859d82a69575256cd12630 (diff)
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 <john.rigby@linaro.org>
Diffstat (limited to 'debian')
-rw-r--r--debian/rules.d/2-binary-arch.mk10
1 files changed, 10 insertions, 0 deletions
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)