diff -Nru binutils-2.14.90.0.7-upstream/debian/binutils-hppa64.postinst binutils-2.14.90.0.7-crossenabled/debian/binutils-hppa64.postinst
--- binutils-2.14.90.0.7-upstream/debian/binutils-hppa64.postinst	2004-02-08 14:31:54.000000000 +0100
+++ binutils-2.14.90.0.7-crossenabled/debian/binutils-hppa64.postinst	1970-01-01 01:00:00.000000000 +0100
@@ -1,7 +0,0 @@
-#! /bin/sh
-
-set -e
-
-if [ "$1" = "configure" ]; then
-	ldconfig
-fi
diff -Nru binutils-2.14.90.0.7-upstream/debian/binutils-hppa64.postrm binutils-2.14.90.0.7-crossenabled/debian/binutils-hppa64.postrm
--- binutils-2.14.90.0.7-upstream/debian/binutils-hppa64.postrm	2004-02-08 14:31:54.000000000 +0100
+++ binutils-2.14.90.0.7-crossenabled/debian/binutils-hppa64.postrm	1970-01-01 01:00:00.000000000 +0100
@@ -1,7 +0,0 @@
-#! /bin/sh
-
-set -e
-
-if [ "$1" = "remove" ]; then
-	ldconfig
-fi
diff -Nru binutils-2.14.90.0.7-upstream/debian/binutils-hppa64.shlibs binutils-2.14.90.0.7-crossenabled/debian/binutils-hppa64.shlibs
--- binutils-2.14.90.0.7-upstream/debian/binutils-hppa64.shlibs	2004-02-08 14:31:54.000000000 +0100
+++ binutils-2.14.90.0.7-crossenabled/debian/binutils-hppa64.shlibs	1970-01-01 01:00:00.000000000 +0100
@@ -1,2 +0,0 @@
-libbfd 2.14.90.0.7 binutils-hppa64
-libopcodes 2.14.90.0.7 binutils-hppa64
diff -Nru binutils-2.14.90.0.7-upstream/debian/changelog binutils-2.14.90.0.7-crossenabled/debian/changelog
--- binutils-2.14.90.0.7-upstream/debian/changelog	2004-02-08 14:31:54.000000000 +0100
+++ binutils-2.14.90.0.7-crossenabled/debian/changelog	2004-02-08 14:32:47.000000000 +0100
@@ -1,3 +1,9 @@
+binutils (2.14.90.0.7-5.1) unstable; urgency=low
+
+  * Support for cross compiled binutils added.
+
+ -- Raphael Bossek <bossekr@debian.org>  Wed,  4 Feb 2004 13:05:50 +0100
+
 binutils (2.14.90.0.7-5) unstable; urgency=low
 
   * 109_objcopy_keep_debug.dpatch: new patch from Daniel Jacobowitz
diff -Nru binutils-2.14.90.0.7-upstream/debian/control binutils-2.14.90.0.7-crossenabled/debian/control
--- binutils-2.14.90.0.7-upstream/debian/control	2004-02-08 14:31:54.000000000 +0100
+++ binutils-2.14.90.0.7-crossenabled/debian/control	2004-02-08 14:34:53.000000000 +0100
@@ -43,18 +43,6 @@
  NORMAL USERS SHOULD NOT INSTALL THIS PACKAGE.  It's meant only for those
  requiring support for reading info from binaries from other architectures.
 
-Package: binutils-hppa64
-Architecture: hppa
-Depends: ${shlibs:Depends}, binutils (>= ${Source-Version})
-Recommends: libc6-dev
-Suggests: binutils-doc (>= ${Source-Version})
-Description: The GNU assembler, linker and binary utilities targeted for hppa64-linux
- The programs in this package are used to assemble, link and manipulate
- binary and object files.  They may be used in conjunction with a compiler
- and various libraries to build programs.
- .
- This package is needed to build an 64-bit kernel for 64-bit hppa machines.
-
 Package: binutils-doc
 Section: doc
 Architecture: all
