summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEzra Peisach <epeisach@mit.edu>2000-06-30 19:34:38 +0000
committerEzra Peisach <epeisach@mit.edu>2000-06-30 19:34:38 +0000
commit52555067459cdac3514d5ae13b8f48db96ef0ad1 (patch)
treed4e78513d6103338d4f2407e8a2642737fb517cc /src
parent41ac0b0b7127178c93344caf4d15f62bb12d4376 (diff)
downloadkrb5-52555067459cdac3514d5ae13b8f48db96ef0ad1.tar.gz
krb5-52555067459cdac3514d5ae13b8f48db96ef0ad1.tar.xz
krb5-52555067459cdac3514d5ae13b8f48db96ef0ad1.zip
* 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. 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
Diffstat (limited to 'src')
-rw-r--r--src/util/pty/ChangeLog7
-rw-r--r--src/util/pty/configure.in22
-rw-r--r--src/util/pty/pty-int.h4
3 files changed, 33 insertions, 0 deletions
diff --git a/src/util/pty/ChangeLog b/src/util/pty/ChangeLog
index 67af4e7fb1..7b7ab0d69c 100644
--- a/src/util/pty/ChangeLog
+++ b/src/util/pty/ChangeLog
@@ -1,3 +1,10 @@
+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
diff --git a/src/util/pty/configure.in b/src/util/pty/configure.in
index 1bf4decb49..28b1b3fe87 100644
--- a/src/util/pty/configure.in
+++ b/src/util/pty/configure.in
@@ -147,6 +147,28 @@ AC_DEFINE(UT_EXIT_STRUCTURE_DIFFER)
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
diff --git a/src/util/pty/pty-int.h b/src/util/pty/pty-int.h
index f2ede6e369..d183cf28fb 100644
--- a/src/util/pty/pty-int.h
+++ b/src/util/pty/pty-int.h
@@ -90,6 +90,10 @@
#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);