From: Sam Hartman Date: Tue, 30 Jul 1996 22:47:08 +0000 (+0000) Subject: Deal with a /usr/include/netdb.h that contains struct rpcent X-Git-Tag: krb5-1.0-beta7~218 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a7c4c09e3d048b35c40463edeae05cea89e9710b;p=krb5.git Deal with a /usr/include/netdb.h that contains struct rpcent git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@8864 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/rpc/ChangeLog b/src/lib/rpc/ChangeLog index 942a4bfe2..d128f38e2 100644 --- a/src/lib/rpc/ChangeLog +++ b/src/lib/rpc/ChangeLog @@ -1,3 +1,13 @@ +Mon Jul 29 22:02:47 1996 Sam Hartman + + * configure.in: Determine whether netdb.h defines struct rpcent. + + * types.hin: Expand rpcent_define to be a null string or a #define + on Linux. + + * netdb.h: Include rpc/types.h and only define struct rpcent if + needed. + Wed Jul 24 07:58:38 1996 Ezra Peisach * pmap_rmt.c (clnt_broadcast): Use memset insetad of bzero. diff --git a/src/lib/rpc/configure.in b/src/lib/rpc/configure.in index 6084638d3..e5ef77b1f 100644 --- a/src/lib/rpc/configure.in +++ b/src/lib/rpc/configure.in @@ -4,7 +4,15 @@ AC_PROG_ARCHIVE AC_PROG_ARCHIVE_ADD AC_PROG_RANLIB AC_PROG_INSTALL - +AC_TRY_COMPILE([ +#include + ],[ + struct rpcent e; + char c = e.r_name[0]; + int i = e.r_number; + ], [rpcent_define='#define STRUCT_RPCENT_ALREADY_PROVIDED'], + [rpcent_define='']) dnl +AC_SUBST(rpcent_define) AC_CHECK_SIZEOF(int) SIZEOF_INT=$ac_cv_sizeof_int AC_SUBST(SIZEOF_INT) diff --git a/src/lib/rpc/netdb.h b/src/lib/rpc/netdb.h index f6b6374b5..628efc2de 100644 --- a/src/lib/rpc/netdb.h +++ b/src/lib/rpc/netdb.h @@ -31,20 +31,20 @@ * Mountain View, California 94043 */ /* @(#)rpc.h 1.8 87/07/24 SMI */ - +#include /* since the gssrpc library requires that any application using it be built with these header files, I am making the decision that any app which uses the rpcent routines must use this header file, or something compatible (which most are) --marc */ /* Really belongs in */ - +#ifndef STRUCT_RPCENT_ALREADY_PROVIDED struct rpcent { char *r_name; /* name of server for this rpc program */ char **r_aliases; /* alias list */ int r_number; /* rpc program number */ }; - +#endif /*STRUCT_RPCENT_ALREADY_PROVIDED*/ struct rpcent *getrpcbyname(), *getrpcbynumber(), *getrpcent(); #endif diff --git a/src/lib/rpc/types.hin b/src/lib/rpc/types.hin index 619a9ce20..e95904198 100644 --- a/src/lib/rpc/types.hin +++ b/src/lib/rpc/types.hin @@ -36,7 +36,8 @@ #define __TYPES_RPC_HEADER__ #include - +/* This is for rpc/netdb.h */ +@rpcent_define@ /* this is a 32-bit int type */ #if @SIZEOF_INT@ == 4 @@ -88,3 +89,4 @@ typedef unsigned long rpc_u_int32; #endif #endif /* ndef __TYPES_RPC_HEADER__ */ +