*** empty log message ***
[coreutils.git] / m4 / boottime.m4
blobe4f405483b53859761612af865a4cd583970c362
1 # Determine whether this system has infrastructure for obtaining the boot time.
3 # GNULIB_BOOT_TIME([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
4 * ----------------------------------------------------------
5 AC_DEFUN([GNULIB_BOOT_TIME],
7   AC_CHECK_FUNCS(sysctl)
8   AC_CHECK_HEADERS(sys/sysctl.h)
9   AC_CACHE_CHECK(
10     [whether we can get the system boot time],
11     [gnulib_cv_have_boot_time],
12     [
13       AC_COMPILE_IFELSE(
14        [AC_LANG_PROGRAM(
15 [AC_INCLUDES_DEFAULT
16 #if HAVE_SYSCTL && HAVE_SYS_SYSCTL_H
17 # include <sys/param.h> /* needed for OpenBSD 3.0 */
18 # include <sys/sysctl.h>
19 #endif
20 #ifdef HAVE_UTMPX_H
21 # include <utmpx.h>
22 #else
23 # include <utmp.h>
24 #endif
27 #if defined BOOT_TIME || (defined CTL_KERN && defined KERN_BOOTTIME)
28 /* your system *does* have the infrastructure to determine boot time */
29 #else
30 please_tell_us_how_to_determine_boot_time_on_your_system
31 #endif
32 ]])],
33        gnulib_cv_have_boot_time=yes,
34        gnulib_cv_have_boot_time=no)
35     ])
36   AS_IF([test $gnulib_cv_have_boot_time = yes], [$1], [$2])