commit:     74727efe17783c5bb57916f8f86009af1bd28c2a
Author:     Dagg <daggs <AT> gmx <DOT> com>
AuthorDate: Sat Jan 10 14:46:39 2015 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sat Jan 31 21:32:59 2015 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=74727efe

net-libs/libtirpc: multiple fixes

---
 ...rpcbynumber-and-getrpcbyname-if-those-are.patch |   85 ++
 .../libtirpc/files/0002-Misc-header-fixes.patch    |   40 +
 .../libtirpc/files/0003-fix_cdefs_h_include.patch  |  618 ++++++++++
 net-libs/libtirpc/files/0004-fix_DECLS.patch       | 1226 ++++++++++++++++++++
 .../libtirpc/files/0005-fix_remaining_issues.patch |   14 +
 .../libtirpc/files/0006-fix_queue_h_include.patch  |   44 +
 net-libs/libtirpc/files/0007-no-des.patch          |   29 +
 .../libtirpc/files/libtirpc-0.2.5-stdarg.patch     |   29 +
 net-libs/libtirpc/libtirpc-0.2.5-r99.ebuild        |   74 ++
 net-libs/libtirpc/metadata.xml                     |    5 +
 10 files changed, 2164 insertions(+)

diff --git 
a/net-libs/libtirpc/files/0001-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
 
b/net-libs/libtirpc/files/0001-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
new file mode 100644
index 0000000..3708638
--- /dev/null
+++ 
b/net-libs/libtirpc/files/0001-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
@@ -0,0 +1,85 @@
+From d3b5ffed6d7d49cc93b2343afcf0e4502a3e54ce Mon Sep 17 00:00:00 2001
+From: Natanael Copa <[email protected]>
+Date: Thu, 24 Apr 2014 09:19:45 +0200
+Subject: [PATCH 1/2] Provide getrpcbynumber and getrpcbyname if those are
+ missing
+
+We enable the config.h again and check fi getrpcbynumber and
+getrpcbyname exists on the building patform. If it does not exist, then
+provide those functions.
+
+This is needed for musl libc.
+---
+ configure.ac    |  6 ++++--
+ src/getrpcent.c | 10 ++++++++--
+ 2 files changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 10d17ea..0180801 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -24,14 +24,16 @@ if test "x$enable_ipv6" != xno; then
+ fi
+ 
+ AC_PROG_CC
+-m4_pattern_allow(AM_CONFIG_HEADERS(config.h))
++AC_CONFIG_HEADERS([config.h])
+ AC_PROG_LIBTOOL
+ AC_HEADER_DIRENT
+ AC_PREFIX_DEFAULT(/usr)
+ AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h limits.h locale.h netdb.h 
netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/param.h 
sys/socket.h sys/time.h syslog.h unistd.h])
+ AC_CHECK_LIB([pthread], [pthread_create])
+ AC_CHECK_LIB([nsl], [yp_get_default_domain])
+-
++AC_CHECK_FUNCS([getrpcbyname getrpcbynumber])
+ 
+ AC_CONFIG_FILES([Makefile src/Makefile man/Makefile doc/Makefile])
+ AC_OUTPUT(libtirpc.pc)
++
++
+diff --git a/src/getrpcent.c b/src/getrpcent.c
+index 1b54b6d..6da006a 100644
+--- a/src/getrpcent.c
++++ b/src/getrpcent.c
+@@ -50,6 +50,10 @@
+ #include <libc_private.h>
+ #endif
+ 
++#if HAVE_CONFIG_H
++#include "config.h"
++#endif
++
+ /*
+  * Internet version.
+  */
+@@ -89,7 +93,7 @@ _rpcdata()
+       return (d);
+ }
+ 
+-#ifdef GQ
++#if !HAVE_GETRPCBYNYMBER
+ struct rpcent *
+ getrpcbynumber(number)
+       int number;
+@@ -135,7 +139,9 @@ no_yp:
+       endrpcent();
+       return (p);
+ }
++#endif /* !HAVE_GETRPCBYNUMBER */
+ 
++#if !HAVE_GETRPCBYNAME
+ struct rpcent *
+ getrpcbyname(name)
+       const char *name;
+@@ -158,7 +164,7 @@ done:
+       endrpcent();
+       return (rpc);
+ }
+-#endif /* GQ */
++#endif /* !HAVE_GETRPCBYNAME */
+ 
+ void
+ setrpcent(f)
+-- 
+1.9.2
+

