This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Build DLL for SunRPC package


The attached patch builds librpc.dll, and also fixes some minor source bugs which seem to stop sunrpc-4.0-3 from building with modern gcc / Cygwin.

I've also built a binary package for this:

http://libvirt.org/sources/win32/

Rich.

--
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
England and Wales under Company Registration No. 03798903
diff -urb sunrpc-4.0-3/etc/portmap.c sunrpc-4.0-4/etc/portmap.c
--- sunrpc-4.0-3/etc/portmap.c	2007-11-29 11:47:15.000000000 +0000
+++ sunrpc-4.0-4/etc/portmap.c	2007-11-29 11:43:53.000000000 +0000
@@ -52,7 +52,6 @@
 
 static callit();
 
-char *malloc();
 int reg_service();
 void reap();
 struct pmaplist *pmaplist;
diff -urb sunrpc-4.0-3/rpc/Makefile sunrpc-4.0-4/rpc/Makefile
--- sunrpc-4.0-3/rpc/Makefile	2007-11-29 11:47:21.000000000 +0000
+++ sunrpc-4.0-4/rpc/Makefile	2007-11-29 13:12:36.000000000 +0000
@@ -30,12 +30,16 @@
 HDRS = auth.h auth_unix.h clnt.h netdb.h pmap_clnt.h \
 	pmap_prot.h pmap_rmt.h rpc.h rpc_msg.h svc.h svc_auth.h types.h xdr.h
 
-all rpclib:	librpclib.a
+all rpclib:	librpclib.a librpc.dll
 
 librpclib.a: ${OBJS}
 	@echo "building librpclib.a"
 	@ar cru librpclib.a ${OBJS}
 
+librpc.dll: ${OBJS}
+	@echo "building $@"
+	gcc -shared -o $@ $^
+
 install: $(HDRS) librpclib.a
 	@echo "Creating RPC header directory"
 	-mkdir -p ${DESTDIR}/usr/include/rpc && \
@@ -45,11 +49,13 @@
 		(install -c -m 644 $$i ${DESTDIR}/usr/include/rpc) done
 	@echo "Installing RPC library"
 	@if [ -f ${DESTDIR}/usr/lib/librpclib.a ]; then rm -f ${DESTDIR}/usr/lib/librpclib.a; fi;
+	@if [ -f ${DESTDIR}/usr/lib/librpc.dll ]; then rm -f ${DESTDIR}/usr/lib/librpc.dll; fi;
 	@mkdir -p ${DESTDIR}/usr/lib
 	install -c -m 644 librpclib.a ${DESTDIR}/usr/lib
 	ranlib ${DESTDIR}/usr/lib/librpclib.a
 	@if [ -L ${DESTDIR}/usr/lib/librpc.a ]; then rm -f ${DESTDIR}/usr/lib/librpc.a; fi;
 	ln -s ./librpclib.a ${DESTDIR}/usr/lib/librpc.a
+	install -c -m 644 librpc.dll ${DESTDIR}/usr/lib
 
 tags: $(SRCS) $(HDRS)
 	ctags -tw $(SRCS) $(HDRS)
@@ -59,7 +65,7 @@
 	awk ' { printf("%-26s%-16s%s\n", $$1, $$2, $$3) }' > ref
 
 clean:  
-	rm -f *.o librpclib.a
+	rm -f *.o librpclib.a librpc.dll
 
 lint: $(SRCS) $(HDRS)
 	$(LINT.c) $(SRCS)
diff -urb sunrpc-4.0-3/rpc/xdr.c sunrpc-4.0-4/rpc/xdr.c
--- sunrpc-4.0-3/rpc/xdr.c	2007-11-29 11:47:39.000000000 +0000
+++ sunrpc-4.0-4/rpc/xdr.c	2007-11-29 11:40:53.000000000 +0000
@@ -42,7 +42,6 @@
  */
 
 #include <stdio.h>
-char *malloc();
 
 #include <rpc/types.h>
 #include <rpc/xdr.h>
diff -urb sunrpc-4.0-3/rpcgen/rpc_util.h sunrpc-4.0-4/rpcgen/rpc_util.h
--- sunrpc-4.0-3/rpcgen/rpc_util.h	2007-11-29 11:47:46.000000000 +0000
+++ sunrpc-4.0-4/rpcgen/rpc_util.h	2007-11-29 11:43:46.000000000 +0000
@@ -33,8 +33,6 @@
  * rpc_util.h, Useful definitions for the RPC protocol compiler 
  * Copyright (C) 1987, Sun Microsystems, Inc. 
  */
-extern char *malloc();
-
 #define alloc(size)		malloc((unsigned)(size))
 #define ALLOC(object)   (object *) malloc(sizeof(object))
 

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]