* configure.in: If getutmpx() exists on the system, test if a
prototype is provided by the system headers.
This was picked up by gcc -Wall. Under Linux glibc 2.1, the system
header file <utmpx.h> provides a prototype for getutmpx() only if
_GNU_SOURCE is defined (GNU extensions). The test offeres a prototype
(which matches in this case) - if the prototype conflicts with a system
provided one, we do not provide it.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12477
dc483132-0cff-0310-8789-
dd5450dbe970
+2000-06-30 Ezra Peisach <epeisach@mit.edu>
+
+ * pty-int.h: Add getutmpx() prototype if needed.
+
+ * configure.in: If getutmpx() exists on the system, test if a
+ prototype is provided by the system headers.
+
2000-06-28 Ezra Peisach <epeisach@mit.edu>
* getpty.c (pty_getpty): More conditionalizing variable defintion
fi
fi
dnl
+dnl Test to see if a certain prototype exists in the system header files
+dnl If we get a conflict - then we back off. Note: If our prototype matches
+dnl exactly, then we will list it and we both win.
+if test x$ac_cv_func_getutmpx = xyes; then
+AC_CACHE_CHECK([need to provide getutmpx prototype], krb5_cv_decl_getutmpx,
+[AC_TRY_COMPILE(dnl
+[#include <sys/types.h>
+#ifdef HAVE_UTMP_H
+#include <utmp.h>
+#endif
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#endif
+extern void getutmpx (const struct utmp *, struct utmpx *);
+],
+[], krb5_cv_decl_getutmpx=yes, krb5_cv_decl_getutmpx=no)])
+ if test $krb5_cv_decl_getutmpx = yes; then
+ AC_DEFINE(NEED_GETUTMPX_PROTOTYPE)
+ fi
+fi
+dnl
+dnl
ADD_DEF(-DKERBEROS)
AC_CONST
KRB5_BUILD_LIBRARY_WITH_DEPS
#define VHANG_LAST
#endif
+#if defined(NEED_GETUTMPX_PROTOTYPE)
+extern void getutmpx (const struct utmp *, struct utmpx *);
+#endif
+
/* Internal functions */
#ifdef __STDC__
long ptyint_void_association(void);