diff --git a/net-libs/libtirpc/files/0002-Misc-header-fixes.patch 
b/net-libs/libtirpc/files/0002-Misc-header-fixes.patch
new file mode 100644
index 0000000..9287d03
--- /dev/null
+++ b/net-libs/libtirpc/files/0002-Misc-header-fixes.patch
@@ -0,0 +1,40 @@
+From ed6dc31ed1092baf42f99278ef9c5c297805c3d0 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <[email protected]>
+Date: Thu, 24 Apr 2014 08:58:20 +0200
+Subject: [PATCH 2/2] Misc header fixes
+
+src/bindresvport.c: IPPORT_RESERVED needs netdb.h
+
+Misc fixes for building on musl libc
+---
+ src/bindresvport.c | 1 +
+ tirpc/netconfig.h  | 1 +
+ tirpc/rpc/rpcent.h | 2 +-
+ tirpc/rpc/types.h  | 1 +
+ 4 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/bindresvport.c b/src/bindresvport.c
+index d6d9c14..5a7a1a9 100644
+--- a/src/bindresvport.c
++++ b/src/bindresvport.c
+@@ -37,6 +37,7 @@
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ 
++#include <netdb.h>
+ #include <netinet/in.h>
+ 
+ #include <errno.h>
+diff --git a/tirpc/rpc/rpcent.h b/tirpc/rpc/rpcent.h
+index c865e51..a36cf91 100644
+--- a/tirpc/rpc/rpcent.h
++++ b/tirpc/rpc/rpcent.h
+@@ -47,7 +47,7 @@
+ __BEGIN_DECLS
+ 
+ /* These are defined in /usr/include/rpc/netdb.h */
+-#if 0
++#if !defined(__GLIBC__)
+ struct rpcent {
+       char    *r_name;        /* name of server for this rpc program */
+       char    **r_aliases;    /* alias list */

diff --git a/net-libs/libtirpc/files/0003-fix_cdefs_h_include.patch 
b/net-libs/libtirpc/files/0003-fix_cdefs_h_include.patch
new file mode 100644
index 0000000..4f09b70
--- /dev/null
+++ b/net-libs/libtirpc/files/0003-fix_cdefs_h_include.patch
@@ -0,0 +1,618 @@
+--- ./tirpc/rpc/xdr.h.orig     2014-11-28 09:09:44.902289976 +0000
++++ ./tirpc/rpc/xdr.h  2014-11-28 09:09:44.903289976 +0000
+@@ -40,7 +40,9 @@
+ 
+ #ifndef _TIRPC_XDR_H
+ #define _TIRPC_XDR_H
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ #include <stdio.h>
+ #include <netinet/in.h>
+ 
+--- ./tirpc/rpc/pmap_prot.h.orig       2014-11-28 09:09:44.901289976 +0000
++++ ./tirpc/rpc/pmap_prot.h    2014-11-28 09:09:44.902289976 +0000
+@@ -71,7 +71,9 @@
+ 
+ #ifndef _RPC_PMAP_PROT_H
+ #define _RPC_PMAP_PROT_H
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ #define PMAPPORT              ((u_short)111)
+ #define PMAPPROG              ((u_long)100000)
+--- ./tirpc/rpc/auth.h.orig    2014-11-28 09:09:44.896289976 +0000
++++ ./tirpc/rpc/auth.h 2014-11-28 09:09:44.897289976 +0000
+@@ -48,7 +48,9 @@
+ 
+ #include <rpc/xdr.h>
+ #include <rpc/clnt_stat.h>
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ #include <sys/socket.h>
+ #include <sys/types.h>
+ 
+--- ./tirpc/rpc/svc.h.orig     2014-11-28 09:09:44.904289976 +0000
++++ ./tirpc/rpc/svc.h  2014-11-28 09:09:44.905289976 +0000
+@@ -40,7 +40,9 @@
+ 
+ #ifndef _TIRPC_SVC_H
+ #define _TIRPC_SVC_H
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ /*
+  * This interface must manage two items concerning remote procedure calling:
+--- ./tirpc/rpc/svc_soc.h.orig 2014-11-28 09:09:44.906289976 +0000
++++ ./tirpc/rpc/svc_soc.h      2014-11-28 09:09:44.907289976 +0000
+@@ -38,7 +38,9 @@
+ 
+ #ifndef _RPC_SVC_SOC_H
+ #define _RPC_SVC_SOC_H
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ /* #pragma ident   "@(#)svc_soc.h  1.11    94/04/25 SMI" */
+ /*      svc_soc.h 1.8 89/05/01 SMI      */
+--- ./tirpc/rpc/clnt_soc.h.orig        2014-11-28 09:09:44.893289976 +0000
++++ ./tirpc/rpc/clnt_soc.h     2014-11-28 09:09:44.894289976 +0000
+@@ -46,7 +46,9 @@
+  * with TS-RPC.
+  */
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ #define UDPMSGSIZE      8800    /* rpc imposed limit on udp msg size */  
+ 
+--- ./tirpc/rpc/rpc_com.h.orig 2014-11-28 09:09:44.894289976 +0000
++++ ./tirpc/rpc/rpc_com.h      2014-11-28 09:09:44.894289976 +0000
+@@ -41,7 +41,9 @@
+ #ifndef _RPC_RPCCOM_H
+ #define       _RPC_RPCCOM_H
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ /* #pragma ident      "@(#)rpc_com.h  1.11    93/07/05 SMI" */
+ 
+--- ./tirpc/rpc/auth_unix.h.orig       2014-11-28 09:09:44.905289976 +0000
++++ ./tirpc/rpc/auth_unix.h    2014-11-28 09:09:44.906289976 +0000
+@@ -45,7 +45,9 @@
+ 
+ #ifndef _TIRPC_AUTH_UNIX_H
+ #define _TIRPC_AUTH_UNIX_H
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ /* The machine name is part of a credential; it may not exceed 255 bytes */
+ #define MAX_MACHINE_NAME 255
+--- ./tirpc/rpc/pmap_rmt.h.orig        2014-11-28 09:09:44.899289976 +0000
++++ ./tirpc/rpc/pmap_rmt.h     2014-11-28 09:09:44.900289976 +0000
+@@ -41,7 +41,9 @@
+ 
+ #ifndef _RPC_PMAP_RMT_H
+ #define _RPC_PMAP_RMT_H
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ struct rmtcallargs {
+       u_long prog, vers, proc, arglen;
+--- ./tirpc/rpc/des_crypt.h.orig       2014-11-28 09:09:44.900289976 +0000
++++ ./tirpc/rpc/des_crypt.h    2014-11-28 09:09:44.901289976 +0000
+@@ -43,7 +43,9 @@
+ #ifndef _DES_DES_CRYPT_H
+ #define _DES_DES_CRYPT_H
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ #include <rpc/rpc.h>
+ 
+ #define DES_MAXDATA 8192      /* max bytes encrypted in one call */
+--- ./tirpc/rpc/clnt.h.orig    2014-11-28 09:09:44.897289976 +0000
++++ ./tirpc/rpc/clnt.h 2014-11-28 09:09:44.899289976 +0000
+@@ -42,7 +42,9 @@
+ #include <rpc/clnt_stat.h>
+ #include <rpc/auth.h>
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ #include <netconfig.h>
+ #include <sys/un.h>
+ 
+--- ./tirpc/rpc/pmap_clnt.h.orig       2014-11-28 09:09:44.895289976 +0000
++++ ./tirpc/rpc/pmap_clnt.h    2014-11-28 09:09:44.895289976 +0000
+@@ -63,7 +63,9 @@
+ 
+ #ifndef _RPC_PMAP_CLNT_H_
+ #define _RPC_PMAP_CLNT_H_
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ __BEGIN_DECLS
+ extern bool_t         pmap_set(u_long, u_long, int, int);
+--- ./tirpc/rpcsvc/crypt.x.orig        2014-11-28 09:09:44.907289976 +0000
++++ ./tirpc/rpcsvc/crypt.x     2014-11-28 09:09:44.908289976 +0000
+@@ -31,7 +31,9 @@
+  */
+ 
+ #ifndef RPC_HDR
+-%#include <sys/cdefs.h>
++%#ifdef __GLIBC__
++%#include <sys/cdefs.h>
++%#endif
+ %__FBSDID("$FreeBSD: src/include/rpcsvc/crypt.x,v 1.5 2003/05/04 02:51:42 
obrien Exp $");
+ #endif
+ 
+--- ./src/auth_none.c.orig     2014-11-28 09:09:44.875289976 +0000
++++ ./src/auth_none.c  2014-11-28 09:09:44.876289976 +0000
+@@ -31,7 +31,9 @@
+ static char *sccsid = "@(#)auth_none.c 1.19 87/08/11 Copyr 1984 Sun Micro";
+ static char *sccsid = "@(#)auth_none.c        2.1 88/07/29 4.0 RPCSRC";
+ #endif
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ __FBSDID("$FreeBSD: src/lib/libc/rpc/auth_none.c,v 1.12 2002/03/22 23:18:35 
obrien Exp $");
+ */
+ 
+--- ./src/crypt_client.c.orig  2014-11-28 09:09:44.886289976 +0000
++++ ./src/crypt_client.c       2014-11-28 09:09:44.886289976 +0000
+@@ -30,7 +30,9 @@
+  * SUCH DAMAGE.
+  */
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ #include <err.h>
+ #include <sys/types.h>
+--- ./src/xdr_reference.c.orig 2014-11-28 09:09:44.858289976 +0000
++++ ./src/xdr_reference.c      2014-11-28 09:09:44.859289976 +0000
+@@ -26,8 +26,12 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ /*
+  * xdr_reference.c, Generic XDR routines impelmentation.
+--- ./src/auth_unix.c.orig     2014-11-28 09:09:44.863289976 +0000
++++ ./src/auth_unix.c  2014-11-28 09:09:44.864289976 +0000
+@@ -26,7 +26,9 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ /*
+  * auth_unix.c, Implements UNIX style authentication parameters.
+--- ./src/authdes_prot.c.orig  2014-11-28 09:09:44.868289976 +0000
++++ ./src/authdes_prot.c       2014-11-28 09:09:44.869289976 +0000
+@@ -1,4 +1,6 @@
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ /*
+  * Copyright (c) 2009, Sun Microsystems, Inc.
+  * All rights reserved.
+--- ./src/rpcb_st_xdr.c.orig   2014-11-28 09:09:44.847289976 +0000
++++ ./src/rpcb_st_xdr.c        2014-11-28 09:09:44.848289976 +0000
+@@ -35,7 +35,9 @@
+  * routines used with the rpcbind stats facility.
+  */
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ #include <rpc/rpc.h>
+ 
+--- ./src/auth_time.c.orig     2014-11-28 09:09:44.887289976 +0000
++++ ./src/auth_time.c  2014-11-28 09:09:44.888289976 +0000
+@@ -25,7 +25,9 @@
+  *    needed to deal with TCP connections.
+  */
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ #include <stdio.h>
+ #include <syslog.h>
+ #include <string.h>
+--- ./src/des_crypt.c.orig     2014-11-28 09:09:44.871289976 +0000
++++ ./src/des_crypt.c  2014-11-28 09:09:44.872289976 +0000
+@@ -39,7 +39,9 @@
+ static char sccsid[] = "@(#)des_crypt.c       2.2 88/08/10 4.0 RPCSRC; from 
1.13 88/02/08 SMI";
+ #endif
+ #endif
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ static int common_crypt( char *, char *, unsigned, unsigned, struct desparams 
* );
+ int (*__des_crypt_LOCAL)() = 0;
+--- ./src/svc_vc.c.orig        2014-11-28 09:09:44.878289976 +0000
++++ ./src/svc_vc.c     2014-11-28 09:09:44.879289976 +0000
+@@ -27,7 +27,9 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ /*
+  * svc_vc.c, Server side for Connection Oriented based RPC. 
+--- ./src/xdr_float.c.orig     2014-11-28 09:09:44.882289976 +0000
++++ ./src/xdr_float.c  2014-11-28 09:09:44.883289976 +0000
+@@ -27,7 +27,9 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ /*
+  * xdr_float.c, Generic XDR routines implementation.
+--- ./src/xdr_sizeof.c.orig    2014-11-28 09:09:44.865289976 +0000
++++ ./src/xdr_sizeof.c 2014-11-28 09:09:44.866289976 +0000
+@@ -34,7 +34,9 @@
+  * when serialized using XDR.
+  */
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ #include <rpc/types.h>
+ #include <rpc/xdr.h>
+--- ./src/xdr_array.c.orig     2014-11-28 09:09:44.892289976 +0000
++++ ./src/xdr_array.c  2014-11-28 09:09:44.893289976 +0000
+@@ -27,7 +27,9 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ /*
+  * xdr_array.c, Generic XDR routines impelmentation.
+--- ./src/rpc_generic.c.orig   2014-11-28 09:09:44.842289976 +0000
++++ ./src/rpc_generic.c        2014-11-28 09:09:44.844289976 +0000
+@@ -29,7 +29,9 @@
+  * Copyright (c) 1986-1991 by Sun Microsystems Inc. 
+  */
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ /*
+  * rpc_generic.c, Miscl routines for RPC.
+--- ./src/getpeereid.c.orig    2014-11-28 09:09:44.855289976 +0000
++++ ./src/getpeereid.c 2014-11-28 09:09:44.856289976 +0000
+@@ -24,7 +24,9 @@
+  * SUCH DAMAGE.
+  */
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ #include <sys/param.h>
+ #include <sys/socket.h>
+--- ./src/xdr_stdio.c.orig     2014-11-28 09:09:44.880289976 +0000
++++ ./src/xdr_stdio.c  2014-11-28 09:09:44.881289976 +0000
+@@ -26,7 +26,9 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ /*
+  * xdr_stdio.c, XDR implementation on standard i/o file.
+--- ./src/clnt_bcast.c.orig    2014-11-28 09:09:44.859289976 +0000
++++ ./src/clnt_bcast.c 2014-11-28 09:09:44.861289976 +0000
+@@ -28,7 +28,9 @@
+ /*
+  * Copyright (c) 1986-1991 by Sun Microsystems Inc. 
+  */
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ /*
+  * clnt_bcast.c
+--- ./src/xdr_mem.c.orig       2014-11-28 09:09:44.876289976 +0000
++++ ./src/xdr_mem.c    2014-11-28 09:09:44.877289976 +0000
+@@ -26,7 +26,9 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ /*
+  * xdr_mem.h, XDR implementation using memory buffers.
+--- ./src/key_call.c.orig      2014-11-28 09:09:44.889289976 +0000
++++ ./src/key_call.c   2014-11-28 09:09:44.890289976 +0000
+@@ -30,7 +30,9 @@
+  */
+ 
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ /*
+  * key_call.c, Interface to keyserver
+--- ./src/svc_simple.c.orig    2014-11-28 09:09:44.874289976 +0000
++++ ./src/svc_simple.c 2014-11-28 09:09:44.875289976 +0000
+@@ -29,7 +29,9 @@
+  * Copyright (c) 1986-1991 by Sun Microsystems Inc. 
+  */
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ /*
+  * svc_simple.c
+--- ./src/mt_misc.c.orig       2014-11-28 09:09:44.870289976 +0000
++++ ./src/mt_misc.c    2014-11-28 09:09:44.871289976 +0000
+@@ -1,5 +1,7 @@
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ #include <pthread.h>
+ #include <reentrant.h>
+ #include <rpc/rpc.h>
+--- ./src/authunix_prot.c.orig 2014-11-28 09:09:44.885289976 +0000
++++ ./src/authunix_prot.c      2014-11-28 09:09:44.885289976 +0000
+@@ -26,7 +26,9 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ /*
+  * authunix_prot.c
+--- ./src/des_soft.c.orig      2014-11-28 09:09:44.851289976 +0000
++++ ./src/des_soft.c   2014-11-28 09:09:44.851289976 +0000
+@@ -1,4 +1,6 @@
+-//#include <sys/cdefs.h>
++//#ifdef __GLIBC__
++#include <sys/cdefs.h>
++#endif
+ 
+ /*
+  * Copyright (c) 2009, Sun Microsystems, Inc.
+--- ./src/rpcdname.c.orig      2014-11-28 09:09:44.850289976 +0000
++++ ./src/rpcdname.c   2014-11-28 09:09:44.850289976 +0000
+@@ -25,7 +25,9 @@
+  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ /*
+  * rpcdname.c
+--- ./src/getnetpath.c.orig    2014-11-28 09:09:44.884289976 +0000
++++ ./src/getnetpath.c 2014-11-28 09:09:44.884289976 +0000
+@@ -25,13 +25,17 @@
+  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ /*
+  * Copyright (c) 1989 by Sun Microsystems, Inc.
+  */
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ #include <stdio.h>
+ #include <errno.h>
+ #include <netconfig.h>
+--- ./src/svc_dg.c.orig        2014-11-28 09:09:44.852289976 +0000
++++ ./src/svc_dg.c     2014-11-28 09:09:44.853289976 +0000
+@@ -31,7 +31,9 @@
+  * Copyright (c) 1986-1991 by Sun Microsystems Inc.
+  */
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ /*
+  * svc_dg.c, Server side for connectionless RPC.
+--- ./src/rpc_com.h.orig       2014-11-28 09:09:44.845289976 +0000
++++ ./src/rpc_com.h    2014-11-28 09:09:44.846289976 +0000
+@@ -40,7 +40,9 @@
+ #ifndef _TIRPC_RPCCOM_H
+ #define       _TIRPC_RPCCOM_H
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ /* #pragma ident      "@(#)rpc_com.h  1.11    93/07/05 SMI" */
+ 
+--- ./src/pmap_getmaps.c.orig  2014-11-28 09:09:44.891289976 +0000
++++ ./src/pmap_getmaps.c       2014-11-28 09:09:44.892289976 +0000
+@@ -26,7 +26,9 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ /*
+  * pmap_getmap.c
+--- ./src/pmap_clnt.c.orig     2014-11-28 09:09:44.869289976 +0000
++++ ./src/pmap_clnt.c  2014-11-28 09:09:44.870289976 +0000
+@@ -26,7 +26,9 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ /*
+  * pmap_clnt.c
+--- ./src/bindresvport.c.orig  2014-11-28 09:09:44.848289976 +0000
++++ ./src/bindresvport.c       2014-11-28 09:09:44.849289976 +0000
+@@ -26,7 +26,9 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ /*
+  * Copyright (c) 1987 by Sun Microsystems, Inc.
+--- ./src/xdr_rec.c.orig       2014-11-28 09:09:44.866289976 +0000
++++ ./src/xdr_rec.c    2014-11-28 09:09:44.868289976 +0000
+@@ -27,8 +27,12 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ /*
+  * xdr_rec.c, Implements TCP/IP based XDR streams with a "record marking"
+--- ./src/clnt_perror.c.orig   2014-11-28 09:09:44.854289976 +0000
++++ ./src/clnt_perror.c        2014-11-28 09:09:44.855289976 +0000
+@@ -27,7 +27,9 @@
+  */
+ 
+ /*
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ */
+ /*
+  * clnt_perror.c
+--- ./src/key_prot_xdr.c.orig  2014-11-28 09:09:44.888289976 +0000
++++ ./src/key_prot_xdr.c       2014-11-28 09:09:44.889289976 +0000
+@@ -33,7 +33,9 @@
+  */
+ /* Copyright (c)  1990, 1991 Sun Microsystems, Inc. */
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ /* 
+  * Compiled from key_prot.x using rpcgen.
+--- ./src/getnetconfig.c.orig  2014-11-28 09:09:44.856289976 +0000
++++ ./src/getnetconfig.c       2014-11-28 09:09:44.858289976 +0000
+@@ -32,7 +32,9 @@
+  
+ #include <pthread.h>
+ #include <reentrant.h>
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ #include <stdio.h>
+ #include <errno.h>
+ #include <netconfig.h>
+--- ./src/getpublickey.c.orig  2014-11-28 09:09:44.844289976 +0000
++++ ./src/getpublickey.c       2014-11-28 09:09:44.845289976 +0000
+@@ -26,7 +26,9 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ /*
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ */
+ 
+ /*
+--- ./src/clnt_simple.c.orig   2014-11-28 09:09:44.881289976 +0000
++++ ./src/clnt_simple.c        2014-11-28 09:09:44.882289976 +0000
+@@ -29,7 +29,9 @@
+  * Copyright (c) 1986-1991 by Sun Microsystems Inc. 
+  */
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ /*
+  * clnt_simple.c
+--- ./src/auth_des.c.orig      2014-11-28 09:09:44.872289976 +0000
++++ ./src/auth_des.c   2014-11-28 09:09:44.874289976 +0000
+@@ -38,7 +38,9 @@
+ #include <string.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ #include <rpc/des_crypt.h>
+ #include <syslog.h>
+ #include <rpc/types.h>
+@@ -52,7 +54,9 @@
+ 
+ #if defined(LIBC_SCCS) && !defined(lint)
+ #endif
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ #include "debug.h"
+ 
+--- ./src/xdr.c.orig   2014-11-28 09:09:44.861289976 +0000
++++ ./src/xdr.c        2014-11-28 09:09:44.863289976 +0000
+@@ -26,7 +26,9 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ 
+ /*
+  * xdr.c, Generic XDR routines implementation.

diff --git a/net-libs/libtirpc/files/0004-fix_DECLS.patch 
b/net-libs/libtirpc/files/0004-fix_DECLS.patch
new file mode 100644
index 0000000..86abf77
--- /dev/null
+++ b/net-libs/libtirpc/files/0004-fix_DECLS.patch
@@ -0,0 +1,1226 @@
+--- ./tirpc/rpc/xdr.h.orig     2014-11-28 09:16:53.990289976 +0000
++++ ./tirpc/rpc/xdr.h  2014-11-28 09:16:53.991289976 +0000
+@@ -289,7 +289,11 @@ struct xdr_discrim {
+ /*
+  * These are the "generic" xdr routines.
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern bool_t xdr_void(void);
+ extern bool_t xdr_int(XDR *, int *);
+ extern bool_t xdr_u_int(XDR *, u_int *);
+@@ -332,7 +336,11 @@ extern bool_t     xdr_hyper(XDR *, quad_t *)
+ extern bool_t xdr_u_hyper(XDR *, u_quad_t *);
+ extern bool_t xdr_longlong_t(XDR *, quad_t *);
+ extern bool_t xdr_u_longlong_t(XDR *, u_quad_t *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ /*
+  * Common opaque bytes objects used by many rpc protocols;
+@@ -350,7 +358,11 @@ extern bool_t   xdr_netobj(XDR *, struct
+  * These are the public routines for the various implementations of
+  * xdr streams.
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ /* XDR using memory buffers */
+ extern void   xdrmem_create(XDR *, char *, u_int, enum xdr_op);
+ 
+@@ -371,6 +383,10 @@ extern bool_t xdrrec_skiprecord(XDR *);
+ /* true if no more input */
+ extern bool_t xdrrec_eof(XDR *);
+ extern u_int xdrrec_readbytes(XDR *, caddr_t, u_int);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ #endif /* !_TIRPC_XDR_H */
+--- ./tirpc/rpc/auth_des.h.orig        2014-11-28 09:16:53.994289976 +0000
++++ ./tirpc/rpc/auth_des.h     2014-11-28 09:16:53.995289976 +0000
+@@ -114,17 +114,33 @@ struct authdes_verf {
+  * Map a des credential into a unix cred.
+  *
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern int authdes_getucred( struct authdes_cred *, uid_t *, gid_t *, int *, 
gid_t * );
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern bool_t xdr_authdes_cred(XDR *, struct authdes_cred *);
+ extern bool_t xdr_authdes_verf(XDR *, struct authdes_verf *);
+ extern int    rtime(dev_t, struct netbuf *, int, struct timeval *,
+                   struct timeval *);
+ extern void   kgetnetname(char *);
+ extern enum auth_stat _svcauth_des(struct svc_req *, struct rpc_msg *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ #endif /* ndef _TI_AUTH_DES_ */
+--- ./tirpc/rpc/pmap_prot.h.orig       2014-11-28 09:16:53.988289976 +0000
++++ ./tirpc/rpc/pmap_prot.h    2014-11-28 09:16:53.989289976 +0000
+@@ -99,10 +99,18 @@ struct pmaplist {
+       struct pmaplist *pml_next;
+ };
+ 
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern bool_t xdr_pmap(XDR *, struct pmap *);
+ extern bool_t xdr_pmaplist(XDR *, struct pmaplist **);
+ extern bool_t xdr_pmaplist_ptr(XDR *, struct pmaplist *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ #endif /* !_RPC_PMAP_PROT_H */
+--- ./tirpc/rpc/auth.h.orig    2014-11-28 09:16:53.982289976 +0000
++++ ./tirpc/rpc/auth.h 2014-11-28 09:16:53.983289976 +0000
+@@ -166,9 +166,17 @@ union des_block {
+       char c[8];
+ };
+ typedef union des_block des_block;
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern bool_t xdr_des_block(XDR *, des_block *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ /*
+  * Authentication info.  Opaque to client.
+@@ -279,9 +287,17 @@ auth_put(AUTH *auth)
+               xfunc, xwhere))
+ 
+ 
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern struct opaque_auth _null_auth;
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ /*
+  * Any style authentication.  These routines can be used by any
+@@ -302,11 +318,19 @@ int authany_wrap(void), authany_unwrap(v
+  *    int len;
+  *    int *aup_gids;
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern AUTH *authunix_create(char *, uid_t, uid_t, int, uid_t *);
+ extern AUTH *authunix_create_default(void);   /* takes no parameters */
+ extern AUTH *authnone_create(void);           /* takes no parameters */
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ /*
+  * DES style authentication
+  * AUTH *authsecdes_create(servername, window, timehost, ckey)
+@@ -315,15 +339,31 @@ __END_DECLS
+  *    const char *timehost;                   - optional hostname to sync with
+  *    des_block *ckey;                - optional conversation key to use
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern AUTH *authdes_create (char *, u_int, struct sockaddr *, des_block *);
+ extern AUTH *authdes_seccreate (const char *, const u_int, const  char *,
+     const  des_block *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern bool_t xdr_opaque_auth         (XDR *, struct opaque_auth *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ #define authsys_create(c,i1,i2,i3,ip) authunix_create((c),(i1),(i2),(i3),(ip))
+ #define authsys_create_default() authunix_create_default()
+@@ -331,36 +371,60 @@ __END_DECLS
+ /*
+  * Netname manipulation routines.
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern int getnetname(char *);
+ extern int host2netname(char *, const char *, const char *);
+ extern int user2netname(char *, const uid_t, const char *);
+ extern int netname2user(char *, uid_t *, gid_t *, int *, gid_t *);
+ extern int netname2host(char *, char *, const int);
+ extern void passwd2des ( char *, char * );
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ /*
+  *
+  * These routines interface to the keyserv daemon
+  *
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern int key_decryptsession(const char *, des_block *);
+ extern int key_encryptsession(const char *, des_block *);
+ extern int key_gendes(des_block *);
+ extern int key_setsecret(const char *);
+ extern int key_secretkey_is_set(void);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ /*
+  * Publickey routines.
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern int getpublickey (const char *, char *);
+ extern int getpublicandprivatekey (char *, char *);
+ extern int getsecretkey (char *, char *, char *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ #ifdef KERBEROS
+ /*
+@@ -373,10 +437,18 @@ __END_DECLS
+  *    const char *timehost;                   - optional hostname to sync with
+  *    int *status;                            - kerberos status returned
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern AUTH   *authkerb_seccreate(const char *, const char *, const  char *,
+                   const u_int, const char *, int *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ /*
+  * Map a kerberos credential into a unix cred.
+@@ -389,20 +461,36 @@ __END_DECLS
+  *    int *groups;
+  *
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern int    authkerb_getucred(/* struct svc_req *, uid_t *, gid_t *,
+                   short *, int * */);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ #endif /* KERBEROS */
+ 
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ struct svc_req;
+ struct rpc_msg;
+ enum auth_stat _svcauth_none (struct svc_req *, struct rpc_msg *);
+ enum auth_stat _svcauth_short (struct svc_req *, struct rpc_msg *);
+ enum auth_stat _svcauth_unix (struct svc_req *, struct rpc_msg *);
+ enum auth_stat _svcauth_gss (struct svc_req *, struct rpc_msg *, bool_t *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ #define AUTH_NONE     0               /* no authentication */
+ #define       AUTH_NULL       0               /* backward compatibility */
+--- ./tirpc/rpc/svc.h.orig     2014-11-28 09:16:53.992289976 +0000
++++ ./tirpc/rpc/svc.h  2014-11-28 09:16:53.993289976 +0000
+@@ -202,11 +202,19 @@ struct svc_req {
+  *    const struct netconfig *nconf;
+  */
+ 
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern bool_t svc_reg(SVCXPRT *, const rpcprog_t, const rpcvers_t,
+                       void (*)(struct svc_req *, SVCXPRT *),
+                       const struct netconfig *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ /*
+  * Service un-registration
+@@ -216,9 +224,17 @@ __END_DECLS
+  *    const rpcvers_t vers;
+  */
+ 
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern void   svc_unreg(const rpcprog_t, const rpcvers_t);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ /*
+  * Transport registration.
+@@ -226,9 +242,17 @@ __END_DECLS
+  * xprt_register(xprt)
+  *    SVCXPRT *xprt;
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern void   xprt_register(SVCXPRT *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ /*
+  * Transport un-register
+@@ -236,9 +260,17 @@ __END_DECLS
+  * xprt_unregister(xprt)
+  *    SVCXPRT *xprt;
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern void   xprt_unregister(SVCXPRT *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ 
+ /*
+@@ -267,7 +299,11 @@ __END_DECLS
+  * deadlock the caller and server processes!
+  */
+ 
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern bool_t svc_sendreply(SVCXPRT *, xdrproc_t, void *);
+ extern void   svcerr_decode(SVCXPRT *);
+ extern void   svcerr_weakauth(SVCXPRT *);
+@@ -279,7 +315,11 @@ extern void       svcerr_systemerr(SVCXPRT *);
+ extern int    rpc_reg(rpcprog_t, rpcvers_t, rpcproc_t,
+                       char *(*)(char *), xdrproc_t, xdrproc_t,
+                       char *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ /*
+  * Lowest level dispatching -OR- who owns this process anyway.
+@@ -308,11 +348,23 @@ extern int svc_fds;
+  * a small program implemented by the svc_rpc implementation itself;
+  * also see clnt.h for protocol numbers.
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern void rpctest_service(void);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern void   svc_getreq(int);
+ extern void   svc_getreqset(fd_set *);
+ extern void   svc_getreq_common(int);
+@@ -321,7 +373,11 @@ extern void       svc_getreq_poll(struct pollf
+ 
+ extern void   svc_run(void);
+ extern void   svc_exit(void);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ /*
+  * Socket to use on svcxxx_create call to get default socket
+@@ -333,7 +389,11 @@ __END_DECLS
+  * These are the existing service side transport implementations
+  */
+ 
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ /*
+  * Transport independent svc_create routine.
+  */
+@@ -429,7 +489,11 @@ int svc_dg_enablecache(SVCXPRT *, const
+ 
+ int __rpc_get_local_uid(SVCXPRT *_transp, uid_t *_uid);
+ 
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ 
+ /* for backward compatibility */
+--- ./tirpc/rpc/rpc.h.orig     2014-11-28 09:16:53.994289976 +0000
++++ ./tirpc/rpc/rpc.h  2014-11-28 09:16:53.994289976 +0000
+@@ -79,7 +79,11 @@
+ #define UDPMSGSIZE 8800
+ #endif
+ 
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern int get_myaddress(struct sockaddr_in *);
+ extern int bindresvport(int, struct sockaddr_in *) __THROW;
+ extern int registerrpc(int, int, int, char *(*)(char [UDPMSGSIZE]),
+@@ -93,18 +97,30 @@ struct netbuf *uaddr2taddr(const struct
+ 
+ struct sockaddr;
+ extern int bindresvport_sa(int, struct sockaddr *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ /*
+  * The following are not exported interfaces, they are for internal library
+  * and rpcbind use only. Do not use, they may change without notice.
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ int __rpc_nconf2fd(const struct netconfig *);
+ int __rpc_nconf2fd_flags(const struct netconfig *, int);
+ int __rpc_nconf2sockinfo(const struct netconfig *, struct __rpc_sockinfo *);
+ int __rpc_fd2sockinfo(int, struct __rpc_sockinfo *);
+ u_int __rpc_get_t_size(int, int, int);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ #endif /* !_RPC_RPC_H */
+--- ./tirpc/rpc/svc_soc.h.orig 2014-11-28 09:16:53.998289976 +0000
++++ ./tirpc/rpc/svc_soc.h      2014-11-28 09:16:53.999289976 +0000
+@@ -66,10 +66,18 @@
+  *    void (*dispatch)();
+  *    int protocol;    like TCP or UDP, zero means do not register 
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern bool_t svc_register(SVCXPRT *, u_long, u_long,
+                   void (*)(struct svc_req *, SVCXPRT *), int);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ /*
+  * Service un-registration
+@@ -78,44 +86,84 @@ __END_DECLS
+  *    u_long prog;
+  *    u_long vers;
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern void   svc_unregister(u_long, u_long);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ 
+ /*
+  * Memory based rpc for testing and timing.
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern SVCXPRT *svcraw_create(void);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ 
+ /*
+  * Udp based rpc.
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern SVCXPRT *svcudp_create(int);
+ extern SVCXPRT *svcudp_bufcreate(int, u_int, u_int);
+ extern int svcudp_enablecache(SVCXPRT *, u_long);
+ extern SVCXPRT *svcudp6_create(int);
+ extern SVCXPRT *svcudp6_bufcreate(int, u_int, u_int);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ 
+ /*
+  * Tcp based rpc.
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern SVCXPRT *svctcp_create(int, u_int, u_int);
+ extern SVCXPRT *svctcp6_create(int, u_int, u_int);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ /*
+  * Fd based rpc.
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern SVCXPRT *svcfd_create(int, u_int, u_int);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ #endif /* !_RPC_SVC_SOC_H */
+--- ./tirpc/rpc/clnt_soc.h.orig        2014-11-28 09:16:53.976289976 +0000
++++ ./tirpc/rpc/clnt_soc.h     2014-11-28 09:16:53.977289976 +0000
+@@ -63,27 +63,51 @@
+  *    u_int sendsz;
+  *    u_int recvsz;
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern CLIENT *clnttcp_create(struct sockaddr_in *, u_long, u_long, int *,
+                             u_int, u_int);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ /*
+  * Raw (memory) rpc.
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern CLIENT *clntraw_create(u_long, u_long);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ 
+ /*
+ IPv6 socket version 
+ */
+ #ifdef INET6
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern CLIENT *clnttcp6_create(struct sockaddr_in6 *, u_long, u_long, int *,
+                             u_int, u_int);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ #endif
+ 
+ /*
+@@ -107,7 +131,11 @@ __END_DECLS
+  *    u_int sendsz;
+  *    u_int recvsz;
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern CLIENT *clntudp_create(struct sockaddr_in *, u_long, u_long, 
+                             struct timeval, int *);
+ extern CLIENT *clntudp_bufcreate(struct sockaddr_in *, u_long, u_long,
+@@ -118,7 +146,11 @@ extern CLIENT *clntudp6_create(struct so
+ extern CLIENT *clntudp6_bufcreate(struct sockaddr_in6 *, u_long, u_long,
+                                struct timeval, int *, u_int, u_int);
+ #endif
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ 
+ #endif /* _RPC_CLNT_SOC_H */
+--- ./tirpc/rpc/rpc_com.h.orig 2014-11-28 09:16:53.977289976 +0000
++++ ./tirpc/rpc/rpc_com.h      2014-11-28 09:16:53.978289976 +0000
+@@ -57,7 +57,11 @@
+ #define __RPC_GETXID(now) ((u_int32_t)getpid() ^ (u_int32_t)(now)->tv_sec ^ \
+     (u_int32_t)(now)->tv_usec)
+ 
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern u_int __rpc_get_a_size(int);
+ extern int __rpc_dtbsize(void);
+ extern int _rpc_dtablesize(void);
+@@ -79,6 +83,10 @@ bool_t rpc_control(int,void *);
+ 
+ char *_get_next_token(char *, int);
+ 
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ #endif /* _RPC_RPCCOM_H */
+--- ./tirpc/rpc/auth_unix.h.orig       2014-11-28 09:16:53.998289976 +0000
++++ ./tirpc/rpc/auth_unix.h    2014-11-28 09:16:53.998289976 +0000
+@@ -69,9 +69,17 @@ struct authunix_parms {
+ 
+ #define authsys_parms authunix_parms
+ 
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern bool_t xdr_authunix_parms(XDR *, struct authunix_parms *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ /*
+  * If a response verifier has flavor AUTH_SHORT,
+--- ./tirpc/rpc/pmap_rmt.h.orig        2014-11-28 09:16:53.986289976 +0000
++++ ./tirpc/rpc/pmap_rmt.h     2014-11-28 09:16:53.986289976 +0000
+@@ -58,9 +58,17 @@ struct rmtcallres {
+       xdrproc_t xdr_results;
+ };
+ 
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern bool_t xdr_rmtcall_args(XDR *, struct rmtcallargs *);
+ extern bool_t xdr_rmtcallres(XDR *, struct rmtcallres *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ #endif /* !_RPC_PMAP_RMT_H */
+--- ./tirpc/rpc/des_crypt.h.orig       2014-11-28 09:16:53.987289976 +0000
++++ ./tirpc/rpc/des_crypt.h    2014-11-28 09:16:53.988289976 +0000
+@@ -85,23 +85,47 @@
+ /*
+  * Cipher Block Chaining mode
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ int cbc_crypt( char *, char *, unsigned int, unsigned int, char *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ /*
+  * Electronic Code Book mode
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ int ecb_crypt( char *, char *, unsigned int, unsigned int );
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ /* 
+  * Set des parity for a key.
+  * DES parity is odd and in the low bit of each byte
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ void des_setparity( char *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ #endif  /* _DES_DES_CRYPT_H */
+--- ./tirpc/rpc/rpcb_clnt.h.orig       2014-11-28 09:16:53.979289976 +0000
++++ ./tirpc/rpc/rpcb_clnt.h    2014-11-28 09:16:53.979289976 +0000
+@@ -59,7 +59,11 @@
+ 
+ #include <rpc/types.h>
+ #include <rpc/rpcb_prot.h>
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern bool_t rpcb_set(const rpcprog_t, const rpcvers_t,
+                      const struct netconfig  *, const struct netbuf *);
+ extern bool_t rpcb_unset(const rpcprog_t, const rpcvers_t,
+@@ -78,6 +82,10 @@ extern bool_t rpcb_getaddr(const rpcprog
+ extern bool_t rpcb_gettime(const char *, time_t *);
+ extern char *rpcb_taddr2uaddr(struct netconfig *, struct netbuf *);
+ extern struct netbuf *rpcb_uaddr2taddr(struct netconfig *, char *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ #endif        /* !_RPC_RPCB_CLNT_H */
+--- ./tirpc/rpc/clnt.h.orig    2014-11-28 09:16:53.984289976 +0000
++++ ./tirpc/rpc/clnt.h 2014-11-28 09:16:53.985289976 +0000
+@@ -269,7 +269,11 @@ struct rpc_timers {
+  * Generic client creation routine. Supported protocols are those that
+  * belong to the nettype namespace (/etc/netconfig).
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern CLIENT *clnt_create(const char *, const rpcprog_t, const rpcvers_t,
+                          const char *);
+ /*
+@@ -416,32 +420,60 @@ extern CLIENT *clnt_dg_create(const int,
+  */
+ extern CLIENT *clnt_raw_create(rpcprog_t, rpcvers_t);
+ 
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ 
+ /*
+  * Print why creation failed
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern void clnt_pcreateerror(const char *);                  /* stderr */
+ extern char *clnt_spcreateerror(const char *);                        /* 
string */
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ /*
+  * Like clnt_perror(), but is more verbose in its output
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern void clnt_perrno(enum clnt_stat);              /* stderr */
+ extern char *clnt_sperrno(enum clnt_stat);            /* string */
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ /*
+  * Print an English error message, given the client error code
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern void clnt_perror(CLIENT *, const char *);              /* stderr */
+ extern char *clnt_sperror(CLIENT *, const char *);            /* string */
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ 
+ /*
+@@ -452,9 +484,17 @@ struct rpc_createerr {
+       struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */
+ };
+ 
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern struct rpc_createerr   *__rpc_createerr(void);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ #define get_rpc_createerr()   (*(__rpc_createerr()))
+ #define rpc_createerr         (*(__rpc_createerr()))
+ 
+@@ -471,12 +511,20 @@ __END_DECLS
+  *    char *out;
+  *    const char *nettype;
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern enum clnt_stat rpc_call(const char *, const rpcprog_t,
+                              const rpcvers_t, const rpcproc_t,
+                              const xdrproc_t, const char *,
+                              const xdrproc_t, char *, const char *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ /*
+  * RPC broadcast interface
+@@ -524,7 +572,11 @@ __END_DECLS
+ 
+ typedef bool_t (*resultproc_t)(caddr_t, ...);
+ 
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern enum clnt_stat rpc_broadcast(const rpcprog_t, const rpcvers_t,
+                                   const rpcproc_t, const xdrproc_t,
+                                   caddr_t, const xdrproc_t, caddr_t,
+@@ -534,7 +586,11 @@ extern enum clnt_stat rpc_broadcast_exp(
+                                       caddr_t, const xdrproc_t, caddr_t,
+                                       const resultproc_t, const int,
+                                       const int, const char *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ /* For backward compatibility */
+ #include <rpc/clnt_soc.h>
+--- ./tirpc/rpc/rpcent.h.orig  2014-11-28 09:16:53.996289976 +0000
++++ ./tirpc/rpc/rpcent.h       2014-11-28 09:16:53.996289976 +0000
+@@ -44,7 +44,11 @@
+ /*    #pragma ident "@(#)rpcent.h   1.13    94/04/25 SMI"     */
+ /*      @(#)rpcent.h 1.1 88/12/06 SMI   */
+ 
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ 
+ /* These are defined in /usr/include/rpc/netdb.h */
+ #if 0
+@@ -62,6 +66,10 @@ extern struct rpcent *getrpcent(void);
+ 
+ extern void setrpcent(int) __THROW;
+ extern void endrpcent(void) __THROW;
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ #endif /* !_RPC_CENT_H */
+--- ./tirpc/rpc/pmap_clnt.h.orig       2014-11-28 09:16:53.980289976 +0000
++++ ./tirpc/rpc/pmap_clnt.h    2014-11-28 09:16:53.980289976 +0000
+@@ -67,7 +67,11 @@
+ #include <sys/cdefs.h>
+ #endif
+ 
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern bool_t         pmap_set(u_long, u_long, int, int);
+ extern bool_t         pmap_unset(u_long, u_long);
+ extern struct pmaplist        *pmap_getmaps(struct sockaddr_in *);
+@@ -82,6 +86,10 @@ extern enum clnt_stat       clnt_broadcast(u_l
+                                      resultproc_t);
+ extern u_short                pmap_getport(struct sockaddr_in *,
+                                    u_long, u_long, u_int);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ #endif /* !_RPC_PMAP_CLNT_H_ */
+--- ./tirpc/rpc/auth_gss.h.orig        2014-11-28 09:16:53.989289976 +0000
++++ ./tirpc/rpc/auth_gss.h     2014-11-28 09:16:53.990289976 +0000
+@@ -104,7 +104,11 @@ struct rpc_gss_init_res {
+ #define MAXSEQ                0x80000000
+ 
+ /* Prototypes. */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ bool_t        xdr_rpc_gss_cred        __P((XDR *xdrs, struct rpc_gss_cred 
*p));
+ bool_t        xdr_rpc_gss_init_args   __P((XDR *xdrs, gss_buffer_desc *p));
+ bool_t        xdr_rpc_gss_init_res    __P((XDR *xdrs, struct rpc_gss_init_res 
*p));
+@@ -126,6 +130,10 @@ void      gss_log_status          __P((char *m, OM_ui
+                                    OM_uint32 minor));
+ void  gss_log_hexdump         __P((const u_char *buf, int len, int offset));
+ 
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ #endif /* !_TIRPC_AUTH_GSS_H */
+--- ./tirpc/rpc/rpc_msg.h.orig 2014-11-28 09:16:53.996289976 +0000
++++ ./tirpc/rpc/rpc_msg.h      2014-11-28 09:16:53.997289976 +0000
+@@ -161,7 +161,11 @@ struct rpc_msg {
+ #define       acpted_rply     ru.RM_rmb.ru.RP_ar
+ #define       rjcted_rply     ru.RM_rmb.ru.RP_dr
+ 
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ /*
+  * XDR routine to handle a rpc message.
+  * xdr_callmsg(xdrs, cmsg)
+@@ -210,6 +214,10 @@ extern bool_t     xdr_rejected_reply(XDR *,
+  *    struct rpc_err *error;
+  */
+ extern void   _seterr_reply(struct rpc_msg *, struct rpc_err *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ #endif /* !_TIRPC_RPC_MSG_H */
+--- ./tirpc/rpc/nettype.h.orig 2014-11-28 09:16:53.981289976 +0000
++++ ./tirpc/rpc/nettype.h      2014-11-28 09:16:53.982289976 +0000
+@@ -53,11 +53,19 @@
+ #define       _RPC_TCP        7
+ #define       _RPC_UDP        8
+ 
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern void *__rpc_setconf(const char *);
+ extern void __rpc_endconf(void *);
+ extern struct netconfig *__rpc_getconf(void *);
+ extern struct netconfig *__rpc_getconfip(const char *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ #endif        /* !_TIRPC_NETTYPE_H */
+--- ./tirpc/rpc/svc_auth.h.orig        2014-11-28 09:16:53.986289976 +0000
++++ ./tirpc/rpc/svc_auth.h     2014-11-28 09:16:53.987289976 +0000
+@@ -65,13 +65,21 @@ typedef struct SVCAUTH {
+ /*
+  * Server side authenticator
+  */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern enum auth_stat _gss_authenticate(struct svc_req *, struct rpc_msg *,
+               bool_t *);
+ extern enum auth_stat _authenticate(struct svc_req *, struct rpc_msg *);
+ extern int svc_auth_reg(int, enum auth_stat (*)(struct svc_req *,
+                         struct rpc_msg *));
+ 
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ #endif /* !_RPC_SVC_AUTH_H */
+--- ./tirpc/rpcsvc/nis.h.orig  2014-11-28 09:16:54.001289976 +0000
++++ ./tirpc/rpcsvc/nis.h       2014-11-28 09:16:54.002289976 +0000
+@@ -36,7 +36,11 @@
+ #include <rpc/rpc.h>
+ #include <rpcsvc/nis_tags.h>
+ 
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ 
+ /*
+  *    nis.h
+@@ -611,6 +615,10 @@ extern  nis_error * nis_rmdir_3_svc (nis
+ extern  nis_error * nis_updkeys_3 (nis_name *, CLIENT *) __THROW;
+ extern  nis_error * nis_updkeys_3_svc (nis_name *, struct svc_req *) __THROW;
+ 
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ #endif /* ! _RPCSVC_NIS_H */
+--- ./tirpc/rpcsvc/nislib.h.orig       2014-11-28 09:16:53.999289976 +0000
++++ ./tirpc/rpcsvc/nislib.h    2014-11-28 09:16:54.000289976 +0000
+@@ -23,7 +23,11 @@
+ 
+ #include <features.h>
+ 
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ 
+ typedef const char *const_nis_name;
+ 
+@@ -283,6 +287,10 @@ extern nis_error __nisfind_server (const
+ 
+ #endif
+ 
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ #endif        /* __RPCSVC_NISLIB_H__ */
+--- ./tirpc/netconfig.h.orig   2014-11-28 09:16:54.003289976 +0000
++++ ./tirpc/netconfig.h        2014-11-28 09:16:54.003289976 +0000
+@@ -74,7 +74,11 @@ typedef struct {
+ #define NC_UDP                "udp"
+ #define NC_ICMP               "icmp"
+ 
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ 
+ extern void *setnetconfig (void);
+ extern struct netconfig *getnetconfig (void *);
+@@ -89,6 +93,10 @@ extern int endnetpath (void *);
+ extern void nc_perror (const char *);
+ extern char *nc_sperror (void);
+ 
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ #endif /* _NETCONFIG_H_ */
+--- ./src/rpc_com.h.orig       2014-11-28 09:16:53.975289976 +0000
++++ ./src/rpc_com.h    2014-11-28 09:16:53.975289976 +0000
+@@ -56,7 +56,11 @@
+ #define __RPC_GETXID(now) ((u_int32_t)getpid() ^ (u_int32_t)(now)->tv_sec ^ \
+     (u_int32_t)(now)->tv_usec)
+ 
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern u_int __rpc_get_a_size(int);
+ extern int __rpc_dtbsize(void);
+ extern struct netconfig * __rpcgettp(int);
+@@ -92,6 +96,10 @@ void __xprt_set_raddr(SVCXPRT *, const s
+ SVCXPRT **__svc_xports;
+ int __svc_maxrec;
+ 
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ 
+ #endif /* _TIRPC_RPCCOM_H */

diff --git a/net-libs/libtirpc/files/0005-fix_remaining_issues.patch 
b/net-libs/libtirpc/files/0005-fix_remaining_issues.patch
new file mode 100644
index 0000000..538e79e
--- /dev/null
+++ b/net-libs/libtirpc/files/0005-fix_remaining_issues.patch
@@ -0,0 +1,14 @@
+--- ./tirpc/rpc/rpcent.h       2014-11-21 21:33:50.421928818 +0000
++++ ./tirpc/rpc/rpcent.h       2014-11-21 21:35:05.140928818 +0000
+@@ -64,6 +64,10 @@ extern struct rpcent *getrpcbynumber(int
+ extern struct rpcent *getrpcent(void);
+ #endif
+ 
++#ifndef __GLIBC__
++#define __THROW
++#endif
++
+ extern void setrpcent(int) __THROW;
+ extern void endrpcent(void) __THROW;
+ #ifdef __GLIBC__
+ 

diff --git a/net-libs/libtirpc/files/0006-fix_queue_h_include.patch 
b/net-libs/libtirpc/files/0006-fix_queue_h_include.patch
new file mode 100644
index 0000000..9db410c
--- /dev/null
+++ b/net-libs/libtirpc/files/0006-fix_queue_h_include.patch
@@ -0,0 +1,44 @@
+--- src/clnt_bcast.c.orig      2014-11-28 09:31:22.462289976 +0000
++++ src/clnt_bcast.c   2014-11-28 09:34:06.588289976 +0000
+@@ -43,8 +43,41 @@
+  */
+ #include <sys/socket.h>
+ #include <sys/types.h>
++#ifdef __GLIBC__
+ #include <sys/queue.h>
++#else
++/*
++ *  * Tail queue definitions.
++ *   */
++#define _TAILQ_HEAD(name, type, qual)                                   \
++struct name {                                                           \
++       qual type *tqh_first;           /* first element */             \
++       qual type *qual *tqh_last;      /* addr of last next element */ \
++}
++#define TAILQ_HEAD(name, type)  _TAILQ_HEAD(name, struct type,)
+ 
++#define _TAILQ_ENTRY(type, qual)                                        \
++struct {                                                                \
++       qual type *tqe_next;            /* next element */              \
++       qual type *qual *tqe_prev;      /* address of previous next element */\
++}
++#define TAILQ_ENTRY(type)       _TAILQ_ENTRY(struct type,)
++/*
++ *  * Tail queue functions.
++ *   */
++#define TAILQ_INIT(head) do {                                           \
++       (head)->tqh_first = NULL;                                       \
++       (head)->tqh_last = &(head)->tqh_first;                          \
++} while (/*CONSTCOND*/0)
++
++#define TAILQ_INSERT_TAIL(head, elm, field) do {                        \
++       (elm)->field.tqe_next = NULL;                                   \
++       (elm)->field.tqe_prev = (head)->tqh_last;                       \
++       *(head)->tqh_last = (elm);                                      \
++       (head)->tqh_last = &(elm)->field.tqe_next;                      \
++} while (/*CONSTCOND*/0)
++
++#endif
+ #include <net/if.h>
+ #include <netinet/in.h>
+ #include <ifaddrs.h>

diff --git a/net-libs/libtirpc/files/0007-no-des.patch 
b/net-libs/libtirpc/files/0007-no-des.patch
new file mode 100644
index 0000000..4347261
--- /dev/null
+++ b/net-libs/libtirpc/files/0007-no-des.patch
@@ -0,0 +1,29 @@
+--- libtirpc-0.2.5.orig/src/Makefile.am
++++ libtirpc-0.2.5/src/Makefile.am
+@@ -51,7 +51,7 @@
+         rpc_callmsg.c rpc_generic.c rpc_soc.c rpcb_clnt.c rpcb_prot.c \
+         rpcb_st_xdr.c svc.c svc_auth.c svc_dg.c svc_auth_unix.c 
svc_auth_none.c \
+         svc_generic.c svc_raw.c svc_run.c svc_simple.c svc_vc.c getpeereid.c \
+-        auth_time.c auth_des.c authdes_prot.c debug.c
++        auth_time.c debug.c
+ 
+ ## XDR
+ libtirpc_la_SOURCES += xdr.c xdr_rec.c xdr_array.c xdr_float.c xdr_mem.c 
xdr_reference.c xdr_stdio.c
+--- libtirpc-0.2.5.orig/src/rpc_soc.c
++++ libtirpc-0.2.5/src/rpc_soc.c
+@@ -520,6 +520,7 @@
+           (resultproc_t) rpc_wrap_bcast, "udp");
+ }
+ 
++#if 0
+ /*
+  * Create the client des authentication object. Obsoleted by
+  * authdes_seccreate().
+@@ -551,6 +552,7 @@
+       dummy = authdes_seccreate(servername, window, NULL, ckey);
+       return (dummy);
+ }
++#endif
+ 
+ /*
+  * Create a client handle for a unix connection. Obsoleted by clnt_vc_create()

diff --git a/net-libs/libtirpc/files/libtirpc-0.2.5-stdarg.patch 
b/net-libs/libtirpc/files/libtirpc-0.2.5-stdarg.patch
new file mode 100644
index 0000000..8006de3
--- /dev/null
+++ b/net-libs/libtirpc/files/libtirpc-0.2.5-stdarg.patch
@@ -0,0 +1,29 @@
+From d26607bade0893fe8652e1a0983f9fae59c64649 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <[email protected]>
+Date: Tue, 12 Aug 2014 03:11:41 -0400
+Subject: [PATCH libtirpc] include stdarg.h when used
+
+The debug.h header uses va_list but doesn't include stdarg.h which
+can lead to random build failures.
+
+Signed-off-by: Mike Frysinger <[email protected]>
+---
+ src/debug.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/debug.h b/src/debug.h
+index afc8d57..c971ac3 100644
+--- a/src/debug.h
++++ b/src/debug.h
+@@ -21,6 +21,8 @@
+ 
+ #ifndef _DEBUG_H
+ #define _DEBUG_H
++
++#include <stdarg.h>
+ #include <syslog.h>
+ 
+ extern int libtirpc_debug_level;
+-- 
+2.0.0
+

diff --git a/net-libs/libtirpc/libtirpc-0.2.5-r99.ebuild 
b/net-libs/libtirpc/libtirpc-0.2.5-r99.ebuild
new file mode 100644
index 0000000..74341b7
--- /dev/null
+++ b/net-libs/libtirpc/libtirpc-0.2.5-r99.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-libs/libtirpc/libtirpc-0.2.5.ebuild,v 
1.4 2014/12/30 18:09:41 maekke Exp $
+
+EAPI="4"
+
+inherit multilib-minimal toolchain-funcs autotools
+
+DESCRIPTION="Transport Independent RPC library (SunRPC replacement)"
+HOMEPAGE="http://libtirpc.sourceforge.net/";
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2
+       mirror://gentoo/${PN}-glibc-nfs.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="ipv6 kerberos static-libs"
+
+RDEPEND="kerberos? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+       app-arch/xz-utils
+       >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]"
+RDEPEND="${RDEPEND}
+       abi_x86_32? (
+               !<=app-emulation/emul-linux-x86-baselibs-20140508-r7
+               !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+       )"
+
+src_unpack() {
+       unpack ${A}
+       cp -r tirpc "${S}"/ || die
+}
+
+src_prepare() {
+       epatch "${FILESDIR}"/${P}-stdarg.patch
+       epatch 
"${FILESDIR}"/0001-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
+       epatch "${FILESDIR}"/0002-Misc-header-fixes.patch
+       epatch "${FILESDIR}"/0003-fix_cdefs_h_include.patch
+       epatch "${FILESDIR}"/0004-fix_DECLS.patch
+       epatch "${FILESDIR}"/0005-fix_remaining_issues.patch
+       epatch "${FILESDIR}"/0006-fix_queue_h_include.patch
+       epatch "${FILESDIR}"/0007-no-des.patch
+       eautoconf
+       eautoreconf
+}
+
+multilib_src_configure() {
+       ECONF_SOURCE=${S} \
+       econf \
+               $(use_enable ipv6) \
+               $(use_enable kerberos gssapi) \
+               $(use_enable static-libs static)
+}
+
+multilib_src_install() {
+       default
+
+       # libtirpc replaces rpc support in glibc, so we need it in /
+       multilib_is_native_abi && gen_usr_ldscript -a tirpc
+}
+
+multilib_src_install_all() {
+       einstalldocs
+
+       insinto /etc
+       doins doc/netconfig
+
+       insinto /usr/include/tirpc
+       doins -r "${WORKDIR}"/tirpc/*
+
+       # makes sure that the linking order for nfs-utils is proper, as
+       # libtool would inject a libgssglue dependency in the list.
+       use static-libs || prune_libtool_files
+}

diff --git a/net-libs/libtirpc/metadata.xml b/net-libs/libtirpc/metadata.xml
new file mode 100644
index 0000000..ca66751
--- /dev/null
+++ b/net-libs/libtirpc/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+<herd>net-fs</herd>
+</pkgmetadata>

Reply via email to