diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2023-08-12 19:39:11 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2023-08-12 19:46:12 -0700 |
commit | 5e736ca6ccfa131736ab0b3a298de2cb319e7dfb (patch) | |
tree | 65b06f7a73dc2a04c60af430bc95102a347979df /configure.ac | |
parent | b35431b218ada2d84eb251d18e5543388b598d80 (diff) | |
download | emacs-5e736ca6ccfa131736ab0b3a298de2cb319e7dfb.tar.gz |
Improve boot-time gathering
Simplify Emacs proper by using Gnulib’s boot-time module
instead of doing it all by hand. This should port Emacs
better to obscurish hosts, as Bruno Haible has merged the
best of Emacs’s and Gnulib’s boot-time gathering.
* lib/boot-time-aux.h, lib/boot-time.c, lib/boot-time.h:
* lib/readutmp.h, m4/readutmp.m4: New files, copied from Gnulib.
* admin/merge-gnulib (GNULIB_MODULES): Add boot-time.
* configure.ac: Do not check for utmp.h;
the boot-time module now does this.
(BOOT_TIME_FILE): Remove; no longer used.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* src/filelock.c [__FreeBSD__]: Do not include <sys/sysctl.h>.
[HAVE_UTMP_H]: Do not include utmp.h.
Include boot-time instead: boot-time does the work now.
(BOOT_TIME) [HAVE_ANDROID && !ANDROID_STUBIFY]: Don’t undef.
(WTMP_FILE): Don’t define.
(boot_time, boot_time_initialized, get_boot_time_1, get_boot_time):
Remove.
(get_boot_sec): New function that simply calls Gnulib get_boot_time.
(lock_file_1, current_lock_owner): Use get_boot_sec instead
of get_boot_time.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 47 |
1 files changed, 1 insertions, 46 deletions
diff --git a/configure.ac b/configure.ac index 35dfed247d0..0234a82b92f 100644 --- a/configure.ac +++ b/configure.ac @@ -2539,7 +2539,7 @@ AC_CHECK_HEADERS_ONCE( sys/sysinfo.h coff.h pty.h sys/resource.h - sys/utsname.h pwd.h utmp.h util.h + sys/utsname.h pwd.h util.h sanitizer/lsan_interface.h sanitizer/asan_interface.h sanitizer/common_interface_defs.h]) @@ -2635,51 +2635,6 @@ if test "$GCC" = yes && test "$ac_enable_autodepend" = yes; then fi AC_SUBST([AUTO_DEPEND]) -BOOT_TIME_FILE= -AC_CACHE_CHECK([for old but post-boot file], - [emacs_cv_boot_time_file], - [AS_CASE([$opsys], - [gnu-linux], - [emacs_cv_boot_time_file=unknown - AS_IF([test $cross_compiling = no], - [# systemd puts it in /var/lib/systemd. - # initscripts puts it in /var/lib/urandom (previously /var/lib). - # Linux drivers/char/random.c before 2022-02-21 suggests /var/run. - for file in \ - /var/lib/systemd/random-seed \ - /var/lib/urandom/random-seed \ - /var/lib/random-seed \ - /var/run/random-seed - do - test -f $file && { emacs_cv_boot_time_file=$file; break; } - done])], - # This isn't perfect, as some systems might have the page file in - # another place. Also, I suspect that the time stamp of that - # file might also change when Windows enlarges the file due to - # insufficient VM. Still, this seems to be the most reliable - # way; the alternative (of using GetSystemTimes) won't work on - # laptops that hibernate, because the system clock is stopped - # then. Other possibility would be to run "net statistics - # workstation" and parse the output, but that's gross. So this - # should do; if the file is not there, the boot time will be - # returned as zero, and filelock.c already handles that. - [mingw32], [emacs_cv_boot_time_file=C:/pagefile.sys], - [*], [emacs_cv_boot_time_file=not-needed])]) - -AS_CASE([$emacs_cv_boot_time_file], - [/*|*:*], [BOOT_TIME_FILE=\"$emacs_cv_boot_time_file\"], - [not-needed], [BOOT_TIME_FILE=], - [# Guess systemd if unknown. - # If guess is wrong, Emacs falls back on something else. - BOOT_TIME_FILE=\"/var/lib/systemd/random-seed\"]) - -AS_IF([test -n "$BOOT_TIME_FILE"], - [AC_DEFINE_UNQUOTED([BOOT_TIME_FILE], [$BOOT_TIME_FILE], - [Name of file that, if it exists, postdates boot and predates - the first Emacs invocation; or a null pointer if no such file is known. - This file is used only on GNU/Linux and other systems - that lack the FreeBSD-style sysctl with KERN_BOOTTIME.])]) - #### Choose a window system. ## We leave window_system equal to none if |