diff -Nru binutils-2.14.90.0.7-upstream/debian/control.cross binutils-2.14.90.0.7-crossenabled/debian/control.cross
--- binutils-2.14.90.0.7-upstream/debian/control.cross	1970-01-01 01:00:00.000000000 +0100
+++ binutils-2.14.90.0.7-crossenabled/debian/control.cross	2004-02-04 14:06:17.000000000 +0100
@@ -0,0 +1,24 @@
+Package: binutils-__TARGET__
+Architecture: any
+Depends: ${shlibs:Depends}, debconf, shellutils
+Conflicts: gas-__TARGET__, elf-binutils-__TARGET__
+Provides: elf-binutils-__TARGET__
+Suggests: binutils-doc (= ${Source-Version})
+Description: The GNU assembler, linker and binary utilities for __TARGET__
+ The programs in this package are used to assemble, link and manipulate
+ binary and object files.  They may be used in conjunction with a compiler
+ and various libraries to build programs for Linux.
+
+Package: binutils-dev-__TARGET__
+Architecture: any
+Priority: extra
+Depends: binutils-__TARGET__ (= ${Source-Version})
+Conflicts: libbfd-dev-__TARGET__
+Provides: libbfd-dev-__TARGET__
+Replaces: libbfd-dev-__TARGET__, libc5-dev-__TARGET__
+Description: The GNU binary utilities (BFD development files) for __TARGET__
+ This package includes header files and static libraries necessary to build
+ programs which use the GNU BFD library, which is part of binutils. Note
+ that building Debian packages which depend on the shared libbfd is Not
+ Allowed.
+
diff -Nru binutils-2.14.90.0.7-upstream/debian/control.native binutils-2.14.90.0.7-crossenabled/debian/control.native
--- binutils-2.14.90.0.7-upstream/debian/control.native	1970-01-01 01:00:00.000000000 +0100
+++ binutils-2.14.90.0.7-crossenabled/debian/control.native	2004-02-05 11:17:56.000000000 +0100
@@ -0,0 +1,55 @@
+Source: binutils
+Section: devel
+Priority: standard
+Maintainer: James Troup <james@nocrew.org>
+Standards-Version: 3.6.1.0
+Build-Depends: autoconf (>= 2.13), bison, flex, gettext, texinfo, binutils (>= 2.9.5.0.12), gcc (>= 2.95.2-1), gcc-2.95 [m68k], dejagnu (>= 1.4.2-1.1), expect (>= 5.32.2-1), libc6-dev (<< 2.3) [m68k], dpatch, file
+
+Package: binutils
+Architecture: any
+Depends: ${shlibs:Depends}
+Conflicts: ${mainConflicts}
+Provides: elf-binutils
+Suggests: binutils-doc (= ${Source-Version})
+Description: The GNU assembler, linker and binary utilities
+ The programs in this package are used to assemble, link and manipulate
+ binary and object files.  They may be used in conjunction with a compiler
+ and various libraries to build programs.
+
+Package: binutils-dev
+Architecture: any
+Priority: extra
+Depends: binutils (= ${Source-Version})
+Conflicts: libbfd-dev
+Provides: libbfd-dev
+Replaces: libbfd-dev, libc5-dev
+Description: The GNU binary utilities (BFD development files)
+ This package includes header files and static libraries necessary to build
+ programs which use the GNU BFD library, which is part of binutils.  Note
+ that building Debian packages which depend on the shared libbfd is Not
+ Allowed.
+
+Package: binutils-multiarch
+Architecture: any
+Priority: extra
+Depends: ${shlibs:Depends}, binutils (= ${Source-Version})
+Provides: multiarch-binutils
+Description: Binary utilities that support multi-arch targets
+ The programs in this package are used to manipulate binary and object
+ files that may have been created on other architectures.  This package
+ is primarily for multi-architecture developers and cross-compilers and
+ is not needed by normal users or developers.  Note that a cross-assembling
+ version of gas is not included in this package, just the binary utilities.
+ NORMAL USERS SHOULD NOT INSTALL THIS PACKAGE.  It's meant only for those
+ requiring support for reading info from binaries from other architectures.
+
+Package: binutils-doc
+Section: doc
+Architecture: all
+Priority: optional
+Conflicts: binutils (<< 2.9.1.0.25-3)
+Suggests: binutils (= ${Source-Version})
+Description: Documentation for the GNU assembler, linker and binary utilities
+ This package consists of the documentation for the GNU assembler,
+ linker and binary utilities.
+
diff -Nru binutils-2.14.90.0.7-upstream/debian/rules binutils-2.14.90.0.7-crossenabled/debian/rules
--- binutils-2.14.90.0.7-upstream/debian/rules	2004-02-08 14:31:54.000000000 +0100
+++ binutils-2.14.90.0.7-crossenabled/debian/rules	2004-02-08 14:37:35.000000000 +0100
@@ -15,11 +15,14 @@
 
 ################################################################################
 
