emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/native-comp e05a62a 1/6: Have a fast build option triggered by e


From: Andrea Corallo
Subject: feature/native-comp e05a62a 1/6: Have a fast build option triggered by env var NATIVE_FAST_BOOT
Date: Sun, 22 Mar 2020 12:42:40 -0400 (EDT)

branch: feature/native-comp
commit e05a62a968e688533f014ac556a8b32662b32ed3
Author: Andrea Corallo <address@hidden>
Commit: Andrea Corallo <address@hidden>

    Have a fast build option triggered by env var NATIVE_FAST_BOOT
---
 lisp/Makefile.in        |  8 +++++---
 lisp/emacs-lisp/comp.el | 22 ++++++++++++----------
 2 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index 8ba6196..035720b 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -351,9 +351,11 @@ compile-main: gen-lisp compile-clean
              GREP_OPTIONS= grep '^;.*[^a-zA-Z]no-byte-compile: *t' $$el > 
/dev/null && \
              continue;                              \
          echo "$${el}c";                            \
-       done | xargs $(XARGS_LIMIT) echo) |          \
-       while read chunk; do                         \
-         $(MAKE) compile-targets TARGETS="$$chunk"; \
+       done | xargs $(XARGS_LIMIT) echo) |          \
+       while read chunk; do                         \
+         $(MAKE) compile-targets                    \
+                 NATIVE_DISABLE=$(NATIVE_FAST_BOOT) \
+                 TARGETS="$$chunk";                 \
        done
 
 .PHONY: native-compile-clean
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 1e348c0..a316d74 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -2234,16 +2234,18 @@ Ultra cheap impersonation of `batch-byte-compile'."
 (defun batch-byte-native-compile-for-bootstrap ()
   "As `batch-byte-compile' but used for booststrap.
 Always generate elc files too and handle native compiler expected errors."
-  (let ((byte-native-for-bootstrap t)
-        (byte-to-native-output-file nil))
-    (unwind-protect
-        (condition-case _
-            (batch-native-compile)
-          (native-compiler-error-dyn-func)
-          (native-compiler-error-empty-byte))
-      (pcase byte-to-native-output-file
-        (`(,tempfile . ,target-file)
-         (rename-file tempfile target-file t))))))
+  (if (equal (getenv "NATIVE_DISABLE") "1")
+      (batch-byte-compile)
+    (let ((byte-native-for-bootstrap t)
+          (byte-to-native-output-file nil))
+      (unwind-protect
+          (condition-case _
+              (batch-native-compile)
+            (native-compiler-error-dyn-func)
+            (native-compiler-error-empty-byte))
+        (pcase byte-to-native-output-file
+          (`(,tempfile . ,target-file)
+           (rename-file tempfile target-file t)))))))
 
 ;;;###autoload
 (defun native-compile-async (paths &optional recursively load)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]