I have updated the patch so that it uses DEB_BUILD_OPTIONS to set the flag to compile the static form of binutils for cross compilation. The option will now be enabled if the user specifies the option 'static-cross' as one of the DEB_BUILD_OPTIONS. This can be done on the command line for dpkg-buildpackage as follows:

TARGET=armel DEB_BUILD_OPTIONS="static-cross" dpkg-buildpackage -us -uc -rfakeroot


--- binutils-2.20.51.20100710/debian/rules.orig	2010-07-26 10:39:56.000000000 -0400
+++ binutils-2.20.51.20100710/debian/rules	2010-07-26 10:53:13.000000000 -0400
@@ -459,7 +459,11 @@
        build_stamps += build-spu-stamp
 endif
 ifneq (,$(TARGET))
+  ifneq (,$(findstring static-cross,$(DEB_BUILD_OPTIONS)))
+       build_stamps = build-static-cross-stamp
+  else
        build_stamps = build-cross-stamp
+  endif
 endif
 
 build: pre-build build-stamp
@@ -480,7 +484,11 @@
        install_stamps += install-spu-stamp
 endif
 ifneq (,$(TARGET))
-       install_stamps = install-cross-stamp
+  ifneq (,$(findstring static-cross,$(DEB_BUILD_OPTIONS)))
+        install_stamps = install-static-cross-stamp
+  else
+        install_stamps = install-cross-stamp
+  endif
 endif
 install: $(install_stamps)
 install-stamp: checkroot build-stamp
@@ -1095,6 +1103,20 @@
 	gzip -9 $(d_cross)/$(PF)/share/man/man1/*
 	touch $@
 
+configure-host-cross-stamp: configure-cross-stamp
+	$(checkdir)
+	test "" != "$(TARGET)"
+	$(MAKE) configure-host -C builddir-$(TARGET) $(NJOBS) CFLAGS="$(CFLAGS)"
+	touch $@
+
+build-static-cross-stamp: configure-host-cross-stamp
+	$(checkdir)
+	test "" != "$(TARGET)"
+	$(MAKE) -C builddir-$(TARGET) $(NJOBS) CFLAGS="$(CFLAGS)" LDFLAGS="-all-static"
+	touch $@
+
+install-static-cross-stamp: build-static-cross-stamp install-cross-stamp
+
 binary-cross: 
 	@echo "Please use dpkg-buildpackage instead of calling binary-cross directly; see README.cross"
 	@false

Reply via email to