diff --git a/configure.ac b/configure.ac index d75fac86ac..955a9e9e31 100644 --- a/configure.ac +++ b/configure.ac @@ -124,6 +124,9 @@ AC_CHECK_LIB([portablexdr],[xdrmem_create],[],[ [AC_MSG_ERROR([Cannot find a XDR library])]) ]) +dnl check for cygwin's variation in xdr function names +AC_CHECK_FUNCS([xdr_u_int64_t],[],[],[#include ]) + AC_CHECK_LIB([intl],[gettext],[]) dnl Do we have rpcgen? diff --git a/src/remote/remote_protocol.c b/src/remote/remote_protocol.c index c9816dd93b..eb0f9c3dc5 100644 --- a/src/remote/remote_protocol.c +++ b/src/remote/remote_protocol.c @@ -4,9 +4,18 @@ * It was generated using rpcgen. */ -#include "./remote/remote_protocol.h" +#include "remote_protocol.h" #include "internal.h" #include +#ifdef HAVE_XDR_U_INT64_T +# define xdr_uint64_t xdr_u_int64_t +#endif +#ifndef IXDR_PUT_INT32 +# define IXDR_PUT_INT32 IXDR_PUT_LONG +#endif +#ifndef IXDR_GET_INT32 +# define IXDR_GET_INT32 IXDR_GET_LONG +#endif bool_t xdr_remote_nonnull_string (XDR *xdrs, remote_nonnull_string *objp) diff --git a/src/remote/remote_protocol.h b/src/remote/remote_protocol.h index 57ed123751..92fd6dfe31 100644 --- a/src/remote/remote_protocol.h +++ b/src/remote/remote_protocol.h @@ -15,6 +15,15 @@ extern "C" { #include "internal.h" #include +#ifdef HAVE_XDR_U_INT64_T +# define xdr_uint64_t xdr_u_int64_t +#endif +#ifndef IXDR_PUT_INT32 +# define IXDR_PUT_INT32 IXDR_PUT_LONG +#endif +#ifndef IXDR_GET_INT32 +# define IXDR_GET_INT32 IXDR_GET_LONG +#endif #define REMOTE_MESSAGE_MAX 262144 #define REMOTE_MESSAGE_HEADER_MAX 24 #define REMOTE_MESSAGE_PAYLOAD_MAX 262120 diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x index 9aa3a7e583..60f93b2cc6 100644 --- a/src/remote/remote_protocol.x +++ b/src/remote/remote_protocol.x @@ -39,6 +39,19 @@ %#include "internal.h" %#include +/* cygwin's xdr implementation defines xdr_u_int64_t instead of xdr_uint64_t + * and lacks IXDR_PUT_INT32 and IXDR_GET_INT32 + */ +%#ifdef HAVE_XDR_U_INT64_T +%# define xdr_uint64_t xdr_u_int64_t +%#endif +%#ifndef IXDR_PUT_INT32 +%# define IXDR_PUT_INT32 IXDR_PUT_LONG +%#endif +%#ifndef IXDR_GET_INT32 +%# define IXDR_GET_INT32 IXDR_GET_LONG +%#endif + /*----- Data types. -----*/ /* Maximum total message size (serialised). */ diff --git a/src/remote/rpcgen_fix.pl b/src/remote/rpcgen_fix.pl index 4943765f6d..3cf5479dfc 100644 --- a/src/remote/rpcgen_fix.pl +++ b/src/remote/rpcgen_fix.pl @@ -31,8 +31,8 @@ while (<>) { s/quad_t/int64_t/g; s/xdr_u_quad_t/xdr_uint64_t/g; s/xdr_quad_t/xdr_int64_t/g; - s/IXDR_GET_LONG/IXDR_GET_INT32/g; - s,#include "\./remote_protocol\.h",#include "remote_protocol.h",; + s/(?