[mingw-portablexdr] Added win64 support (contributed by Marc-Andre Lureau)

Erik van Pienbroek epienbro at fedoraproject.org
Sat Apr 14 20:55:13 UTC 2012


commit 4ea194c697536322ad224a5842c80257b225c0ce
Author: Erik van Pienbroek <epienbro at fedoraproject.org>
Date:   Sat Apr 14 22:55:00 2012 +0200

    Added win64 support (contributed by Marc-Andre Lureau)
    
    - Added win64 support (contributed by Marc-Andre Lureau)
    - Added static subpackage
    - Added win64 specific patch
    - Automatically generate debuginfo subpackages

 mingw-portablexdr.spec                             |   66 ++++++++++++++--
 ...intptr_t-and-uintptr_t-to-cast-ptr-to-int.patch |   79 ++++++++++++++++++++
 2 files changed, 137 insertions(+), 8 deletions(-)
---
diff --git a/mingw-portablexdr.spec b/mingw-portablexdr.spec
index df8faa4..1c2f74c 100644
--- a/mingw-portablexdr.spec
+++ b/mingw-portablexdr.spec
@@ -1,9 +1,8 @@
-%define __strip %{mingw32_strip}
-%define __objdump %{mingw32_objdump}
+%?mingw_package_header
 
 Name:		mingw-portablexdr
 Version:	4.9.1
-Release:	7%{?dist}
+Release:	8%{?dist}
 Summary:	MinGW Windows PortableXDR / RPC Library
 
 License:	LGPLv2+
@@ -12,42 +11,73 @@ URL:		http://et.redhat.com/~rjones/portablexdr/
 Source0:	http://et.redhat.com/~rjones/portablexdr/portablexdr-%{version}.tar.gz
 BuildArch:	noarch
 
-BuildRequires:	mingw32-filesystem
+BuildRequires:	mingw32-filesystem >= 95
 BuildRequires:	mingw32-gcc
 BuildRequires:	mingw32-binutils
 
+BuildRequires:	mingw64-filesystem >= 95
+BuildRequires:	mingw64-gcc
+BuildRequires:	mingw64-binutils
+
 # Remove include of config.h from public header.
-Patch0:         portablexdr-4.9.1-no-config-h.patch
+Patch0:		portablexdr-4.9.1-no-config-h.patch
+Patch1:		portablexdr-build-use-intptr_t-and-uintptr_t-to-cast-ptr-to-int.patch
 
 
 %description
 MinGW Windows PortableXDR XDR / RPC library.
 
 
+# Win32
 %package -n mingw32-portablexdr
 Summary:	MinGW Windows PortableXDR / RPC Library
 
 %description -n mingw32-portablexdr
 MinGW Windows PortableXDR XDR / RPC library.
 
+%package -n mingw32-portablexdr-static
+Summary:       MinGW Windows PortableXDR XDR / RPC library, static version
+
+%description -n mingw32-portablexdr-static
+MinGW Windows PortableXDR XDR / RPC library, static version.
+
+# Win64
+%package -n mingw64-portablexdr
+Summary:        MinGW Windows PortableXDR / RPC Library
+
+%description -n mingw64-portablexdr
+MinGW Windows PortableXDR XDR / RPC library.
+
+%package -n mingw64-portablexdr-static
+Summary:       MinGW Windows PortableXDR XDR / RPC library, static version
+
+%description -n mingw64-portablexdr-static
+MinGW Windows PortableXDR XDR / RPC library, static version.
+
+
+%?mingw_debug_package
+
 
 %prep
 %setup -q -n portablexdr-%{version}
 
 %patch0 -p1
+%patch1 -p1
+
 
 %build
-%{mingw32_configure} --disable-static
-make %{?_smp_flags}
+%mingw_configure --enable-static
+%mingw_make %{?_smp_flags}
 
 
 %install
-make DESTDIR=$RPM_BUILD_ROOT install
+%mingw_make DESTDIR=$RPM_BUILD_ROOT install
 
 # Drop all .la files
 find $RPM_BUILD_ROOT -name "*.la" -delete
 
 
+# Win32
 %files -n mingw32-portablexdr
 %doc COPYING.LIB
 %{mingw32_bindir}/portable-rpcgen.exe
@@ -55,8 +85,28 @@ find $RPM_BUILD_ROOT -name "*.la" -delete
 %{mingw32_libdir}/libportablexdr.dll.a
 %{mingw32_includedir}/rpc
 
+%files -n mingw32-portablexdr-static
+%{mingw32_libdir}/libportablexdr.a
+
+# Win64
+%files -n mingw64-portablexdr
+%doc COPYING.LIB
+%{mingw64_bindir}/portable-rpcgen.exe
+%{mingw64_bindir}/libportablexdr-0.dll
+%{mingw64_libdir}/libportablexdr.dll.a
+%{mingw64_includedir}/rpc
+
+%files -n mingw64-portablexdr-static
+%{mingw64_libdir}/libportablexdr.a
+
 
 %changelog
