diff options
author | Martin Baulig <baulig@suse.de> | 2000-07-24 14:55:17 +0000 |
---|---|---|
committer | Martin Baulig <martin@src.gnome.org> | 2000-07-24 14:55:17 +0000 |
commit | 7c80f5d7dfbf54c1ed432dc7f06dc32d3a0d43ed (patch) | |
tree | 755d6b5244ba542f0e05ccf56c15618fb76f32b1 | |
parent | 425e5cc9aad003c9f64d43f2d3f15e04a97db854 (diff) | |
download | shared-mime-info-7c80f5d7dfbf54c1ed432dc7f06dc32d3a0d43ed.tar.gz |
New file.
2000-07-24 Martin Baulig <baulig@suse.de>
* check-utmp.m4: New file.
svn path=/trunk/; revision=1311
-rw-r--r-- | macros2/ChangeLog | 4 | ||||
-rw-r--r-- | macros2/check-utmp.m4 | 243 |
2 files changed, 247 insertions, 0 deletions
diff --git a/macros2/ChangeLog b/macros2/ChangeLog index 82f4b695..6a0fc356 100644 --- a/macros2/ChangeLog +++ b/macros2/ChangeLog @@ -1,5 +1,9 @@ 2000-07-24 Martin Baulig <baulig@suse.de> + * check-utmp.m4: New file. + +2000-07-24 Martin Baulig <baulig@suse.de> + Synced with gnome-libs/gnome-data. 2000-06-09 Martin Baulig <martin@home-of-linux.org> diff --git a/macros2/check-utmp.m4 b/macros2/check-utmp.m4 new file mode 100644 index 00000000..5241b96b --- /dev/null +++ b/macros2/check-utmp.m4 @@ -0,0 +1,243 @@ +# Checks for availability of various utmp fields +# +# Original code by Bernhard Rosenkraenzer (bero@linux.net.eu.org), 1998. +# Modifications by Timur Bakeyev (timur@gnu.org), 1999. +# + +dnl AC_CHECK_UTMP() +dnl Test for presence of the field and define HAVE_UT_UT_field macro +dnl + +AC_DEFUN(AC_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]) +else + AC_DEFINE(UTMP,[struct utmp]) +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) +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) +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) +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) +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) +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) +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) +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) +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={0, 0};],result=yes,result=no) +if test "$result" = "yes"; then + AC_DEFINE(HAVE_UT_UT_TV) +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) +fi +AC_MSG_RESULT($result) + +]) |