[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Updated cross-binutils patch



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> Attached to this message is a slightly updated version of
> binutils-cross.patch that makes binutils-arm-linux package to conflict
> with binutils-arm, and binutils-powerpc-linux to conflict with
> binutils-powerpc. This will avoid "file overlap" errors when installing
> on system with old emdebian packages already installed.

One more update to fix failure of mipsel-linux target build: 
- --enable-targets should be mips64el-linux, not mipsel64-linux.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA7GKQsTbPknTfAB4RAtFMAJ9aT/ulE8eoK8F8zGETwk0GnbDR6wCgkzAc
hLj/cFryAh6NTw/HpmQumqo=
=Vqxw
-----END PGP SIGNATURE-----
diff -urN binutils-2.14.90.0.7/debian/control.cross.in binutils-2.14.90.0.7.cross/debian/control.cross.in
--- binutils-2.14.90.0.7/debian/control.cross.in	1970-01-01 03:00:00.000000000 +0300
+++ binutils-2.14.90.0.7.cross/debian/control.cross.in	2004-07-08 00:40:41.000000000 +0400
@@ -0,0 +1,12 @@
+Package: binutils-TARGET
+Architecture: any
+Depends: binutils, ${shlibs:Depends}
+Suggests: binutils-doc (= ${Source-Version})
+Priority: extra
+OLD_EMDEBIAN_CONFLICT
+Description: The GNU binary utilities, for TARGET target
+ This package provides GNU assembler, linker and binary utilities
+ for TARGET target, for use in cross-compilation environment.
+ .
+ You don't need this package unless you plan to cross-compile programs
+ for TARGET.
diff -urN binutils-2.14.90.0.7/debian/README.cross binutils-2.14.90.0.7.cross/debian/README.cross
--- binutils-2.14.90.0.7/debian/README.cross	1970-01-01 03:00:00.000000000 +0300
+++ binutils-2.14.90.0.7.cross/debian/README.cross	2004-07-08 00:40:41.000000000 +0400
@@ -0,0 +1,12 @@
+Cross-binutils debian packages can be built directly from binutils
+source package.
+
+To build cross-binutils package, download and unpack binutils
+source package, and run
+
+TARGET=your-target fakeroot debian/rules binary-cross
+
+(substitute your target name, e.g. "arm-linux", instead of "your-target")
+
+---
+Nikita Youshchenko <yoush@cs.msu.su>
\ ÷ ËÏÎÃÅ ÆÁÊÌÁ ÎÅÔ ÎÏ×ÏÊ ÓÔÒÏËÉ
diff -urN binutils-2.14.90.0.7/debian/rules binutils-2.14.90.0.7.cross/debian/rules
--- binutils-2.14.90.0.7/debian/rules	2004-07-08 00:40:03.000000000 +0400
+++ binutils-2.14.90.0.7.cross/debian/rules	2004-07-08 00:42:28.000000000 +0400
@@ -382,7 +382,7 @@
 endif
 
 	$(install_file) $(pwd)/test-summary binutils/NEWS binutils/ChangeLog.linux \
-	                debian/README.Debian $(d_bin)/usr/share/doc/$(p_bin)/
+	                debian/README.Debian debian/README.cross $(d_bin)/usr/share/doc/$(p_bin)/
 
 	$(install_file) binutils/ChangeLog $(d_bin)/usr/share/doc/$(p_bin)/changelog
 
@@ -434,6 +434,95 @@
 
 ################################################################################
 
+#################
+# cross targets #
+#################
+
+d_cross = debian/binutils-$(TARGET)
+p_cross = binutils-$(TARGET)
+
+ifneq ($(filter sparc-linux powerpc-linux mips-linux, $(TARGET)),)
+ADDITIONAL_TARGETS = --enable-targets=$(TARGET:%-linux=%64-linux)
+endif
+ifneq ($(filter i386-linux i486-linux i586-linux x86-linux, $(TARGET)),)
+ADDITIONAL_TARGETS = --enable-targets=x86_64-linux
+endif
+ifeq ($(TARGET), mipsel-linux)
+ADDITIONAL_TARGETS = --enable-targets=mips64el-linux
+endif
+ifeq ($(TARGET), sparc64-linux)
+ADDITIONAL_TARGETS = --enable-targets=sparc-linux
+endif
+ifeq ($(TARGET), s390-linux)
+ADDITIONAL_TARGETS = --enable-targets=s390x-linux
+endif
+
+configure-$(TARGET)-stamp: patch-stamp
+	$(checkdir)
+	test "" != "$(TARGET)"
+	rm -rf configure-$(TARGET)-stamp builddir-$(TARGET)
+	mkdir builddir-$(TARGET)
+	cd builddir-$(TARGET) \
+	    && env CC="$(CC)" ../configure --host=$(DEB_HOST_GNU_TYPE) \
+	        --build=$(DEB_BUILD_GNU_TYPE) --target=$(TARGET) --prefix=/usr \
+		$(ADDITIONAL_TARGETS)
+	touch $@
+
+build-$(TARGET)-stamp: configure-$(TARGET)-stamp
+	$(checkdir)
+	test "" != "$(TARGET)"
+	$(MAKE) -C builddir-$(TARGET) CFLAGS="$(CFLAGS)"
+	touch $@
+
+install-$(TARGET)-stamp: build-$(TARGET)-stamp
+	$(checkdir)
+	test "" != "$(TARGET)"
+	rm -rf $(d_cross)
+	$(MAKE) -C builddir-$(TARGET) prefix=$(pwd)/$(d_cross)/usr \
+		mandir=$(pwd)/$(d_cross)/usr/share/man install
+	rm -rf $(d_cross)/usr/lib $(d_cross)/usr/info $(d_cross)/usr/share/locale
+	$(STRIP) $(d_cross)/usr/bin/*
+	gzip -9 $(d_cross)/usr/share/man/man1/*
+	touch $@
+
+binary-cross: checkroot install-$(TARGET)-stamp
+	$(checkdir)
+	test "" != "$(TARGET)"
+	
+	sed '/^$$/ q' < debian/control > debian/control.$(TARGET)
+	case "$(TARGET)" in \
+	  arm-linux|powerpc-linux) \
+	    sed "s/TARGET/$(TARGET)/g; s/OLD_EMDEBIAN_CONFLICT/Conflicts: binutils-`echo $(TARGET) | sed s/-linux//`/" < debian/control.cross.in >> debian/control.$(TARGET) ;; \
+	  *) \
+	    grep -v OLD_EMDEBIAN_CONFLICT debian/control.cross.in | sed 's/TARGET/$(TARGET)/g' >> debian/control.$(TARGET) ;; \
+	esac
+	
+	$(install_dir) $(d_cross)/DEBIAN
+	
+	$(install_dir) $(d_cross)/usr/share/doc/$(p_cross)/
+	$(install_file)	debian/changelog $(d_cross)/usr/share/doc/$(p_cross)/changelog.Debian
+	$(install_file)	debian/copyright debian/README.cross $(d_cross)/usr/share/doc/$(p_cross)/
+	gzip -f -9 $(d_cross)/usr/share/doc/$(p_cross)/changelog.Debian
+	
+	for pkg in bfd gas gprof ld; do \
+	  ln -sf ../binutils/$$pkg $(d_cross)/usr/share/doc/$(p_cross)/$$pkg; \
+	done
+
+	rm -f debian/substvars
+	dpkg-shlibdeps $(d_cross)/usr/bin/*
+	dpkg-gencontrol -cdebian/control.$(TARGET) -P$(d_cross) -p$(p_cross)
+	dpkg --build $(d_cross) ..
+
+clean-cross: unpatch
+	$(checkdir)
+	test "" != "$(TARGET)"
+	rm -rf $(d_cross) debian/control.$(TARGET) debian/files debian/substvars \
+		builddir-$(TARGET) {configure,build,install}-$(TARGET)-stamp
+
+.PHONY: binary-cross clean-cross
+
+################################################################################
+
 define checkdir
         test -f bfd/elf32.c -a -f debian/rules
 endef
@@ -444,6 +533,6 @@
 
 checkroot:
 	$(checkdir)
-        test root = "`whoami`"
+	test root = "`whoami`"
 
 .PHONY: binary binary-arch binary-indep clean checkroot

Reply to: