From: Eli Zaretskii Date: Thu, 16 May 2013 12:48:54 +0000 (+0300) Subject: Support building Emacs on MS-Windows using the Posix configury. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~2026^2~229^2~63 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=df065a0b9a1ad4be56ffd30bba934b940e85c2c3;p=emacs.git 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. [!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. --- df065a0b9a1ad4be56ffd30bba934b940e85c2c3 diff --cc ChangeLog index ce2014288e6,ce2014288e6..f47d2b70585 --- a/ChangeLog +++ b/ChangeLog @@@ -1,3 -1,3 +1,31 @@@ ++2013-05-16 Eli Zaretskii ++ ++ * 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. ++ 2013-05-16 Paul Eggert Merge from gnulib, incorporating: diff --cc etc/ChangeLog index f4f17ac29cf,f4f17ac29cf..b516d1aef65 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@@ -1,3 -1,3 +1,7 @@@ ++2013-05-16 Eli Zaretskii ++ ++ * NEWS: Advertise the MSYS build on MS-Windows. ++ 2013-05-15 Stefan Monnier * .gitignore: Don't ignore DOC-* any more. diff --cc leim/ChangeLog index 64954ddad85,64954ddad85..f86fb23eb5e --- a/leim/ChangeLog +++ b/leim/ChangeLog @@@ -1,3 -1,3 +1,7 @@@ ++2013-05-16 Eli Zaretskii ++ ++ * Makefile.in (leim-list.el, check-declare): Use reveal-filename. ++ 2013-04-01 Paul Eggert Use UTF-8 for most files with non-ASCII characters (Bug#13936). diff --cc lib-src/ChangeLog index 63108cae9a9,63108cae9a9..6ff653b7be6 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@@ -1,3 -1,3 +1,27 @@@ ++2013-05-16 Eli Zaretskii ++ ++ * update-game-score.c [WINDOWSNT]: Include "ntlib.h". ++ ++ * ntlib.h (sleep): Update prototype. ++ (geteuid): Add prototype. ++ ++ * ntlib.c (sleep): Now returns an unsigned value. ++ (getgid): New function. ++ ++ * 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. ++ 2013-05-15 Stefan Monnier * makefile.w32-in ($(DOC)): Use DOC rather than DOC-X. diff --cc lisp/ChangeLog index e6f56664a52,e6f56664a52..a33796ce24f --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@@ -1,3 -1,3 +1,18 @@@ ++2013-05-16 Eli Zaretskii ++ ++ * 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 * progmodes/octave.el (octave-indent-defun): Mark obsolete. diff --cc nt/ChangeLog index b66871e319b,b66871e319b..80b6390d368 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@@ -1,3 -1,3 +1,48 @@@ ++2013-05-16 Eli Zaretskii ++ ++ * msysconfig.sh: New file. ++ ++ * mingw-cfg.site: New file. ++ ++ * makefile.w32-in (LOCAL_FLAGS): Add -DOLD_PATHS=1. ++ ++ * inc/unistd.h: Include pwd.h and sys/types.h. ++ ++ * inc/sys/time.h (_TIMEVAL_DEFINED, timerisset, timercmp) ++ (timerclear): Define. ++ (gettimeofday): Adjust signature to be Posix compatible, by using ++ the 'restrict' keyword. ++ ++ * inc/sys/stat.h (UTIME_NOW, UTIME_OMIT): Define. ++ (struct _stat, struct _stati64): Define. ++ ++ * 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. ++ ++ * 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. ++ ++ * gnulib.mk: New file. ++ ++ * epaths.nt: New file. ++ ++ * addpm.c [!OLD_PATHS]: Include src/epaths.h, instead of having a ++ copy of the file names there. ++ [!OLD_PATHS]: Use macros from epaths.h instead of ++ literal strings. ++ ++ * Makefile.in: New file. ++ ++ * INSTALL.MSYS: New file. ++ ++ * INSTALL: Mention INSTALL.MSYS. ++ 2013-05-15 Stefan Monnier * makefile.w32-in (clean, top-distclean): DOC-X doesn't exist any more. diff --cc src/ChangeLog index c45ec824919,c45ec824919..e5308e2db3b --- a/src/ChangeLog +++ b/src/ChangeLog @@@ -1,3 -1,3 +1,27 @@@ ++2013-05-16 Eli Zaretskii ++ ++ * 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. ++ ++ * unexw32.c (open_output_file): Delete the existing emacs.exe ++ before creating it, to break the hard link to the versioned ++ executable. ++ ++ * 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. ++ 2013-05-15 Stefan Monnier * makefile.w32-in (DOC): Use just "DOC".