diff options
author | Eli Zaretskii <eliz@gnu.org> | 2013-05-16 15:48:54 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2013-05-16 15:48:54 +0300 |
commit | df065a0b9a1ad4be56ffd30bba934b940e85c2c3 (patch) | |
tree | 55c7ca0dd3993d45d3bb54877fb31f025b0ca0ea /lisp | |
parent | dcfda130117b8a79f4253197b48cf09ba35a3b72 (diff) | |
parent | f1e496a5c86d88c2d6f92c5083b1a9ee11f90109 (diff) | |
download | emacs-df065a0b9a1ad4be56ffd30bba934b940e85c2c3.tar.gz emacs-df065a0b9a1ad4be56ffd30bba934b940e85c2c3.tar.bz2 emacs-df065a0b9a1ad4be56ffd30bba934b940e85c2c3.zip |
Support building Emacs on MS-Windows using the Posix configury.
lib/Makefile.am: If building for MS-Windows, include
nt/gnulib.mk instead of lib/gnulib.mk.
configure.ac: Adapt to MSYS build on MS-Windows.
Makefile.in (NTDIR): New variable, for the MSYS build on
MS-Windows.
(SUBDIR): Add $(NTDIR).
(.PHONY): Add epaths-force-w32.
(msys_to_w32): New variable.
(epaths-force-w32, install-nt, uninstall-nt): New targets.
(lib-src src): Add $(NTLIB) to prerequisites.
(lib lib-src lisp leim nt): Add 'nt'.
(config.status): Use $(CFG).
(.PHONY): Add install-$(NTDIR) and uninstall-$(NTDIR).
(install, install-arch-dep): Add install-$(NTDIR).
(uninstall): Depend on uninstall-$(NTDIR).
(mostlyclean, clean, distclean, bootstrap-clean): Add 'nt'.
* GNUmakefile (CFG): New variable, uses mingw-cfg.site as
CONFIG_SITE for the MSYS build on MS-Windows.
(Makefile): Use $(CFG).
.bzrignore: Ignore *.res, *.tmp, and *.map. Remove
src/emacs.res.
etc/NEWS: Advertise the MSYS build on MS-Windows.
leim/Makefile.in (leim-list.el, check-declare): Use reveal-filename.
lib-src/update-game-score.c [WINDOWSNT]: Include "ntlib.h".
lib-src/ntlib.h (sleep): Update prototype.
(geteuid): Add prototype.
lib-src/ntlib.c (sleep): Now returns an unsigned value.
(getgid): New function.
lib-src/Makefile.in (CLIENTW, LIB_WSOCK32, LIBS_ECLIENT, NTLIB)
(CLIENTRES, WINDRES, NTINC, NTDEPS): New variables.
(INSTALLABLES): Add $(CLIENTW).
(LIBS_MOVE): Use $(LIB_WSOCK32).
($(DESTDIR)${archlibdir}): Use $(EXEEXT) on update-game-score.
(test-distrib${EXEEXT}): Use $(EXEEXT) on test-distrib.
(etags${EXEEXT}, ebrowse${EXEEXT}, ctags${EXEEXT})
(profile${EXEEXT}, make-docfile${EXEEXT}, movemail${EXEEXT})
(emacsclient${EXEEXT}, hexl${EXEEXT}, update-game-score${EXEEXT}):
Add $(NTLIB) to prerequisites. Use $(EXEEXT).
(pop.o): Add pop.h to prerequisites.
(emacsclientw${EXEEXT}, ntlib.o): New targets.
(emacsclient.res): New target.
lisp/subr.el (reveal-filename): New function.
lisp/loadup.el: Compute Emacs executable versions on MS-Windows,
where executables have the .exe extension. Add a hard link
emacs-XX.YY.ZZ.exe on MS-Windows.
lisp/Makefile.in (XARGS_LIMIT): New variable.
(custom-deps, finder-data, autoloads)
($(MH_E_DIR)/mh-loaddefs.el, $(TRAMP_DIR)/tramp-loaddefs.el)
($(CAL_DIR)/cal-loaddefs.el, $(CAL_DIR)/diary-loaddefs.el)
($(CAL_DIR)/hol-loaddefs.el): Use reveal-filename.
(compile-main): Limit xargs according to $(XARGS_LIMIT).
nt/msysconfig.sh: New file.
nt/mingw-cfg.site: New file.
nt/makefile.w32-in (LOCAL_FLAGS): Add -DOLD_PATHS=1.
nt/inc/unistd.h: Include pwd.h and sys/types.h.
nt/inc/sys/time.h (_TIMEVAL_DEFINED, timerisset, timercmp)
(timerclear): Define.
(gettimeofday): Adjust signature to be Posix compatible, by using
the 'restrict' keyword.
nt/inc/sys/stat.h (UTIME_NOW, UTIME_OMIT): Define.
(struct _stat, struct _stati64): Define.
nt/inc/sys/socket.h (timeval): Define only for MSVC.
(FD_SET, FD_CLR, FD_ISSET, fd_set): Redefine only if
EMACS_CONFIG_H is defined.
(timeval): Undefine only for MSVC.
nt/inc/ms-w32.h (HAVE___BUILTIN_UNWIND_INIT, restrict)
(HAVE_WINDOW_SYSTEM, HAVE_MENUS, EMACS_CONFIGURATION)
(EMACS_CONFIG_OPTIONS, HAVE_LONG_LONG_INT)
(HAVE_UNSIGNED_LONG_LONG_INT): Define only if not already defined.
(fileno): Move definition after including stdio.h.
(sigset_t): Guard typedef by _W64.
nt/gnulib.mk: New file.
nt/epaths.nt: New file.
nt/addpm.c [!OLD_PATHS]: Include src/epaths.h, instead of having a
copy of the file names there.
<env_vars> [!OLD_PATHS]: Use macros from epaths.h instead of
literal strings.
nt/Makefile.in: New file.
nt/INSTALL.MSYS: New file.
nt/INSTALL: Mention INSTALL.MSYS.
src/w32.c: Include epaths.h.
(init_environment): Use cmdproxy.exe without leading directories.
Support emacs.exe in src; point SHELL to cmdproxy in ../nt in that
case.
(gettimeofday): Adjust signature and return value to Posix
expectations.
src/unexw32.c (open_output_file): Delete the existing emacs.exe
before creating it, to break the hard link to the versioned
executable.
src/Makefile.in (EMACS_MANIFEST, CM_OBJ, TEMACS_POST_LINK)
(ADDSECTION, EMACS_HEAPSIZE, MINGW_TEMACS_POST_LINK)
(FIRSTFILE_OBJ): New variables.
(W32_RES): Rename to EMACSRES. All users changed.
(base_obj): Use $(CM_OBJ).
(ALLOBJS): Use $(FIRSTFILE_OBJ).
(emacs$(EXEEXT)): Depend on $(ADDSECTION).
(temacs$(EXEEXT)): Use $(TEMACS_POST_LINK), and move
$(W32_RES_LINK) before $(LIBES).
(emacs.res): Depend on $(EMACS_MANIFEST). Put emacs.rc in nt.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 15 | ||||
-rw-r--r-- | lisp/Makefile.in | 22 | ||||
-rw-r--r-- | lisp/loadup.el | 20 | ||||
-rw-r--r-- | lisp/subr.el | 16 |
4 files changed, 59 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e6f56664a52..a33796ce24f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,18 @@ +2013-05-16 Eli Zaretskii <eliz@gnu.org> + + * subr.el (reveal-filename): New function. + + * loadup.el: Compute Emacs executable versions on MS-Windows, + where executables have the .exe extension. Add a hard link + emacs-XX.YY.ZZ.exe on MS-Windows. + + * Makefile.in (XARGS_LIMIT): New variable. + (custom-deps, finder-data, autoloads) + ($(MH_E_DIR)/mh-loaddefs.el, $(TRAMP_DIR)/tramp-loaddefs.el) + ($(CAL_DIR)/cal-loaddefs.el, $(CAL_DIR)/diary-loaddefs.el) + ($(CAL_DIR)/hol-loaddefs.el): Use reveal-filename. + (compile-main): Limit xargs according to $(XARGS_LIMIT). + 2013-05-16 Leo Liu <sdl.web@gmail.com> * progmodes/octave.el (octave-indent-defun): Mark obsolete. 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 a2e0d8ecec5..5764cdec7eb 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))) @@ -376,18 +379,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 177e9a84a58..9bf11a13ef6 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4678,4 +4678,20 @@ as alpha versions." (prin1-to-string (make-hash-table))))) (provide 'hashtable-print-readable)) +;; This is used in lisp/Makefile.in and in leim/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 |