tags 474097 + patch

On Thu, Apr 03, 2008 at 11:57:27AM +0100, Mark Brown wrote:
> > +N32-ARCHS=mips mipsel
> > +ifneq (,$(findstring $(DEB_HOST_ARCH), $(N32-ARCHS)))
> > +EXTRA_INSTALL+=installn32
> > +EXTRA_BUILD+=buildn32-stamp
> > +m64=-mabi=64
> > +mn32=-mabi=n32
> >  endif
> 
> The patch looks good but could you please rearrange it so that the
> overriding of -m64 for MIPS is done in the 64-ARCHS test block rather
> than here?  Something along the lines of:
> 
>   # MIPS doesn't use -m64
>   ifneq (,$(findstring $(DEB_HOST_ARCH), mips mipsel))
>   m64=-mabi=64
>   else
>   m64=-m64
>   endif
> 
> ought to do the trick.  I'd rather take a known-tested patch than modify
> it myself without testing.

Done, also added a Build-Depends on binutils (>= 2.18.1~cvs20080103-2) [mips 
mipsel],
it fixes PR binutils/4453 (see #363423). Also, is a symbols files update 
required?

I've uploaded a build with the build log here: http://ada.lri.fr/~arthur/zlib/


Thanks. :-)


Arthur.
From 82dc670c2ac5ffa51e68b7827d3dbfee0bf7b4cb Mon Sep 17 00:00:00 2001
From: Arthur Loiret <[EMAIL PROTECTED]>
Date: Thu, 3 Apr 2008 10:10:43 +0000
Subject: [PATCH] Support MIPS triarch.

---
 debian/control              |   24 +++++++++++++++++++++---
 debian/libn32z1-dev.dirs    |    1 +
 debian/libn32z1-dev.install |    2 ++
 debian/libn32z1.dirs        |    1 +
 debian/libn32z1.install     |    1 +
 debian/rules                |   42 +++++++++++++++++++++++++++++++++++++++---
 6 files changed, 65 insertions(+), 6 deletions(-)
 create mode 100644 debian/libn32z1-dev.dirs
 create mode 100644 debian/libn32z1-dev.install
 create mode 100644 debian/libn32z1.dirs
 create mode 100644 debian/libn32z1.install

diff --git a/debian/control b/debian/control
index 4a49ab2..f665c90 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: optional
 Maintainer: Mark Brown <[EMAIL PROTECTED]>
 Standards-Version: 3.7.3
 XS-VCS-Bzr: http://bzr.debian.org/bzr/pkg-zlib/zlib/debian
-Build-Depends: debhelper (>= 5), quilt, gcc-multilib [amd64 i386 kfreebsd-amd64 powerpc ppc64 s390 sparc]
+Build-Depends: debhelper (>= 5), quilt, binutils (>= 2.18.1~cvs20080103-2) [mips mipsel], gcc-multilib [amd64 i386 kfreebsd-amd64 mips mipsel powerpc ppc64 s390 sparc]
 
 Package: zlib1g
 Architecture: any
@@ -58,7 +58,7 @@ Description: compression library - runtime for Debian installer
  for use with the Debian installer.
 
 Package: lib64z1
-Architecture: sparc s390 i386 powerpc
+Architecture: sparc s390 i386 powerpc mips mipsel
 Depends: ${shlibs:Depends}
 Replaces: amd64-libs (<< 1.4)
 Description: compression library - 64 bit runtime
@@ -68,7 +68,7 @@ Description: compression library - 64 bit runtime
 
 Package: lib64z1-dev
 Section: libdevel
-Architecture: sparc s390 i386 powerpc
+Architecture: sparc s390 i386 powerpc mips mipsel
 Depends: lib64z1 (= ${binary:Version}), zlib1g-dev (= ${binary:Version}), lib64c-dev
 Replaces: amd64-libs-dev (<< 1.4)
 Provides: lib64z-dev
@@ -96,3 +96,21 @@ Description: compression library - 32 bit development
  zlib is a library implementing the deflate compression method found
  in gzip and PKZIP.  This package includes the development support
  files for building 32 bit applications.
+
+Package: libn32z1
+Architecture: mips mipsel
+Depends: ${shlibs:Depends}
+Description: compression library - n32 runtime
+ zlib is a library implementing the deflate compression method found
+ in gzip and PKZIP.  This package includes a n32 version of the shared
+ library.
+
+Package: libn32z1-dev
+Section: libdevel
+Architecture: mips mipsel
+Depends: libn32z1 (= ${binary:Version}), zlib1g-dev (= ${binary:Version}), libn32c-dev
+Provides: libn32z-dev
+Description: compression library - n32 development
+ zlib is a library implementing the deflate compression method found
+ in gzip and PKZIP.  This package includes the development support
+ files for building n32 applications.
diff --git a/debian/libn32z1-dev.dirs b/debian/libn32z1-dev.dirs
new file mode 100644
index 0000000..5a51e61
--- /dev/null
+++ b/debian/libn32z1-dev.dirs
@@ -0,0 +1 @@
+usr/lib32
diff --git a/debian/libn32z1-dev.install b/debian/libn32z1-dev.install
new file mode 100644
index 0000000..f9b0fc2
--- /dev/null
+++ b/debian/libn32z1-dev.install
@@ -0,0 +1,2 @@
+usr/lib32/libz.a
+usr/lib32/libz.so
diff --git a/debian/libn32z1.dirs b/debian/libn32z1.dirs
new file mode 100644
index 0000000..5a51e61
--- /dev/null
+++ b/debian/libn32z1.dirs
@@ -0,0 +1 @@
+usr/lib32
diff --git a/debian/libn32z1.install b/debian/libn32z1.install
new file mode 100644
index 0000000..4b9abde
--- /dev/null
+++ b/debian/libn32z1.install
@@ -0,0 +1 @@
+usr/lib32/libz.so.*
diff --git a/debian/rules b/debian/rules
index 814a619..ca6b601 100755
--- a/debian/rules
+++ b/debian/rules
@@ -34,16 +34,30 @@ else
 	CFLAGS += -O3
 endif
 
