aboutsummaryrefslogtreecommitdiff
path: root/src/lib/rpc
diff options
context:
space:
mode:
authorTom Yu <tlyu@mit.edu>1996-08-08 19:47:13 +0000
committerTom Yu <tlyu@mit.edu>1996-08-08 19:47:13 +0000
commita0d13713b25a4927c6ced5c8f5cf4c1569840958 (patch)
treebcfbe9660b75fab1df49eb84f160f95435dc3319 /src/lib/rpc
parentcc01be4a066930c0d55475b8916392cefe48e46d (diff)
downloadkrb5-a0d13713b25a4927c6ced5c8f5cf4c1569840958.zip
krb5-a0d13713b25a4927c6ced5c8f5cf4c1569840958.tar.gz
krb5-a0d13713b25a4927c6ced5c8f5cf4c1569840958.tar.bz2
* 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
Diffstat (limited to 'src/lib/rpc')
-rw-r--r--src/lib/rpc/ChangeLog7
-rw-r--r--src/lib/rpc/configure.in30
-rw-r--r--src/lib/rpc/netdb.h2
3 files changed, 35 insertions, 4 deletions
diff --git a/src/lib/rpc/ChangeLog b/src/lib/rpc/ChangeLog
index de8dae3..55897e8 100644
--- a/src/lib/rpc/ChangeLog
+++ b/src/lib/rpc/ChangeLog
@@ -1,3 +1,10 @@
+Thu Aug 8 15:30:01 1996 Tom Yu <tlyu@voltage-multiplier.mit.edu>
+
+ * 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 <tlyu@voltage-multiplier.mit.edu>
* 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 97199f8..7fe2f06 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 <netdb.h>],
[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 <rpc/netdb.h>],
+[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 628efc2..60f5fab 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 <netdb.h> are) --marc */
/* Really belongs in <netdb.h> */
-#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 */