diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2006-08-22 17:42:21 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2006-08-22 17:42:21 +0000 |
commit | cafb7947b5a1c658a97cfd5251500dbd5f86028c (patch) | |
tree | b137c42eb7623905b91bb7a3bae1434d1546057f /m4 | |
parent | 0797e95b8a8aa6a9dbbd21d60dfbce66a8b67c2e (diff) | |
download | coreutils-cafb7947b5a1c658a97cfd5251500dbd5f86028c.tar.xz |
BeOS portability.
* src/uptime.c: Include OS.h if it exists.
(print_uptime): On BeOS, use the get_system_info function (actually a
macro). Loop through utmp entries only if utmp.h or utmpx.h exists.
(uptime): Call read_utmp only if utmp.h or utmpx.h exists.
* m4/boottime.m4 (GNULIB_BOOT_TIME): Test also for utmp.h, utmpx.h,
OS.h. Don't require to have utmp.h or utmpx.h. Enable boottime
support if <OS.h> is found.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/ChangeLog | 7 | ||||
-rw-r--r-- | m4/boottime.m4 | 14 |
2 files changed, 16 insertions, 5 deletions
diff --git a/m4/ChangeLog b/m4/ChangeLog index 1f73b7280..a99c7129d 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,10 @@ +2006-08-22 Bruno Haible <bruno@clisp.org> + + BeOS portability. + * boottime.m4 (GNULIB_BOOT_TIME): Test also for utmp.h, utmpx.h, + OS.h. Don't require to have utmp.h or utmpx.h. Enable boottime + support if <OS.h> is found. + 2006-08-22 Jim Meyering <jim@meyering.net> * .cvsignore: Add files that are now generated by ../bootstrap. diff --git a/m4/boottime.m4 b/m4/boottime.m4 index e7b742d7f..ad350f1d8 100644 --- a/m4/boottime.m4 +++ b/m4/boottime.m4 @@ -1,7 +1,7 @@ -# boottime.m4 serial 2 +# boottime.m4 serial 3 # Determine whether this system has infrastructure for obtaining the boot time. -# Copyright (C) 1996, 2000, 2002, 2003, 2004 Free Software Foundation, Inc. +# Copyright (C) 1996, 2000, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,6 +28,7 @@ AC_DEFUN([GNULIB_BOOT_TIME], [#if HAVE_SYS_PARAM_H #include <sys/param.h> #endif]]) + AC_CHECK_HEADERS_ONCE(utmp.h utmpx.h OS.h) AC_CACHE_CHECK( [whether we can get the system boot time], [gnulib_cv_have_boot_time], @@ -41,14 +42,17 @@ AC_DEFUN([GNULIB_BOOT_TIME], # endif # include <sys/sysctl.h> #endif -#ifdef HAVE_UTMPX_H +#if HAVE_UTMPX_H # include <utmpx.h> -#else +#elif HAVE_UTMP_H # include <utmp.h> #endif +#if HAVE_OS_H +# include <OS.h> +#endif ], [[ -#if defined BOOT_TIME || (defined CTL_KERN && defined KERN_BOOTTIME) +#if defined BOOT_TIME || (defined CTL_KERN && defined KERN_BOOTTIME) || HAVE_OS_H /* your system *does* have the infrastructure to determine boot time */ #else please_tell_us_how_to_determine_boot_time_on_your_system |