+CROSS_TARGETS = $(filter-out $(DEB_HOST_ARCH),alpha arm hppa hppa64 i386 ia64 m68k mips mipsel powerpc s390 sh sparc)
+
+################################################################################
+
 p_bin = binutils
 p_dev = $(p_bin)-dev
 p_mul = $(p_bin)-multiarch
 p_doc = $(p_bin)-doc
-p_hppa64 = $(p_bin)-hppa64
 
 pwd   := $(shell pwd)
 d     = debian/tmp
@@ -27,7 +30,14 @@
 d_dev = debian/$(p_dev)
 d_mul = debian/$(p_mul)
 d_doc = debian/$(p_doc)
-d_hppa64 = debian/$(p_hppa64)
+
+ifneq ($(CROSS_TARGET),)
+p_bin_cross = $(p_bin)-$(CROSS_TARGET)
+p_dev_cross = $(p_dev)-$(CROSS_TARGET)
+
+d_bin_cross = debian/$(p_bin_cross)
+d_dev_cross = debian/$(p_dev_cross)
+endif
 
 install_dir    = install -d -m 755
 install_file   = install -m 644
@@ -35,7 +45,11 @@
 install_binary = install -m 755 -s
 
 DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+ifneq ($(CROSS_TARGET),)
+DEB_HOST_ARCH      := $(CROSS_TARGET)
+else
 DEB_HOST_ARCH 	   := $(shell dpkg-architecture -qDEB_HOST_ARCH)
+endif
 DEB_HOST_GNU_TYPE  := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 
 CC     = gcc
@@ -46,8 +60,9 @@
 MULTI_VERSION = $(VERSION)-multiarch
 MULTI_ARGS    = MAKEOVERRIDES="VERSION=$(MULTI_VERSION)"
 
-HPPA64_VERSION= $(VERSION)-hppa64
-HPPA64_ARGS   = MAKEOVERRIDES="VERSION=$(HPPA64_VERSION)"
+ifneq ($(CROSS_TARGET),)
+CROSS_ARGS = MAKEOVERRIDES="VERSION=$(VERSION)-cross"
+endif
 
 ########################################
 
@@ -94,11 +109,18 @@
 
 clean: unpatch
 	$(checkdir)
-	-rm -fr builddir-multi builddir-single builddir-hppa64
+	-rm -fr builddir-*
+	-rm *-stamp
 	-find . -name \*.gmo -o -name \*~ | xargs rm -f
 	-rm -f $(pwd)/test-summary