+* Sat Apr 14 2012 Erik van Pienbroek <epienbro at fedoraproject.org> - 4.9.1-8
+- Added win64 support (contributed by Marc-Andre Lureau)
+- Added static subpackage
+- Added win64 specific patch
+- Automatically generate debuginfo subpackages
+
 * Fri Mar 09 2012 Erik van Pienbroek <epienbro at fedoraproject.org> - 4.9.1-7
 - Dropped .la files
 
diff --git a/portablexdr-build-use-intptr_t-and-uintptr_t-to-cast-ptr-to-int.patch b/portablexdr-build-use-intptr_t-and-uintptr_t-to-cast-ptr-to-int.patch
new file mode 100644
index 0000000..847ca15
--- /dev/null
+++ b/portablexdr-build-use-intptr_t-and-uintptr_t-to-cast-ptr-to-int.patch
@@ -0,0 +1,79 @@
+From a7461e1430fcc26b02457f7b8f53dc423c062e1e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau at redhat.com>
+Date: Mon, 23 Jan 2012 19:31:10 +0100
+Subject: [PATCH] build: use intptr_t and uintptr_t to cast ptr to int
+
+---
+ xdr_mem.c |    2 +-
+ xdr_rec.c |   16 ++++++++--------
+ 2 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/xdr_mem.c b/xdr_mem.c
+index 701cad2..f8a2d3a 100644
+--- a/xdr_mem.c
++++ b/xdr_mem.c
+@@ -169,7 +169,7 @@ xdrmem_setpos(xdrs, pos)
+ 	register caddr_t newaddr = xdrs->x_base + pos;
+ 	register caddr_t lastaddr = xdrs->x_private + xdrs->x_handy;
+ 
+-	if ((long)newaddr > (long)lastaddr)
++	if ((intptr_t)newaddr > (intptr_t)lastaddr)
+ 		return (FALSE);
+ 	xdrs->x_private = newaddr;
+ 	xdrs->x_handy = lastaddr - newaddr;
+diff --git a/xdr_rec.c b/xdr_rec.c
+index 6859c42..a0d34c6 100644
+--- a/xdr_rec.c
++++ b/xdr_rec.c
+@@ -173,7 +173,7 @@ xdrrec_create(xdrs, sendsize, recvsize, tcp_handle, readit, writeit)
+ 		return;
+ 	}
+ 	for (rstrm->out_base = rstrm->the_buffer;
+-	     (long) rstrm->out_base % BYTES_PER_XDR_UNIT != 0;
++	     (intptr_t) rstrm->out_base % BYTES_PER_XDR_UNIT != 0;
+ 		rstrm->out_base++);
+ 	rstrm->in_base = rstrm->out_base + sendsize;
+ 	/*
+@@ -472,12 +472,12 @@ xdrrec_endofrecord(xdrs, sendnow)
+ 	register u_long len;  /* fragment length */
+ 
+ 	if (sendnow || rstrm->frag_sent ||
+-		((u_long)rstrm->out_finger + sizeof(u_long) >=
+-		(u_long)rstrm->out_boundry)) {
++		((uintptr_t)rstrm->out_finger + sizeof(u_long) >=
++		(uintptr_t)rstrm->out_boundry)) {
+ 		rstrm->frag_sent = FALSE;
+ 		return (flush_out(rstrm, TRUE));
+ 	}
+-	len = (u_long)(rstrm->out_finger) - (u_long)(rstrm->frag_header) -
++	len = (uintptr_t)(rstrm->out_finger) - (uintptr_t)(rstrm->frag_header) -
+ 	   sizeof(u_long);
+ 	*(rstrm->frag_header) = htonl((u_long)len | LAST_FRAG);
+ 	rstrm->frag_header = (u_long *)rstrm->out_finger;
+@@ -495,11 +495,11 @@ flush_out(rstrm, eor)
+ 	bool_t eor;
+ {
+ 	register u_long eormask = (eor == TRUE) ? LAST_FRAG : 0;
+-	register u_long len = (u_long)(rstrm->out_finger) - 
+-		(u_long)(rstrm->frag_header) - sizeof(u_long);
++	register u_long len = (uintptr_t)(rstrm->out_finger) -
++		(uintptr_t)(rstrm->frag_header) - sizeof(u_long);
+ 
+ 	*(rstrm->frag_header) = htonl(len | eormask);
+-	len = (u_long)(rstrm->out_finger) - (u_long)(rstrm->out_base);
++	len = (uintptr_t)(rstrm->out_finger) - (uintptr_t)(rstrm->out_base);
+ 	if ((*(rstrm->writeit))(rstrm->tcp_handle, rstrm->out_base, (int)len)
+ 		!= (int)len)
+ 		return (FALSE);
+@@ -517,7 +517,7 @@ fill_input_buf(rstrm)
+ 	register int len;
+ 
+ 	where = rstrm->in_base;
+-	i = (long) rstrm->in_boundry % BYTES_PER_XDR_UNIT;
++	i = (intptr_t) rstrm->in_boundry % BYTES_PER_XDR_UNIT;
+ 	where += i;
+ 	len = rstrm->in_size - i;
+ 	if ((len = (*(rstrm->readit))(rstrm->tcp_handle, where, len)) == -1)
+-- 
+1.7.7.5
+


More information about the scm-commits mailing list