diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/Makefile.in | 22 | ||||
-rw-r--r-- | lisp/loadup.el | 34 | ||||
-rw-r--r-- | lisp/subr.el | 16 |
3 files changed, 56 insertions, 16 deletions
diff --git a/lisp/Makefile.in b/lisp/Makefile.in index c8707df15df..138ad5abfa6 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -24,6 +24,10 @@ abs_top_builddir = @abs_top_builddir@ lisp = $(srcdir) VPATH = $(srcdir) +# Empty for all systems except MinGW, where xargs needs an explicit +# limitation. +XARGS_LIMIT = @XARGS_LIMIT@ + # You can specify a different executable on the make command line, # e.g. "make EMACS=../src/emacs ...". @@ -160,21 +164,21 @@ $(lisp)/cus-load.el: custom-deps: doit cd $(lisp); $(setwins_almost); \ echo Directories: $$wins; \ - $(emacs) -l cus-dep --eval '(setq generated-custom-dependencies-file "$(lisp)/cus-load.el")' -f custom-make-dependencies $$wins + $(emacs) -l cus-dep --eval '(setq generated-custom-dependencies-file (reveal-filename "$(lisp)/cus-load.el"))' -f custom-make-dependencies $$wins $(lisp)/finder-inf.el: $(MAKE) $(MFLAGS) finder-data finder-data: doit cd $(lisp); $(setwins_almost); \ echo Directories: $$wins; \ - $(emacs) -l finder --eval '(setq generated-finder-keywords-file "$(lisp)/finder-inf.el")' -f finder-compile-keywords-make-dist $$wins + $(emacs) -l finder --eval '(setq generated-finder-keywords-file (reveal-filename "$(lisp)/finder-inf.el"))' -f finder-compile-keywords-make-dist $$wins # The chmod +w is to handle env var CVSREAD=1. autoloads: $(LOADDEFS) doit cd $(lisp) && chmod +w $(AUTOGEN_VCS) cd $(lisp); $(setwins_almost); \ echo Directories: $$wins; \ - $(emacs) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins + $(emacs) -l autoload --eval '(setq generated-autoload-file (reveal-filename "$(lisp)/loaddefs.el"))' -f batch-update-autoloads $$wins # This is required by the bootstrap-emacs target in ../src/Makefile, so # we know that if we have an emacs executable, we also have a subdirs.el. @@ -274,7 +278,7 @@ compile-main: compile-clean test -f $$el || continue; \ test ! -f $${el}c && GREP_OPTIONS= grep '^;.*no-byte-compile: t' $$el > /dev/null && continue; \ echo "$${el}c"; \ - done | xargs echo) | \ + done | xargs $(XARGS_LIMIT) echo) | \ while read chunk; do \ $(MAKE) $(MFLAGS) compile-targets EMACS="$(EMACS)" TARGETS="$$chunk"; \ done @@ -369,7 +373,7 @@ mh-autoloads: $(MH_E_DIR)/mh-loaddefs.el $(MH_E_DIR)/mh-loaddefs.el: $(MH_E_SRC) $(emacs) -l autoload \ --eval "(setq generate-autoload-cookie \";;;###mh-autoload\")" \ - --eval "(setq generated-autoload-file \"$@\")" \ + --eval "(setq generated-autoload-file (reveal-filename \"$@\"))" \ --eval "(setq make-backup-files nil)" \ -f batch-update-autoloads $(MH_E_DIR) @@ -387,7 +391,7 @@ TRAMP_SRC = $(TRAMP_DIR)/tramp.el $(TRAMP_DIR)/tramp-adb.el \ $(TRAMP_DIR)/tramp-loaddefs.el: $(TRAMP_SRC) $(emacs) -l autoload \ --eval "(setq generate-autoload-cookie \";;;###tramp-autoload\")" \ - --eval "(setq generated-autoload-file \"$@\")" \ + --eval "(setq generated-autoload-file (reveal-filename \"$@\"))" \ --eval "(setq make-backup-files nil)" \ -f batch-update-autoloads $(TRAMP_DIR) @@ -409,21 +413,21 @@ CAL_SRC = $(CAL_DIR)/cal-bahai.el $(CAL_DIR)/cal-china.el \ $(CAL_DIR)/cal-loaddefs.el: $(CAL_SRC) $(emacs) -l autoload \ --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \ - --eval "(setq generated-autoload-file \"$@\")" \ + --eval "(setq generated-autoload-file (reveal-filename \"$@\"))" \ --eval "(setq make-backup-files nil)" \ -f batch-update-autoloads $(CAL_DIR) $(CAL_DIR)/diary-loaddefs.el: $(CAL_SRC) $(emacs) -l autoload \ --eval "(setq generate-autoload-cookie \";;;###diary-autoload\")" \ - --eval "(setq generated-autoload-file \"$@\")" \ + --eval "(setq generated-autoload-file (reveal-filename \"$@\"))" \ --eval "(setq make-backup-files nil)" \ -f batch-update-autoloads $(CAL_DIR) $(CAL_DIR)/hol-loaddefs.el: $(CAL_SRC) $(emacs) -l autoload \ --eval "(setq generate-autoload-cookie \";;;###holiday-autoload\")" \ - --eval "(setq generated-autoload-file \"$@\")" \ + --eval "(setq generated-autoload-file (reveal-filename \"$@\"))" \ --eval "(setq make-backup-files nil)" \ -f batch-update-autoloads $(CAL_DIR) diff --git a/lisp/loadup.el b/lisp/loadup.el index 00c52341058..7509689e2b7 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -290,9 +290,12 @@ (equal (nth 4 command-line-args) "dump")) (not (eq system-type 'ms-dos))) (let* ((base (concat "emacs-" emacs-version ".")) + (exelen (if (eq system-type 'windows-nt) -4)) (files (file-name-all-completions base default-directory)) - (versions (mapcar (function (lambda (name) - (string-to-number (substring name (length base))))) + (versions (mapcar (function + (lambda (name) + (string-to-number + (substring name (length base) exelen)))) files))) (setq emacs-bzr-version (condition-case nil (emacs-bzr-get-version) (error nil))) @@ -311,8 +314,18 @@ "-" (substring name (match-end 0))))) (if (memq system-type '(ms-dos windows-nt)) - (setq name (expand-file-name - (if (fboundp 'x-create-frame) "DOC-X" "DOC") "../etc")) + (let ((name1 (expand-file-name + (if (fboundp 'x-create-frame) "DOC-X" "DOC") + "../etc"))) + ;; There will be no DOC-X on MS-Windows when we build + ;; using the Posix Makefile's. In that case, we want + ;; to create DOC-XX.YY.ZZ, as on Unix. + (if (file-exists-p name1) + (setq name name1) + (setq name (concat (expand-file-name "../etc/DOC-") name)) + (if (file-exists-p name) + (delete-file name)) + (copy-file (expand-file-name "../etc/DOC") name t))) (setq name (concat (expand-file-name "../etc/DOC-") name)) (if (file-exists-p name) (delete-file name)) @@ -388,18 +401,25 @@ (dump-emacs "emacs" "temacs") (message "%d pure bytes used" pure-bytes-used) ;; Recompute NAME now, so that it isn't set when we dump. - (if (not (or (memq system-type '(ms-dos windows-nt)) + (if (not (or (eq system-type 'ms-dos) ;; Don't bother adding another name if we're just ;; building bootstrap-emacs. (equal (nth 3 command-line-args) "bootstrap") (equal (nth 4 command-line-args) "bootstrap"))) - (let ((name (concat "emacs-" emacs-version))) + (let ((name (concat "emacs-" emacs-version)) + (exe (if (eq system-type 'windows-nt) ".exe" ""))) (while (string-match "[^-+_.a-zA-Z0-9]+" name) (setq name (concat (downcase (substring name 0 (match-beginning 0))) "-" (substring name (match-end 0))))) + (setq name (concat name exe)) (message "Adding name %s" name) - (add-name-to-file "emacs" name t))) + ;; When this runs on Windows, invocation-directory is not + ;; necessarily the current directory. + (add-name-to-file (expand-file-name (concat "emacs" exe) + invocation-directory) + (expand-file-name name invocation-directory) + t))) (kill-emacs))) ;; For machines with CANNOT_DUMP defined in config.h, diff --git a/lisp/subr.el b/lisp/subr.el index bb23745df72..802fee4ee65 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4655,4 +4655,20 @@ as alpha versions." (prin1-to-string (make-hash-table))))) (provide 'hashtable-print-readable)) +;; This is used in lisp/Makefile.in to generate file names for +;; autoloads, custom-deps, and finder-data. +(defun reveal-filename (file) + "Produce the real file name for FILE. + +On systems other than MS-Windows, just returns FILE. +On MS-Windows, converts /d/foo/bar form of file names +passed by MSYS Make into d:/foo/bar that Emacs can grok. + +This function is called from lisp/Makefile." + (when (and (eq system-type 'windows-nt) + (string-match "\\`/[a-zA-Z]/" file)) + (setq file (concat (substring file 1 2) ":" (substring file 2)))) + file) + + ;;; subr.el ends here |