-64-ARCHS=s390 sparc i386 powerpc
+64-ARCHS=s390 sparc i386 powerpc mips mipsel
 ifneq (,$(findstring $(DEB_HOST_ARCH), $(64-ARCHS)))
 EXTRA_INSTALL=install64
 EXTRA_BUILD=build64-stamp
+# MIPS doesn't use -m64
+ifneq (,$(findstring $(DEB_HOST_ARCH), mips mipsel))
+m64=-mabi=64
+else
+m64=-m64
+endif
 endif
 
 32-ARCHS=amd64 ppc64 kfreebsd-amd64
 ifneq (,$(findstring $(DEB_HOST_ARCH), $(32-ARCHS)))
 EXTRA_INSTALL=install32
 EXTRA_BUILD=build32-stamp
+m32=-m32
+endif
+
+N32-ARCHS=mips mipsel
+ifneq (,$(findstring $(DEB_HOST_ARCH), $(N32-ARCHS)))
+EXTRA_INSTALL+=installn32
+EXTRA_BUILD+=buildn32-stamp
+mn32=-mabi=n32
 endif
 
 UNALIGNED_ARCHS=i386 amd64 kfreebsd-i386 kfreebsd-amd64 hurd-i386
@@ -68,7 +82,7 @@ configure64-stamp: configure patch
 
 	mkdir -p debian/64
 	cp $(COPYLIST) debian/64
-	cd debian/64 && AR=$(AR) CC="$(DEB_HOST_GNU_TYPE)-gcc -m64" \
+	cd debian/64 && AR=$(AR) CC="$(DEB_HOST_GNU_TYPE)-gcc $(m64)" \
 	    CFLAGS="$(CFLAGS)" \
 	    uname=GNU ./configure --shared --prefix=/usr  --libdir=\$${prefix}/usr/lib64
 	touch $@
@@ -78,7 +92,17 @@ configure32-stamp: configure patch
 
 	mkdir -p debian/32
 	cp $(COPYLIST) debian/32
-	cd debian/32 && AR=$(AR) CC="$(DEB_HOST_GNU_TYPE)-gcc -m32" \
+	cd debian/32 && AR=$(AR) CC="$(DEB_HOST_GNU_TYPE)-gcc $(m32)" \
+	    CFLAGS="$(CFLAGS)" \
+	    uname=GNU ./configure --shared --prefix=/usr --libdir=\$${prefix}/usr/lib32
+	touch $@
+
+configuren32-stamp: configure patch
+	dh_testdir
+
+	mkdir -p debian/n32
+	cp $(COPYLIST) debian/n32
+	cd debian/n32 && AR=$(AR) CC="$(DEB_HOST_GNU_TYPE)-gcc $(mn32)" \
 	    CFLAGS="$(CFLAGS)" \
 	    uname=GNU ./configure --shared --prefix=/usr --libdir=\$${prefix}/usr/lib32
 	touch $@
@@ -103,6 +127,11 @@ build32-stamp: configure32-stamp
 	make -C debian/32
 	touch $@
 
+buildn32-stamp: configuren32-stamp
+	dh_testdir
+	make -C debian/n32
+	touch $@
+
 clean: unpatch
 	dh_testdir
 	dh_testroot
@@ -113,6 +142,7 @@ clean: unpatch
 	rm -f build-stamp configure-stamp foo.gz 
 	rm -rf debian/64 build64-stamp configure64-stamp
 	rm -rf debian/32 build32-stamp configure32-stamp
+	rm -rf debian/n32 buildn32-stamp configuren32-stamp
 	-mv Makefile.stash Makefile
 	-mv zlibdefs.h.stash zlibdefs.h
 
@@ -132,6 +162,9 @@ install64: install build64-stamp
 install32: install build32-stamp
 	$(MAKE) -C debian/32 prefix=$(CURDIR)/debian/tmp install
 
+installn32: install buildn32-stamp
+	$(MAKE) -C debian/n32 prefix=$(CURDIR)/debian/tmp install
+
 # Build architecture-independent files here.
 binary-indep: build install
 # We have nothing to do by default.
@@ -166,6 +199,9 @@ endif
 ifneq (,$(findstring $(DEB_HOST_ARCH), $(32-ARCHS)))
 	dh_makeshlibs -plib32z1 -V"lib32z1 (>= 1:1.2.3.3.dfsg-1)"
 endif
+ifneq (,$(findstring $(DEB_HOST_ARCH), $(N32-ARCHS)))
+	dh_makeshlibs -plibn32z1 -V"libn32z1 (>= 1:1.2.3.3.dfsg-1)"
+endif
 	dh_installdeb -s
 	dh_shlibdeps -s
 	dh_gencontrol -s
-- 
1.5.4.5

Attachment: signature.asc
Description: Digital signature

Reply via email to