(defvar comp-dry-run nil
"When non nil run everything but the C back-end.")
+(defconst comp-valid-source-re (rx ".el" (? ".gz") eos)
+ "Regexp to match filename of valid input source files.")
+
(defconst comp-log-buffer-name "*Native-compile-Log*"
"Name of the native-compiler log buffer.")
(cl-loop
for (source-file . load) = (pop comp-files-queue)
while source-file
- do (cl-assert (string-match-p (rx ".el" eos) source-file) nil
+ do (cl-assert (string-match-p comp-valid-source-re source-file) nil
"`comp-files-queue' should be \".el\" files: %s"
source-file)
when (or comp-always-compile
(dolist (path paths)
(cond ((file-directory-p path)
(dolist (file (if recursively
- (directory-files-recursively path (rx ".el" eos))
- (directory-files path t (rx ".el" eos))))
+ (directory-files-recursively path comp-valid-source-re)
+ (directory-files path t comp-valid-source-re)))
(push file files)))
((file-exists-p path) (push path files))
(t (signal 'native-compiler-error
(Lisp_Object file_name, Lisp_Object base_dir)
{
CHECK_STRING (file_name);
+ if (suffix_p (file_name, ".gz"))
+ file_name = Fsubstring (file_name, Qnil, make_fixnum (-3));
file_name = Fexpand_file_name (file_name, Qnil);
Lisp_Object hashed = Fsubstring (comp_hash_string (file_name), Qnil,
make_fixnum (ELN_FILENAME_HASH_LEN));
concat2 (CALL1I (file-name-sans-extension, Vload_true_file_name),
build_pure_c_string (".el"));
if (NILP (Ffile_exists_p (src)))
- return;
+ {
+ src = concat2 (src, build_pure_c_string (".gz"));
+ if (NILP (Ffile_exists_p (src)))
+ return;
+ }
/* This is to have deferred compilaiton able to compile comp
dependecies breaking circularity. */