summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorWilliam Jon McCann <mccann@jhu.edu>2007-08-21 16:10:34 +0000
committerWilliam Jon McCann <mccann@src.gnome.org>2007-08-21 16:10:34 +0000
commitd826466c4231993bc40e430e3828e3cc0e3424e5 (patch)
treeac1b66bded36c49d84c215328c73989c20027de4 /acinclude.m4
parent9d0888fedf2ee1ff59e5d47789b01d960c7e804c (diff)
downloadgdm-d826466c4231993bc40e430e3828e3cc0e3424e5.tar.gz
Some Solaris build fixes. Patch from Brian Cameron <brian.cameron@sun.com>
2007-08-21 William Jon McCann <mccann@jhu.edu> * acconfig.h: * acinclude.m4: * common/gdm-address.c: * configure.ac: * daemon/Makefile.am: * daemon/factory-slave-main.c: * daemon/gdm-server.c: (server_child_setup): * daemon/main.c: (main): * daemon/product-slave-main.c: * daemon/session-worker-main.c: * daemon/simple-slave-main.c: * daemon/test-session.c: (on_secret_info_query): Some Solaris build fixes. Patch from Brian Cameron <brian.cameron@sun.com> svn path=/branches/mccann-gobject/; revision=5174
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m4245
1 files changed, 245 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index d6c9e330..970dbec2 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -41,3 +41,248 @@ AC_DEFUN([AS_AC_EXPAND],
prefix=$prefix_save
exec_prefix=$exec_prefix_save
])
+
+dnl Checks for availability of various utmp fields
+dnl
+dnl Original code by Bernhard Rosenkraenzer (bero@linux.net.eu.org), 1998.
+dnl Modifications by Timur Bakeyev (timur@gnu.org), 1999.
+dnl Patched from http://bugzilla.gnome.org/show_bug.cgi?id=937
+dnl
+
+dnl GDM_CHECK_UTMP()
+dnl Test for presence of the field and define HAVE_UT_UT_field macro
+dnl Taken from vte/gnome-pty-helper's GPH_CHECK_UTMP
+
+AC_DEFUN([GDM_CHECK_UTMP],[
+
+AC_CHECK_HEADERS(sys/time.h utmp.h utmpx.h)
+AC_HEADER_TIME
+
+if test "$ac_cv_header_utmpx_h" = "yes"; then
+ AC_DEFINE(UTMP,[struct utmpx],[Define to the name of a structure which holds utmp data.])
+else
+ AC_DEFINE(UTMP,[struct utmp],[Define to the name of a structure which holds utmp data.])
+fi
+
+dnl some systems (BSD4.4-like) require time.h to be included before utmp.h :/
+AC_MSG_CHECKING(for ut_host field in the utmp structure)
+AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+#ifdef HAVE_UTMP_H
+#include <utmp.h>
+#endif
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#endif],[UTMP ut; char *p; p=ut.ut_host;],result=yes,result=no)
+if test "$result" = "yes"; then
+ AC_DEFINE(HAVE_UT_UT_HOST,1,[Define if your utmp struct contains a ut_host field.])
+fi
+AC_MSG_RESULT($result)
+
+AC_MSG_CHECKING(for ut_pid field in the utmp structure)
+AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+#ifdef HAVE_UTMP_H
+#include <utmp.h>
+#endif
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#endif],[UTMP ut; int i; i=ut.ut_pid;],result=yes,result=no)
+if test "$result" = "yes"; then
+ AC_DEFINE(HAVE_UT_UT_PID,1,[Define if your utmp struct contains a ut_pid field.])
+fi
+AC_MSG_RESULT($result)
+
+AC_MSG_CHECKING(for ut_id field in the utmp structure)
+AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+#ifdef HAVE_UTMP_H
+#include <utmp.h>
+#endif
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#endif],[UTMP ut; char *p; p=ut.ut_id;],result=yes,result=no)
+if test "$result" = "yes"; then
+ AC_DEFINE(HAVE_UT_UT_ID,1,[Define if your utmp struct contains a ut_id field.])
+fi
+AC_MSG_RESULT($result)
+
+AC_MSG_CHECKING(for ut_name field in the utmp structure)
+AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+#ifdef HAVE_UTMP_H
+#include <utmp.h>
+#endif
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#endif],[UTMP ut; char *p; p=ut.ut_name;],result=yes,result=no)
+if test "$result" = "yes"; then
+ AC_DEFINE(HAVE_UT_UT_NAME,1,[Define if your utmp struct contains a ut_name field.])
+fi
+AC_MSG_RESULT($result)
+
+AC_MSG_CHECKING(for ut_type field in the utmp structure)
+AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+#ifdef HAVE_UTMP_H
+#include <utmp.h>
+#endif
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#endif],[UTMP ut; int i; i=(int) ut.ut_type;],result=yes,result=no)
+if test "$result" = "yes"; then
+ AC_DEFINE(HAVE_UT_UT_TYPE,1,[Define if your utmp struct contains a ut_type field.])
+fi
+AC_MSG_RESULT($result)
+
+AC_MSG_CHECKING(for ut_exit.e_termination field in the utmp structure)
+AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+#ifdef HAVE_UTMP_H
+#include <utmp.h>
+#endif
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#endif],[UTMP ut; ut.ut_exit.e_termination=0;],result=yes,result=no)
+if test "$result" = "yes"; then
+ AC_DEFINE(HAVE_UT_UT_EXIT_E_TERMINATION,1,[Define if your utmp struct contains a ut_exit.e_termination field.])
+fi
+AC_MSG_RESULT($result)
+
+AC_MSG_CHECKING(for ut_user field in the utmp structure)
+AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+#ifdef HAVE_UTMP_H
+#include <utmp.h>
+#endif
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#endif],[UTMP ut; char *p; p=ut.ut_user;],result=yes,result=no)
+if test "$result" = "yes"; then
+ AC_DEFINE(HAVE_UT_UT_USER,1,[Define if your utmp struct contains a ut_user field.])
+fi
+AC_MSG_RESULT($result)
+
+AC_MSG_CHECKING(for ut_time field in the utmp structure)
+AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+#ifdef HAVE_UTMP_H
+#include <utmp.h>
+#endif
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#endif],[UTMP ut; ut.ut_time=0;],result=yes,result=no)
+if test "$result" = "yes"; then
+ AC_DEFINE(HAVE_UT_UT_TIME,1,[Define if your utmp struct contains a ut_time field.])
+fi
+AC_MSG_RESULT($result)
+
+AC_MSG_CHECKING(for ut_tv field in the utmp structure)
+AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+#ifdef HAVE_UTMP_H
+#include <utmp.h>
+#endif
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#endif],[UTMP ut; ut.ut_tv.tv_sec=0; ut.ut_tv.tv_usec=0; ],result=yes,result=no)
+if test "$result" = "yes"; then
+ AC_DEFINE(HAVE_UT_UT_TV,1,[Define if your utmp struct contains a ut_tv field.])
+fi
+AC_MSG_RESULT($result)
+
+AC_MSG_CHECKING(for ut_syslen field in the utmp structure)
+AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+#ifdef HAVE_UTMP_H
+#include <utmp.h>
+#endif
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#endif],[UTMP ut; ut.ut_syslen=0;],result=yes,result=no)
+if test "$result" = "yes"; then
+ AC_DEFINE(HAVE_UT_UT_SYSLEN,1,[Define if your utmp struct contains a ut_syslen field.])
+fi
+AC_MSG_RESULT($result)
+
+])