aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorPaul Eggert2023-08-09 12:06:25 -0700
committerPaul Eggert2023-08-09 12:15:47 -0700
commitcc0a30a876adffa5ec110df9f4e0f21097f6d73e (patch)
tree024bc0acb8de48aebed591b25aeb02508038272d /configure.ac
parent020b5d7fefd255117ab4fca636146b5b59c8fb84 (diff)
downloademacs-cc0a30a876adffa5ec110df9f4e0f21097f6d73e.tar.gz
emacs-cc0a30a876adffa5ec110df9f4e0f21097f6d73e.zip
Adjust to random-seed move
For some time, GNU/Linux systems have put their random-seed file somewhere other than where src/filelock.c looks for it. Catch up to this by having 'configure' scout for it. * configure.ac (BOOT_TIME_FILE): Define this at configure-time. * nt/inc/ms-w32.h (BOOT_TIME_FILE): Override 'configure'. * src/filelock.c (BOOT_TIME_FILE): Remove default definition, since 'configure' defaults it now.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac31
1 files changed, 31 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 6e080c1c666..56c8cf1ae05 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2625,6 +2625,37 @@ if test "$GCC" = yes && test "$ac_enable_autodepend" = yes; then
2625fi 2625fi
2626AC_SUBST([AUTO_DEPEND]) 2626AC_SUBST([AUTO_DEPEND])
2627 2627
2628AC_CACHE_CHECK([for old but post-boot file],
2629 [emacs_cv_boot_time_file],
2630 [AS_CASE([$opsys],
2631 [*bsd|darwin|dragonfly],
2632 [emacs_cv_boot_time_file='not needed'],
2633 [emacs_cv_boot_time_file=unknown
2634 AS_IF([test $cross_compiling = no],
2635 [# systemd puts it in /var/lib/systemd.
2636 # initscripts puts it in /var/lib/urandom (previously /var/lib).
2637 # Linux drivers/char/random.c before 2022-02-21 suggests /var/run.
2638 for file in \
2639 /var/lib/systemd/random-seed \
2640 /var/lib/urandom/random-seed \
2641 /var/lib/random-seed \
2642 /var/run/random-seed
2643 do
2644 test -f $file && { emacs_cv_boot_time_file=$file; break; }
2645 done])])])
2646AS_CASE([$emacs_cv_boot_time_file],
2647 [/*|*:*], [BOOT_TIME_FILE=\"$emacs_cv_boot_time_file\"],
2648 [NULL|nullptr|0], [BOOT_TIME_FILE=$emacs_cv_boot_time_file],
2649 ['not needed'], [BOOT_TIME_FILE=NULL],
2650 [# Guess systemd if unknown.
2651 # If guess is wrong, Emacs falls back on something else.
2652 BOOT_TIME_FILE=\"/var/lib/systemd/random-seed\"])
2653AC_DEFINE_UNQUOTED([BOOT_TIME_FILE], [$BOOT_TIME_FILE],
2654 [Name of file that, if it exists, postdates boot and predates
2655 the first Emacs invocation; or a null pointer if no such file is known.
2656 This file is used only on GNU/Linux and other systems
2657 that lack the FreeBSD-style sysctl with KERN_BOOTTIME.])
2658
2628#### Choose a window system. 2659#### Choose a window system.
2629 2660
2630## We leave window_system equal to none if 2661## We leave window_system equal to none if