[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 <rpc/xdr.h>])
+
AC_CHECK_LIB([intl],[gettext],[])
dnl Do we have rpcgen?
* It was generated using rpcgen.
*/
-#include "./remote/remote_protocol.h"
+#include "remote_protocol.h"
#include "internal.h"
#include <arpa/inet.h>
+#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)
#include "internal.h"
#include <arpa/inet.h>
+#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
%#include "internal.h"
%#include <arpa/inet.h>
+/* 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). */
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/(?<!IXDR_GET_INT32 )IXDR_GET_LONG/IXDR_GET_INT32/g;
+ s,#include "\./remote/remote_protocol\.h",#include "remote_protocol.h",;
if (m/^}/) {
$in_function = 0;