diff options
| author | Paul Eggert | 2016-03-02 10:21:45 -0800 |
|---|---|---|
| committer | Paul Eggert | 2016-03-02 10:24:11 -0800 |
| commit | 65f692658e81c940df8b3b315be873840dcef92b (patch) | |
| tree | 6a1b68cef01af388264cc691ab8bf7ec3daa9cbe /src | |
| parent | d5a18a93270bfc8c36e40910f8520b3738a91f43 (diff) | |
| download | emacs-65f692658e81c940df8b3b315be873840dcef92b.tar.gz emacs-65f692658e81c940df8b3b315be873840dcef92b.zip | |
Deterministic build improvements
* configure.ac (BUILD_DETAILS): Rename from DETERMINISTIC_DUMP,
and negate its sense. Use it via AC_SUBST, not AC_DEFINE,
and have its value be either empty or --no-build-details.
All uses changed. Change option to --disable-build-details.
* doc/lispref/cmdargs.texi (Initial Options):
Document --no-build-details.
* doc/lispref/internals.texi (Building Emacs):
* etc/NEWS:
Document --disable-build-details.
* doc/lispref/intro.texi (Version Info): Say that
emacs-build-time can be nil.
* lisp/erc/erc-compat.el (erc-emacs-build-time):
Now nil if details are omitted.
* lisp/erc/erc.el (erc-cmd-SV):
* lisp/version.el (emacs-build-time):
Now nil if no build details.
(emacs-version):
Output build time only if build details.
* src/Makefile.in (BUILD_DETAILS): New macro.
(temacs, bootstrap-emacs): Use it.
* src/emacs.c (build_details): New var.
(standard_args, main): Support --no-build-details.
(Vdeterministic_dump): Remove; all uses replaced
by !build_details.
(syms_of_emacs): Set Vbuild_details to a boolean, not
to a Lisp_Object.
* src/lisp.h (build_details): New decl.
* src/sysdep.c (init_system_name): When !build_details,
set system-name to nil, not to "elided".
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile.in | 7 | ||||
| -rw-r--r-- | src/emacs.c | 18 | ||||
| -rw-r--r-- | src/lisp.h | 3 | ||||
| -rw-r--r-- | src/sysdep.c | 7 |
4 files changed, 19 insertions, 16 deletions
diff --git a/src/Makefile.in b/src/Makefile.in index 8dcaf7e4759..c290a6082da 100644 --- a/src/Makefile.in +++ b/src/Makefile.in | |||
| @@ -313,6 +313,9 @@ GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ | |||
| 313 | 313 | ||
| 314 | RUN_TEMACS = ./temacs | 314 | RUN_TEMACS = ./temacs |
| 315 | 315 | ||
| 316 | # Whether builds should contain details. '--no-build-details' or empty. | ||
| 317 | BUILD_DETAILS = @BUILD_DETAILS@ | ||
| 318 | |||
| 316 | UNEXEC_OBJ = @UNEXEC_OBJ@ | 319 | UNEXEC_OBJ = @UNEXEC_OBJ@ |
| 317 | 320 | ||
| 318 | CANNOT_DUMP=@CANNOT_DUMP@ | 321 | CANNOT_DUMP=@CANNOT_DUMP@ |
| @@ -534,7 +537,7 @@ emacs$(EXEEXT): temacs$(EXEEXT) \ | |||
| 534 | ifeq ($(CANNOT_DUMP),yes) | 537 | ifeq ($(CANNOT_DUMP),yes) |
| 535 | ln -f temacs$(EXEEXT) $@ | 538 | ln -f temacs$(EXEEXT) $@ |
| 536 | else | 539 | else |
| 537 | LC_ALL=C $(RUN_TEMACS) -batch -l loadup dump | 540 | LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup dump |
| 538 | $(PAXCTL_if_present) -zex $@ | 541 | $(PAXCTL_if_present) -zex $@ |
| 539 | ln -f $@ bootstrap-emacs$(EXEEXT) | 542 | ln -f $@ bootstrap-emacs$(EXEEXT) |
| 540 | endif | 543 | endif |
| @@ -740,7 +743,7 @@ bootstrap-emacs$(EXEEXT): temacs$(EXEEXT) | |||
| 740 | ifeq ($(CANNOT_DUMP),yes) | 743 | ifeq ($(CANNOT_DUMP),yes) |
| 741 | ln -f temacs$(EXEEXT) $@ | 744 | ln -f temacs$(EXEEXT) $@ |
| 742 | else | 745 | else |
| 743 | $(RUN_TEMACS) --batch --load loadup bootstrap | 746 | $(RUN_TEMACS) --batch $(BUILD_DETAILS) --load loadup bootstrap |
| 744 | $(PAXCTL_if_present) -zex emacs$(EXEEXT) | 747 | $(PAXCTL_if_present) -zex emacs$(EXEEXT) |
| 745 | mv -f emacs$(EXEEXT) $@ | 748 | mv -f emacs$(EXEEXT) $@ |
| 746 | endif | 749 | endif |
diff --git a/src/emacs.c b/src/emacs.c index e7cb4ea4aaa..a381da4fb8f 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -181,6 +181,9 @@ bool noninteractive; | |||
| 181 | /* True means remove site-lisp directories from load-path. */ | 181 | /* True means remove site-lisp directories from load-path. */ |
| 182 | bool no_site_lisp; | 182 | bool no_site_lisp; |
| 183 | 183 | ||
| 184 | /* True means put details like time stamps into builds. */ | ||
| 185 | bool build_details; | ||
| 186 | |||
| 184 | /* Name for the server started by the daemon.*/ | 187 | /* Name for the server started by the daemon.*/ |
| 185 | static char *daemon_name; | 188 | static char *daemon_name; |
| 186 | 189 | ||
| @@ -222,6 +225,7 @@ Initialization options:\n\ | |||
| 222 | --display, -d DISPLAY use X server DISPLAY\n\ | 225 | --display, -d DISPLAY use X server DISPLAY\n\ |
| 223 | ", | 226 | ", |
| 224 | "\ | 227 | "\ |
| 228 | --no-build-details do not add build details such as time stamps\n\ | ||
| 225 | --no-desktop do not load a saved desktop\n\ | 229 | --no-desktop do not load a saved desktop\n\ |
| 226 | --no-init-file, -q load neither ~/.emacs nor default.el\n\ | 230 | --no-init-file, -q load neither ~/.emacs nor default.el\n\ |
| 227 | --no-loadup, -nl do not load loadup.el into bare Emacs\n\ | 231 | --no-loadup, -nl do not load loadup.el into bare Emacs\n\ |
| @@ -872,9 +876,6 @@ main (int argc, char **argv) | |||
| 872 | SET_BINARY (fileno (stdout)); | 876 | SET_BINARY (fileno (stdout)); |
| 873 | #endif /* MSDOS */ | 877 | #endif /* MSDOS */ |
| 874 | 878 | ||
| 875 | if (DETERMINISTIC_DUMP) | ||
| 876 | Vdeterministic_dump = Qt; | ||
| 877 | |||
| 878 | /* Skip initial setlocale if LC_ALL is "C", as it's not needed in that case. | 879 | /* Skip initial setlocale if LC_ALL is "C", as it's not needed in that case. |
| 879 | The build procedure uses this while dumping, to ensure that the | 880 | The build procedure uses this while dumping, to ensure that the |
| 880 | dumped Emacs does not have its system locale tables initialized, | 881 | dumped Emacs does not have its system locale tables initialized, |
| @@ -1192,6 +1193,9 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem | |||
| 1192 | no_site_lisp | 1193 | no_site_lisp |
| 1193 | = argmatch (argv, argc, "-nsl", "--no-site-lisp", 11, NULL, &skip_args); | 1194 | = argmatch (argv, argc, "-nsl", "--no-site-lisp", 11, NULL, &skip_args); |
| 1194 | 1195 | ||
| 1196 | build_details = ! argmatch (argv, argc, "-no-build-details", | ||
| 1197 | "--no-build-details", 7, NULL, &skip_args); | ||
| 1198 | |||
| 1195 | #ifdef HAVE_NS | 1199 | #ifdef HAVE_NS |
| 1196 | ns_pool = ns_alloc_autorelease_pool (); | 1200 | ns_pool = ns_alloc_autorelease_pool (); |
| 1197 | #ifdef NS_IMPL_GNUSTEP | 1201 | #ifdef NS_IMPL_GNUSTEP |
| @@ -1641,6 +1645,7 @@ static const struct standard_args standard_args[] = | |||
| 1641 | { "-help", "--help", 90, 0 }, | 1645 | { "-help", "--help", 90, 0 }, |
| 1642 | { "-nl", "--no-loadup", 70, 0 }, | 1646 | { "-nl", "--no-loadup", 70, 0 }, |
| 1643 | { "-nsl", "--no-site-lisp", 65, 0 }, | 1647 | { "-nsl", "--no-site-lisp", 65, 0 }, |
| 1648 | { "-no-build-details", "--no-build-details", 63, 0 }, | ||
| 1644 | /* -d must come last before the options handled in startup.el. */ | 1649 | /* -d must come last before the options handled in startup.el. */ |
| 1645 | { "-d", "--display", 60, 1 }, | 1650 | { "-d", "--display", 60, 1 }, |
| 1646 | { "-display", 0, 60, 1 }, | 1651 | { "-display", 0, 60, 1 }, |
| @@ -2535,13 +2540,6 @@ libraries; only those already known by Emacs will be loaded. */); | |||
| 2535 | Vdynamic_library_alist = Qnil; | 2540 | Vdynamic_library_alist = Qnil; |
| 2536 | Fput (intern_c_string ("dynamic-library-alist"), Qrisky_local_variable, Qt); | 2541 | Fput (intern_c_string ("dynamic-library-alist"), Qrisky_local_variable, Qt); |
| 2537 | 2542 | ||
| 2538 | DEFVAR_BOOL ("deterministic-dump", Vdeterministic_dump, | ||
| 2539 | doc: /* If non-nil, attempt to make dumping deterministic by | ||
| 2540 | avoiding sources of nondeterminism such as absolute file names, the | ||
| 2541 | hostname, or timestamps. */); | ||
| 2542 | Vdeterministic_dump = DETERMINISTIC_DUMP ? Qt : Qnil; | ||
| 2543 | XSYMBOL (intern_c_string ("deterministic-dump"))->constant = 1; | ||
| 2544 | |||
| 2545 | #ifdef WINDOWSNT | 2543 | #ifdef WINDOWSNT |
| 2546 | Vlibrary_cache = Qnil; | 2544 | Vlibrary_cache = Qnil; |
| 2547 | staticpro (&Vlibrary_cache); | 2545 | staticpro (&Vlibrary_cache); |
diff --git a/src/lisp.h b/src/lisp.h index 18d986441f0..9c7955e2bc4 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -4132,6 +4132,9 @@ extern bool noninteractive; | |||
| 4132 | /* True means remove site-lisp directories from load-path. */ | 4132 | /* True means remove site-lisp directories from load-path. */ |
| 4133 | extern bool no_site_lisp; | 4133 | extern bool no_site_lisp; |
| 4134 | 4134 | ||
| 4135 | /* True means put details like time stamps into builds. */ | ||
| 4136 | extern bool build_details; | ||
| 4137 | |||
| 4135 | /* Pipe used to send exit notification to the daemon parent at | 4138 | /* Pipe used to send exit notification to the daemon parent at |
| 4136 | startup. On Windows, we use a kernel event instead. */ | 4139 | startup. On Windows, we use a kernel event instead. */ |
| 4137 | #ifndef WINDOWSNT | 4140 | #ifndef WINDOWSNT |
diff --git a/src/sysdep.c b/src/sysdep.c index b01c64d52ac..a01bf1d7c10 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -1408,11 +1408,10 @@ setup_pty (int fd) | |||
| 1408 | void | 1408 | void |
| 1409 | init_system_name (void) | 1409 | init_system_name (void) |
| 1410 | { | 1410 | { |
| 1411 | if (DETERMINISTIC_DUMP && (might_dump || ! NILP (Vpurify_flag))) | 1411 | if (!build_details) |
| 1412 | { | 1412 | { |
| 1413 | /* If we're dumping, set the hostname to a literal so that the | 1413 | /* Set system-name to nil so that the build is deterministic. */ |
| 1414 | dump is deterministic. */ | 1414 | Vsystem_name = Qnil; |
| 1415 | Vsystem_name = build_pure_c_string ("elided"); | ||
| 1416 | return; | 1415 | return; |
| 1417 | } | 1416 | } |
| 1418 | char *hostname_alloc = NULL; | 1417 | char *hostname_alloc = NULL; |