aboutsummaryrefslogtreecommitdiffstats
path: root/main/libtirpc
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-12-16 13:09:16 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-12-16 13:09:16 +0000
commit94d5a5ec541a1275519db22a70609a62c1fef88c (patch)
tree270735fb789eb14d8451221dd6b5bcd14b0f2144 /main/libtirpc
parent18eb199691fe7b75716793aa8fcb4ad36ea13419 (diff)
downloadaports-94d5a5ec541a1275519db22a70609a62c1fef88c.tar.bz2
aports-94d5a5ec541a1275519db22a70609a62c1fef88c.tar.xz
main/libtirpc: rebase patches
those patches were sent upstream
Diffstat (limited to 'main/libtirpc')
-rw-r--r--main/libtirpc/0002-Misc-header-fixes.patch67
-rw-r--r--main/libtirpc/0002-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch (renamed from main/libtirpc/0001-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch)10
-rw-r--r--main/libtirpc/0003-Avoid-use-of-internal-glibc-sys-cdefs.h-header.patch1752
-rw-r--r--main/libtirpc/0004-Add-configure-option-to-disable-DES-authentication.patch97
-rw-r--r--main/libtirpc/0005-Fix-compile-error-IPPORT_RESERVED-undeclared.patch33
-rw-r--r--main/libtirpc/0006-Define-struct-rpcent-on-non-GNU-libc.patch48
-rw-r--r--main/libtirpc/APKBUILD46
-rw-r--r--main/libtirpc/automake.patch11
-rw-r--r--main/libtirpc/libtirpc-no-des.patch29
-rw-r--r--main/libtirpc/nis.h9
10 files changed, 1970 insertions, 132 deletions
diff --git a/main/libtirpc/0002-Misc-header-fixes.patch b/main/libtirpc/0002-Misc-header-fixes.patch
deleted file mode 100644
index 08c277b5d3..0000000000
--- a/main/libtirpc/0002-Misc-header-fixes.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From ed6dc31ed1092baf42f99278ef9c5c297805c3d0 Mon Sep 17 00:00:00 2001
-From: Natanael Copa <ncopa@alpinelinux.org>
-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/netconfig.h b/tirpc/netconfig.h
-index 7d6c2bc..2922e6f 100644
---- a/tirpc/netconfig.h
-+++ b/tirpc/netconfig.h
-@@ -2,6 +2,7 @@
- #define _NETCONFIG_H_
-
- #include <features.h>
-+#include <sys/cdefs.h>
-
- #define NETCONFIG "/etc/netconfig"
- #define NETPATH "NETPATH"
-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/tirpc/rpc/types.h b/tirpc/rpc/types.h
-index 52c30a2..d967271 100644
---- a/tirpc/rpc/types.h
-+++ b/tirpc/rpc/types.h
-@@ -39,6 +39,7 @@
- #define _TIRPC_TYPES_H
-
- #include <sys/types.h>
-+#include <sys/cdefs.h>
-
- typedef int32_t bool_t;
- typedef int32_t enum_t;
---
-1.9.2
-
diff --git a/main/libtirpc/0001-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch b/main/libtirpc/0002-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
index 3708638a43..0fd8d6ceac 100644
--- a/main/libtirpc/0001-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
+++ b/main/libtirpc/0002-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
@@ -1,14 +1,16 @@
-From d3b5ffed6d7d49cc93b2343afcf0e4502a3e54ce Mon Sep 17 00:00:00 2001
+From fe103d60b2d4c71f11095232dadc8352c6c096da Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Thu, 24 Apr 2014 09:19:45 +0200
-Subject: [PATCH 1/2] Provide getrpcbynumber and getrpcbyname if those are
+Subject: [PATCH 2/9] Provide getrpcbynumber and getrpcbyname if those are
missing
-We enable the config.h again and check fi getrpcbynumber and
+We enable the config.h again and check if getrpcbynumber and
getrpcbyname exists on the building patform. If it does not exist, then
provide those functions.
This is needed for musl libc.
+
+Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
---
configure.ac | 6 ++++--
src/getrpcent.c | 10 ++++++++--
@@ -81,5 +83,5 @@ index 1b54b6d..6da006a 100644
void
setrpcent(f)
--
-1.9.2
+2.2.0
diff --git a/main/libtirpc/0003-Avoid-use-of-internal-glibc-sys-cdefs.h-header.patch b/main/libtirpc/0003-Avoid-use-of-internal-glibc-sys-cdefs.h-header.patch
new file mode 100644
index 0000000000..2d5ad055fe
--- /dev/null
+++ b/main/libtirpc/0003-Avoid-use-of-internal-glibc-sys-cdefs.h-header.patch
@@ -0,0 +1,1752 @@
+From d859292140e52c055b2a51ded67cbb966531ac4c Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Mon, 15 Dec 2014 09:29:32 +0100
+Subject: [PATCH 3/9] Avoid use of internal glibc sys/cdefs.h header
+
+This header was never intended to be used by programs.
+
+Expand the macros used, __BEGIN_CDECLS, __END_CDECLS and __P()
+
+The __THROW macro is a non-portable hint for optimization so we simply
+remove those.
+
+Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
+---
+ src/auth_des.c | 2 --
+ src/auth_none.c | 1 -
+ src/auth_time.c | 1 -
+ src/auth_unix.c | 1 -
+ src/authdes_prot.c | 1 -
+ src/authunix_prot.c | 1 -
+ src/bindresvport.c | 1 -
+ src/clnt_bcast.c | 1 -
+ src/clnt_perror.c | 3 --
+ src/clnt_simple.c | 1 -
+ src/crypt_client.c | 1 -
+ src/des_crypt.c | 1 -
+ src/getnetconfig.c | 1 -
+ src/getnetpath.c | 2 --
+ src/getpeereid.c | 1 -
+ src/getpublickey.c | 3 --
+ src/key_call.c | 1 -
+ src/key_prot_xdr.c | 1 -
+ src/mt_misc.c | 1 -
+ src/pmap_clnt.c | 1 -
+ src/pmap_getmaps.c | 1 -
+ src/rpc_com.h | 9 ++++--
+ src/rpc_generic.c | 1 -
+ src/rpcb_st_xdr.c | 1 -
+ src/rpcdname.c | 1 -
+ src/svc_dg.c | 1 -
+ src/svc_simple.c | 1 -
+ src/svc_vc.c | 1 -
+ src/xdr.c | 1 -
+ src/xdr_array.c | 1 -
+ src/xdr_float.c | 1 -
+ src/xdr_mem.c | 1 -
+ src/xdr_rec.c | 2 --
+ src/xdr_reference.c | 2 --
+ src/xdr_sizeof.c | 1 -
+ src/xdr_stdio.c | 1 -
+ tirpc/netconfig.h | 8 +++--
+ tirpc/rpc/auth.h | 89 ++++++++++++++++++++++++++++++++++++++-------------
+ tirpc/rpc/auth_des.h | 16 ++++++---
+ tirpc/rpc/auth_gss.h | 47 ++++++++++++++-------------
+ tirpc/rpc/auth_unix.h | 9 ++++--
+ tirpc/rpc/clnt.h | 57 ++++++++++++++++++++++++---------
+ tirpc/rpc/clnt_soc.h | 33 +++++++++++++------
+ tirpc/rpc/des_crypt.h | 25 +++++++++++----
+ tirpc/rpc/nettype.h | 8 +++--
+ tirpc/rpc/pmap_clnt.h | 9 ++++--
+ tirpc/rpc/pmap_prot.h | 9 ++++--
+ tirpc/rpc/pmap_rmt.h | 9 ++++--
+ tirpc/rpc/rpc.h | 18 ++++++++---
+ tirpc/rpc/rpc_com.h | 9 ++++--
+ tirpc/rpc/rpc_msg.h | 8 +++--
+ tirpc/rpc/rpcb_clnt.h | 8 +++--
+ tirpc/rpc/rpcent.h | 12 ++++---
+ tirpc/rpc/svc.h | 65 +++++++++++++++++++++++++++----------
+ tirpc/rpc/svc_auth.h | 8 +++--
+ tirpc/rpc/svc_soc.h | 49 ++++++++++++++++++++--------
+ tirpc/rpc/xdr.h | 17 +++++++---
+ 57 files changed, 369 insertions(+), 196 deletions(-)
+
+diff --git a/src/auth_des.c b/src/auth_des.c
+index cff777c..1ccbf28 100644
+--- a/src/auth_des.c
++++ b/src/auth_des.c
+@@ -38,7 +38,6 @@
+ #include <string.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+-#include <sys/cdefs.h>
+ #include <rpc/des_crypt.h>
+ #include <syslog.h>
+ #include <rpc/types.h>
+@@ -52,7 +51,6 @@
+
+ #if defined(LIBC_SCCS) && !defined(lint)
+ #endif
+-#include <sys/cdefs.h>
+
+ #include "debug.h"
+
+diff --git a/src/auth_none.c b/src/auth_none.c
+index affc92b..0b0bbd1 100644
+--- a/src/auth_none.c
++++ b/src/auth_none.c
+@@ -31,7 +31,6 @@
+ 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
+-#include <sys/cdefs.h>
+ __FBSDID("$FreeBSD: src/lib/libc/rpc/auth_none.c,v 1.12 2002/03/22 23:18:35 obrien Exp $");
+ */
+
+diff --git a/src/auth_time.c b/src/auth_time.c
+index 7cfbb7e..ace86bf 100644
+--- a/src/auth_time.c
++++ b/src/auth_time.c
+@@ -25,7 +25,6 @@
+ * needed to deal with TCP connections.
+ */
+
+-#include <sys/cdefs.h>
+ #include <stdio.h>
+ #include <syslog.h>
+ #include <string.h>
+diff --git a/src/auth_unix.c b/src/auth_unix.c
+index 4b9b13f..3009543 100644
+--- a/src/auth_unix.c
++++ b/src/auth_unix.c
+@@ -26,7 +26,6 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+-#include <sys/cdefs.h>
+
+ /*
+ * auth_unix.c, Implements UNIX style authentication parameters.
+diff --git a/src/authdes_prot.c b/src/authdes_prot.c
+index ed061a5..227d08a 100644
+--- a/src/authdes_prot.c
++++ b/src/authdes_prot.c
+@@ -1,4 +1,3 @@
+-#include <sys/cdefs.h>
+ /*
+ * Copyright (c) 2009, Sun Microsystems, Inc.
+ * All rights reserved.
+diff --git a/src/authunix_prot.c b/src/authunix_prot.c
+index bf76a9d..0a04336 100644
+--- a/src/authunix_prot.c
++++ b/src/authunix_prot.c
+@@ -26,7 +26,6 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+-#include <sys/cdefs.h>
+
+ /*
+ * authunix_prot.c
+diff --git a/src/bindresvport.c b/src/bindresvport.c
+index d6d9c14..950fbd1 100644
+--- a/src/bindresvport.c
++++ b/src/bindresvport.c
+@@ -26,7 +26,6 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+-#include <sys/cdefs.h>
+
+ /*
+ * Copyright (c) 1987 by Sun Microsystems, Inc.
+diff --git a/src/clnt_bcast.c b/src/clnt_bcast.c
+index 373d8a5..be05af4 100644
+--- a/src/clnt_bcast.c
++++ b/src/clnt_bcast.c
+@@ -28,7 +28,6 @@
+ /*
+ * Copyright (c) 1986-1991 by Sun Microsystems Inc.
+ */
+-#include <sys/cdefs.h>
+
+ /*
+ * clnt_bcast.c
+diff --git a/src/clnt_perror.c b/src/clnt_perror.c
+index bcd8af8..fb7fb80 100644
+--- a/src/clnt_perror.c
++++ b/src/clnt_perror.c
+@@ -27,9 +27,6 @@
+ */
+
+ /*
+-#include <sys/cdefs.h>
+-*/
+-/*
+ * clnt_perror.c
+ *
+ * Copyright (C) 1984, Sun Microsystems, Inc.
+diff --git a/src/clnt_simple.c b/src/clnt_simple.c
+index 7ee9542..1700060 100644
+--- a/src/clnt_simple.c
++++ b/src/clnt_simple.c
+@@ -29,7 +29,6 @@
+ * Copyright (c) 1986-1991 by Sun Microsystems Inc.
+ */
+
+-#include <sys/cdefs.h>
+
+ /*
+ * clnt_simple.c
+diff --git a/src/crypt_client.c b/src/crypt_client.c
+index 670b253..f393926 100644
+--- a/src/crypt_client.c
++++ b/src/crypt_client.c
+@@ -30,7 +30,6 @@
+ * SUCH DAMAGE.
+ */
+
+-#include <sys/cdefs.h>
+
+ #include <err.h>
+ #include <sys/types.h>
+diff --git a/src/des_crypt.c b/src/des_crypt.c
+index 37a1022..980a6cb 100644
+--- a/src/des_crypt.c
++++ b/src/des_crypt.c
+@@ -39,7 +39,6 @@
+ static char sccsid[] = "@(#)des_crypt.c 2.2 88/08/10 4.0 RPCSRC; from 1.13 88/02/08 SMI";
+ #endif
+ #endif
+-#include <sys/cdefs.h>
+
+ static int common_crypt( char *, char *, unsigned, unsigned, struct desparams * );
+ int (*__des_crypt_LOCAL)() = 0;
+diff --git a/src/getnetconfig.c b/src/getnetconfig.c
+index 635c03a..92e7c43 100644
+--- a/src/getnetconfig.c
++++ b/src/getnetconfig.c
+@@ -32,7 +32,6 @@
+
+ #include <pthread.h>
+ #include <reentrant.h>
+-#include <sys/cdefs.h>
+ #include <stdio.h>
+ #include <errno.h>
+ #include <netconfig.h>
+diff --git a/src/getnetpath.c b/src/getnetpath.c
+index cd80dca..7c19932 100644
+--- a/src/getnetpath.c
++++ b/src/getnetpath.c
+@@ -25,13 +25,11 @@
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+-#include <sys/cdefs.h>
+
+ /*
+ * Copyright (c) 1989 by Sun Microsystems, Inc.
+ */
+
+-#include <sys/cdefs.h>
+ #include <stdio.h>
+ #include <errno.h>
+ #include <netconfig.h>
+diff --git a/src/getpeereid.c b/src/getpeereid.c
+index 57ee197..dd85270 100644
+--- a/src/getpeereid.c
++++ b/src/getpeereid.c
+@@ -24,7 +24,6 @@
+ * SUCH DAMAGE.
+ */
+
+-#include <sys/cdefs.h>
+
+ #include <sys/param.h>
+ #include <sys/socket.h>
+diff --git a/src/getpublickey.c b/src/getpublickey.c
+index 85935d8..764a5f9 100644
+--- a/src/getpublickey.c
++++ b/src/getpublickey.c
+@@ -25,9 +25,6 @@
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+-/*
+-#include <sys/cdefs.h>
+-*/
+
+ /*
+ * publickey.c
+diff --git a/src/key_call.c b/src/key_call.c
+index 8b9f388..1a6430b 100644
+--- a/src/key_call.c
++++ b/src/key_call.c
+@@ -30,7 +30,6 @@
+ */
+
+
+-#include <sys/cdefs.h>
+
+ /*
+ * key_call.c, Interface to keyserver
+diff --git a/src/key_prot_xdr.c b/src/key_prot_xdr.c
+index df2842f..772f582 100644
+--- a/src/key_prot_xdr.c
++++ b/src/key_prot_xdr.c
+@@ -33,7 +33,6 @@
+ */
+ /* Copyright (c) 1990, 1991 Sun Microsystems, Inc. */
+
+-#include <sys/cdefs.h>
+
+ /*
+ * Compiled from key_prot.x using rpcgen.
+diff --git a/src/mt_misc.c b/src/mt_misc.c
+index 093086e..a50f385 100644
+--- a/src/mt_misc.c
++++ b/src/mt_misc.c
+@@ -1,5 +1,4 @@
+
+-#include <sys/cdefs.h>
+ #include <pthread.h>
+ #include <reentrant.h>
+ #include <rpc/rpc.h>
+diff --git a/src/pmap_clnt.c b/src/pmap_clnt.c
+index 1d5d153..4b5fd85 100644
+--- a/src/pmap_clnt.c
++++ b/src/pmap_clnt.c
+@@ -26,7 +26,6 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+-#include <sys/cdefs.h>
+
+ /*
+ * pmap_clnt.c
+diff --git a/src/pmap_getmaps.c b/src/pmap_getmaps.c
+index 54338f7..853f724 100644
+--- a/src/pmap_getmaps.c
++++ b/src/pmap_getmaps.c
+@@ -26,7 +26,6 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+-#include <sys/cdefs.h>
+
+ /*
+ * pmap_getmap.c
+diff --git a/src/rpc_com.h b/src/rpc_com.h
+index 38c2cfe..52a8c48 100644
+--- a/src/rpc_com.h
++++ b/src/rpc_com.h
+@@ -40,7 +40,6 @@
+ #ifndef _TIRPC_RPCCOM_H
+ #define _TIRPC_RPCCOM_H
+
+-#include <sys/cdefs.h>
+
+ /* #pragma ident "@(#)rpc_com.h 1.11 93/07/05 SMI" */
+
+@@ -54,7 +53,9 @@
+ #define __RPC_GETXID(now) ((u_int32_t)getpid() ^ (u_int32_t)(now)->tv_sec ^ \
+ (u_int32_t)(now)->tv_usec)
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern u_int __rpc_get_a_size(int);
+ extern int __rpc_dtbsize(void);
+ extern struct netconfig * __rpcgettp(int);
+@@ -90,6 +91,8 @@ void __xprt_set_raddr(SVCXPRT *, const struct sockaddr_storage *);
+ SVCXPRT **__svc_xports;
+ int __svc_maxrec;
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* _TIRPC_RPCCOM_H */
+diff --git a/src/rpc_generic.c b/src/rpc_generic.c
+index a43906c..0ceadb4 100644
+--- a/src/rpc_generic.c
++++ b/src/rpc_generic.c
+@@ -29,7 +29,6 @@
+ * Copyright (c) 1986-1991 by Sun Microsystems Inc.
+ */
+
+-#include <sys/cdefs.h>
+
+ /*
+ * rpc_generic.c, Miscl routines for RPC.
+diff --git a/src/rpcb_st_xdr.c b/src/rpcb_st_xdr.c
+index c5d3575..08db745 100644
+--- a/src/rpcb_st_xdr.c
++++ b/src/rpcb_st_xdr.c
+@@ -35,7 +35,6 @@
+ * routines used with the rpcbind stats facility.
+ */
+
+-#include <sys/cdefs.h>
+
+ #include <rpc/rpc.h>
+
+diff --git a/src/rpcdname.c b/src/rpcdname.c
+index 094cea3..3e6a988 100644
+--- a/src/rpcdname.c
++++ b/src/rpcdname.c
+@@ -25,7 +25,6 @@
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+-#include <sys/cdefs.h>
+
+ /*
+ * rpcdname.c
+diff --git a/src/svc_dg.c b/src/svc_dg.c
+index f8255cc..1fd6f92 100644
+--- a/src/svc_dg.c
++++ b/src/svc_dg.c
+@@ -31,7 +31,6 @@
+ * Copyright (c) 1986-1991 by Sun Microsystems Inc.
+ */
+
+-#include <sys/cdefs.h>
+
+ /*
+ * svc_dg.c, Server side for connectionless RPC.
+diff --git a/src/svc_simple.c b/src/svc_simple.c
+index b6c371e..cb58002 100644
+--- a/src/svc_simple.c
++++ b/src/svc_simple.c
+@@ -29,7 +29,6 @@
+ * Copyright (c) 1986-1991 by Sun Microsystems Inc.
+ */
+
+-#include <sys/cdefs.h>
+
+ /*
+ * svc_simple.c
+diff --git a/src/svc_vc.c b/src/svc_vc.c
+index 4d3ea51..9dba72a 100644
+--- a/src/svc_vc.c
++++ b/src/svc_vc.c
+@@ -27,7 +27,6 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+-#include <sys/cdefs.h>
+
+ /*
+ * svc_vc.c, Server side for Connection Oriented based RPC.
+diff --git a/src/xdr.c b/src/xdr.c
+index 1142a88..f3fb9ad 100644
+--- a/src/xdr.c
++++ b/src/xdr.c
+@@ -26,7 +26,6 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+-#include <sys/cdefs.h>
+
+ /*
+ * xdr.c, Generic XDR routines implementation.
+diff --git a/src/xdr_array.c b/src/xdr_array.c
+index 216173d..7fc8fb8 100644
+--- a/src/xdr_array.c
++++ b/src/xdr_array.c
+@@ -27,7 +27,6 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+-#include <sys/cdefs.h>
+
+ /*
+ * xdr_array.c, Generic XDR routines impelmentation.
+diff --git a/src/xdr_float.c b/src/xdr_float.c
+index 90daf3f..26bc865 100644
+--- a/src/xdr_float.c
++++ b/src/xdr_float.c
+@@ -27,7 +27,6 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+-#include <sys/cdefs.h>
+
+ /*
+ * xdr_float.c, Generic XDR routines implementation.
+diff --git a/src/xdr_mem.c b/src/xdr_mem.c
+index bd86f00..ecdc932 100644
+--- a/src/xdr_mem.c
++++ b/src/xdr_mem.c
+@@ -26,7 +26,6 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+-#include <sys/cdefs.h>
+
+ /*
+ * xdr_mem.h, XDR implementation using memory buffers.
+diff --git a/src/xdr_rec.c b/src/xdr_rec.c
+index 2aca623..7d535cf 100644
+--- a/src/xdr_rec.c
++++ b/src/xdr_rec.c
+@@ -27,8 +27,6 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+-#include <sys/cdefs.h>
+-#include <sys/cdefs.h>
+
+ /*
+ * xdr_rec.c, Implements TCP/IP based XDR streams with a "record marking"
+diff --git a/src/xdr_reference.c b/src/xdr_reference.c
+index affe19e..13f6410 100644
+--- a/src/xdr_reference.c
++++ b/src/xdr_reference.c
+@@ -26,8 +26,6 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+-#include <sys/cdefs.h>
+-#include <sys/cdefs.h>
+
+ /*
+ * xdr_reference.c, Generic XDR routines impelmentation.
+diff --git a/src/xdr_sizeof.c b/src/xdr_sizeof.c
+index a805e31..cc5414b 100644
+--- a/src/xdr_sizeof.c
++++ b/src/xdr_sizeof.c
+@@ -34,7 +34,6 @@
+ * when serialized using XDR.
+ */
+
+-#include <sys/cdefs.h>
+
+ #include <rpc/types.h>
+ #include <rpc/xdr.h>
+diff --git a/src/xdr_stdio.c b/src/xdr_stdio.c
+index 45b1150..4410262 100644
+--- a/src/xdr_stdio.c
++++ b/src/xdr_stdio.c
+@@ -26,7 +26,6 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+-#include <sys/cdefs.h>
+
+ /*
+ * xdr_stdio.c, XDR implementation on standard i/o file.
+diff --git a/tirpc/netconfig.h b/tirpc/netconfig.h
+index 7d6c2bc..c25788c 100644
+--- a/tirpc/netconfig.h
++++ b/tirpc/netconfig.h
+@@ -74,7 +74,9 @@ typedef struct {
+ #define NC_UDP "udp"
+ #define NC_ICMP "icmp"
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ extern void *setnetconfig (void);
+ extern struct netconfig *getnetconfig (void *);
+@@ -89,6 +91,8 @@ extern int endnetpath (void *);
+ extern void nc_perror (const char *);
+ extern char *nc_sperror (void);
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* _NETCONFIG_H_ */
+diff --git a/tirpc/rpc/auth.h b/tirpc/rpc/auth.h
+index 7c8f813..434d35c 100644
+--- a/tirpc/rpc/auth.h
++++ b/tirpc/rpc/auth.h
+@@ -48,7 +48,6 @@
+
+ #include <rpc/xdr.h>
+ #include <rpc/clnt_stat.h>
+-#include <sys/cdefs.h>
+ #include <sys/socket.h>
+ #include <sys/types.h>
+
+@@ -164,9 +163,13 @@ union des_block {
+ char c[8];
+ };
+ typedef union des_block des_block;
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern bool_t xdr_des_block(XDR *, des_block *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ /*
+ * Authentication info. Opaque to client.
+@@ -277,9 +280,13 @@ auth_put(AUTH *auth)
+ xfunc, xwhere))
+
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern struct opaque_auth _null_auth;
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ /*
+ * Any style authentication. These routines can be used by any
+@@ -300,11 +307,15 @@ int authany_wrap(void), authany_unwrap(void);
+ * int len;
+ * int *aup_gids;
+ */
+-__BEGIN_DECLS
++#ifdef __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 */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ /*
+ * DES style authentication
+ * AUTH *authsecdes_create(servername, window, timehost, ckey)
+@@ -313,15 +324,23 @@ __END_DECLS
+ * const char *timehost; - optional hostname to sync with
+ * des_block *ckey; - optional conversation key to use
+ */
+-__BEGIN_DECLS
++#ifdef __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 *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern bool_t xdr_opaque_auth (XDR *, struct opaque_auth *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #define authsys_create(c,i1,i2,i3,ip) authunix_create((c),(i1),(i2),(i3),(ip))
+ #define authsys_create_default() authunix_create_default()
+@@ -329,36 +348,48 @@ __END_DECLS
+ /*
+ * Netname manipulation routines.
+ */
+-__BEGIN_DECLS
++#ifdef __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 * );
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ /*
+ *
+ * These routines interface to the keyserv daemon
+ *
+ */
+-__BEGIN_DECLS
++#ifdef __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);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ /*
+ * Publickey routines.
+ */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern int getpublickey (const char *, char *);
+ extern int getpublicandprivatekey (char *, char *);
+ extern int getsecretkey (char *, char *, char *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #ifdef KERBEROS
+ /*
+@@ -371,10 +402,14 @@ __END_DECLS
+ * const char *timehost; - optional hostname to sync with
+ * int *status; - kerberos status returned
+ */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern AUTH *authkerb_seccreate(const char *, const char *, const char *,
+ const u_int, const char *, int *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ /*
+ * Map a kerberos credential into a unix cred.
+@@ -387,20 +422,28 @@ __END_DECLS
+ * int *groups;
+ *
+ */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern int authkerb_getucred(/* struct svc_req *, uid_t *, gid_t *,
+ short *, int * */);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ #endif /* KERBEROS */
+
+-__BEGIN_DECLS
++#ifdef __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 *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #define AUTH_NONE 0 /* no authentication */
+ #define AUTH_NULL 0 /* backward compatibility */
+diff --git a/tirpc/rpc/auth_des.h b/tirpc/rpc/auth_des.h
+index 39b5332..77e169d 100644
+--- a/tirpc/rpc/auth_des.h
++++ b/tirpc/rpc/auth_des.h
+@@ -114,17 +114,25 @@ struct authdes_verf {
+ * Map a des credential into a unix cred.
+ *
+ */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern int authdes_getucred( struct authdes_cred *, uid_t *, gid_t *, int *, gid_t * );
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+-__BEGIN_DECLS
++#ifdef __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 *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* ndef _TI_AUTH_DES_ */
+diff --git a/tirpc/rpc/auth_gss.h b/tirpc/rpc/auth_gss.h
+index d6f2bbd..a17b34b 100644
+--- a/tirpc/rpc/auth_gss.h
++++ b/tirpc/rpc/auth_gss.h
+@@ -104,28 +104,29 @@ struct rpc_gss_init_res {
+ #define MAXSEQ 0x80000000
+
+ /* Prototypes. */
+-__BEGIN_DECLS
+-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));
+-bool_t xdr_rpc_gss_data __P((XDR *xdrs, xdrproc_t xdr_func,
+- caddr_t xdr_ptr, gss_ctx_id_t ctx,
+- gss_qop_t qop, rpc_gss_svc_t svc,
+- u_int seq));
+-
+-AUTH *authgss_create __P((CLIENT *, gss_name_t,
+- struct rpc_gss_sec *));
+-AUTH *authgss_create_default __P((CLIENT *, char *, struct rpc_gss_sec *));
+-bool_t authgss_service __P((AUTH *auth, int svc));
+-bool_t authgss_get_private_data __P((AUTH *auth,
+- struct authgss_private_data *));
+-bool_t authgss_free_private_data __P((struct authgss_private_data *));
+-
+-void gss_log_debug __P((const char *fmt, ...));
+-void gss_log_status __P((char *m, OM_uint32 major,
+- OM_uint32 minor));
+-void gss_log_hexdump __P((const u_char *buf, int len, int offset));
+-
+-__END_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
++bool_t xdr_rpc_gss_cred (XDR *xdrs, struct rpc_gss_cred *p);
++bool_t xdr_rpc_gss_init_args (XDR *xdrs, gss_buffer_desc *p);
++bool_t xdr_rpc_gss_init_res (XDR *xdrs, struct rpc_gss_init_res *p);
++bool_t xdr_rpc_gss_data (XDR *xdrs, xdrproc_t xdr_func,
++ caddr_t xdr_ptr, gss_ctx_id_t ctx,
++ gss_qop_t qop, rpc_gss_svc_t svc,
++ u_int seq);
++
++AUTH *authgss_create (CLIENT *, gss_name_t, struct rpc_gss_sec *);
++AUTH *authgss_create_default (CLIENT *, char *, struct rpc_gss_sec *);
++bool_t authgss_service (AUTH *auth, int svc);
++bool_t authgss_get_private_data (AUTH *auth, struct authgss_private_data *);
++bool_t authgss_free_private_data (struct authgss_private_data *);
++
++void gss_log_debug (const char *fmt, ...);
++void gss_log_status (char *m, OM_uint32 major, OM_uint32 minor);
++void gss_log_hexdump (const u_char *buf, int len, int offset);
++
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* !_TIRPC_AUTH_GSS_H */
+diff --git a/tirpc/rpc/auth_unix.h b/tirpc/rpc/auth_unix.h
+index 602889b..b10e71d 100644
+--- a/tirpc/rpc/auth_unix.h
++++ b/tirpc/rpc/auth_unix.h
+@@ -45,7 +45,6 @@
+
+ #ifndef _TIRPC_AUTH_UNIX_H
+ #define _TIRPC_AUTH_UNIX_H
+-#include <sys/cdefs.h>
+
+ /* The machine name is part of a credential; it may not exceed 255 bytes */
+ #define MAX_MACHINE_NAME 255
+@@ -67,9 +66,13 @@ struct authunix_parms {
+
+ #define authsys_parms authunix_parms
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern bool_t xdr_authunix_parms(XDR *, struct authunix_parms *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ /*
+ * If a response verifier has flavor AUTH_SHORT,
+diff --git a/tirpc/rpc/clnt.h b/tirpc/rpc/clnt.h
+index 9ee619e..05f2215 100644
+--- a/tirpc/rpc/clnt.h
++++ b/tirpc/rpc/clnt.h
+@@ -42,7 +42,6 @@
+ #include <rpc/clnt_stat.h>
+ #include <rpc/auth.h>
+
+-#include <sys/cdefs.h>
+ #include <netconfig.h>
+ #include <sys/un.h>
+
+@@ -267,7 +266,9 @@ struct rpc_timers {
+ * Generic client creation routine. Supported protocols are those that
+ * belong to the nettype namespace (/etc/netconfig).
+ */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern CLIENT *clnt_create(const char *, const rpcprog_t, const rpcvers_t,
+ const char *);
+ /*
+@@ -414,32 +415,46 @@ extern CLIENT *clnt_dg_create(const int, const struct netbuf *,
+ */
+ extern CLIENT *clnt_raw_create(rpcprog_t, rpcvers_t);
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+
+ /*
+ * Print why creation failed
+ */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern void clnt_pcreateerror(const char *); /* stderr */
+ extern char *clnt_spcreateerror(const char *); /* string */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ /*
+ * Like clnt_perror(), but is more verbose in its output
+ */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern void clnt_perrno(enum clnt_stat); /* stderr */
+ extern char *clnt_sperrno(enum clnt_stat); /* string */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ /*
+ * Print an English error message, given the client error code
+ */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern void clnt_perror(CLIENT *, const char *); /* stderr */
+ extern char *clnt_sperror(CLIENT *, const char *); /* string */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+
+ /*
+@@ -450,9 +465,13 @@ struct rpc_createerr {
+ struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */
+ };
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern struct rpc_createerr *__rpc_createerr(void);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ #define get_rpc_createerr() (*(__rpc_createerr()))
+ #define rpc_createerr (*(__rpc_createerr()))
+
+@@ -469,12 +488,16 @@ __END_DECLS
+ * char *out;
+ * const char *nettype;
+ */
+-__BEGIN_DECLS
++#ifdef __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 *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ /*
+ * RPC broadcast interface
+@@ -522,7 +545,9 @@ __END_DECLS
+
+ typedef bool_t (*resultproc_t)(caddr_t, ...);
+
+-__BEGIN_DECLS
++#ifdef __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,
+@@ -532,7 +557,9 @@ extern enum clnt_stat rpc_broadcast_exp(const rpcprog_t, const rpcvers_t,
+ caddr_t, const xdrproc_t, caddr_t,
+ const resultproc_t, const int,
+ const int, const char *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ /* For backward compatibility */
+ #include <rpc/clnt_soc.h>
+diff --git a/tirpc/rpc/clnt_soc.h b/tirpc/rpc/clnt_soc.h
+index 82330a3..6ec545c 100644
+--- a/tirpc/rpc/clnt_soc.h
++++ b/tirpc/rpc/clnt_soc.h
+@@ -46,7 +46,6 @@
+ * with TS-RPC.
+ */
+
+-#include <sys/cdefs.h>
+
+ #define UDPMSGSIZE 8800 /* rpc imposed limit on udp msg size */
+
+@@ -61,27 +60,39 @@
+ * u_int sendsz;
+ * u_int recvsz;
+ */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern CLIENT *clnttcp_create(struct sockaddr_in *, u_long, u_long, int *,
+ u_int, u_int);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ /*
+ * Raw (memory) rpc.
+ */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern CLIENT *clntraw_create(u_long, u_long);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+
+ /*
+ IPv6 socket version
+ */
+ #ifdef INET6
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern CLIENT *clnttcp6_create(struct sockaddr_in6 *, u_long, u_long, int *,
+ u_int, u_int);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ #endif
+
+ /*
+@@ -105,7 +116,9 @@ __END_DECLS
+ * u_int sendsz;
+ * u_int recvsz;
+ */
+-__BEGIN_DECLS
++#ifdef __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,
+@@ -116,7 +129,9 @@ extern CLIENT *clntudp6_create(struct sockaddr_in6 *, u_long, u_long,
+ extern CLIENT *clntudp6_bufcreate(struct sockaddr_in6 *, u_long, u_long,
+ struct timeval, int *, u_int, u_int);
+ #endif
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+
+ #endif /* _RPC_CLNT_SOC_H */
+diff --git a/tirpc/rpc/des_crypt.h b/tirpc/rpc/des_crypt.h
+index 837088c..2358960 100644
+--- a/tirpc/rpc/des_crypt.h
++++ b/tirpc/rpc/des_crypt.h
+@@ -43,7 +43,6 @@
+ #ifndef _DES_DES_CRYPT_H
+ #define _DES_DES_CRYPT_H
+
+-#include <sys/cdefs.h>
+ #include <rpc/rpc.h>
+
+ #define DES_MAXDATA 8192 /* max bytes encrypted in one call */
+@@ -83,23 +82,35 @@
+ /*
+ * Cipher Block Chaining mode
+ */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ int cbc_crypt( char *, char *, unsigned int, unsigned int, char *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ /*
+ * Electronic Code Book mode
+ */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ int ecb_crypt( char *, char *, unsigned int, unsigned int );
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ /*
+ * Set des parity for a key.
+ * DES parity is odd and in the low bit of each byte
+ */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ void des_setparity( char *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* _DES_DES_CRYPT_H */
+diff --git a/tirpc/rpc/nettype.h b/tirpc/rpc/nettype.h
+index 92063c6..926797a 100644
+--- a/tirpc/rpc/nettype.h
++++ b/tirpc/rpc/nettype.h
+@@ -53,11 +53,15 @@
+ #define _RPC_TCP 7
+ #define _RPC_UDP 8
+
+-__BEGIN_DECLS
++#ifdef __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 *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* !_TIRPC_NETTYPE_H */
+diff --git a/tirpc/rpc/pmap_clnt.h b/tirpc/rpc/pmap_clnt.h
+index 0d23908..6abd583 100644
+--- a/tirpc/rpc/pmap_clnt.h
++++ b/tirpc/rpc/pmap_clnt.h
+@@ -63,9 +63,10 @@
+
+ #ifndef _RPC_PMAP_CLNT_H_
+ #define _RPC_PMAP_CLNT_H_
+-#include <sys/cdefs.h>
+
+-__BEGIN_DECLS
++#ifdef __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 *);
+@@ -80,6 +81,8 @@ extern enum clnt_stat clnt_broadcast(u_long, u_long, u_long,
+ resultproc_t);
+ extern u_short pmap_getport(struct sockaddr_in *,
+ u_long, u_long, u_int);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* !_RPC_PMAP_CLNT_H_ */
+diff --git a/tirpc/rpc/pmap_prot.h b/tirpc/rpc/pmap_prot.h
+index c1a2546..75354ce 100644
+--- a/tirpc/rpc/pmap_prot.h
++++ b/tirpc/rpc/pmap_prot.h
+@@ -71,7 +71,6 @@
+
+ #ifndef _RPC_PMAP_PROT_H
+ #define _RPC_PMAP_PROT_H
+-#include <sys/cdefs.h>
+
+ #define PMAPPORT ((u_short)111)
+ #define PMAPPROG ((u_long)100000)
+@@ -97,10 +96,14 @@ struct pmaplist {
+ struct pmaplist *pml_next;
+ };
+
+-__BEGIN_DECLS
++#ifdef __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 *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* !_RPC_PMAP_PROT_H */
+diff --git a/tirpc/rpc/pmap_rmt.h b/tirpc/rpc/pmap_rmt.h
+index dd59a15..2a385e7 100644
+--- a/tirpc/rpc/pmap_rmt.h
++++ b/tirpc/rpc/pmap_rmt.h
+@@ -41,7 +41,6 @@
+
+ #ifndef _RPC_PMAP_RMT_H
+ #define _RPC_PMAP_RMT_H
+-#include <sys/cdefs.h>
+
+ struct rmtcallargs {
+ u_long prog, vers, proc, arglen;
+@@ -56,9 +55,13 @@ struct rmtcallres {
+ xdrproc_t xdr_results;
+ };
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern bool_t xdr_rmtcall_args(XDR *, struct rmtcallargs *);
+ extern bool_t xdr_rmtcallres(XDR *, struct rmtcallres *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* !_RPC_PMAP_RMT_H */
+diff --git a/tirpc/rpc/rpc.h b/tirpc/rpc/rpc.h
+index 6c0222e..fac2fa9 100644
+--- a/tirpc/rpc/rpc.h
++++ b/tirpc/rpc/rpc.h
+@@ -79,9 +79,11 @@
+ #define UDPMSGSIZE 8800
+ #endif
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern int get_myaddress(struct sockaddr_in *);
+-extern int bindresvport(int, struct sockaddr_in *) __THROW;
++extern int bindresvport(int, struct sockaddr_in *);
+ extern int registerrpc(int, int, int, char *(*)(char [UDPMSGSIZE]),
+ xdrproc_t, xdrproc_t);
+ extern int callrpc(const char *, int, int, int, xdrproc_t, void *,
+@@ -93,18 +95,24 @@ struct netbuf *uaddr2taddr(const struct netconfig *, const char *);
+
+ struct sockaddr;
+ extern int bindresvport_sa(int, struct sockaddr *);
+-__END_DECLS
++#ifdef __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.
+ */
+-__BEGIN_DECLS
++#ifdef __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);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* !_RPC_RPC_H */
+diff --git a/tirpc/rpc/rpc_com.h b/tirpc/rpc/rpc_com.h
+index cb3bbbb..236fcee 100644
+--- a/tirpc/rpc/rpc_com.h
++++ b/tirpc/rpc/rpc_com.h
+@@ -41,7 +41,6 @@
+ #ifndef _RPC_RPCCOM_H
+ #define _RPC_RPCCOM_H
+
+-#include <sys/cdefs.h>
+
+ /* #pragma ident "@(#)rpc_com.h 1.11 93/07/05 SMI" */
+
+@@ -55,7 +54,9 @@
+ #define __RPC_GETXID(now) ((u_int32_t)getpid() ^ (u_int32_t)(now)->tv_sec ^ \
+ (u_int32_t)(now)->tv_usec)
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern u_int __rpc_get_a_size(int);
+ extern int __rpc_dtbsize(void);
+ extern int _rpc_dtablesize(void);
+@@ -77,6 +78,8 @@ bool_t rpc_control(int,void *);
+
+ char *_get_next_token(char *, int);
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* _RPC_RPCCOM_H */
+diff --git a/tirpc/rpc/rpc_msg.h b/tirpc/rpc/rpc_msg.h
+index 16d8eef..f7aabd8 100644
+--- a/tirpc/rpc/rpc_msg.h
++++ b/tirpc/rpc/rpc_msg.h
+@@ -161,7 +161,9 @@ struct rpc_msg {
+ #define acpted_rply ru.RM_rmb.ru.RP_ar
+ #define rjcted_rply ru.RM_rmb.ru.RP_dr
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ /*
+ * XDR routine to handle a rpc message.
+ * xdr_callmsg(xdrs, cmsg)
+@@ -210,6 +212,8 @@ extern bool_t xdr_rejected_reply(XDR *, struct rejected_reply *);
+ * struct rpc_err *error;
+ */
+ extern void _seterr_reply(struct rpc_msg *, struct rpc_err *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* !_TIRPC_RPC_MSG_H */
+diff --git a/tirpc/rpc/rpcb_clnt.h b/tirpc/rpc/rpcb_clnt.h
+index 7e64f8f..86d81f6 100644
+--- a/tirpc/rpc/rpcb_clnt.h
++++ b/tirpc/rpc/rpcb_clnt.h
+@@ -59,7 +59,9 @@
+
+ #include <rpc/types.h>
+ #include <rpc/rpcb_prot.h>
+-__BEGIN_DECLS
++#ifdef __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 +80,8 @@ extern bool_t rpcb_getaddr(const rpcprog_t, const rpcvers_t,
+ 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 *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* !_RPC_RPCB_CLNT_H */
+diff --git a/tirpc/rpc/rpcent.h b/tirpc/rpc/rpcent.h
+index c865e51..6619cd3 100644
+--- a/tirpc/rpc/rpcent.h
++++ b/tirpc/rpc/rpcent.h
+@@ -44,7 +44,9 @@
+ /* #pragma ident "@(#)rpcent.h 1.13 94/04/25 SMI" */
+ /* @(#)rpcent.h 1.1 88/12/06 SMI */
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /* These are defined in /usr/include/rpc/netdb.h */
+ #if 0
+@@ -60,8 +62,10 @@ extern struct rpcent *getrpcbynumber(int);
+ extern struct rpcent *getrpcent(void);
+ #endif
+
+-extern void setrpcent(int) __THROW;
+-extern void endrpcent(void) __THROW;
+-__END_DECLS
++extern void setrpcent(int);
++extern void endrpcent(void);
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* !_RPC_CENT_H */
+diff --git a/tirpc/rpc/svc.h b/tirpc/rpc/svc.h
+index b9691a8..8273c95 100644
+--- a/tirpc/rpc/svc.h
++++ b/tirpc/rpc/svc.h
+@@ -40,7 +40,6 @@
+
+ #ifndef _TIRPC_SVC_H
+ #define _TIRPC_SVC_H
+-#include <sys/cdefs.h>
+
+ /*
+ * This interface must manage two items concerning remote procedure calling:
+@@ -200,11 +199,15 @@ struct svc_req {
+ * const struct netconfig *nconf;
+ */
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern bool_t svc_reg(SVCXPRT *, const rpcprog_t, const rpcvers_t,
+ void (*)(struct svc_req *, SVCXPRT *),
+ const struct netconfig *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ /*
+ * Service un-registration
+@@ -214,9 +217,13 @@ __END_DECLS
+ * const rpcvers_t vers;
+ */
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern void svc_unreg(const rpcprog_t, const rpcvers_t);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ /*
+ * Transport registration.
+@@ -224,9 +231,13 @@ __END_DECLS
+ * xprt_register(xprt)
+ * SVCXPRT *xprt;
+ */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern void xprt_register(SVCXPRT *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ /*
+ * Transport un-register
+@@ -234,9 +245,13 @@ __END_DECLS
+ * xprt_unregister(xprt)
+ * SVCXPRT *xprt;
+ */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern void xprt_unregister(SVCXPRT *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+
+ /*
+@@ -265,7 +280,9 @@ __END_DECLS
+ * deadlock the caller and server processes!
+ */
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern bool_t svc_sendreply(SVCXPRT *, xdrproc_t, void *);
+ extern void svcerr_decode(SVCXPRT *);
+ extern void svcerr_weakauth(SVCXPRT *);
+@@ -277,7 +294,9 @@ extern void svcerr_systemerr(SVCXPRT *);
+ extern int rpc_reg(rpcprog_t, rpcvers_t, rpcproc_t,
+ char *(*)(char *), xdrproc_t, xdrproc_t,
+ char *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ /*
+ * Lowest level dispatching -OR- who owns this process anyway.
+@@ -306,11 +325,17 @@ extern int svc_fds;
+ * a small program implemented by the svc_rpc implementation itself;
+ * also see clnt.h for protocol numbers.
+ */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern void rpctest_service(void);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern void svc_getreq(int);
+ extern void svc_getreqset(fd_set *);
+ extern void svc_getreq_common(int);
+@@ -319,7 +344,9 @@ extern void svc_getreq_poll(struct pollfd *, int);
+
+ extern void svc_run(void);
+ extern void svc_exit(void);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ /*
+ * Socket to use on svcxxx_create call to get default socket
+@@ -331,7 +358,9 @@ __END_DECLS
+ * These are the existing service side transport implementations
+ */
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ /*
+ * Transport independent svc_create routine.
+ */
+@@ -427,7 +456,9 @@ int svc_dg_enablecache(SVCXPRT *, const u_int);
+
+ int __rpc_get_local_uid(SVCXPRT *_transp, uid_t *_uid);
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+
+ /* for backward compatibility */
+diff --git a/tirpc/rpc/svc_auth.h b/tirpc/rpc/svc_auth.h
+index 723c989..67608d0 100644
+--- a/tirpc/rpc/svc_auth.h
++++ b/tirpc/rpc/svc_auth.h
+@@ -65,13 +65,17 @@ typedef struct SVCAUTH {
+ /*
+ * Server side authenticator
+ */
+-__BEGIN_DECLS
++#ifdef __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 *));
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* !_RPC_SVC_AUTH_H */
+diff --git a/tirpc/rpc/svc_soc.h b/tirpc/rpc/svc_soc.h
+index 6148d7b..9b7befa 100644
+--- a/tirpc/rpc/svc_soc.h
++++ b/tirpc/rpc/svc_soc.h
+@@ -38,7 +38,6 @@
+
+ #ifndef _RPC_SVC_SOC_H
+ #define _RPC_SVC_SOC_H
+-#include <sys/cdefs.h>
+
+ /* #pragma ident "@(#)svc_soc.h 1.11 94/04/25 SMI" */
+ /* svc_soc.h 1.8 89/05/01 SMI */
+@@ -64,10 +63,14 @@
+ * void (*dispatch)();
+ * int protocol; like TCP or UDP, zero means do not register
+ */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern bool_t svc_register(SVCXPRT *, u_long, u_long,
+ void (*)(struct svc_req *, SVCXPRT *), int);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ /*
+ * Service un-registration
+@@ -76,44 +79,64 @@ __END_DECLS
+ * u_long prog;
+ * u_long vers;
+ */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern void svc_unregister(u_long, u_long);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+
+ /*
+ * Memory based rpc for testing and timing.
+ */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern SVCXPRT *svcraw_create(void);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+
+ /*
+ * Udp based rpc.
+ */
+-__BEGIN_DECLS
++#ifdef __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);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+
+ /*
+ * Tcp based rpc.
+ */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern SVCXPRT *svctcp_create(int, u_int, u_int);
+ extern SVCXPRT *svctcp6_create(int, u_int, u_int);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ /*
+ * Fd based rpc.
+ */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern SVCXPRT *svcfd_create(int, u_int, u_int);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* !_RPC_SVC_SOC_H */
+diff --git a/tirpc/rpc/xdr.h b/tirpc/rpc/xdr.h
+index 613fab0..917c067 100644
+--- a/tirpc/rpc/xdr.h
++++ b/tirpc/rpc/xdr.h
+@@ -40,7 +40,6 @@
+
+ #ifndef _TIRPC_XDR_H
+ #define _TIRPC_XDR_H
+-#include <sys/cdefs.h>
+ #include <stdio.h>
+ #include <netinet/in.h>
+
+@@ -287,7 +286,9 @@ struct xdr_discrim {
+ /*
+ * These are the "generic" xdr routines.
+ */
+-__BEGIN_DECLS
++#ifdef __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 *);
+@@ -330,7 +331,9 @@ 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 *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ /*
+ * Common opaque bytes objects used by many rpc protocols;
+@@ -348,7 +351,9 @@ extern bool_t xdr_netobj(XDR *, struct netobj *);
+ * These are the public routines for the various implementations of
+ * xdr streams.
+ */
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ /* XDR using memory buffers */
+ extern void xdrmem_create(XDR *, char *, u_int, enum xdr_op);
+
+@@ -369,6 +374,8 @@ 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);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* !_TIRPC_XDR_H */
+--
+2.2.0
+
diff --git a/main/libtirpc/0004-Add-configure-option-to-disable-DES-authentication.patch b/main/libtirpc/0004-Add-configure-option-to-disable-DES-authentication.patch
new file mode 100644
index 0000000000..cd68c29684
--- /dev/null
+++ b/main/libtirpc/0004-Add-configure-option-to-disable-DES-authentication.patch
@@ -0,0 +1,97 @@
+From 5aff70a8fc06163c4ed5fcc45df4a734447000bd Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Mon, 15 Dec 2014 11:40:20 +0100
+Subject: [PATCH 4/9] Add configure option to disable DES authentication
+
+DES is not good for encryption anymore and some C libraries does not
+even implement it. We add a --disable-authdes to optionally disable
+it, but let it be enabled by default for compatibility.
+
+This is needed for musl libc.
+
+Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
+---
+ configure.ac | 6 ++++++
+ src/Makefile.am | 12 ++++++++++--
+ src/rpc_soc.c | 2 ++
+ 3 files changed, 18 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0180801..e6d3df5 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -15,6 +15,12 @@ if test x$enable_gssapi = xyes; then
+ AC_SUBST([GSSAPI_CFLAGS])
+ AC_SUBST([GSSAPI_LIBS])
+ fi
++
++AC_ARG_ENABLE(authdes,
++ [AC_HELP_STRING([--disable-authdes], [Disable DES authentication @<:@default=no@:>@])],
++ [],[enable_authdes=yes])
++AM_CONDITIONAL(AUTHDES, test x$enable_authdes = xyes)
++
+ AC_ARG_ENABLE(ipv6,
+ [AC_HELP_STRING([--disable-ipv6], [Disable IPv6 support @<:@default=no@:>@])],
+ [],[enable_ipv6=yes])
+diff --git a/src/Makefile.am b/src/Makefile.am
+index de57c8f..26ccbdf 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -42,6 +42,7 @@ lib_LTLIBRARIES = libtirpc.la
+ # misunderstanding of the purpose of library versions."
+ #
+ libtirpc_la_LDFLAGS = -lpthread -version-info 1:10:0
++libtirpc_la_CFLAGS =
+
+ libtirpc_la_SOURCES = auth_none.c auth_unix.c authunix_prot.c bindresvport.c clnt_bcast.c \
+ clnt_dg.c clnt_generic.c clnt_perror.c clnt_raw.c clnt_simple.c \
+@@ -51,7 +52,7 @@ libtirpc_la_SOURCES = auth_none.c auth_unix.c authunix_prot.c bindresvport.c cln
+ 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
+@@ -60,9 +61,16 @@ libtirpc_la_SOURCES += xdr.c xdr_rec.c xdr_array.c xdr_float.c xdr_mem.c xdr_ref
+ if GSS
+ libtirpc_la_SOURCES += auth_gss.c authgss_prot.c svc_auth_gss.c
+ libtirpc_la_LDFLAGS += $(GSSAPI_LIBS)
+- libtirpc_la_CFLAGS = -DHAVE_RPCSEC_GSS $(GSSAPI_CFLAGS)
++ libtirpc_la_CFLAGS += -DHAVE_RPCSEC_GSS $(GSSAPI_CFLAGS)
+ endif
+
++## DES authentication
++if AUTHDES
++ libtirpc_la_SOURCES += auth_des.c authdes_prot.c
++ libtirpc_la_CFLAGS += -DHAVE_AUTHDES
++endif
++
++
+ ## libtirpc_a_SOURCES += key_call.c key_prot_xdr.c getpublickey.c
+ ## libtirpc_a_SOURCES += netname.c netnamer.c rpcdname.c \
+ ## libtirpc_a_SOURCES += rtime.c \
+diff --git a/src/rpc_soc.c b/src/rpc_soc.c
+index 338edbb..b12b116 100644
+--- a/src/rpc_soc.c
++++ b/src/rpc_soc.c
+@@ -520,6 +520,7 @@ clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
+ (resultproc_t) rpc_wrap_bcast, "udp");
+ }
+
++#if HAVE_AUTHDES
+ /*
+ * Create the client des authentication object. Obsoleted by
+ * authdes_seccreate().
+@@ -551,6 +552,7 @@ fallback:
+ dummy = authdes_seccreate(servername, window, NULL, ckey);
+ return (dummy);
+ }
++#endif
+
+ /*
+ * Create a client handle for a unix connection. Obsoleted by clnt_vc_create()
+--
+2.2.0
+
diff --git a/main/libtirpc/0005-Fix-compile-error-IPPORT_RESERVED-undeclared.patch b/main/libtirpc/0005-Fix-compile-error-IPPORT_RESERVED-undeclared.patch
new file mode 100644
index 0000000000..4408a63d2c
--- /dev/null
+++ b/main/libtirpc/0005-Fix-compile-error-IPPORT_RESERVED-undeclared.patch
@@ -0,0 +1,33 @@
+From 90c2dea527d8fd95065e2a10147d050f978fe8a5 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Thu, 24 Apr 2014 08:58:20 +0200
+Subject: [PATCH 5/9] Fix compile error: 'IPPORT_RESERVED' undeclared
+
+The IPPORT_RESERVED is declared in netdb.h. This fixes the following
+compile error with musl libc:
+
+bindresvport.c: In function 'bindresvport_sa':
+bindresvport.c:67:18: error: 'IPPORT_RESERVED' undeclared (first use in
+this function)
+ #define ENDPORT (IPPORT_RESERVED - 1)
+ ^
+Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
+---
+ src/bindresvport.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/bindresvport.c b/src/bindresvport.c
+index 950fbd1..2d8f2bc 100644
+--- a/src/bindresvport.c
++++ b/src/bindresvport.c
+@@ -36,6 +36,7 @@
+ #include <sys/types.h>
+ #include <sys/socket.h>
+
++#include <netdb.h>
+ #include <netinet/in.h>
+
+ #include <errno.h>
+--
+2.2.0
+
diff --git a/main/libtirpc/0006-Define-struct-rpcent-on-non-GNU-libc.patch b/main/libtirpc/0006-Define-struct-rpcent-on-non-GNU-libc.patch
new file mode 100644
index 0000000000..9664f2311b
--- /dev/null
+++ b/main/libtirpc/0006-Define-struct-rpcent-on-non-GNU-libc.patch
@@ -0,0 +1,48 @@
+From 182305b99d3a63b6caf72fe5abba3fb88ebea679 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Mon, 15 Dec 2014 14:55:37 +0100
+Subject: [PATCH 6/9] Define struct rpcent on non GNU libc
+
+This fixes the following compile error with musl libc:
+getrpcent.c:65:16: error: field 'rpc' has incomplete type
+ struct rpcent rpc;
+ ^
+
+Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
+---
+This patch could probably be better. It assumes that only GNU libc has
+the rpcent struct defined, but the BSDs probably has it too.
+
+I am not sure if uClibc has it, but uClibc does define __GLIBC__ so it
+might be broken there too.
+
+I looked into using AC_CHECK_MEMBER but I don't think it is a good idea
+so depend on config.h since this is a header that will be installed on
+the system.
+
+I also found out that struct rpcent is also defined in
+/usr/include/gssrpc/netdb.h but I am unsure if we can depend on that
+too since GSS is optional.
+
+So I am a bit in doubt what the proper fix is. Meanwhile, this works
+for musl libc.
+
+ tirpc/rpc/rpcent.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tirpc/rpc/rpcent.h b/tirpc/rpc/rpcent.h
+index 6619cd3..147f909 100644
+--- a/tirpc/rpc/rpcent.h
++++ b/tirpc/rpc/rpcent.h
+@@ -49,7 +49,7 @@ extern "C" {
+ #endif
+
+ /* 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 */
+--
+2.2.0
+
diff --git a/main/libtirpc/APKBUILD b/main/libtirpc/APKBUILD
index c135ea4f32..7252772602 100644
--- a/main/libtirpc/APKBUILD
+++ b/main/libtirpc/APKBUILD
@@ -1,19 +1,23 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libtirpc
pkgver=0.2.5
-pkgrel=2
+pkgrel=3
pkgdesc="Transport Independent RPC library (SunRPC replacement)"
url="http://libtirpc.sourceforge.net/"
arch="all"
license="GPL2"
depends=
depends_dev="krb5-dev"
-makedepends="$depends_dev autoconf automake libtool"
+makedepends="$depends_dev autoconf automake libtool linux-headers
+ bsd-compat-headers"
subpackages="$pkgname-dev $pkgname-doc $pkgname-dbg"
source="http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.bz2
- 0001-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
- 0002-Misc-header-fixes.patch
- libtirpc-no-des.patch
+ 0002-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
+ 0003-Avoid-use-of-internal-glibc-sys-cdefs.h-header.patch
+ 0004-Add-configure-option-to-disable-DES-authentication.patch
+ 0005-Fix-compile-error-IPPORT_RESERVED-undeclared.patch
+ 0006-Define-struct-rpcent-on-non-GNU-libc.patch
+
nis.h
"
@@ -44,7 +48,7 @@ build() {
--host=$CHOST \
--prefix=/usr \
--sysconf=/etc \
- --enable-gss \
+ --disable-authdes \
|| return 1
make || return 1
}
@@ -56,17 +60,23 @@ package() {
}
md5sums="8cd41a5ef5a9b50d0fb6abb98af15368 libtirpc-0.2.5.tar.bz2
-f21a33e797dfe14c9efade5c8fd5a4b0 0001-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
-62aada9c8fa7e197000846815a02541c 0002-Misc-header-fixes.patch
-e30cf7369dc3faa495311b1f42c983df libtirpc-no-des.patch
-082dff1bc78bdcbac6d305c1534fe3c0 nis.h"
+1f0ae1fe18baf94eeb5c66b116e1ea5d 0002-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
+32a70fd0f64c36987f319cd4734ec7ed 0003-Avoid-use-of-internal-glibc-sys-cdefs.h-header.patch
+df1805367d42931b05c63fee8bd9eb3f 0004-Add-configure-option-to-disable-DES-authentication.patch
+41e2c7652e32bd4029da40c0bb59f914 0005-Fix-compile-error-IPPORT_RESERVED-undeclared.patch
+ac7d69dddc7b24aff9914c8b4030f8bb 0006-Define-struct-rpcent-on-non-GNU-libc.patch
+821394d42c2a666d9b69452b4cc444b5 nis.h"
sha256sums="62f9de7c2c8686c568757730e1fef66502a0e00d6cacf33546d0267984e002db libtirpc-0.2.5.tar.bz2
-9ff042aa7ba870d2d581f2815eee9cae7620df6b3a725da4c4d555325a08a05d 0001-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
-1565e46325a5321638511d8637686ac02f039c4a99e1c0bcc2ec40f213ff73e3 0002-Misc-header-fixes.patch
-12823f030b803045108df782018d04ca253d4439b0e92015ddb140dcd33c1be3 libtirpc-no-des.patch
-7149d53da167168cbad9e75cbab302768f659e59e208763b1bf5df2a6ff3bfdb nis.h"
+48bbb87c2fdc1ab89f8c719b56abf79b717266079def9e7a578cde7cd9e0ec79 0002-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
+5b7af3d430bd4c5659ed22826f392dc07314e896a459d5b51e10424bccb8982a 0003-Avoid-use-of-internal-glibc-sys-cdefs.h-header.patch
+90dd942250276b639dd48e2231c05545c5917785587f570f0df6ec3cdccbbe48 0004-Add-configure-option-to-disable-DES-authentication.patch
+ebd4c0f311d034107c5aeb02f3d6db3bfa6a02e93d9050cc192d4d9d109f42c7 0005-Fix-compile-error-IPPORT_RESERVED-undeclared.patch
+509f53b9bab3d25f4ff2154483b78d614e7e6bfeab82e1027b8b41d1641c1a62 0006-Define-struct-rpcent-on-non-GNU-libc.patch
+82657302b530628afd5866b76fc338956ca011d11e995cf6dea5d8b0493278eb nis.h"
sha512sums="9f8afa1acb04a2c2c558018f2528f8caaa79994a2af2abeed947f914145872ef72988b241e11925c799db0de9ec51fd9baecd2b08150240b22f91e2e55a45194 libtirpc-0.2.5.tar.bz2
-e60fc98c9efaa4675d08e85b669d8dea07b2c7e7b268344e06e172f5751baf6fae7f354149d738f4bbe139ff5b964f1d80d0bfa91a1c9ca94f9ab9489618166d 0001-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
-0e40b26c7b71e14ca5481975892795346043f8193a4af233268b3af7b74acac9cff483f9cb6d4bb1b581741ec87e8d6abd536f3d0942ba0f14257c31d22349c9 0002-Misc-header-fixes.patch
-95ad086657d008a01a4072ba7141391cbbe8ac35372b2f063a3f9774eb5dfa12b97bcff0c1b6da2d887001beaa60a8524823df93a8de2fdb73ad2a30340770ba libtirpc-no-des.patch
-15edac1e30cc1aa65ca495bae14c6c7455d65ca539b7e5c865c3fbd5a51c76966b37dd34e9a6483aadcaea3602aefb0b48cdb46f877dae1c65dfa6840dfd8c54 nis.h"
+0d5711125ebecace4d7268afd272135c9f277a012313b321fbc0e1ab1751931edc3b18a0285cf8a11a70a590d24e323eb2f59f03382ac095ea3839de152c0a50 0002-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
+edfa4fda70139874e445b467ba5675e7342976097a63ea348f3c6381494c3cef7d95ac8434a8b58cb28132c9090d3e3be9cd9d447a9a4d18a1b0777be6bb0c94 0003-Avoid-use-of-internal-glibc-sys-cdefs.h-header.patch
+9575ca014f4725fa8e9e06a246d1e5c72cc0c7b14ffa402e5eae0a790d88cef2b6fac639e5795e683c1f8caaa99dc0b3880a6dd2d2ed68a1838493ec02334069 0004-Add-configure-option-to-disable-DES-authentication.patch
+38ffc51a7336195c3a570b0981588a4ad7dae2099b1a0564bc51cfdc4c34b5617a6dcdcdaed54d99bcdeac49c283f32e523612acfdb849ef6311f88e6887b4a2 0005-Fix-compile-error-IPPORT_RESERVED-undeclared.patch
+ea5597069ffc50285f306d860513f5afb3d16f2e067e6c532ffdb6969e2275765d84bfb328c45f66c2c570b115c5f592a2292d1681d601e8d3636e7b650cfdbb 0006-Define-struct-rpcent-on-non-GNU-libc.patch
+83be3277aa7539d454273d7579827ff09e6b927e21de0af8a9290733b4bdfdcebfef26c9faffffd005a7631eae8beb4db9f60787f08db92fdd140686fe160c47 nis.h"
diff --git a/main/libtirpc/automake.patch b/main/libtirpc/automake.patch
deleted file mode 100644
index 5cd3c3d626..0000000000
--- a/main/libtirpc/automake.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- ./configure.ac.orig 2012-12-31 20:17:44.565801520 +0000
-+++ ./configure.ac 2012-12-31 20:17:57.815919238 +0000
-@@ -17,7 +17,7 @@
- fi
-
- AC_PROG_CC
--AM_CONFIG_HEADER(config.h)
-+AC_CONFIG_HEADER(config.h)
- AC_PROG_LIBTOOL
- AC_HEADER_DIRENT
- AC_PREFIX_DEFAULT(/usr)
diff --git a/main/libtirpc/libtirpc-no-des.patch b/main/libtirpc/libtirpc-no-des.patch
deleted file mode 100644
index 434726126a..0000000000
--- a/main/libtirpc/libtirpc-no-des.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- 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/main/libtirpc/nis.h b/main/libtirpc/nis.h
index a03a25f37b..8e29596685 100644
--- a/main/libtirpc/nis.h
+++ b/main/libtirpc/nis.h
@@ -35,7 +35,9 @@
//#include <rpc/rpc.h>
//#include <rpcsvc/nis_tags.h>
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
/*
* nis.h
@@ -536,7 +538,8 @@ typedef enum name_pos name_pos;
#define NIS_PROG 100300
#define NIS_VERSION 3
-
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
#endif /* ! _RPCSVC_NIS_H */