From a0d13713b25a4927c6ced5c8f5cf4c1569840958 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Thu, 8 Aug 1996 19:47:13 +0000 Subject: [PATCH] * configure.in, types.hin: Change search for struct rpcent yet again, this time compile-checking both netdb.h and rpc/netdb.h and taking action appropriately. See the comments in configure.in for details. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@8916 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/rpc/ChangeLog | 7 +++++++ src/lib/rpc/configure.in | 30 +++++++++++++++++++++++++++--- src/lib/rpc/netdb.h | 2 +- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/src/lib/rpc/ChangeLog b/src/lib/rpc/ChangeLog index de8dae378..55897e8a0 100644 --- a/src/lib/rpc/ChangeLog +++ b/src/lib/rpc/ChangeLog @@ -1,3 +1,10 @@ +Thu Aug 8 15:30:01 1996 Tom Yu + + * configure.in, types.hin: Change search for struct rpcent yet + again, this time compile-checking both netdb.h and + rpc/netdb.h and taking action appropriately. See the + comments in configure.in for details. + Mon Aug 5 16:46:48 1996 Tom Yu * Makefile.in (CFLAGS): Change DEBUG_GSSAPI to 0 to avoid printing diff --git a/src/lib/rpc/configure.in b/src/lib/rpc/configure.in index 97199f847..7fe2f069a 100644 --- a/src/lib/rpc/configure.in +++ b/src/lib/rpc/configure.in @@ -4,14 +4,38 @@ AC_PROG_ARCHIVE AC_PROG_ARCHIVE_ADD AC_PROG_RANLIB AC_PROG_INSTALL + +### Check where struct rpcent is declared. +# +# This is necessary to determine: +# 1. If /usr/include/netdb.h declares struct rpcent +# 2. If /usr/include/rpc/netdb.h declares struct rpcent +# +# We have our own rpc/netdb.h, and if /usr/include/netdb.h includes +# rpc/netdb.h, then nastiness could happen. +# +# Logic: If /usr/include/netdb.h declares struct rpcent, then check +# rpc/netdb.h. If /usr/include/rpc/netdb.h declares struct rpcent, +# then define STRUCT_RPCENT_IN_RPC_NETDB_H, otherwise do not. If +# neither netdb.h nor rpc/netdb.h declares struct rpcent, then define +# STRUCT_RPCENT_IN_RPC_NETDB_H anyway. +# +AC_MSG_CHECKING([where struct rpcent is declared]) AC_TRY_COMPILE([#include ], [struct rpcent e; char c = e.r_name[0]; int i = e.r_number;], -[AC_CHECK_HEADER(rpc/netdb.h, rpcent_define='', - [rpcent_define='#define STRUCT_RPCENT_ALREADY_PROVIDED'])], -[rpcent_define='']) +[AC_TRY_COMPILE([#include ], +[struct rpcent e; +char c = e.r_name[0]; +int i = e.r_number;], +[AC_MSG_RESULT([rpc/netdb.h]) +rpcent_define='#define STRUCT_RPCENT_IN_RPC_NETDB_H'], +[AC_MSG_RESULT([netdb.h])])], +[AC_MSG_RESULT([nowhere]) +rpcent_define='#define STRUCT_RPCENT_IN_RPC_NETDB_H']) 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 628efc2de..60f5fab54 100644 --- a/src/lib/rpc/netdb.h +++ b/src/lib/rpc/netdb.h @@ -38,7 +38,7 @@ 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 +#ifdef STRUCT_RPCENT_IN_RPC_NETDB_H struct rpcent { char *r_name; /* name of server for this rpc program */ char **r_aliases; /* alias list */ -- 2.26.2