-	-rm -fr $(d_bin) $(d_dev) $(d_mul) $(d_doc) $(d_hppa64)
-	-rm -rf debian/patched debian/tmp debian/files debian/substvars
+	-rm -fr $(d_bin) $(d_dev) $(d_mul) $(d_doc)
+	-rm -fr debian/patched debian/tmp debian/files debian/*.substvars
+	-rm -f debian/*.debhelper
+	cp debian/control.native debian/control
+	for target in $(CROSS_TARGETS); do \
+		rm -rf debian/binutils-dev-$${target} debian/binutils-$${target}; \
+		rm -f debian/binutils-$${target}.shlibs debian/binutils-$${target}.postinst debian/binutils-$${target}.postrm; \
+	done
 
 ################################################################################
 
@@ -152,42 +174,66 @@
 		CFLAGS="$(CFLAGS)" $(MULTI_ARGS)
 	touch build-multi-stamp
 
-################################################################################
-
-#################
-# hppa64 target #
-#################
-
-configure-hppa64-stamp: patch-stamp
-	$(checkdir)
-	rm -rf configure-hppa64-stamp \
-		builddir-hppa64
-	mkdir builddir-hppa64
-	cd builddir-hppa64 \
-	    && env CC="$(CC)" ../configure \
-		--enable-shared \
-		--prefix=/usr \
-		--build=$(DEB_BUILD_GNU_TYPE) \
-		--host=$(DEB_BUILD_GNU_TYPE) \
-		--target=hppa64-linux
-	$(MAKE) -C builddir-hppa64 configure-host
-	touch configure-hppa64-stamp
-
-build-hppa64-stamp: configure-hppa64-stamp
-	$(checkdir)
-	$(MAKE) -C builddir-hppa64/bfd headers
-	$(MAKE) -C builddir-hppa64 \
-		CFLAGS="$(CFLAGS)" $(HPPA64_ARGS)
-	touch build-hppa64-stamp
-
 build_stamps = build-single-stamp build-multi-stamp
-ifeq ($(DEB_HOST_ARCH),hppa)
-       build_stamps += build-hppa64-stamp
+ifneq ($(CROSS_TARGETS),)
+	build_stamps += build-cross
 endif
+
 build: build-stamp
 build-stamp: $(build_stamps)
 	touch build-stamp
 
+ifneq ($(CROSS_TARGETS),)
+build-cross:
+	for target in $(CROSS_TARGETS); do \
+		$(MAKE) -f debian/rules CROSS_TARGET=$$target build-cross-target; \
+	done
+endif
+
+################################################################################
+
+################
+# cross target #
+################
+ifneq ($(CROSS_TARGET),)
+
+CROSS_CONFARGS = $(CONFARGS) --target=$(CROSS_TARGET)-linux --includedir=$(CROSS_INCLUDEDIR) --libdir=$(CROSS_LIBDIR)
+CROSS_LIBDIR=/usr/$(CROSS_TARGET)-linux/$(DEB_HOST_GNU_TYPE)/lib
+CROSS_BFDLIBDIR=/usr/$(DEB_HOST_GNU_TYPE)/$(CROSS_TARGET)-linux/lib
+CROSS_INCLUDEDIR=/usr/$(CROSS_TARGET)-linux/$(DEB_HOST_GNU_TYPE)/include
+CROSS_BFDINCLUDEDIR=/usr/$(DEB_HOST_GNU_TYPE)/$(CROSS_TARGET)-linux/include
+CROSS_CFLAGS= $(CFLAGS)
+CROSS_LDFLAGS = $(LDFLAGS)
+
+configure-cross-target:	configure-cross-$(CROSS_TARGET)-stamp
+configure-cross-$(CROSS_TARGET)-stamp:	patch-stamp 
+	$(checkdir)
+	rm -rf configure-cross-$(CROSS_TARGET)-stamp \
+		builddir-cross-$(CROSS_TARGET)
+	mkdir builddir-cross-$(CROSS_TARGET)
+	cd builddir-cross-$(CROSS_TARGET) && env CC="$(CC)" \
+		../configure $(CROSS_CONFARGS)
+	$(MAKE) -C builddir-cross-$(CROSS_TARGET) configure-host
+	sed -e 's,__TARGET__,$(CROSS_TARGET),g' debian/control.cross >> debian/control
+	cp -p debian/binutils.postinst debian/binutils-$(CROSS_TARGET).postinst
+	cp -p debian/binutils.postrm debian/binutils-$(CROSS_TARGET).postrm
+	sed -e 's,binutils,binutils-$(CROSS_TARGET),g' debian/binutils.shlibs > debian/binutils-$(CROSS_TARGET).shlibs
+	touch $@
+
+build-cross-target:	build-cross-$(CROSS_TARGET)-stamp
+build-cross-$(CROSS_TARGET)-stamp:	configure-cross-target 
+	$(checkdir)
+	$(MAKE) -C builddir-cross-$(CROSS_TARGET)/bfd headers
+	$(MAKE) -C builddir-cross-$(CROSS_TARGET) \
+		CFLAGS="$(CFLAGS)"
+	-DEJAGNU=$(CROSS_TARGET)-linux $(MAKE) -C builddir-cross-$(CROSS_TARGET) -k \
+		CFLAGS="$(CFLAGS)" check
+	cat builddir-cross-$(CROSS_TARGET)/binutils/binutils.sum \
+	    builddir-cross-$(CROSS_TARGET)/gas/testsuite/gas.sum \
+	    builddir-cross-$(CROSS_TARGET)/ld/ld.sum >> $(pwd)/test-summary
+	touch $@
+endif
+
 ################################################################################
 
 ##################
@@ -195,8 +241,8 @@
 ##################
 
 install_stamps = install-stamp
-ifeq ($(DEB_HOST_ARCH),hppa)
-       install_stamps += install-hppa64-stamp
+ifneq ($(CROSS_TARGETS),)
+	install_stamps += install-cross
 endif
 install: $(install_stamps)
 install-stamp: checkroot build-stamp
@@ -218,6 +264,7 @@
 		mandir=$(pwd)/$(d_mul)/usr/share/man \
 		infodir=$(pwd)/$(d_doc)/usr/share/info install
 
+
 	: # Work around bug in 2.14.90.0.7 which caused as info and
 	: # manpages to not be installed.
 	make -C builddir-single/gas/doc \
@@ -278,43 +325,61 @@
 
 	touch install-stamp
 
-install-hppa64-stamp: checkroot build-hppa64-stamp
-	$(checkdir)
-
-	rm -fr $(d_hppa64)
-	$(install_dir) $(d_hppa64)
-	$(install_dir) $(d_hppa64)/usr/lib
-
-	: # install binutils-hppa64 stuff
-	$(MAKE) -C builddir-hppa64 \
-		CFLAGS="$(CFLAGS)" $(HPPA64_ARGS) \
-		prefix=$(pwd)/$(d_hppa64)/usr/ \
-		mandir=$(pwd)/$(d_hppa64)/usr/share/man \
-		infodir=$(pwd)/$(d_hppa64)/usr/share/info install
-
-	: # move shared libs to the stndard path
-	mv $(d_hppa64)/usr/hppa-linux/hppa64-linux/lib/lib*-*.so \
-		$(d_hppa64)/usr/lib/.
-
-	: # Now get rid of just about everything in binutils-hppa64
-	rm -rf $(d_hppa64)/usr/man
-	rm -rf $(d_hppa64)/usr/info
-	rm -rf $(d_hppa64)/usr/include
-	rm -rf $(d_hppa64)/usr/share
-	rm -rf $(d_hppa64)/usr/hppa-linux
-	rm -rf $(d_hppa64)/usr/lib/libiberty.a
+###############################################################################
 
-	: # Strip shared libraries
-	$(STRIP) --strip-unneeded $(d_hppa64)/usr/lib/libbfd-*so
-	$(STRIP) --strip-unneeded $(d_hppa64)/usr/lib/libopcodes-*so
+########################
+# cross target install #
+########################
+
+ifneq ($(CROSS_TARGETS),)
+install-cross:	checkroot build-stamp
+	for target in $(CROSS_TARGETS); do \
+		$(MAKE) -f debian/rules CROSS_TARGET=$$target install-cross-target; \
+	done
+endif
 
-	chmod ugo-x $(d_hppa64)/usr/lib/*.so
-	$(STRIP) $(d_hppa64)/usr/bin/*
+ifneq ($(CROSS_TARGET),)
+install-cross-target:	build-cross-$(CROSS_TARGET)-stamp install-cross-$(CROSS_TARGET)-stamp
+install-cross-$(CROSS_TARGET)-stamp:
+	: # at least install binutils-cross stuff
+	$(MAKE) -C builddir-cross-$(CROSS_TARGET) \
+		CFLAGS="$(CROSS_CFLAGS)" LDFLAGS="$(CROSS_LDFLAGS)" \
+		$(CROSS_ARGS) \
+		prefix=$(pwd)/$(d_bin_cross)/usr \
+		includedir=$(pwd)/$(d_bin_cross)/$(CROSS_INCLUDEDIR) \
+		libdir=$(pwd)/$(d_bin_cross)/$(CROSS_LIBDIR) \
+		mandir=$(pwd)/$(d_bin_cross)/usr/share/man \
+		infodir=$(pwd)/$(d_doc)/usr/share/info install
 
-	: # Don't want /usr/<arch>-linux to exist in any package
-	rm -rf $(d_hppa64)/usr/hppa64-linux
+	: # copy libiberty.h ... not too keen on this, but it was requested
+	mkdir -p $(d_bin_cross)/$(CROSS_INCLUDEDIR) \
+		&& cp -f include/libiberty.h $(d_bin_cross)/$(CROSS_INCLUDEDIR)
+	mkdir -p $(d_bin_cross)/$(CROSS_LIBDIR) \
+		&& mv $(d_bin_cross)/$(CROSS_BFDLIBDIR)/* $(d_bin_cross)/$(CROSS_LIBDIR)
+	mkdir -p $(d_bin_cross)/$(CROSS_INCLUDEDIR) \
+		&& mv $(d_bin_cross)/$(CROSS_BFDINCLUDEDIR)/* $(d_bin_cross)/$(CROSS_INCLUDEDIR)
+
+	: # Split out binutils-dev-$(CROSS_TARGET)
+	dh_movefiles --sourcedir=$(d_bin_cross) -p$(p_dev_cross) \
+		$(CROSS_INCLUDEDIR) \
+		$(CROSS_LIBDIR)/*.a \
+		$(CROSS_LIBDIR)/*.la \
+		$(CROSS_LIBDIR)/libbfd.so \
+		$(CROSS_LIBDIR)/libopcodes.so
+
+	: # Now get rid of just about everything in binutils-cross
+	rm -rf $(d_bin_cross)/usr/man
+	rm -rf $(d_bin_cross)/usr/info
+	rm -rf $(d_bin_cross)/usr/share
+	rm -rf $(d_bin_cross)/usr/$(DEB_HOST_GNU_TYPE)
+	rm -rf $(d_bin_cross)/usr/share/locale
+	rm -r $(d_bin_cross)/$(CROSS_INCLUDEDIR)
 
-	touch install-hppa64-stamp
+	: # Strip shared libraries
+	$(STRIP) --strip-unneeded $(d_bin_cross)/$(CROSS_LIBDIR)/libbfd-*so
+	$(STRIP) --strip-unneeded $(d_bin_cross)/$(CROSS_LIBDIR)/libopcodes-*so
+	touch $@
+endif
 
 ################################################################################
 
@@ -368,13 +433,6 @@
 	$(install_script) debian/binutils-multiarch.preinst $(d_mul)/DEBIAN/preinst
 	$(install_file) debian/binutils-multiarch.shlibs $(d_mul)/DEBIAN/shlibs
 
-ifeq ($(DEB_HOST_ARCH),hppa)
-	$(install_dir) $(d_hppa64)/DEBIAN
-	$(install_script) debian/binutils-hppa64.postinst $(d_hppa64)/DEBIAN/postinst
-	$(install_script) debian/binutils-hppa64.postrm $(d_hppa64)/DEBIAN/postrm
-	$(install_file) debian/binutils-hppa64.shlibs $(d_hppa64)/DEBIAN/shlibs
-endif
-
 	: # install docs
 	$(install_dir) $(d_bin)/usr/share/doc/$(p_bin)/
 	$(install_file)	debian/changelog $(d_bin)/usr/share/doc/$(p_bin)/changelog.Debian
@@ -383,10 +441,6 @@
 	$(install_dir) $(d_dev)/usr/share/doc/ $(d_mul)/usr/share/doc/
 	ln -sf $(p_bin) $(d_dev)/usr/share/doc/$(p_dev)
 	ln -sf $(p_bin) $(d_mul)/usr/share/doc/$(p_mul)
-ifeq ($(DEB_HOST_ARCH),hppa)
-	$(install_dir) $(d_hppa64)/usr/share/doc/
-	ln -sf $(p_bin) $(d_hppa64)/usr/share/doc/$(p_hppa64)
-endif
 
 	$(install_file) $(pwd)/test-summary binutils/NEWS binutils/ChangeLog.linux \
 	                debian/README.Debian $(d_bin)/usr/share/doc/$(p_bin)/
@@ -422,35 +476,71 @@
 	find $(d_mul) -type f | xargs file | grep ELF | cut -d: -f 1 | xargs dpkg-shlibdeps
 	dpkg-gencontrol -isp -P$(d_mul) -p$(p_mul)
 
-ifeq ($(DEB_HOST_ARCH),hppa)
-	rm -f debian/substvars
-	find $(d_hppa64) -type f | xargs file | grep ELF | cut -d: -f 1 | xargs dpkg-shlibdeps
-	dpkg-gencontrol -isp -P$(d_hppa64) -p$(p_hppa64)
-endif
-
 	chown -R root:root $(d_bin) $(d_dev) $(d_mul)
 	chmod -R go=rX  $(d_bin) $(d_dev) $(d_mul)
 	dpkg --build $(d_bin) ..
 	dpkg --build $(d_dev) ..
 	dpkg --build $(d_mul) ..
-ifeq ($(DEB_HOST_ARCH),hppa)
-	chown -R root:root $(d_hppa64)
-	chmod -R go=rX  $(d_hppa64)
-	dpkg --build $(d_hppa64) ..
+
+################################################################################
+
+#######################
+# cross target binary #
+#######################
+
+ifneq ($(CROSS_TARGETS),)
+binary-arch-cross:
+	for target in $(CROSS_TARGETS); do \
+		$(MAKE) -f debian/rules CROSS_TARGET=$$target binary-arch-cross-target; \
+	done
+endif
+
+ifneq ($(CROSS_TARGET),)
+binary-arch-cross-target:	binary-arch-cross-$(CROSS_TARGET)-stamp
+binary-arch-cross-$(CROSS_TARGET)-stamp:	checkroot build-cross-target install-cross-target
+#	dh_installdebconf -a -p$(p_bin_cross) -p$(p_dev_cross)
+	dh_installdocs -a -p$(p_bin_cross) -p$(p_dev_cross)
+#	dh_installexamples -a -p$(p_bin_cross) -p$(p_dev_cross)
+#	dh_installmenu -a -p$(p_bin_cross) -p$(p_dev_cross)
+#	dh_installlogrotate -a -p$(p_bin_cross) -p$(p_dev_cross)
+#	dh_installemacsen -a -p$(p_bin_cross) -p$(p_dev_cross)
+#	dh_installpam -a -p$(p_bin_cross) -p$(p_dev_cross)
+#	dh_installmime -a -p$(p_bin_cross) -p$(p_dev_cross)
+#	dh_installinit -a -p$(p_bin_cross) -p$(p_dev_cross)
+#	dh_installcron -a -p$(p_bin_cross) -p$(p_dev_cross)
+#	dh_installman -a -p$(p_bin_cross) -p$(p_dev_cross)
+#	dh_installinfo -a -p$(p_bin_cross) -p$(p_dev_cross)
+#	dh_undocumented -a -p$(p_bin_cross) -p$(p_dev_cross)
+	dh_installchangelogs -a -p$(p_bin_cross) -p$(p_dev_cross)
+	#dh_strip -a -p$(p_bin_cross) -p$(p_dev_cross)
+	dh_link -a -p$(p_bin_cross) -p$(p_dev_cross)
+	dh_compress -a -p$(p_bin_cross) -p$(p_dev_cross)
+	dh_fixperms -a -p$(p_bin_cross) -p$(p_dev_cross)
+#	dh_makeshlibs -a -p$(p_bin_cross) -p$(p_dev_cross)
+	dh_installdeb -a -p$(p_bin_cross) -p$(p_dev_cross)
+#	dh_perl -a -p$(p_bin_cross) -p$(p_dev_cross)
+	dh_shlibdeps -a -p$(p_bin_cross) -p$(p_dev_cross)
+	dh_gencontrol -a -p$(p_bin_cross) -p$(p_dev_cross)
+	dh_md5sums -a -p$(p_bin_cross) -p$(p_dev_cross)
+	dh_builddeb -a -p$(p_bin_cross) -p$(p_dev_cross)
+	touch $@
 endif
 
 ################################################################################
 
 define checkdir
-        test -f bfd/elf32.c -a -f debian/rules
+	test -f bfd/elf32.c -a -f debian/rules
 endef
 
+binary_stamps = binary-indep binary-arch
 # Below here is fairly generic really
-
-binary:         binary-indep binary-arch
+ifneq ($(CROSS_TARGETS),)
+	binary_stamps += binary-arch-cross
+endif
+binary:	$(binary_stamps)
 
 checkroot:
 	$(checkdir)
-        test root = "`whoami`"
+	test root = "`whoami`"
 
-.PHONY: binary binary-arch binary-indep clean checkroot
+.PHONY: binary binary-arch binary-arch-cross binary-indep clean checkroot
