mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
Fix the MS-DOS, Haiku, USG, etc builds
* configure.ac (emacs_cv_boot_time_file): Only compute this on GNU/Linux, the sole system with systemd. * nt/inc/ms-w32.h (BOOT_TIME_FILE): Remove now redundant #undef. * src/filelock.c (get_boot_time): Eschew BOOT_TIME_FILE if not defined.
This commit is contained in:
parent
e1d08e9e11
commit
c4e0b10f18
3 changed files with 15 additions and 12 deletions
23
configure.ac
23
configure.ac
|
|
@ -2625,11 +2625,11 @@ if test "$GCC" = yes && test "$ac_enable_autodepend" = yes; then
|
||||||
fi
|
fi
|
||||||
AC_SUBST([AUTO_DEPEND])
|
AC_SUBST([AUTO_DEPEND])
|
||||||
|
|
||||||
|
BOOT_TIME_FILE=
|
||||||
AC_CACHE_CHECK([for old but post-boot file],
|
AC_CACHE_CHECK([for old but post-boot file],
|
||||||
[emacs_cv_boot_time_file],
|
[emacs_cv_boot_time_file],
|
||||||
[AS_CASE([$opsys],
|
[AS_CASE([$opsys],
|
||||||
[*bsd|darwin|dragonfly],
|
[gnu-linux],
|
||||||
[emacs_cv_boot_time_file='not needed'],
|
|
||||||
[emacs_cv_boot_time_file=unknown
|
[emacs_cv_boot_time_file=unknown
|
||||||
AS_IF([test $cross_compiling = no],
|
AS_IF([test $cross_compiling = no],
|
||||||
[# systemd puts it in /var/lib/systemd.
|
[# systemd puts it in /var/lib/systemd.
|
||||||
|
|
@ -2642,19 +2642,22 @@ AC_CACHE_CHECK([for old but post-boot file],
|
||||||
/var/run/random-seed
|
/var/run/random-seed
|
||||||
do
|
do
|
||||||
test -f $file && { emacs_cv_boot_time_file=$file; break; }
|
test -f $file && { emacs_cv_boot_time_file=$file; break; }
|
||||||
done])])])
|
done])],
|
||||||
|
[*], [emacs_cv_boot_time_file=not-needed])])
|
||||||
|
|
||||||
AS_CASE([$emacs_cv_boot_time_file],
|
AS_CASE([$emacs_cv_boot_time_file],
|
||||||
[/*|*:*], [BOOT_TIME_FILE=\"$emacs_cv_boot_time_file\"],
|
[/*|*:*], [BOOT_TIME_FILE=\"$emacs_cv_boot_time_file\"],
|
||||||
[NULL|nullptr|0], [BOOT_TIME_FILE=$emacs_cv_boot_time_file],
|
['not needed'], [BOOT_TIME_FILE=],
|
||||||
['not needed'], [BOOT_TIME_FILE=NULL],
|
|
||||||
[# Guess systemd if unknown.
|
[# Guess systemd if unknown.
|
||||||
# If guess is wrong, Emacs falls back on something else.
|
# If guess is wrong, Emacs falls back on something else.
|
||||||
BOOT_TIME_FILE=\"/var/lib/systemd/random-seed\"])
|
BOOT_TIME_FILE=\"/var/lib/systemd/random-seed\"])
|
||||||
AC_DEFINE_UNQUOTED([BOOT_TIME_FILE], [$BOOT_TIME_FILE],
|
|
||||||
[Name of file that, if it exists, postdates boot and predates
|
AS_IF([test -n "$BOOT_TIME_FILE"],
|
||||||
the first Emacs invocation; or a null pointer if no such file is known.
|
[AC_DEFINE_UNQUOTED([BOOT_TIME_FILE], [$BOOT_TIME_FILE],
|
||||||
This file is used only on GNU/Linux and other systems
|
[Name of file that, if it exists, postdates boot and predates
|
||||||
that lack the FreeBSD-style sysctl with KERN_BOOTTIME.])
|
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.
|
#### Choose a window system.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
the output, but that's gross. So this should do; if the file is
|
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
|
not there, the boot time will be returned as zero, and filelock.c
|
||||||
already handles that. */
|
already handles that. */
|
||||||
#undef BOOT_TIME_FILE
|
|
||||||
#define BOOT_TIME_FILE "C:/pagefile.sys"
|
#define BOOT_TIME_FILE "C:/pagefile.sys"
|
||||||
|
|
||||||
/* ============================================================ */
|
/* ============================================================ */
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,7 @@ get_boot_time (void)
|
||||||
}
|
}
|
||||||
#endif /* defined (CTL_KERN) && defined (KERN_BOOTTIME) */
|
#endif /* defined (CTL_KERN) && defined (KERN_BOOTTIME) */
|
||||||
|
|
||||||
if (BOOT_TIME_FILE)
|
#ifdef BOOT_TIME_FILE
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
if (stat (BOOT_TIME_FILE, &st) == 0)
|
if (stat (BOOT_TIME_FILE, &st) == 0)
|
||||||
|
|
@ -168,6 +168,7 @@ get_boot_time (void)
|
||||||
return boot_time;
|
return boot_time;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* BOOT_TIME_FILE */
|
||||||
|
|
||||||
#if defined (BOOT_TIME)
|
#if defined (BOOT_TIME)
|
||||||
/* The utmp routines maintain static state. Don't touch that state
|
/* The utmp routines maintain static state. Don't touch that state
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue