summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--GNUmakefile7
-rw-r--r--Makefile.in71
-rwxr-xr-xbuild-aux/update-subdirs4
-rw-r--r--configure.ac525
-rw-r--r--doc/lispintro/ChangeLog5
-rw-r--r--doc/lispintro/emacs-lisp-intro.texi21
-rw-r--r--leim/Makefile.in4
-rw-r--r--lib-src/Makefile.in83
-rw-r--r--lib-src/ntlib.c12
-rw-r--r--lib-src/ntlib.h4
-rw-r--r--lib-src/update-game-score.c4
-rw-r--r--lib/Makefile.am4
-rw-r--r--lisp/ChangeLog54
-rw-r--r--lisp/Makefile.in22
-rw-r--r--lisp/epg.el20
-rw-r--r--lisp/info-look.el7
-rw-r--r--lisp/jit-lock.el25
-rw-r--r--lisp/loadup.el34
-rw-r--r--lisp/minibuffer.el4
-rw-r--r--lisp/net/tramp-adb.el7
-rw-r--r--lisp/net/tramp-compat.el14
-rw-r--r--lisp/net/tramp-gvfs.el2
-rw-r--r--lisp/net/tramp-sh.el134
-rw-r--r--lisp/net/tramp.el22
-rw-r--r--lisp/subr.el16
-rw-r--r--lisp/textmodes/reftex-vars.el9
-rw-r--r--lisp/textmodes/reftex.el1
-rwxr-xr-xmake-dist3
-rw-r--r--nt/INSTALL10
-rw-r--r--nt/INSTALL.MSYS580
-rw-r--r--nt/Makefile.in212
-rw-r--r--nt/addpm.c17
-rw-r--r--nt/epaths.nt89
-rw-r--r--nt/gnulib.mk858
-rw-r--r--nt/inc/ms-w32.h48
-rw-r--r--nt/inc/sys/socket.h12
-rw-r--r--nt/inc/sys/stat.h36
-rw-r--r--nt/inc/sys/time.h18
-rw-r--r--nt/inc/unistd.h3
-rw-r--r--nt/makefile.w32-in2
-rw-r--r--nt/mingw-cfg.site74
-rw-r--r--nt/msysconfig.sh39
-rw-r--r--src/ChangeLog5
-rw-r--r--src/Makefile.in44
-rw-r--r--src/unexw32.c8
-rw-r--r--src/w32.c72
47 files changed, 2916 insertions, 338 deletions
diff --git a/ChangeLog b/ChangeLog
index dc6c0bfc3ec..5f74726a743 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2013-04-22 Paul Eggert <eggert@cs.ucla.edu>
+
+ * make-dist: Do not distribute admin/unidata/Makefile.
+ It is generated by 'configure'.
+
+ * build-aux/update-subdirs: Don't leave subdirs.el~ behind.
+ It messes up 'make distclean', and contains no useful information
+ because it's a copy of subdirs.el.
+
2013-04-18 John Marino <gnugcc@marino.st> (tiny change)
* configure.ac: Add DragonFly BSD, mostly same as FreeBSD. (Bug#14068)
diff --git a/GNUmakefile b/GNUmakefile
index b829e93b498..a2a630ba9d5 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -32,6 +32,11 @@
# run "configure" by hand. But run autogen.sh first, if the source
# was checked out directly from the repository.
+ifneq ($(MSYSTEM),)
+CFG = CONFIG_SITE=$(CURDIR)/nt/mingw-cfg.site
+else
+CFG =
+endif
# If a Makefile already exists, just use it.
@@ -70,7 +75,7 @@ configure:
Makefile: configure
@echo >&2 'There seems to be no Makefile in this directory.'
@echo >&2 'Running ./configure ...'
- ./configure
+ $(CFG) ./configure
@echo >&2 'Makefile built.'
endif
diff --git a/Makefile.in b/Makefile.in
index 019460acf3c..13b452d30d1 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -93,6 +93,9 @@ version=@version@
### for, like `mips-dec-ultrix' or `sparc-sun-sunos'.
configuration=@configuration@
+### The nt/ subdirectory gets built only for MinGW
+NTDIR=@NTDIR@
+
# ==================== Where To Install Things ====================
# Location to install Emacs.app under GNUstep / Mac OS X.
@@ -272,23 +275,23 @@ EMACS = ${EMACS_NAME}${EXEEXT}
EMACSFULL = `echo emacs-${version} | sed '$(TRANSFORM)'`${EXEEXT}
# Subdirectories to make recursively.
-SUBDIR = lib lib-src src lisp leim
+SUBDIR = $(NTDIR) lib lib-src src lisp leim
# The subdir makefiles created by config.status.
SUBDIR_MAKEFILES_IN = @SUBDIR_MAKEFILES_IN@
SUBDIR_MAKEFILES = `echo $(SUBDIR_MAKEFILES_IN:.in=) | sed 's|$(srcdir)/||g'`
-# Subdirectories to install, and where they'll go.
-# lib-src's makefile knows how to install it, so we don't do that here.
-# Directories that cannot simply be copied, eg info,
-# are treated separately.
-# quail appears twice because in out-of-tree builds, it exists twice.
+# Subdirectories to install, and where they'll go. lib-src's and nt's
+# makefiles know how to install them, so we don't do that here.
+# Directories that cannot simply be copied, eg info, are treated
+# separately. quail appears twice because in out-of-tree builds, it
+# exists twice.
COPYDIR = ${srcdir}/etc ${srcdir}/lisp ${srcdir}/leim/ja-dic ${srcdir}/leim/quail leim/quail
COPYDESTS = $(DESTDIR)${etcdir} $(DESTDIR)${lispdir} $(DESTDIR)${leimdir}/ja-dic $(DESTDIR)${leimdir}/quail $(DESTDIR)${leimdir}/quail
all: ${SUBDIR}
-.PHONY: all ${SUBDIR} blessmail epaths-force FRC
+.PHONY: all ${SUBDIR} blessmail epaths-force epaths-force-w32 FRC
removenullpaths=sed -e 's/^://g' -e 's/:$$//g' -e 's/::/:/g'
@@ -315,7 +318,20 @@ epaths-force: FRC
-e 's;\(#.*PATH_DOC\).*$$;\1 "${docdir}";') && \
${srcdir}/build-aux/move-if-change epaths.h.$$$$ src/epaths.h
-lib-src src: lib
+# Convert MSYS-style /x/foo file name into x:/foo that Windows can grok.
+msys_to_w32=sed -e 's,^/\([A-Za-z]\)/,\1:/,'
+
+# The w32 build needs a slightly different editing, and it uses
+# nt/epaths.nt as the template.
+epaths-force-w32: FRC
+ @(w32srcdir=`echo "${srcdir}" | ${msys_to_w32}` ; \
+ sed < ${srcdir}/nt/epaths.nt > epaths.h.$$$$ \
+ -e '/^.*#/s/@VER@/${version}/g' \
+ -e '/^.*#/s/@CFG@/${configuration}/g' \
+ -e "/^.*#/s|@SRC@|$${w32srcdir}|g") && \
+ ${srcdir}/build-aux/move-if-change epaths.h.$$$$ src/epaths.h
+
+lib-src src: $(NTDIR) lib
src: lib-src FRC
@@ -324,7 +340,7 @@ src: lib-src FRC
lisp leim: src
# These targets should be "${SUBDIR} without `src'".
-lib lib-src lisp leim: Makefile FRC
+lib lib-src lisp leim nt: Makefile FRC
cd $@ && $(MAKE) all $(MFLAGS) \
CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \
LDFLAGS='${LDFLAGS}' MAKE='${MAKE}'
@@ -378,9 +394,9 @@ $(MAKEFILE_NAME): config.status $(srcdir)/src/config.in \
config.status: ${srcdir}/configure ${srcdir}/lisp/version.el
if [ -x ./config.status ]; then \
- ./config.status --recheck; \
+ $(CFG) ./config.status --recheck; \
else \
- $(srcdir)/configure $(CONFIGURE_FLAGS); \
+ $(CFG) $(srcdir)/configure $(CONFIGURE_FLAGS); \
fi
AUTOCONF_INPUTS = $(srcdir)/configure.ac $(srcdir)/aclocal.m4
@@ -417,13 +433,14 @@ $(srcdir)/src/stamp-h.in: $(AUTOCONF_INPUTS)
# ==================== Installation ====================
.PHONY: install install-arch-dep install-arch-indep install-doc install-info
-.PHONY: install-man install-etc install-strip uninstall
+.PHONY: install-man install-etc install-strip install-$(NTDIR)
+.PHONY: uninstall uninstall-$(NTDIR)
## If we let lib-src do its own installation, that means we
## don't have to duplicate the list of utilities to install in
## this Makefile as well.
-install: all install-arch-indep install-doc install-arch-dep blessmail
+install: all install-arch-indep install-doc install-arch-dep install-$(NTDIR) blessmail
@true
## Ensure that $subdir contains a subdirs.el file.
@@ -444,7 +461,7 @@ write_subdir=if [ -f $${subdir}/subdirs.el ]; \
### Install the executables that were compiled specifically for this machine.
### We do install-arch-indep first because the executable needs the
### Lisp files and DOC file to work properly.
-install-arch-dep: src install-arch-indep install-doc
+install-arch-dep: src install-arch-indep install-doc install-$(NTDIR)
umask 022; ${MKDIR_P} $(DESTDIR)${bindir}
cd lib-src && \
$(MAKE) install $(MFLAGS) prefix=${prefix} \
@@ -464,6 +481,16 @@ install-arch-dep: src install-arch-indep install-doc
rm -rf ${ns_appresdir}/share; \
fi
+### Windows-specific install target for installing programs produced
+### in nt/, and its Posix do-nothing shadow.
+install-:
+install-nt:
+ cd $(NTDIR) && \
+ $(MAKE) install $(MFLAGS) prefix=${prefix} \
+ exec_prefix=${exec_prefix} bindir=${bindir} \
+ libexecdir=${libexecdir} archlibdir=${archlibdir} \
+ INSTALL_STRIP=${INSTALL_STRIP}
+
## In the share directory, we are deleting:
## applications (with emacs.desktop, also found in etc/)
## emacs (basically empty except for unneeded site-lisp directories)
@@ -688,11 +715,12 @@ install-strip:
### create (but not the noninstalled files such as `make all' would create).
###
### Don't delete the lisp and etc directories if they're in the source tree.
-uninstall:
+uninstall: uninstall-$(NTDIR)
cd lib-src && \
$(MAKE) $(MFLAGS) uninstall \
prefix=${prefix} exec_prefix=${exec_prefix} \
bindir=${bindir} libexecdir=${libexecdir} archlibdir=${archlibdir}
+
-unset CDPATH; \
for dir in $(DESTDIR)${lispdir} $(DESTDIR)${etcdir} ; do \
if [ -d $${dir} ]; then \
@@ -737,6 +765,15 @@ uninstall:
[ -s $${file} ] || rm -f $$file; \
done
+### Windows-specific uninstall target for removing programs produced
+### in nt/, and its Posix do-nothing shadow.
+uninstall-:
+uninstall-nt:
+ cd $(NTDIR) && \
+ $(MAKE) $(MFLAGS) uninstall \
+ prefix=${prefix} exec_prefix=${exec_prefix} \
+ bindir=${bindir} libexecdir=${libexecdir} archlibdir=${archlibdir}
+
FRC:
# ==================== Cleaning up and miscellanea ====================
@@ -754,6 +791,7 @@ mostlyclean: FRC
(cd lwlib; $(MAKE) $(MFLAGS) mostlyclean)
(cd lib; $(MAKE) $(MFLAGS) mostlyclean)
(cd lib-src; $(MAKE) $(MFLAGS) mostlyclean)
+ (cd nt; $(MAKE) $(MFLAGS) mostlyclean)
-(cd doc/emacs && $(MAKE) $(MFLAGS) mostlyclean)
-(cd doc/misc && $(MAKE) $(MFLAGS) mostlyclean)
-(cd doc/lispref && $(MAKE) $(MFLAGS) mostlyclean)
@@ -775,6 +813,7 @@ clean: FRC
(cd lwlib; $(MAKE) $(MFLAGS) clean)
(cd lib; $(MAKE) $(MFLAGS) clean)
(cd lib-src; $(MAKE) $(MFLAGS) clean)
+ (cd nt; $(MAKE) $(MFLAGS) clean)
-(cd doc/emacs && $(MAKE) $(MFLAGS) clean)
-(cd doc/misc && $(MAKE) $(MFLAGS) clean)
-(cd doc/lispref && $(MAKE) $(MFLAGS) clean)
@@ -801,6 +840,7 @@ distclean: FRC
(cd lwlib; $(MAKE) $(MFLAGS) distclean)
(cd lib; $(MAKE) $(MFLAGS) distclean)
(cd lib-src; $(MAKE) $(MFLAGS) distclean)
+ (cd nt; $(MAKE) $(MFLAGS) distclean)
(cd doc/emacs && $(MAKE) $(MFLAGS) distclean)
(cd doc/misc && $(MAKE) $(MFLAGS) distclean)
(cd doc/lispref && $(MAKE) $(MFLAGS) distclean)
@@ -819,6 +859,7 @@ bootstrap-clean: FRC
(cd lwlib; $(MAKE) $(MFLAGS) maintainer-clean)
(cd lib; $(MAKE) $(MFLAGS) maintainer-clean)
(cd lib-src; $(MAKE) $(MFLAGS) maintainer-clean)
+ (cd nt; $(MAKE) $(MFLAGS) maintainer-clean)
-(cd doc/emacs && $(MAKE) $(MFLAGS) maintainer-clean)
-(cd doc/misc && $(MAKE) $(MFLAGS) maintainer-clean)
-(cd doc/lispref && $(MAKE) $(MFLAGS) maintainer-clean)
diff --git a/build-aux/update-subdirs b/build-aux/update-subdirs
index 8fdf1609e6f..3c429b8b5e4 100755
--- a/build-aux/update-subdirs
+++ b/build-aux/update-subdirs
@@ -49,8 +49,8 @@ else
;; no-byte-compile: t
;; End:" > subdirs.el~
if cmp "subdirs.el" "subdirs.el~" >/dev/null 2>&1; then
- :; # echo "subdirs.el unchanged";
+ rm subdirs.el~
else
- mv subdirs.el~ subdirs.el
+ mv subdirs.el~ subdirs.el
fi
fi
diff --git a/configure.ac b/configure.ac
index 2b3afc1fb80..d9b70d6ddd3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -192,7 +192,7 @@ OPTION_DEFAULT_ON([toolkit-scroll-bars],[don't use Motif or Xaw3d scroll bars])
OPTION_DEFAULT_ON([xaw3d],[don't use Xaw3d])
OPTION_DEFAULT_ON([xim],[don't use X11 XIM])
OPTION_DEFAULT_OFF([ns],[use NeXTstep (Cocoa or GNUstep) windowing system])
-OPTION_DEFAULT_OFF([w32], [use native MS Windows GUI])
+OPTION_DEFAULT_OFF([w32], [use native MS Windows GUI in a Cygwin build])
OPTION_DEFAULT_ON([gpm],[don't use -lgpm for mouse support on a GNU/Linux console])
OPTION_DEFAULT_ON([dbus],[don't compile with D-Bus support])
@@ -377,7 +377,7 @@ AC_ARG_ENABLE(gtk-deprecation-warnings,
## Make sure CDPATH doesn't affect cd (in case PWD is relative).
unset CDPATH
case "${srcdir}" in
- /* ) ;;
+ [[\\/]]* | ?:[[\\/]]*) ;;
. )
## We may be able to use the $PWD environment variable to make this
## absolute. But sometimes PWD is inaccurate.
@@ -555,6 +555,11 @@ case "${canonical}" in
i[3456]86-*-* )
case "${canonical}" in
*-darwin* ) opsys=darwin ;;
+ *-mingw32 )
+ opsys=mingw32
+ # MinGW overrides and adds some system headers in nt/inc.
+ GCC_TEST_OPTIONS="-I $srcdir/nt/inc"
+ ;;
*-sysv4.2uw* ) opsys=unixware ;;
*-sysv5uw* ) opsys=unixware ;;
*-sysv5OpenUNIX* ) opsys=unixware ;;
@@ -603,6 +608,11 @@ else
test "x$NON_GCC_TEST_OPTIONS" != x && CC="$CC $NON_GCC_TEST_OPTIONS"
fi
+dnl This is used in lib/Makefile.am to use nt/gnulib.mk, the
+dnl alternative to lib/gnulib.mk, so as to avoid generating header files
+dnl that clash with MinGW.
+AM_CONDITIONAL([BUILDING_FOR_WINDOWSNT], [test "x$opsys" = "xmingw32"])
+
# Avoid gnulib's tests for HAVE_WORKING_O_NOATIME and HAVE_WORKING_O_NOFOLLOW,
# as we don't use them.
AC_DEFUN([gl_FCNTL_O_FLAGS])
@@ -638,6 +648,9 @@ if test "$ac_test_CFLAGS" != set; then
else
CFLAGS=$emacs_save_CFLAGS
fi
+ if test $opsys = mingw32; then
+ CFLAGS="$CFLAGS -gdwarf-2"
+ fi
fi
fi
@@ -837,6 +850,16 @@ fi
AC_SUBST(LN_S_FILEONLY)
+dnl AC_PROG_LN_S sets LN_S to 'cp -pR' for MinGW, on the premise that 'ln'
+dnl doesn't support links to directories, as in "ln file dir". But that
+dnl use is non-portable, and OTOH MinGW wants to use hard links for Emacs
+dnl executables at "make install" time.
+dnl See http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00475.html
+dnl for more details.
+if test "$opsys" = "mingw32"; then
+ LN_S="ln"
+fi
+
AC_PATH_PROG(INSTALL_INFO, install-info, :,
$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin)
dnl Don't use GZIP, which is used by gzip for additional parameters.
@@ -942,7 +965,6 @@ AC_SUBST(CANNOT_DUMP)
UNEXEC_OBJ=unexelf.o
case "$opsys" in
# MSDOS uses unexcoff.o
- # MSWindows uses unexw32.o
aix4-2)
UNEXEC_OBJ=unexaix.o
;;
@@ -955,6 +977,9 @@ case "$opsys" in
hpux10-20 | hpux11)
UNEXEC_OBJ=unexhp9k800.o
;;
+ mingw32)
+ UNEXEC_OBJ=unexw32.o
+ ;;
sol2-10)
# Use the Solaris dldump() function, called from unexsol.c, to dump
# emacs, instead of the generic ELF dump code found in unexelf.c.
@@ -1049,6 +1074,7 @@ C_SWITCH_SYSTEM=
## additional optimization. --nils@exp-math.uni-essen.de
test "$opsys" = "aix4.2" && test "x$GCC" != "xyes" && \
C_SWITCH_SYSTEM="-ma -qmaxmem=4000"
+test "$opsys" = "mingw32" && C_SWITCH_SYSTEM="-mtune=pentium4"
## gnu-linux might need -D_BSD_SOURCE on old libc5 systems.
## It is redundant in glibc2, since we define _GNU_SOURCE.
AC_SUBST(C_SWITCH_SYSTEM)
@@ -1068,8 +1094,8 @@ case "$opsys" in
## Motif needs -lgen.
unixware) LIBS_SYSTEM="-lsocket -lnsl -lelf -lgen" ;;
esac
-AC_SUBST(LIBS_SYSTEM)
+AC_SUBST(LIBS_SYSTEM)
### Make sure subsequent tests use flags consistent with the build flags.
@@ -1107,6 +1133,10 @@ case $opsys in
;;
hpux10-20 | hpux11 )
;;
+ mingw32 )
+ LIB_MATH=
+ SYSTEM_TYPE=windows-nt
+ ;;
dnl NB this may be adjusted below.
netbsd | openbsd )
SYSTEM_TYPE=berkeley-unix
@@ -1182,11 +1212,15 @@ AC_DEFUN([PKG_CHECK_MODULES], [
fi
])
-
if test "${with_sound}" != "no"; then
- # Sound support for GNU/Linux and the free BSDs.
- AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h soundcard.h,
- have_sound_header=yes)
+ # Sound support for GNU/Linux, the free BSDs, and MinGW.
+ AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h soundcard.h mmsystem.h,
+ have_sound_header=yes, [], [
+ #ifdef __MINGW32__
+ #define WIN32_LEAN_AND_MEAN
+ #include <windows.h>
+ #endif
+ ])
# Emulation library used on NetBSD.
AC_CHECK_LIB(ossaudio, _oss_ioctl, LIBSOUND=-lossaudio, LIBSOUND=)
AC_SUBST(LIBSOUND)
@@ -1226,7 +1260,7 @@ if test "${with_sound}" != "no"; then
if test x$have_sound_header = xyes || test $HAVE_ALSA = yes; then
case "$opsys" in
dnl defined __FreeBSD__ || defined __NetBSD__ || defined __linux__
- gnu-linux|freebsd|netbsd)
+ gnu-linux|freebsd|netbsd|mingw32)
AC_DEFINE(HAVE_SOUND, 1, [Define to 1 if you have sound support.])
;;
esac
@@ -1548,31 +1582,98 @@ AC_SUBST(NS_OBJC_OBJ)
HAVE_W32=no
W32_OBJ=
W32_LIBS=
-W32_RES=
+EMACSRES=
+CLIENTRES=
+CLIENTW=
W32_RES_LINK=
+EMACS_MANIFEST=
if test "${with_w32}" != no; then
- if test "${opsys}" != "cygwin"; then
- AC_MSG_ERROR([Using w32 with an autotools build is only supported for Cygwin.])
+ case "${opsys}" in
+ cygwin)
+ AC_CHECK_HEADER([windows.h], [HAVE_W32=yes],
+ [AC_MSG_ERROR([`--with-w32' was specified, but windows.h
+ cannot be found.])])
+ ;;
+ mingw32)
+ ## Using --with-w32 with MinGW is a no-op, but we allow it.
+ ;;
+ *)
+ AC_MSG_ERROR([Using w32 with an autotools build is only supported for Cygwin and MinGW32.])
+ ;;
+ esac
+fi
+
+if test "${opsys}" = "mingw32"; then
+ AC_MSG_CHECKING([whether Windows API headers are recent enough])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #include <windows.h>
+ #include <usp10.h>]],
+ [[void test(PIMAGE_NT_HEADERS pHeader)
+ {PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader);}]])],
+ [emacs_cv_w32api=yes
+ HAVE_W32=yes],
+ emacs_cv_w32api=no)
+ AC_MSG_RESULT($emacs_cv_w32api)
+ if test "${emacs_cv_w32api}" = "no"; then
+ AC_MSG_ERROR([the Windows API headers are too old to support this build.])
fi
- AC_CHECK_HEADER([windows.h], [HAVE_W32=yes],
- [AC_MSG_ERROR([`--with-w32' was specified, but windows.h
- cannot be found.])])
+fi
+
+FIRSTFILE_OBJ=
+NTDIR=
+LIBS_ECLIENT=
+LIB_WSOCK32=
+NTLIB=
+CM_OBJ="cm.o"
+XARGS_LIMIT=
+if test "${HAVE_W32}" = "yes"; then
AC_DEFINE(HAVE_NTGUI, 1, [Define to use native MS Windows GUI.])
AC_CHECK_TOOL(WINDRES, [windres],
[AC_MSG_ERROR([No resource compiler found.])])
W32_OBJ="w32fns.o w32menu.o w32reg.o w32font.o w32term.o"
W32_OBJ="$W32_OBJ w32xfns.o w32select.o w32uniscribe.o"
- W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32"
- W32_LIBS="$W32_LIBS -lusp10 -lcomctl32 -lwinspool"
- W32_RES="emacs.res"
- # Tell the linker that emacs.res is an object (which we compile from
- # the rc file), not a linker script.
- W32_RES_LINK="-Wl,emacs.res"
+ EMACSRES="emacs.res"
+ case "$canonical" in
+ x86_64-*-*) EMACS_MANIFEST="emacs-x64.manifest" ;;
+ *) EMACS_MANIFEST="emacs-x86.manifest" ;;
+ esac
+ if test "${opsys}" = "cygwin"; then
+ W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32"
+ W32_LIBS="$W32_LIBS -lusp10 -lcomctl32 -lwinspool"
+ # Tell the linker that emacs.res is an object (which we compile from
+ # the rc file), not a linker script.
+ W32_RES_LINK="-Wl,emacs.res"
+ else
+ W32_OBJ="$W32_OBJ w32.o w32console.o w32heap.o w32inevt.o w32proc.o"
+ W32_OBJ="$W32_OBJ w32notify.o"
+ W32_LIBS="$W32_LIBS -lwinmm -lgdi32 -lcomdlg32"
+ W32_LIBS="$W32_LIBS -lmpr -lwinspool -lole32 -lcomctl32 -lusp10"
+ W32_RES_LINK="\$(EMACSRES)"
+ CLIENTRES="emacsclient.res"
+ CLIENTW="emacsclientw\$(EXEEXT)"
+ FIRSTFILE_OBJ=firstfile.o
+ NTDIR=nt
+ CM_OBJ=
+ LIBS_ECLIENT="-lcomctl32"
+ LIB_WSOCK32="-lwsock32"
+ NTLIB="ntlib.$ac_objext"
+ XARGS_LIMIT="-s 10000"
+ fi
fi
AC_SUBST(W32_OBJ)
AC_SUBST(W32_LIBS)
-AC_SUBST(W32_RES)
+AC_SUBST(EMACSRES)
+AC_SUBST(EMACS_MANIFEST)
+AC_SUBST(CLIENTRES)
+AC_SUBST(CLIENTW)
AC_SUBST(W32_RES_LINK)
+AC_SUBST(FIRSTFILE_OBJ)
+AC_SUBST(NTDIR)
+AC_SUBST(CM_OBJ)
+AC_SUBST(LIBS_ECLIENT)
+AC_SUBST(LIB_WSOCK32)
+AC_SUBST(NTLIB)
+AC_SUBST(XARGS_LIMIT)
if test "${HAVE_W32}" = "yes"; then
window_system=w32
@@ -1897,7 +1998,7 @@ fi
### Use -lrsvg-2 if available, unless `--with-rsvg=no' is specified.
HAVE_RSVG=no
-if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes"; then
+if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes" || test "${opsys}" = "mingw32"; then
if test "${with_rsvg}" != "no"; then
RSVG_REQUIRED=2.11.0
RSVG_MODULE="librsvg-2.0 >= $RSVG_REQUIRED"
@@ -1940,43 +2041,45 @@ HAVE_GTK=no
GTK_OBJ=
check_gtk2=no
gtk3_pkg_errors=
-if test "${with_gtk3}" = "yes" || test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then
- GLIB_REQUIRED=2.28
- GTK_REQUIRED=3.0
- GTK_MODULES="gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
-
- dnl Checks for libraries.
- PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no)
- if test "$pkg_check_gtk" = "no" && test "$with_gtk3" = "yes"; then
- AC_MSG_ERROR($GTK_PKG_ERRORS)
- fi
- if test "$pkg_check_gtk" = "yes"; then
- AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.])
- GTK_OBJ=emacsgtkfixed.o
- term_header=gtkutil.h
- USE_GTK_TOOLKIT="GTK3"
- if test "x$ac_enable_gtk_deprecation_warnings" = x; then
- GTK_CFLAGS="$GTK_CFLAGS -DGDK_DISABLE_DEPRECATION_WARNINGS"
- fi
- else
- check_gtk2=yes
- gtk3_pkg_errors="$GTK_PKG_ERRORS "
+if test "${opsys}" != "mingw32"; then
+ if test "${with_gtk3}" = "yes" || test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then
+ GLIB_REQUIRED=2.28
+ GTK_REQUIRED=3.0
+ GTK_MODULES="gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
+
+ dnl Checks for libraries.
+ PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no)
+ if test "$pkg_check_gtk" = "no" && test "$with_gtk3" = "yes"; then
+ AC_MSG_ERROR($GTK_PKG_ERRORS)
+ fi
+ if test "$pkg_check_gtk" = "yes"; then
+ AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.])
+ GTK_OBJ=emacsgtkfixed.o
+ term_header=gtkutil.h
+ USE_GTK_TOOLKIT="GTK3"
+ if test "x$ac_enable_gtk_deprecation_warnings" = x; then
+ GTK_CFLAGS="$GTK_CFLAGS -DGDK_DISABLE_DEPRECATION_WARNINGS"
+ fi
+ else
+ check_gtk2=yes
+ gtk3_pkg_errors="$GTK_PKG_ERRORS "
+ fi
fi
-fi
-if test "${with_gtk2}" = "yes" || test "$check_gtk2" = "yes"; then
- GLIB_REQUIRED=2.10
- GTK_REQUIRED=2.10
- GTK_MODULES="gtk+-2.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
+ if test "${with_gtk2}" = "yes" || test "$check_gtk2" = "yes"; then
+ GLIB_REQUIRED=2.10
+ GTK_REQUIRED=2.10
+ GTK_MODULES="gtk+-2.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
- dnl Checks for libraries.
- PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no)
- if test "$pkg_check_gtk" = "no" &&
- { test "$with_gtk" = yes || test "$with_gtk2" = "yes"; }
- then
- AC_MSG_ERROR($gtk3_pkg_errors$GTK_PKG_ERRORS)
+ dnl Checks for libraries.
+ PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no)
+ if test "$pkg_check_gtk" = "no" &&
+ { test "$with_gtk" = yes || test "$with_gtk2" = "yes"; }
+ then
+ AC_MSG_ERROR($gtk3_pkg_errors$GTK_PKG_ERRORS)
+ fi
+ test "$pkg_check_gtk" = "yes" && USE_GTK_TOOLKIT="GTK2"
fi
- test "$pkg_check_gtk" = "yes" && USE_GTK_TOOLKIT="GTK2"
fi
if test x"$pkg_check_gtk" = xyes; then
@@ -2146,6 +2249,8 @@ if test "${with_gnutls}" = "yes" ; then
AC_DEFINE(HAVE_GNUTLS, 1, [Define if using GnuTLS.])
fi
+ OLD_CFLAGS=$CFLAGS
+ OLD_LIBS=$LIBS
CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
LIBS="$LIBGNUTLS_LIBS $LIBS"
AC_CHECK_FUNCS(gnutls_certificate_set_verify_function, HAVE_GNUTLS_CALLBACK_CERTIFICATE_VERIFY=yes)
@@ -2153,6 +2258,13 @@ if test "${with_gnutls}" = "yes" ; then
if test "${HAVE_GNUTLS_CALLBACK_CERTIFICATE_VERIFY}" = "yes"; then
AC_DEFINE(HAVE_GNUTLS_CALLBACK_CERTIFICATE_VERIFY, 1, [Define if using GnuTLS certificate verification callbacks.])
fi
+
+ # Windows loads GnuTLS dynamically
+ if test "${opsys}" = "mingw32"; then
+ CFLAGS=$OLD_CFLAGS
+ LIBS=$OLD_LIBS
+ LIBGNUTLS_LIBS=
+ fi
fi
AC_SUBST(LIBGNUTLS_LIBS)
@@ -2285,6 +2397,9 @@ case $opsys in
hpux* | aix4-2 )
test "X$ac_cv_lib_Xmu_XmuConvertStandardSelection" != "Xyes" && LIBXMU=
;;
+ mingw32 )
+ LIBXMU=
+ ;;
esac
AC_SUBST(LIBXMU)
@@ -2543,10 +2658,10 @@ AC_SUBST(M17N_FLT_CFLAGS)
AC_SUBST(M17N_FLT_LIBS)
### Use -lXpm if available, unless `--with-xpm=no'.
+### mingw32 doesn't use -lXpm, since it loads the library dynamically.
HAVE_XPM=no
LIBXPM=
-
-if test "${HAVE_W32}" = "yes"; then
+if test "${HAVE_W32}" = "yes" && test "${opsys}" = "cygwin"; then
if test "${with_xpm}" != "no"; then
SAVE_CPPFLAGS="$CPPFLAGS"
SAVE_LDFLAGS="$LDFLAGS"
@@ -2607,19 +2722,33 @@ no_return_alloc_pixels
fi
fi
+### FIXME: Perhaps regroup to minimize code duplication due to MinGW's
+### slightly different requirements wrt image libraries (it doesn't
+### use -lXpm because it loads the xpm shared library dynamically at
+### run time).
+if test "${opsys}" = "mingw32"; then
+ if test "${with_xpm}" != "no"; then
+ AC_CHECK_HEADER(X11/xpm.h, HAVE_XPM=yes, HAVE_XPM=no, [
+#define FOR_MSW 1])
+ fi
+
+ if test "${HAVE_XPM}" = "yes"; then
+ AC_DEFINE(HAVE_XPM, 1, [Define to 1 if you have the Xpm library (-lXpm).])
+ fi
+fi
+
AC_SUBST(LIBXPM)
### Use -ljpeg if available, unless `--with-jpeg=no'.
+### mingw32 doesn't use -ljpeg, since it loads the library dynamically.
HAVE_JPEG=no
LIBJPEG=
-if test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
+if test "${opsys}" = "mingw32"; then
if test "${with_jpeg}" != "no"; then
dnl Checking for jpeglib.h can lose because of a redefinition of
- dnl HAVE_STDLIB_H.
- AC_CHECK_HEADER(jerror.h,
- [AC_CHECK_LIB(jpeg, jpeg_destroy_compress, HAVE_JPEG=yes)])
+ dnl HAVE_STDLIB_H.
+ AC_CHECK_HEADER(jerror.h, HAVE_JPEG=yes, HAVE_JPEG=no)
fi
-
AH_TEMPLATE(HAVE_JPEG, [Define to 1 if you have the jpeg library (-ljpeg).])dnl
if test "${HAVE_JPEG}" = "yes"; then
AC_DEFINE(HAVE_JPEG)
@@ -2631,6 +2760,25 @@ if test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
[AC_MSG_WARN([libjpeg found, but not version 6b or later])
HAVE_JPEG=no])
fi
+elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
+ if test "${with_jpeg}" != "no"; then
+ dnl Checking for jpeglib.h can lose because of a redefinition of
+ dnl HAVE_STDLIB_H.
+ AC_CHECK_HEADER(jerror.h,
+ [AC_CHECK_LIB(jpeg, jpeg_destroy_compress, HAVE_JPEG=yes)])
+ fi
+
+ AH_TEMPLATE(HAVE_JPEG, [Define to 1 if you have the jpeg library (-ljpeg).])dnl
+ if test "${HAVE_JPEG}" = "yes"; then
+ AC_DEFINE(HAVE_JPEG)
+ AC_EGREP_CPP([version= *(6[2-9]|[7-9][0-9])],
+ [#include <jpeglib.h>
+ version=JPEG_LIB_VERSION
+],
+ [AC_DEFINE(HAVE_JPEG)],
+ [AC_MSG_WARN([libjpeg found, but not version 6b or later])
+ HAVE_JPEG=no])
+ fi
if test "${HAVE_JPEG}" = "yes"; then
LIBJPEG=-ljpeg
fi
@@ -2638,9 +2786,30 @@ fi
AC_SUBST(LIBJPEG)
### Use -lpng if available, unless `--with-png=no'.
+### mingw32 doesn't use -lpng, since it loads the library dynamically.
HAVE_PNG=no
LIBPNG=
-if test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
+if test "${opsys}" = "mingw32"; then
+ if test "${with_png}" != "no"; then
+ AC_CHECK_HEADER(png.h, HAVE_PNG=yes, HAVE_PNG=no)
+ fi
+ if test "${HAVE_PNG}" = "yes"; then
+ AC_DEFINE(HAVE_PNG, 1, [Define to 1 if you have the png library (-lpng).])
+
+ AC_CHECK_DECL(png_longjmp,
+ [],
+ [AC_DEFINE(PNG_DEPSTRUCT, [],
+ [Define to empty to suppress deprecation warnings when building
+ with --enable-gcc-warnings and with libpng versions before 1.5,
+ which lack png_longjmp.])],
+ [[#ifdef HAVE_LIBPNG_PNG_H
+ # include <libpng/png.h>
+ #else
+ # include <png.h>
+ #endif
+ ]])
+ fi
+elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
if test "${with_png}" != "no"; then
# Debian unstable as of July 2003 has multiple libpngs, and puts png.h
# in /usr/include/libpng.
@@ -2671,9 +2840,17 @@ fi
AC_SUBST(LIBPNG)
### Use -ltiff if available, unless `--with-tiff=no'.
+### mingw32 doesn't use -ltiff, since it loads the library dynamically.
HAVE_TIFF=no
LIBTIFF=
-if test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
+if test "${opsys}" = "mingw32"; then
+ if test "${with_tiff}" != "no"; then
+ AC_CHECK_HEADER(tiffio.h, HAVE_TIFF=yes, HAVE_TIFF=no)
+ fi
+ if test "${HAVE_TIFF}" = "yes"; then
+ AC_DEFINE(HAVE_TIFF, 1, [Define to 1 if you have the tiff library (-ltiff).])
+ fi
+elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
if test "${with_tiff}" != "no"; then
AC_CHECK_HEADER(tiffio.h,
[tifflibs="-lz -lm"
@@ -2691,9 +2868,17 @@ fi
AC_SUBST(LIBTIFF)
### Use -lgif or -lungif if available, unless `--with-gif=no'.
+### mingw32 doesn't use -lgif/-lungif, since it loads the library dynamically.
HAVE_GIF=no
LIBGIF=
-if test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no" \
+if test "${opsys}" = "mingw32"; then
+ if test "${with_gif}" != "no"; then
+ AC_CHECK_HEADER(gif_lib.h, HAVE_GIF=yes, HAVE_GIF=no)
+ fi
+ if test "${HAVE_GIF}" = "yes"; then
+ AC_DEFINE(HAVE_GIF, 1, [Define to 1 if you have a gif (or ungif) library.])
+ fi
+elif test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no" \
|| test "${HAVE_W32}" = "yes"; then
AC_CHECK_HEADER(gif_lib.h,
# EGifPutExtensionLast only exists from version libungif-4.1.0b1.
@@ -2799,13 +2984,18 @@ fi
AC_SUBST(LIBXSM)
### Use libxml (-lxml2) if available
+### mingw32 doesn't use -lxml2, since it loads the library dynamically.
HAVE_LIBXML2=no
if test "${with_xml2}" != "no"; then
### I'm not sure what the version number should be, so I just guessed.
PKG_CHECK_MODULES(LIBXML2, libxml-2.0 > 2.6.17, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
if test "${HAVE_LIBXML2}" = "yes"; then
- LIBS="$LIBXML2_LIBS $LIBS"
- AC_CHECK_LIB(xml2, htmlReadMemory, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
+ if test "${opsys}" != "mingw32"; then
+ LIBS="$LIBXML2_LIBS $LIBS"
+ AC_CHECK_LIB(xml2, htmlReadMemory, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
+ else
+ LIBXML2_LIBS=""
+ fi
if test "${HAVE_LIBXML2}" = "yes"; then
AC_DEFINE(HAVE_LIBXML2, 1, [Define to 1 if you have the libxml library (-lxml2).])
else
@@ -2818,6 +3008,10 @@ AC_SUBST(LIBXML2_LIBS)
AC_SUBST(LIBXML2_CFLAGS)
# If netdb.h doesn't declare h_errno, we must declare it by hand.
+# On MinGW, that is provided by nt/inc/sys/socket.h and w32.c.
+if test "${opsys}" = "mingw32"; then
+ emacs_cv_netdb_declares_h_errno=yes
+fi
AC_CACHE_CHECK(whether netdb declares h_errno,
emacs_cv_netdb_declares_h_errno,
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]],
@@ -2828,8 +3022,10 @@ if test $emacs_cv_netdb_declares_h_errno = yes; then
fi
# sqrt and other floating-point functions such as fmod and frexp
-# are found in -lm on most systems.
-AC_CHECK_LIB(m, sqrt)
+# are found in -lm on most systems, but mingw32 doesn't use -lm.
+if test "${opsys}" != "mingw32"; then
+ AC_CHECK_LIB(m, sqrt)
+fi
# Check for mail-locking functions in a "mail" library. Probably this should
# have the same check as for liblockfile below.
@@ -2893,6 +3089,9 @@ case "$opsys" in
test $ac_cv_header_maillock_h = yes && mail_lock=no
fi
;;
+
+ mingw32)
+ mail_lock="none-needed" ;;
esac
BLESSMAIL_TARGET=
@@ -2901,6 +3100,8 @@ case "$mail_lock" in
lockf) AC_DEFINE(MAIL_USE_LOCKF, 1, [Define if the mailer uses lockf to interlock the mail spool.]) ;;
+ none-needed) ;;
+
*) BLESSMAIL_TARGET="need-blessmail" ;;
esac
AC_SUBST(BLESSMAIL_TARGET)
@@ -2972,25 +3173,29 @@ AC_DEFUN([tputs_link_source], [
return 0;
}]])
])
-# Maybe curses should be tried earlier?
-# See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9736#35
-for tputs_library in '' tinfo ncurses terminfo termcap curses; do
- OLIBS=$LIBS
- if test -z "$tputs_library"; then
- LIBS_TERMCAP=
- msg='none required'
- else
- LIBS_TERMCAP=-l$tputs_library
- msg=$LIBS_TERMCAP
- LIBS="$LIBS_TERMCAP $LIBS"
- fi
- AC_RUN_IFELSE([tputs_link_source], [], [msg=no],
- [AC_LINK_IFELSE([tputs_link_source], [], [msg=no])])
- LIBS=$OLIBS
- if test "X$msg" != Xno; then
- break
- fi
-done
+if test "${opsys}" = "mingw32"; then
+ msg='none required'
+else
+ # Maybe curses should be tried earlier?
+ # See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9736#35
+ for tputs_library in '' tinfo ncurses terminfo termcap curses; do
+ OLIBS=$LIBS
+ if test -z "$tputs_library"; then
+ LIBS_TERMCAP=
+ msg='none required'
+ else
+ LIBS_TERMCAP=-l$tputs_library
+ msg=$LIBS_TERMCAP
+ LIBS="$LIBS_TERMCAP $LIBS"
+ fi
+ AC_RUN_IFELSE([tputs_link_source], [], [msg=no],
+ [AC_LINK_IFELSE([tputs_link_source], [], [msg=no])])
+ LIBS=$OLIBS
+ if test "X$msg" != Xno; then
+ break
+ fi
+ done
+fi
AC_MSG_RESULT([$msg])
if test "X$msg" = Xno; then
AC_MSG_ERROR([The required function `tputs' was not found in any library.
@@ -3036,6 +3241,11 @@ fail;
fi
;;
+ mingw32)
+ TERMINFO=no
+ LIBS_TERMCAP=
+ ;;
+
netbsd)
if test "x$LIBS_TERMCAP" != "x-lterminfo"; then
TERMINFO=no
@@ -3325,11 +3535,14 @@ dnl AC_DEFINE(HAVE_TCATTR, 1, [Define to 1 if you have tcgetattr and tcsetatt
dnl fi
dnl Turned on June 1996 supposing nobody will mind it.
-AC_DEFINE(AMPERSAND_FULL_NAME, 1, [Define to use the convention that &
- in the full name stands for the login id.])
+dnl MinGW emulates passwd database, so this feature doesn't make sense there.
+if test "${opsys}" != "mingw32"; then
+ AC_DEFINE(AMPERSAND_FULL_NAME, 1, [Define to use the convention that &
+ in the full name stands for the login id.])
+fi
-dnl Every platform that uses configure (ie every non-MS platform)
-dnl supports this. There is a create-lockfiles option you can
+dnl Every platform that uses configure supports this.
+dnl There is a create-lockfiles option you can
dnl customize if you do not want the lock files to be written.
dnl So it is not clear that this #define still needs to exist.
AC_DEFINE(CLASH_DETECTION, 1, [Define if you want lock files to be written,
@@ -3339,7 +3552,9 @@ AC_DEFINE(CLASH_DETECTION, 1, [Define if you want lock files to be written,
dnl Everybody supports this, except MS.
dnl Seems like the kind of thing we should be testing for, though.
## Note: PTYs are broken on darwin <6. Use at your own risk.
-AC_DEFINE(HAVE_PTYS, 1, [Define if the system supports pty devices.])
+if test "${opsys}" != "mingw32"; then
+ AC_DEFINE(HAVE_PTYS, 1, [Define if the system supports pty devices.])
+fi
dnl Everybody supports this, except MS-DOS.
dnl Seems like the kind of thing we should be testing for, though.
@@ -3349,10 +3564,20 @@ AC_DEFINE(HAVE_SOCKETS, 1, [Define if the system supports
AH_TEMPLATE(INTERNAL_TERMINAL, [This is substituted when $TERM is "internal".])
-AC_DEFINE(NULL_DEVICE, ["/dev/null"], [Name of the file to open to get
+AH_TEMPLATE(NULL_DEVICE, [Name of the file to open to get
a null file, or a data sink.])
+if test "${opsys}" = "mingw32"; then
+ AC_DEFINE(NULL_DEVICE, ["NUL:"])
+else
+ AC_DEFINE(NULL_DEVICE, ["/dev/null"])
+fi
-AC_DEFINE(SEPCHAR, [':'], [Character that separates PATH elements.])
+AH_TEMPLATE(SEPCHAR, [Character that separates PATH elements.])
+if test "${opsys}" = "mingw32"; then
+ AC_DEFINE(SEPCHAR, [';'])
+else
+ AC_DEFINE(SEPCHAR, [':'])
+fi
dnl Everybody supports this, except MS-DOS.
AC_DEFINE(subprocesses, 1, [Define to enable asynchronous subprocesses.])
@@ -3363,19 +3588,28 @@ AC_DEFINE(USER_FULL_NAME, [pw->pw_gecos], [How to get a user's full name.])
AC_DEFINE(DIRECTORY_SEP, ['/'],
[Character that separates directories in a file name.])
-dnl Only used on MS platforms.
AH_TEMPLATE(DEVICE_SEP, [Character that separates a device in a file name.])
+if test "${opsys}" = "mingw32"; then
+ dnl Only used on MS platforms.
+ AC_DEFINE(DEVICE_SEP, ':')
+ AC_DEFINE(IS_DEVICE_SEP(_c_), [((_c_) == DEVICE_SEP)],
+ [Returns true if character is a device separator.])
-AC_DEFINE(IS_DEVICE_SEP(_c_), 0,
- [Returns true if character is a device separator.])
+ AC_DEFINE(IS_DIRECTORY_SEP(_c_), [((_c_) == '/' || (_c_) == '\\')],
+ [Returns true if character is a directory separator.])
-AC_DEFINE(IS_DIRECTORY_SEP(_c_), [((_c_) == DIRECTORY_SEP)],
- [Returns true if character is a directory separator.])
+ AC_DEFINE(IS_ANY_SEP(_c_), [(IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP(_c_))],
+ [Returns true if character is any form of separator.])
+else
+ AC_DEFINE(IS_DEVICE_SEP(_c_), 0,
+ [Returns true if character is a device separator.])
-dnl On MS, this also accepts IS_DEVICE_SEP.
-AC_DEFINE(IS_ANY_SEP(_c_), [(IS_DIRECTORY_SEP (_c_))],
- [Returns true if character is any form of separator.])
+ AC_DEFINE(IS_DIRECTORY_SEP(_c_), [((_c_) == DIRECTORY_SEP)],
+ [Returns true if character is a directory separator.])
+ AC_DEFINE(IS_ANY_SEP(_c_), [(IS_DIRECTORY_SEP (_c_))],
+ [Returns true if character is any form of separator.])
+fi
AH_TEMPLATE(NO_EDITRES, [Define if XEditRes should not be used.])
@@ -3764,10 +3998,14 @@ else
esac
fi dnl GCC?
+dnl In a weird quirk, MS runtime uses _setjmp and longjmp.
AC_CACHE_CHECK([for _setjmp], [emacs_cv_func__setjmp],
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <setjmp.h>
+ #ifdef __MINGW32__
+ # define _longjmp longjmp
+ #endif
]],
[[jmp_buf j;
if (! _setjmp (j))
@@ -3862,6 +4100,14 @@ case $opsys in
AC_DEFINE(IRIX6_5, [], [Define if the system is IRIX.])
;;
+ mingw32)
+ AC_DEFINE(DOS_NT, [])
+ AC_DEFINE(WINDOWSNT, 1, [Define if compiling for native MS Windows.])
+ if test "x$ac_enable_checking" != "x" ; then
+ AC_DEFINE(EMACSDEBUG, 1, [Define to 1 to enable w32 debug facilities.])
+ fi
+ ;;
+
sol2*)
AC_DEFINE(USG, [])
AC_DEFINE(USG5, [])
@@ -3883,6 +4129,10 @@ AC_CACHE_CHECK([for usable FIONREAD], [emacs_cv_usable_FIONREAD],
emacs_cv_usable_FIONREAD=no
;;
+ mingw32)
+ emacs_cv_usable_FIONREAD=yes
+ ;;
+
*)
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <sys/types.h>
@@ -4023,6 +4273,12 @@ AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${emacs_config_options}",
AH_TEMPLATE(config_opsysfile, [Some platforms that do not use configure
define this to include extra configuration information.])
+case $opsys in
+ mingw32)
+ AC_DEFINE(config_opsysfile, <ms-w32.h>, [])
+ ;;
+esac
+
XMENU_OBJ=
XOBJ=
FONT_OBJ=
@@ -4083,12 +4339,14 @@ case "$USE_X_TOOLKIT" in
esac
AC_SUBST(TOOLKIT_LIBW)
-if test "$USE_X_TOOLKIT" = "none"; then
- LIBXT_OTHER="\$(LIBXSM)"
- OLDXMENU_TARGET="really-oldXMenu"
-else
- LIBXT_OTHER="\$(LIBXMU) -lXt \$(LIBXTR6) -lXext"
- OLDXMENU_TARGET="really-lwlib"
+if test "${opsys}" != "mingw32"; then
+ if test "$USE_X_TOOLKIT" = "none"; then
+ LIBXT_OTHER="\$(LIBXSM)"
+ OLDXMENU_TARGET="really-oldXMenu"
+ else
+ LIBXT_OTHER="\$(LIBXMU) -lXt \$(LIBXTR6) -lXext"
+ OLDXMENU_TARGET="really-lwlib"
+ fi
fi
AC_SUBST(LIBXT_OTHER)
@@ -4162,6 +4420,10 @@ if test "$opsys" = "cygwin"; then
## Cygwin differs because of its unexec().
PRE_ALLOC_OBJ=
POST_ALLOC_OBJ=lastfile.o
+elif test "$opsys" = "mingw32"; then
+ CYGWIN_OBJ=
+ PRE_ALLOC_OBJ=
+ POST_ALLOC_OBJ=lastfile.o
else
CYGWIN_OBJ=
PRE_ALLOC_OBJ=lastfile.o
@@ -4189,6 +4451,12 @@ gl_INIT
CFLAGS=$SAVE_CFLAGS
LIBS=$SAVE_LIBS
+if test "${opsys}" = "mingw32"; then
+ CPPFLAGS="$CPPFLAGS -DUSE_CRT_DLL=1 -I $srcdir/nt/inc"
+ # Remove unneeded switches from the value of CC that goes to Makefiles
+ CC=`echo $CC | sed -e "s,$GCC_TEST_OPTIONS,,"`
+fi
+
case "$opsys" in
aix4-2) LD_SWITCH_SYSTEM_TEMACS="-Wl,-bnodelcsect" ;;
@@ -4222,6 +4490,13 @@ case "$opsys" in
## It seems clearer therefore to put this piece in LD_SWITCH_SYSTEM_TEMACS.
gnu*) LD_SWITCH_SYSTEM_TEMACS="\$(LD_SWITCH_X_SITE_RPATH)" ;;
+ mingw32)
+ case "$canonical" in
+ x86_64-*-*) LD_SWITCH_SYSTEM_TEMACS="-Wl,-stack,0x00800000 -Wl,-heap,0x00100000 -Wl,-image-base,0x01000000 -Wl,-subsystem,console -Wl,-entry,_start -Wl,-Map,./temacs.map" ;;
+ *) LD_SWITCH_SYSTEM_TEMACS="-Wl,-stack,0x00800000 -Wl,-heap,0x00100000 -Wl,-image-base,0x01000000 -Wl,-subsystem,console -Wl,-entry,__start -Wl,-Map,./temacs.map" ;;
+ esac
+ ;;
+
*) LD_SWITCH_SYSTEM_TEMACS= ;;
esac
@@ -4234,6 +4509,24 @@ fi
AC_SUBST(LD_SWITCH_SYSTEM_TEMACS)
+## MinGW-specific post-link processing of temacs.
+TEMACS_POST_LINK=":"
+ADDSECTION=
+EMACS_HEAPSIZE=
+if test "${opsys}" = "mingw32"; then
+ TEMACS_POST_LINK="\$(MINGW_TEMACS_POST_LINK)"
+ ADDSECTION="../nt/addsection\$(EXEEXT)"
+ ## Preload heap size of temacs.exe in MB.
+ case "$canonical" in
+ x86_64-*-*) EMACS_HEAPSIZE=42 ;;
+ *) EMACS_HEAPSIZE=27 ;;
+ esac
+fi
+
+AC_SUBST(ADDSECTION)
+AC_SUBST(TEMACS_POST_LINK)
+AC_SUBST(EMACS_HEAPSIZE)
+
## Common for all window systems
if test "$window_system" != "none"; then
AC_DEFINE(HAVE_WINDOW_SYSTEM, 1, [Define if you have a window system.])
@@ -4392,12 +4685,12 @@ dnl This will work, but you get a config.status that is not quite right
dnl (see http://lists.gnu.org/archive/html/bug-autoconf/2008-08/msg00028.html).
dnl That doesn't have any obvious consequences for Emacs, but on the whole
dnl it seems better to just live with the duplication.
-SUBDIR_MAKEFILES="lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile nextstep/Makefile"
+SUBDIR_MAKEFILES="lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile nextstep/Makefile nt/Makefile"
AC_CONFIG_FILES([Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile \
doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile \
doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile \
- leim/Makefile nextstep/Makefile])
+ leim/Makefile nextstep/Makefile nt/Makefile])
dnl test/ is not present in release tarfiles.
opt_makefile=test/automated/Makefile
@@ -4440,8 +4733,12 @@ dnl by configure. This also explains the `move-if-change' test and
dnl the use of force in the `epaths-force' rule in Makefile.in.
AC_CONFIG_COMMANDS([epaths], [
echo creating src/epaths.h
-${MAKE-make} MAKEFILE_NAME=do-not-make-Makefile epaths-force
-], [GCC="$GCC" CPPFLAGS="$CPPFLAGS"])
+if test "${opsys}" = "mingw32"; then
+ ${MAKE-make} MAKEFILE_NAME=do-not-make-Makefile epaths-force-w32
+else
+ ${MAKE-make} MAKEFILE_NAME=do-not-make-Makefile epaths-force
+fi
+], [GCC="$GCC" CPPFLAGS="$CPPFLAGS" opsys="$opsys"])
AC_CONFIG_COMMANDS([gdbinit], [
if test ! -f src/.gdbinit && test -f "$srcdir/src/.gdbinit"; then
diff --git a/doc/lispintro/ChangeLog b/doc/lispintro/ChangeLog
index 1f27775442c..be9f9f963c0 100644
--- a/doc/lispintro/ChangeLog
+++ b/doc/lispintro/ChangeLog
@@ -1,3 +1,8 @@
+2013-04-23 Xue Fuqiao <xfq.free@gmail.com>
+
+ * emacs-lisp-intro.texi (Complications, defvar): Refine the doc
+ about Lisp macros. (http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00618.html)
+
2013-04-21 Xue Fuqiao <xfq.free@gmail.com>
* emacs-lisp-intro.texi (defcustom, defun)
diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi
index 3147960fbc3..7831603124e 100644
--- a/doc/lispintro/emacs-lisp-intro.texi
+++ b/doc/lispintro/emacs-lisp-intro.texi
@@ -457,7 +457,7 @@ Practicing Evaluation
How To Write Function Definitions
* Primitive Functions::
-* defun:: The @code{defun} special form.
+* defun:: The @code{defun} macro.
* Install:: Install a function definition.
* Interactive:: Making a function interactive.
* Interactive Options:: Different options for @code{interactive}.
@@ -1618,11 +1618,16 @@ the symbol's value as a @dfn{variable}. This situation is described
in the section on variables. (@xref{Variables}.)
@cindex Special form
-The second complication occurs because some functions are unusual and do
-not work in the usual manner. Those that don't are called @dfn{special
-forms}. They are used for special jobs, like defining a function, and
-there are not many of them. In the next few chapters, you will be
-introduced to several of the more important special forms.
+The second complication occurs because some functions are unusual and
+do not work in the usual manner. Those that don't are called
+@dfn{special forms}. They are used for special jobs, like defining a
+function, and there are not many of them. In the next few chapters,
+you will be introduced to several of the more important special forms.
+And there are also @dfn{macros}. Macro is a construct defined in
+Lisp, which differs from a function in that it translates a Lisp
+expression into another expression which is to be evaluated instead of
+the original expression. (@xref{Lisp macro}.)
+
The third and final complication is this: if the function that the
Lisp interpreter is looking at is not a special form, and if it is part
@@ -9291,6 +9296,10 @@ have a value. If the variable already has a value, @code{defvar} does
not override the existing value. Second, @code{defvar} has a
documentation string.
+(There is a related macro, @code{defcustom}, designed for variables
+that people customize. It has more features than @code{defvar}.
+(@xref{defcustom, , Setting Variables with @code{defcustom}}.)
+
@menu
* See variable current value::
* defvar and asterisk::
diff --git a/leim/Makefile.in b/leim/Makefile.in
index 0242244295e..a660d9b56e0 100644
--- a/leim/Makefile.in
+++ b/leim/Makefile.in
@@ -140,7 +140,7 @@ leim-list.el: ${TIT_MISC} ${srcdir}/leim-ext.el
--eval "(update-leim-list-file \".\")" ; \
else \
${RUN_EMACS} -l ${buildlisppath}/international/quail \
- --eval "(update-leim-list-file \".\" \"${srcdir}\")" ; \
+ --eval "(update-leim-list-file \".\" (reveal-filename \"${srcdir}\"))" ; \
fi
sed -n '/^[^;]/ p' < ${srcdir}/leim-ext.el >> $@
@@ -199,4 +199,4 @@ extraclean: maintainer-clean
check-declare:
$(RUN_EMACS) -l $(buildlisppath)/emacs-lisp/check-declare \
- --eval '(check-declare-directory "$(srcdir)")'
+ --eval '(check-declare-directory (reveal-filename "$(srcdir)"))'
diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in
index 7069af9767a..e0acea867b7 100644
--- a/lib-src/Makefile.in
+++ b/lib-src/Makefile.in
@@ -113,8 +113,11 @@ MKDIR_P = @MKDIR_P@
# ========================== Lists of Files ===========================
+# emacsclientw.exe for MinGW, empty otherwise
+CLIENTW = @CLIENTW@
+
# Things that a user might actually run, which should be installed in bindir.
-INSTALLABLES = etags${EXEEXT} ctags${EXEEXT} emacsclient${EXEEXT} \
+INSTALLABLES = etags${EXEEXT} ctags${EXEEXT} emacsclient${EXEEXT} $(CLIENTW) \
ebrowse${EXEEXT}
INSTALLABLE_SCRIPTS = grep-changelog
@@ -163,10 +166,21 @@ LIBS_MAIL=@LIBS_MAIL@
LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
## empty or -lrt or -lposix4 if HAVE_FDATASYNC
LIB_FDATASYNC = @LIB_FDATASYNC@
+## empty or -lwsock2 for MinGW
+LIB_WSOCK32=@LIB_WSOCK32@
## Extra libraries to use when linking movemail.
LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \
- $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV)
+ $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV) $(LIB_WSOCK32)
+
+## Extra libraries when linking emacsclient
+## (empty or -lcomctl32 for MinGW)
+LIBS_ECLIENT = @LIBS_ECLIENT@
+
+## Extra object files for linking for MinGW
+NTLIB = @NTLIB@
+CLIENTRES = @CLIENTRES@
+WINDRES = @WINDRES@
## Some systems define this to request special libraries.
LIBS_SYSTEM = @LIBS_SYSTEM@
@@ -227,7 +241,7 @@ $(DESTDIR)${archlibdir}: all
umask 022; ${MKDIR_P} $(DESTDIR)${gamedir}; \
touch $(DESTDIR)${gamedir}/snake-scores; \
touch $(DESTDIR)${gamedir}/tetris-scores
- -if chown ${gameuser} $(DESTDIR)${archlibdir}/update-game-score && chmod u+s $(DESTDIR)${archlibdir}/update-game-score; then \
+ -if chown ${gameuser} $(DESTDIR)${archlibdir}/update-game-score${EXEEXT} && chmod u+s $(DESTDIR)${archlibdir}/update-game-score${EXEEXT}; then \
chown ${gameuser} $(DESTDIR)${gamedir}; \
chmod u=rwx,g=rwx,o=rx $(DESTDIR)${gamedir}; \
fi
@@ -292,7 +306,7 @@ TAGS: etags${EXEEXT}
## distribute Emacs. If they were clobbered, all the .elc files were
## clobbered too.
test-distrib${EXEEXT}: ${srcdir}/test-distrib.c
- $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
+ $(CC) ${ALL_CFLAGS} -o test-distrib${EXEEXT} ${srcdir}/test-distrib.c
./test-distrib ${srcdir}/testfile
../lib/libgnu.a: $(config_h)
@@ -302,47 +316,68 @@ regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h $(config_h)
${CC} -c ${CPP_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER \
${srcdir}/../src/regex.c
-etags${EXEEXT}: ${srcdir}/etags.c regex.o $(config_h)
+etags${EXEEXT}: ${srcdir}/etags.c regex.o $(NTLIB) $(config_h)
$(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" \
-DVERSION="\"${version}\"" ${srcdir}/etags.c \
- regex.o $(LOADLIBES) -o etags
+ regex.o $(LOADLIBES) $(NTLIB) -o etags${EXEEXT}
-ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(config_h)
+ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(NTLIB) \
+ $(config_h)
$(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \
- ${srcdir}/ebrowse.c $(LOADLIBES) -o ebrowse
+ ${srcdir}/ebrowse.c $(LOADLIBES) $(NTLIB) -o ebrowse${EXEEXT}
## We depend on etags to assure that parallel makes do not write two
## etags.o files on top of each other.
ctags${EXEEXT}: etags${EXEEXT}
$(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" \
-DVERSION="\"${version}\"" ${srcdir}/etags.c \
- regex.o $(LOADLIBES) -o ctags
+ regex.o $(LOADLIBES) $(NTLIB) -o ctags${EXEEXT}
-profile${EXEEXT}: ${srcdir}/profile.c $(config_h)
+profile${EXEEXT}: ${srcdir}/profile.c $(NTLIB) $(config_h)
$(CC) ${ALL_CFLAGS} ${srcdir}/profile.c \
- $(LOADLIBES) $(LIB_CLOCK_GETTIME) -o profile
+ $(LOADLIBES) $(NTLIB) $(LIB_CLOCK_GETTIME) -o profile${EXEEXT}
-make-docfile${EXEEXT}: ${srcdir}/make-docfile.c $(config_h)
- $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) \
- -o make-docfile
+make-docfile${EXEEXT}: ${srcdir}/make-docfile.c $(NTLIB) $(config_h)
+ $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) $(NTLIB) \
+ -o make-docfile${EXEEXT}
-movemail${EXEEXT}: ${srcdir}/movemail.c pop.o $(config_h)
+movemail${EXEEXT}: ${srcdir}/movemail.c pop.o $(NTLIB) $(config_h)
$(CC) ${ALL_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c pop.o \
- $(LOADLIBES) $(LIBS_MOVE) -o movemail
+ $(LOADLIBES) $(NTLIB) $(LIBS_MOVE) -o movemail${EXEEXT}
-pop.o: ${srcdir}/pop.c ${srcdir}/../lib/min-max.h $(config_h)
+pop.o: ${srcdir}/pop.c ${srcdir}/pop.h ${srcdir}/../lib/min-max.h $(config_h)
$(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
-emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(config_h)
+emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(config_h)
$(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c \
- -DVERSION="\"${version}\"" \
- $(LOADLIBES) $(LIB_FDATASYNC) -o emacsclient
+ -DVERSION="\"${version}\"" $(NTLIB) $(LOADLIBES) $(LIB_FDATASYNC) \
+ $(LIB_WSOCK32) $(LIBS_ECLIENT) -o emacsclient${EXEEXT}
+
+emacsclientw${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(CLIENTRES) $(config_h)
+ $(CC) ${ALL_CFLAGS} $(CLIENTRES) -mwindows ${srcdir}/emacsclient.c \
+ -DVERSION="\"${version}\"" $(LOADLIBES) $(LIB_FDATASYNC) \
+ $(LIB_WSOCK32) $(LIBS_ECLIENT) -o emacsclientw${EXEEXT}
-hexl${EXEEXT}: ${srcdir}/hexl.c $(config_h)
- $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
+NTINC = ${srcdir}/../nt/inc
+NTDEPS = $(NTINC)/ms-w32.h $(NTINC)/sys/stat.h $(NTINC)/inttypes.h \
+ $(NTINC)/stdint.h $(NTINC)/pwd.h $(NTINC)/sys/time.h $(NTINC)/stdbool.h \
+ $(NTINC)/sys/wait.h $(NTINC)/unistd.h $(NTINC)/sys/file.h $(NTINC)/netdb.h
-update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(config_h)
+# The dependency on $(NTDEPS) is a trick intended to cause recompile of
+# programs on MinGW whenever some private header in nt/inc is modified.
+ntlib.o: ${srcdir}/ntlib.c ${srcdir}/ntlib.h $(NTDEPS)
+ $(CC) -c ${CPP_CFLAGS} ${srcdir}/ntlib.c
+
+hexl${EXEEXT}: ${srcdir}/hexl.c $(NTLIB) $(config_h)
+ $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl${EXEEXT}
+
+update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(NTLIB) $(config_h)
$(CC) ${ALL_CFLAGS} -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \
- ${srcdir}/update-game-score.c $(LOADLIBES) -o update-game-score
+ ${srcdir}/update-game-score.c $(LOADLIBES) $(NTLIB) \
+ -o update-game-score${EXEEXT}
+
+emacsclient.res: $(NTINC)/../emacsclient.rc
+ $(WINDRES) -O coff --include-dir=$(NTINC)/.. -o emacsclient.res \
+ $(NTINC)/../emacsclient.rc
## Makefile ends here.
diff --git a/lib-src/ntlib.c b/lib-src/ntlib.c
index 849abc2ede5..41b4e3a0cbc 100644
--- a/lib-src/ntlib.c
+++ b/lib-src/ntlib.c
@@ -49,10 +49,11 @@ struct timezone
/* Emulate sleep...we could have done this with a define, but that
would necessitate including windows.h in the files that used it.
This is much easier. */
-void
-sleep (unsigned long seconds)
+unsigned
+sleep (unsigned seconds)
{
Sleep (seconds * 1000);
+ return 0;
}
/* Get the current working directory. */
@@ -138,6 +139,12 @@ getuid (void)
}
unsigned
+geteuid (void)
+{
+ return getuid ();
+}
+
+unsigned
getgid (void)
{
return 0;
@@ -415,4 +422,3 @@ lstat (const char * path, struct stat * buf)
{
return stat (path, buf);
}
-
diff --git a/lib-src/ntlib.h b/lib-src/ntlib.h
index 1b2f57f35e5..3e48d2997e0 100644
--- a/lib-src/ntlib.h
+++ b/lib-src/ntlib.h
@@ -16,7 +16,6 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-
#include <pwd.h>
#include <malloc.h>
@@ -29,12 +28,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifdef sleep
#undef sleep
#endif
-void sleep (unsigned long seconds);
+unsigned sleep (unsigned seconds);
char *getwd (char *dir);
int getppid (void);
char * getlogin (void);
char * cuserid (char * s);
unsigned getuid (void);
+unsigned geteuid (void);
unsigned getegid (void);
unsigned getgid (void);
int setuid (unsigned uid);
diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c
index 29c81a8936c..ec8b4317770 100644
--- a/lib-src/update-game-score.c
+++ b/lib-src/update-game-score.c
@@ -46,6 +46,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/stat.h>
#include <getopt.h>
+#ifdef WINDOWSNT
+#include "ntlib.h"
+#endif
+
#define MAX_ATTEMPTS 5
#define MAX_SCORES 200
#define MAX_DATA_LEN 1024
diff --git a/lib/Makefile.am b/lib/Makefile.am
index d8979a1cf74..2ba63f3152a 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -7,6 +7,10 @@ noinst_LIBRARIES =
AM_CFLAGS = $(PROFILING_CFLAGS) $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS)
DEFAULT_INCLUDES = -I. -I$(top_srcdir)/lib -I../src -I$(top_srcdir)/src
+if BUILDING_FOR_WINDOWSNT
+include ../nt/gnulib.mk
+else
include gnulib.mk
libgnu_a_SOURCES += openat-die.c save-cwd.c
+endif
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index afb1ffd06fe..59e2a227e42 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,55 @@
+2013-04-23 Tassilo Horn <tsdh@gnu.org>
+
+ * textmodes/reftex.el (reftex-compile-variables): Add autoload
+ cookie.
+
+ * textmodes/reftex-vars.el (reftex-label-regexps): Call
+ `reftex-compile-variables' after changes to this variable.
+
+2013-04-23 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * jit-lock.el: Fix signals in jit-lock-force-redisplay.
+ Use lexical-binding.
+ (jit-lock-force-redisplay): Use markers, check buffer's continued
+ existence and beware narrowed buffers.
+ (jit-lock-fontify-now): Adjust call accordingly.
+
+2013-04-22 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * minibuffer.el (minibuffer-completion-contents): Fix obsolescence info
+ to avoid misleading the user.
+
+2013-04-22 Leo Liu <sdl.web@gmail.com>
+
+ * info-look.el: Prefer latex2e.info. (Bug#14240)
+
+2013-04-22 Michael Albinus <michael.albinus@gmx.de>
+
+ Fix pack/unpack coding. Reported by David Smith <davidsmith@acm.org>.
+
+ * net/tramp-compat.el (tramp-compat-call-process): Move function ...
+ * net/tramp.el (tramp-call-process): ... here
+ (tramp-set-completion-function, tramp-parse-putty):
+ * net/tramp-adb.el (tramp-adb-execute-adb-command):
+ * net/tramp-gvfs.el (tramp-gvfs-send-command):
+ * net/tramp-sh.el (tramp-sh-handle-set-file-times)
+ (tramp-set-file-uid-gid, tramp-sh-handle-write-region)
+ (tramp-call-local-coding-command): Use `tramp-call-process'
+ instead of `tramp-compat-call-process'.
+
+ * net/tramp-sh.el (tramp-perl-pack, tramp-perl-unpack): New defconst.
+ (tramp-local-coding-commands, tramp-remote-coding-commands): Use them.
+ (tramp-sh-handle-file-local-copy, tramp-sh-handle-write-region):
+ (tramp-find-inline-compress):Improve traces.
+ (tramp-maybe-send-script): Check for Perl binary.
+ (tramp-get-inline-coding): Do not redirect STDOUT for local decoding.
+
+2013-04-22 Daiki Ueno <ueno@gnu.org>
+
+ * epg.el (epg-context-pinentry-mode): New function.
+ (epg-context-set-pinentry-mode): New function.
+ (epg--start): Pass --pinentry-mode option to gpg command.
+
2013-04-21 Xue Fuqiao <xfq.free@gmail.com>
* comint.el: (comint-dynamic-complete-functions, comint-mode-map):
@@ -53,7 +105,7 @@
2013-04-19 Masatake YAMATO <yamato@redhat.com>
* progmodes/sh-script.el (sh-imenu-generic-expression):
- Handle function names with a single character. (Bug#11182)
+ Handle function names with a single character. (Bug#14111)
2013-04-19 Dima Kogan <dima@secretsauce.net> (tiny change)
diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index 1e701df348f..9e56d835b6d 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/epg.el b/lisp/epg.el
index 3f04aa2e07a..c36de7e4624 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -195,7 +195,7 @@
cipher-algorithm digest-algorithm compress-algorithm
(list #'epg-passphrase-callback-function)
nil
- nil nil nil nil nil nil)))
+ nil nil nil nil nil nil nil)))
(defun epg-context-protocol (context)
"Return the protocol used within CONTEXT."
@@ -289,6 +289,12 @@ This function is for internal use only."
(signal 'wrong-type-argument (list 'epg-context-p context)))
(aref (cdr context) 14))
+(defun epg-context-pinentry-mode (context)
+ "Return the mode of pinentry invocation."
+ (unless (eq (car-safe context) 'epg-context)
+ (signal 'wrong-type-argument (list 'epg-context-p context)))
+ (aref (cdr context) 15))
+
(defun epg-context-set-protocol (context protocol)
"Set the protocol used within CONTEXT."
(unless (eq (car-safe context) 'epg-context)
@@ -407,6 +413,14 @@ This function is for internal use only."
(signal 'wrong-type-argument (list 'epg-context-p context)))
(aset (cdr context) 14 operation))
+(defun epg-context-set-pinentry-mode (context mode)
+ "Set the mode of pinentry invocation."
+ (unless (eq (car-safe context) 'epg-context)
+ (signal 'wrong-type-argument (list 'epg-context-p context)))
+ (unless (memq mode '(nil ask cancel error loopback))
+ (signal 'epg-error (list "Unknown pinentry mode" mode)))
+ (aset (cdr context) 15 mode))
+
(defun epg-make-signature (status &optional key-id)
"Return a signature object."
(cons 'epg-signature (vector status key-id nil nil nil nil nil nil nil nil
@@ -1152,6 +1166,10 @@ This function is for internal use only."
(if (epg-context-textmode context) '("--textmode"))
(if (epg-context-output-file context)
(list "--output" (epg-context-output-file context)))
+ (if (epg-context-pinentry-mode context)
+ (list "--pinentry-mode"
+ (symbol-name (epg-context-pinentry-mode
+ context))))
args))
(coding-system-for-write 'binary)
(coding-system-for-read 'binary)
diff --git a/lisp/info-look.el b/lisp/info-look.el
index afe4301c659..e43cd731547 100644
--- a/lisp/info-look.el
+++ b/lisp/info-look.el
@@ -881,8 +881,11 @@ Return nil if there is nothing appropriate in the buffer near point."
(info-lookup-maybe-add-help
:mode 'latex-mode
:regexp "\\\\\\([a-zA-Z]+\\|[^a-zA-Z]\\)"
- :doc-spec '(("(latex)Command Index" nil
- "`" "\\({[^}]*}\\)?'")))
+ :doc-spec `((,(if (Info-find-file "latex2e" t)
+ ;; From http://home.gna.org/latexrefman
+ "(latex2e)Command Index"
+ "(latex)Command Index")
+ nil "`" "\\({[^}]*}\\)?'")))
(info-lookup-maybe-add-help
:mode 'emacs-lisp-mode
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index d879735c344..9359a65a1b8 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -1,4 +1,4 @@
-;;; jit-lock.el --- just-in-time fontification
+;;; jit-lock.el --- just-in-time fontification -*- lexical-binding: t -*-
;; Copyright (C) 1998, 2000-2013 Free Software Foundation, Inc.
@@ -412,21 +412,24 @@ Defaults to the whole buffer. END can be out of bounds."
;; eagerly extend the refontified region with
;; jit-lock-after-change-extend-region-functions.
(when (< start orig-start)
- (run-with-timer 0 nil 'jit-lock-force-redisplay
- (current-buffer) start orig-start))
+ (run-with-timer 0 nil #'jit-lock-force-redisplay
+ (copy-marker start) (copy-marker orig-start)))
;; Find the start of the next chunk, if any.
(setq start (text-property-any next end 'fontified nil))))))))
-(defun jit-lock-force-redisplay (buf start end)
+(defun jit-lock-force-redisplay (start end)
"Force the display engine to re-render buffer BUF from START to END."
- (with-current-buffer buf
- (with-buffer-prepared-for-jit-lock
- ;; Don't cause refontification (it's already been done), but just do
- ;; some random buffer change, so as to force redisplay.
- (put-text-property start end 'fontified t))))
-
-
+ (when (marker-buffer start)
+ (with-current-buffer (marker-buffer start)
+ (with-buffer-prepared-for-jit-lock
+ (when (> end (point-max))
+ (setq end (point-max) start (min start end)))
+ (when (< start (point-min))
+ (setq start (point-min) end (max start end)))
+ ;; Don't cause refontification (it's already been done), but just do
+ ;; some random buffer change, so as to force redisplay.
+ (put-text-property start end 'fontified t)))))
;;; Stealth fontification.
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/minibuffer.el b/lisp/minibuffer.el
index 978b3a5b130..ef949f7482e 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -638,8 +638,8 @@ If ARGS are provided, then pass MESSAGE through `format'."
(defun minibuffer-completion-contents ()
"Return the user input in a minibuffer before point as a string.
-That used to be what completion commands operate on."
- (declare (obsolete minibuffer-contents "24.4"))
+In Emacs-22, that was what completion commands operated on."
+ (declare (obsolete nil "24.4"))
(buffer-substring (field-beginning) (point)))
(defun delete-minibuffer-contents ()
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index a71df54db58..613b2067955 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -982,11 +982,10 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(setq args (append (list "-s" (tramp-file-name-host vec)) args)))
(with-temp-buffer
(prog1
- (unless (zerop (apply 'call-process tramp-adb-program nil t nil args))
+ (unless
+ (zerop (apply 'tramp-call-process tramp-adb-program nil t nil args))
(buffer-string))
- (tramp-message
- vec 6 "%s %s\n%s"
- tramp-adb-program (mapconcat 'identity args " ") (buffer-string)))))
+ (tramp-message vec 6 "%s" (buffer-string)))))
(defun tramp-adb-find-test-command (vec)
"Checks, whether the ash has a builtin \"test\" command.
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index ed61fbcfa76..d4115352b34 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -438,20 +438,6 @@ This is, the first, empty, element is omitted. In XEmacs, the first
element is not omitted."
(delete "" (split-string string pattern)))
-(defun tramp-compat-call-process
- (program &optional infile destination display &rest args)
- "Calls `call-process' on the local host.
-This is needed because for some Emacs flavors Tramp has
-defadvised `call-process' to behave like `process-file'. The
-Lisp error raised when PROGRAM is nil is trapped also, returning 1."
- (let ((default-directory
- (if (file-remote-p default-directory)
- (tramp-compat-temporary-file-directory)
- default-directory)))
- (if (executable-find program)
- (apply 'call-process program infile destination display args)
- 1)))
-
(defun tramp-compat-process-running-p (process-name)
"Returns `t' if system process PROCESS-NAME is running for `user-login-name'."
(when (stringp process-name)
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 6f066f56a2b..7c3b393873c 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -1572,7 +1572,7 @@ COMMAND is usually a command from the gvfs-* utilities.
(tramp-gvfs-maybe-open-connection vec)
(erase-buffer)
(tramp-message vec 6 "%s %s" command (mapconcat 'identity args " "))
- (setq result (apply 'tramp-compat-call-process command nil t nil args))
+ (setq result (apply 'tramp-call-process command nil t nil args))
(tramp-message vec 6 "\n%s" (buffer-string))
(zerop result))))
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index f28df1ce160..e45c2cf8511 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -767,6 +767,16 @@ while (my $data = <STDIN>) {
Escape sequence %s is replaced with name of Perl binary.
This string is passed to `format', so percent characters need to be doubled.")
+(defconst tramp-perl-pack
+ "%s -e 'binmode STDIN; binmode STDOUT; print pack(q{u*}, join q{}, <>)'"
+ "Perl program to use for encoding a file.
+Escape sequence %s is replaced with name of Perl binary.")
+
+(defconst tramp-perl-unpack
+ "%s -e 'binmode STDIN; binmode STDOUT; print unpack(q{u*}, join q{}, <>)'"
+ "Perl program to use for decoding a file.
+Escape sequence %s is replaced with name of Perl binary.")
+
(defconst tramp-vc-registered-read-file-names
"echo \"(\"
while read file; do
@@ -1309,7 +1319,7 @@ of."
;; without `set-file-times', this function is an alias for this.
;; We are local, so we don't need the UTC settings.
(zerop
- (tramp-compat-call-process
+ (tramp-call-process
"touch" nil nil nil "-t"
(format-time-string "%Y%m%d%H%M.%S" time)
(tramp-shell-quote-argument filename)))))
@@ -1343,7 +1353,7 @@ be non-negative integers."
;; `set-file-uid-gid'. On W32 "chown" might not work.
(let ((uid (or (and (natnump uid) uid) (tramp-get-local-uid 'integer)))
(gid (or (and (natnump gid) gid) (tramp-get-local-gid 'integer))))
- (tramp-compat-call-process
+ (tramp-call-process
"chown" nil nil nil
(format "%d:%d" uid gid) (tramp-shell-quote-argument filename))))))
@@ -2891,40 +2901,39 @@ the result will be a local, non-Tramp, filename."
(rem-enc
(save-excursion
(with-tramp-progress-reporter
- v 3 (format "Encoding remote file %s" filename)
+ v 3
+ (format "Encoding remote file `%s' with `%s'" filename rem-enc)
(tramp-barf-unless-okay
v (format rem-enc (tramp-shell-quote-argument localname))
"Encoding remote file failed"))
- (if (functionp loc-dec)
- ;; If local decoding is a function, we call it. We
- ;; must disable multibyte, because
- ;; `uudecode-decode-region' doesn't handle it
- ;; correctly.
- (with-temp-buffer
- (set-buffer-multibyte nil)
- (insert-buffer-substring (tramp-get-buffer v))
- (with-tramp-progress-reporter
- v 3 (format "Decoding remote file %s with function %s"
- filename loc-dec)
+ (with-tramp-progress-reporter
+ v 3 (format "Decoding local file `%s' with `%s'"
+ tmpfile loc-dec)
+ (if (functionp loc-dec)
+ ;; If local decoding is a function, we call it.
+ ;; We must disable multibyte, because
+ ;; `uudecode-decode-region' doesn't handle it
+ ;; correctly.
+ (with-temp-buffer
+ (set-buffer-multibyte nil)
+ (insert-buffer-substring (tramp-get-buffer v))
(funcall loc-dec (point-min) (point-max))
;; Unset `file-name-handler-alist'. Otherwise,
;; epa-file gets confused.
(let (file-name-handler-alist
(coding-system-for-write 'binary))
- (write-region (point-min) (point-max) tmpfile))))
-
- ;; If tramp-decoding-function is not defined for this
- ;; method, we invoke tramp-decoding-command instead.
- (let ((tmpfile2 (tramp-compat-make-temp-file filename)))
- ;; Unset `file-name-handler-alist'. Otherwise,
- ;; epa-file gets confused.
- (let (file-name-handler-alist
- (coding-system-for-write 'binary))
- (write-region (point-min) (point-max) tmpfile2))
- (with-tramp-progress-reporter
- v 3 (format "Decoding remote file %s with command %s"
- filename loc-dec)
+ (write-region (point-min) (point-max) tmpfile)))
+
+ ;; If tramp-decoding-function is not defined for this
+ ;; method, we invoke tramp-decoding-command instead.
+ (let ((tmpfile2 (tramp-compat-make-temp-file filename)))
+ ;; Unset `file-name-handler-alist'. Otherwise,
+ ;; epa-file gets confused.
+ (let (file-name-handler-alist
+ (coding-system-for-write 'binary))
+ (with-current-buffer (tramp-get-buffer v)
+ (write-region (point-min) (point-max) tmpfile2)))
(unwind-protect
(tramp-call-local-coding-command
loc-dec tmpfile2 tmpfile)
@@ -3149,28 +3158,25 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
(with-temp-buffer
(set-buffer-multibyte nil)
;; Use encoding function or command.
- (if (functionp loc-enc)
- (with-tramp-progress-reporter
- v 3 (format "Encoding region using function `%s'"
- loc-enc)
- (let ((coding-system-for-read 'binary))
- (insert-file-contents-literally tmpfile))
- ;; The following `let' is a workaround for the
- ;; base64.el that comes with pgnus-0.84. If
- ;; both of the following conditions are
+ (with-tramp-progress-reporter
+ v 3 (format "Encoding local file `%s' using `%s'"
+ tmpfile loc-enc)
+ (if (functionp loc-enc)
+ ;; The following `let' is a workaround for
+ ;; the base64.el that comes with pgnus-0.84.
+ ;; If both of the following conditions are
;; satisfied, it tries to write to a local
;; file in default-directory, but at this
;; point, default-directory is remote.
;; (`call-process-region' can't write to
;; remote files, it seems.) The file in
;; question is a tmp file anyway.
- (let ((default-directory
+ (let ((coding-system-for-read 'binary)
+ (default-directory
(tramp-compat-temporary-file-directory)))
- (funcall loc-enc (point-min) (point-max))))
+ (insert-file-contents-literally tmpfile)
+ (funcall loc-enc (point-min) (point-max)))
- (with-tramp-progress-reporter
- v 3 (format "Encoding region using command `%s'"
- loc-enc)
(unless (zerop (tramp-call-local-coding-command
loc-enc tmpfile t))
(tramp-error
@@ -3183,8 +3189,8 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
;; writes to remote file. Because this happens on
;; the remote host, we cannot use the function.
(with-tramp-progress-reporter
- v 3
- (format "Decoding region into remote file %s" filename)
+ v 3 (format "Decoding remote file `%s' using `%s'"
+ filename rem-dec)
(goto-char (point-max))
(unless (bolp) (newline))
(tramp-send-command
@@ -3204,7 +3210,7 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
(erase-buffer)
(and
;; cksum runs locally, if possible.
- (zerop (tramp-compat-call-process "cksum" tmpfile t))
+ (zerop (tramp-call-process "cksum" tmpfile t))
;; cksum runs remotely.
(tramp-send-command-and-check
v
@@ -3382,6 +3388,9 @@ Only send the definition if it has not already been done."
(unless (member name scripts)
(with-tramp-progress-reporter vec 5 (format "Sending script `%s'" name)
;; The script could contain a call of Perl. This is masked with `%s'.
+ (when (and (string-match "%s" script)
+ (not (tramp-get-remote-perl vec)))
+ (tramp-error vec 'file-error "No Perl available on remote host"))
(tramp-barf-unless-okay
vec
(format "%s () {\n%s\n}" name
@@ -3811,11 +3820,6 @@ process to set up. VEC specifies the connection."
(tramp-send-command
vec (format "unset %s" (mapconcat 'identity unset " ")) t))))
-;; CCC: We should either implement a Perl version of base64 encoding
-;; and decoding. Then we just use that in the last item. The other
-;; alternative is to use the Perl version of UU encoding. But then
-;; we need a Lisp version of uuencode.
-;;
;; Old text from documentation of tramp-methods:
;; Using a uuencode/uudecode inline method is discouraged, please use one
;; of the base64 methods instead since base64 encoding is much more
@@ -3832,11 +3836,9 @@ process to set up. VEC specifies the connection."
(autoload 'uudecode-decode-region "uudecode")
(defconst tramp-local-coding-commands
- '((b64 base64-encode-region base64-decode-region)
+ `((b64 base64-encode-region base64-decode-region)
(uu tramp-uuencode-region uudecode-decode-region)
- (pack
- "perl -e 'binmode STDIN; binmode STDOUT; print pack(q{u*}, join q{}, <>)'"
- "perl -e 'binmode STDIN; binmode STDOUT; print unpack(q{u*}, join q{}, <>)'"))
+ (pack ,(format tramp-perl-pack "perl") ,(format tramp-perl-unpack "perl")))
"List of local coding commands for inline transfer.
Each item is a list that looks like this:
@@ -3871,9 +3873,7 @@ with the encoded or decoded results, respectively.")
(uu "uuencode xxx" "uudecode -o -")
(uu "uuencode xxx" "uudecode -p")
(uu "uuencode xxx" tramp-uudecode)
- (pack
- "perl -e 'binmode STDIN; binmode STDOUT; print pack(q{u*}, join q{}, <>)'"
- "perl -e 'binmode STDIN; binmode STDOUT; print unpack(q{u*}, join q{}, <>)'"))
+ (pack tramp-perl-pack tramp-perl-unpack))
"List of remote coding commands for inline transfer.
Each item is a list that looks like this:
@@ -4014,7 +4014,7 @@ INPUT can also be nil which means `/dev/null'.
OUTPUT can be a string (which specifies a filename), or t (which
means standard output and thus the current buffer), or nil (which
means discard it)."
- (tramp-compat-call-process
+ (tramp-call-process
tramp-encoding-shell
(when (and input (not (string-match "%s" cmd))) input)
(if (eq output t) t nil)
@@ -4022,7 +4022,7 @@ means discard it)."
tramp-encoding-command-switch
(concat
(if (string-match "%s" cmd) (format cmd input) cmd)
- (if (stringp output) (concat "> " output) ""))))
+ (if (stringp output) (concat " >" output) ""))))
(defconst tramp-inline-compress-commands
'(("gzip" "gzip -d")
@@ -4051,7 +4051,7 @@ Goes through the list `tramp-inline-compress-commands'."
decompress (nth 1 item))
(tramp-message
vec 5
- "Checking local compress command `%s', `%s' for sanity"
+ "Checking local compress commands `%s', `%s' for sanity"
compress decompress)
(unless
(zerop
@@ -4067,7 +4067,7 @@ Goes through the list `tramp-inline-compress-commands'."
(throw 'next nil))
(tramp-message
vec 5
- "Checking remote compress command `%s', `%s' for sanity"
+ "Checking remote compress commands `%s', `%s' for sanity"
compress decompress)
(unless (tramp-send-command-and-check
vec (format "echo %s | %s | %s" magic compress decompress) t)
@@ -4981,10 +4981,12 @@ function cell is returned to be applied on a buffer."
;; Windows shells need the program file name after
;; the pipe symbol be quoted if they use forward
;; slashes as directory separators.
- (if (and (string-match "local" prop)
- (memq system-type '(windows-nt)))
- "(%s | \"%s\" >%%s)"
- "(%s | %s >%%s)")
+ (cond
+ ((and (string-match "local" prop)
+ (memq system-type '(windows-nt)))
+ "(%s | \"%s\")")
+ ((string-match "local" prop) "(%s | %s)")
+ (t "(%s | %s >%%s)"))
coding compress))
(compress
(format
@@ -4997,7 +4999,9 @@ function cell is returned to be applied on a buffer."
"(%s <%%s | %s)")
compress coding))
((string-match "decoding" prop)
- (format "%s >%%s" coding))
+ (cond
+ ((string-match "local" prop) (format "%s" coding))
+ (t (format "%s >%%s" coding))))
(t
(format "%s <%%s" coding)))))))
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 7795d9f808c..4ec3a4b7829 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1717,7 +1717,7 @@ Example:
;; Windows registry.
(and (memq system-type '(cygwin windows-nt))
(zerop
- (tramp-compat-call-process
+ (tramp-call-process
"reg" nil nil nil "query" (nth 1 (car v)))))
;; Configuration file.
(file-exists-p (nth 1 (car v)))))
@@ -2769,7 +2769,7 @@ User may be nil."
User is always nil."
(if (memq system-type '(windows-nt))
(with-temp-buffer
- (when (zerop (tramp-compat-call-process
+ (when (zerop (tramp-call-process
"reg" nil t nil "query" registry-or-dirname))
(goto-char (point-min))
(loop while (not (eobp)) collect
@@ -3897,6 +3897,24 @@ ALIST is of the form ((FROM . TO) ...)."
;;; Compatibility functions section:
+(defun tramp-call-process
+ (program &optional infile destination display &rest args)
+ "Calls `call-process' on the local host.
+This is needed because for some Emacs flavors Tramp has
+defadvised `call-process' to behave like `process-file'. The
+Lisp error raised when PROGRAM is nil is trapped also, returning 1.
+Furthermore, traces are written with verbosity of 6."
+ (let ((default-directory
+ (if (file-remote-p default-directory)
+ (tramp-compat-temporary-file-directory)
+ default-directory)))
+ (tramp-message
+ (vector tramp-current-method tramp-current-user tramp-current-host nil nil)
+ 6 "%s %s %s" program infile args)
+ (if (executable-find program)
+ (apply 'call-process program infile destination display args)
+ 1)))
+
;;;###tramp-autoload
(defun tramp-read-passwd (proc &optional prompt)
"Read a password from user (compat function).
diff --git a/lisp/subr.el b/lisp/subr.el
index 7fe3d411580..dc968542cd0 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
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el
index c00cf36c79e..a220002286e 100644
--- a/lisp/textmodes/reftex-vars.el
+++ b/lisp/textmodes/reftex-vars.el
@@ -873,7 +873,14 @@ DOWNCASE t: Downcase words before using them."
The default value matches usual \\label{...} definitions and
keyval style [..., label = {...}, ...] label definitions. It is
assumed that the regexp group 1 matches the label text, so you
-have to define it using \\(?1:...\\) when adding new regexps."
+have to define it using \\(?1:...\\) when adding new regexps.
+
+When changed from Lisp, make sure to call
+`reftex-compile-variables' afterwards to make the change
+effective."
+ :set (lambda (symbol value)
+ (set symbol value)
+ (reftex-compile-variables))
:group 'reftex-defining-label-environments
:type '(repeat (regexp :tag "Regular Expression")))
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index 21083fd188a..8b5dee5a037 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -811,6 +811,7 @@ This enforces rescanning the buffer on next use."
(reftex-kill-buffer (reftex-make-index-buffer-name tag)))
(cdr (assoc 'index-tags (symbol-value reftex-docstruct-symbol)))))
+;;;###autoload
(defun reftex-compile-variables ()
;; Compile the information in reftex-label-alist & Co.
diff --git a/make-dist b/make-dist
index 283defe8a7d..e1e62c895c7 100755
--- a/make-dist
+++ b/make-dist
@@ -439,6 +439,9 @@ echo "Making links to \`lwlib'"
echo "Making links to \`admin' and its subdirectories"
for f in `find admin -type f`; do
+ case $f in
+ admin/unidata/Makefile) continue ;;
+ esac
ln $f $tempdir/$f
done
diff --git a/nt/INSTALL b/nt/INSTALL
index 0c4b50f0c28..8abd8aff920 100644
--- a/nt/INSTALL
+++ b/nt/INSTALL
@@ -13,9 +13,13 @@
Do not use this recipe with Cygwin. For building on Cygwin,
use the normal installation instructions, ../INSTALL.
- If you have a Cygwin or MSYS port of Bash on your Path, you will be
- better off removing it from PATH. (For details, search for "MSYS
- sh.exe" below.)
+ Do not use these instructions with MSYS environment. For building
+ the native Windows binary with MinGW and MSYS, follow the
+ instructions in the file INSTALL.MSYS in this directory.
+
+ For building without MSYS, if you have a Cygwin or MSYS port of Bash
+ on your Path, you will be better off removing it from PATH. (For
+ details, search for "MSYS sh.exe" below.)
1. Change to the `nt' directory (the directory of this file):
diff --git a/nt/INSTALL.MSYS b/nt/INSTALL.MSYS
new file mode 100644
index 00000000000..c1b287083f6
--- /dev/null
+++ b/nt/INSTALL.MSYS
@@ -0,0 +1,580 @@
+ Building and Installing Emacs on MS-Windows
+ using the MSYS and MinGW tools
+
+ Copyright (C) 2013 Free Software Foundation, Inc.
+ See the end of the file for license conditions.
+
+The MSYS/MinGW build described here is supported on versions of
+Windows starting with Windows 2000 and newer. Windows 9X are not
+supported (but the Emacs binary produced by this build will run on
+Windows 9X as well).
+
+* For the brave (a.k.a. "impatient"):
+
+ For those who have a working MSYS/MinGW development environment and
+ are comfortable with running Posix configure scripts, here are the
+ concise instructions for configuring and building the native Windows
+ binary of Emacs with these tools.
+
+ Do not use this recipe with Cygwin. For building on Cygwin, use the
+ normal installation instructions, ../INSTALL.
+
+ Do not use these instructions if you don't have MSYS installed; for
+ that, see the file INSTALL in this directory.
+
+ 0. Start the MSYS Bash window. Everything else below is done from
+ that window's Bash prompt.
+
+ 0a. If you are building from the development trunk (as opposed to a
+ release tarball), produce the configure script, by typing from
+ the top-level Emacs source directory:
+
+ ./autogen.sh
+
+ 1. If you want to build Emacs outside of the source tree
+ (recommended), create the build directory and chdir there.
+
+ 2. Invoke the MSYS-specific configure script:
+
+ - If you are building outside the source tree:
+
+ /PATH/TO/EMACS/SOURCE/TREE/nt/msysconfig.sh --prefix=PREFIX ...
+
+ - If you are building in-place, i.e. inside the source tree:
+
+ ./nt/msysconfig.sh --prefix=PREFIX ...
+
+ It is always preferable to use --prefix to configure Emacs for
+ some specific location of its installed tree; the default
+ /usr/local is not suitable for Windows.
+
+ You can pass other options to the configure script. Here's a
+ typical example (for an in-place debug build):
+
+ CPPFLAGS='-DGLYPH_DEBUG=1' CFLAGS='-O0 -g3' ./nt/msysconfig.sh --prefix=d:/usr/emacs --enable-checking
+
+ 3. After the configure script finishes, it should display the
+ resulting configuration. After that, type
+
+ make
+
+ Use "make -j N" if your MSYS Make supports parallel execution;
+ the build will take significantly less time in that case. Here N
+ is the number of simultaneous parallel jobs; use the number of
+ the cores on your system.
+
+ 4. Install the produced binaries:
+
+ make install
+
+ If you want the installation tree to go to a place that is
+ different from the one specified by --prefix, say
+
+ make install prefix=/where/ever/you/want
+
+ That's it!
+
+ If these short instructions somehow fail, read the rest of this
+ file.
+
+* Installing MinGW and MSYS
+
+ Make sure you carefully read the following two sections in their
+ entirety and install/configure the various packages as instructed.
+ A correct installation makes all the rest almost trivial; a botched
+ installation will likely make you miserable for quite some time.
+
+** Installing MinGW
+
+ You will need to install the MinGW port of GCC and Binutils, and the
+ MinGW runtime and Windows API distributions, to compile Emacs. You
+ can find these on the MinGW download/Base page:
+
+ https://sourceforge.net/projects/mingw/files/MinGW/Base/
+
+ In general, install the latest stable versions of the following
+ MinGW packages from that page: gcc, binutils, mingw-rt, w32api. You
+ only need the 'bin' and the 'dll' tarballs of each of the above.
+
+ A nice GUI installer, called mingw-get, is available for those who
+ don't like to mess with manual installations. You can download it
+ from here:
+
+ https://sourceforge.net/projects/mingw/files/Installer/mingw-get/
+
+ (This installer only supports packages downloaded from the MinGW
+ site; for the rest you will still need the manual method.)
+
+ MinGW and MSYS packages are distributed as .tar.lzma compressed
+ archives. If you like to install the packages manually, then we
+ recommend to use the Windows port of the 'bsdtar' program to unpack
+ the tarballs. 'bsdtar' is available as part of the 'libarchive'
+ package from here:
+
+ http://sourceforge.net/projects/ezwinports/files/
+
+ The recommended place to install these packages is a single tree
+ starting from some directory on a drive other than the system drive
+ C:. A typical example would be D:\usr, with D:\usr\bin holding the
+ binaries and DLLs (should be added to your Path environment
+ variable), D:\usr\include holding the include files, D:\usr\lib
+ holding the static and import libraries, D:\share holding docs,
+ message catalogs, and package-specific subdirectories, etc.
+
+ Having all the headers and libraries in a single place will greatly
+ reduce the number of -I and -L flags you will have to pass to the
+ configure script (see below), as these files will be right where the
+ compiler expects them.
+
+ We specifically do NOT recommend installing packages below
+ "C:\Program Files" or "C:\Program Files (x86)". These directories
+ are protected on versions of Windows from Vista and on, and you will
+ have difficulties updating and maintaining your installation later,
+ due to UAC elevation prompts, file virtualization, etc. You *have*
+ been warned!
+
+ Additional MinGW packages are required/recommended, especially if
+ you are building from the Bazaar repository:
+
+ . Texinfo (needed to produce the Info manuals when building from bzr)
+
+ Available from http://sourceforge.net/projects/ezwinports/files/.
+
+ . gzip (needed to compress files during "make install")
+
+ Available from http://gnuwin32.sourceforge.net/packages/gzip.htm.
+
+ . pkg-config (needed for building with some optional image libraries)
+
+ Available from http://www.gtk.org/download/win32.php
+
+ Each package might list other packages as prerequisites on its
+ download page (under "Runtime requirements"); download those as
+ well. (Using the GUI installer mingw-get will fetch those
+ prerequisites automatically for you.) A missing prerequisite will
+ manifest itself by the program failing to run and presenting a
+ pop-up dialog that states the missing or incompatible DLL; be sure
+ to find and install these missing DLLs.
+
+ Once you think you have MinGW installed, test the installation by
+ building a trivial "hello, world!" program, and make sure that it
+ builds without any error messages and the binary works when run.
+
+** Installing MSYS
+
+ You will also need a reasonably full MSYS installation. MSYS is an
+ environment needed to run the Posix configure scripts and the
+ resulting Makefile's, in order to produce native Windows binaries
+ using the MinGW compiler and runtime libraries. Here's the list of
+ MSYS packages that are required:
+
+ . All the packages from the MSYS Base distribution, listed here:
+
+ https://sourceforge.net/projects/mingw/files/MSYS/Base/
+
+ . Additional packages listed below, from the MSYS Extension
+ distribution here:
+
+ https://sourceforge.net/projects/mingw/files/MSYS/Extension/
+
+ - flex
+ - bison
+ - m4
+ - perl
+ - mktemp
+
+ These should only be needed if you intend to build development
+ versions of Emacs from the Bazaar repository.
+
+ . Additional packages (needed only if building from the Bazaar
+ repository): Automake and Autoconf. They are available from
+ here:
+
+ http://sourceforge.net/projects/ezwinports/files/automake-1.11.6-msys-bin.zip/download
+ http://sourceforge.net/projects/ezwinports/files/autoconf-2.65-msys-bin.zip/download
+
+ If/when you are confident in your MinGW/MSYS installation, and want
+ to speed up the builds, we recommend installing a pre-release
+ version of Make from here:
+
+ https://sourceforge.net/projects/mingwbuilds/files/external-binary-packages/
+
+ These are snapshot builds of many packages, but you only need
+ make.exe from there. The advantage of this make.exe is that it
+ supports parallel builds, so you can use "make -j N" to considerably
+ speed up your builds
+
+ For each of these packages, install the 'bin' and 'dll' tarballs of
+ their latest stable releases. If there's an 'ext' tarball (e.g.,
+ msysCORE and Coreutils have it), download and install those as well.
+
+ Each package might list other packages as prerequisites on its
+ download page (under "Runtime requirements"); download those as
+ well. (Using the GUI installer mingw-get will fetch those
+ prerequisites automatically for you.) A missing prerequisite will
+ manifest itself by the program failing to run and presenting a
+ pop-up dialog that states the missing or incompatible DLL; be sure
+ to find and install these missing DLLs.
+
+ MSYS packages should be installed in a separate tree from MinGW.
+ For example, use D:\MSYS or D:\usr\MSYS as the top-level directory
+ from which you unpack all of the MSYS packages.
+
+ Do NOT add the MSYS bin directory to your Windows Path! Only the
+ MinGW bin directory should be on Path. When you install MSYS, it
+ creates a shortcut on your desktop that invokes the MSYS Bash shell
+ in a Command Prompt window; that shell is already set up so that the
+ MSYS bin directory is on PATH ahead of any other directory. Thus,
+ Bash will find MSYS executables first, which is exactly what you
+ need.
+
+ At this point, you are ready to build Emacs in its basic
+ configuration. If you want to build it with image support, read
+ about the optional image libraries near the end of this document.
+
+* Generating the configure script.
+
+ If you are building a release or pretest tarball, skip this section,
+ because the configure script is already present in the tarball.
+
+ To build a development snapshot from the Emacs Bazaar repository,
+ you will first need to generate the configure script and a few other
+ auto-generated files. (If this step, described below, somehow
+ fails, you can use the files in the autogen/ directory instead, but
+ they might be outdated, and, most importantly, you are well advised
+ not to disregard any failures in your local build procedures, as
+ these are likely to be symptoms of incorrect installation that will
+ bite you down the road.)
+
+ To generate the configure script, type this at the MSYS Bash prompt
+ from the top-level directory of the Emacs tree:
+
+ ./autogen.sh
+
+ If successful, this command should produce the following output:
+
+ $ ./autogen.sh
+ Checking whether you have the necessary tools...
+ (Read INSTALL.BZR for more details on building Emacs)
+
+ Checking for autoconf (need at least version 2.65)...
+ ok
+ Checking for automake (need at least version 1.11)...
+ ok
+ Your system has the required tools, running autoreconf...
+ You can now run `./configure'.
+
+* Configuring Emacs for MinGW:
+
+ Now it's time to run the configure script. You can do that either
+ from a separate build directory that is outside of the Emacs source
+ tree (recommended), or from inside the source tree. The former is
+ recommended because it allows you to have several different builds,
+ e.g., an optimized build and an unoptimized one, of the same
+ revision of the source tree; the source tree will be left in its
+ pristine state, without any build products.
+
+ You invoke the configure script like this:
+
+ /PATH/TO/EMACS/SOURCE/TREE/nt/msysconfig.sh --prefix=PREFIX ...
+
+ or, if you are building in-place, i.e. inside the source tree:
+
+ ./nt/msysconfig.sh --prefix=PREFIX ...
+
+ Here PREFIX is the place where you eventually want to install Emacs
+ once built, e.g. d:/usr.
+
+ You can pass additional options to the configure script, for the
+ full list type
+
+ ./nt/msysconfig.sh --help
+
+ As explained in the help text, you may need to tell the script what
+ are the optional flags to invoke the compiler. This is needed if
+ some of your headers and libraries, e.g., those belonging to
+ optional image libraries, are installed in places where the compiler
+ normally doesn't look for them. (Remember that advice above to
+ avoid such situations? here's is where you will start paying for
+ disregarding that recommendation.) For example, if you have libpng
+ headers in C:\emacs\libs\libpng-1.2.37-lib\include and jpeg library
+ headers in C:\emacs\libs\jpeg-6b-4-lib\include, you will need to say
+ something like this:
+
+ CPPFLAGS='-Ic:/emacs/libs/libpng-1.2.37-lib/include -Ic:/emacs/libs/jpeg-6b-4-lib/include' ./nt/msysconfig.sh --prefix=PREFIX
+
+ which is quite a mouth-full, especially if you have more directories
+ to specify... Perhaps you may wish to revisit your installation
+ decisions now.
+
+ A few frequently used options are needed when you want to produce an
+ unoptimized binary with runtime checks enabled:
+
+ CPPFLAGS='-DGLYPH_DEBUG=1' CFLAGS='-O0 -g3' ./nt/msysconfig.sh --prefix=PREFIX --enable-checking
+
+ Once invoked, the configure script will run for some time, and, if
+ successful, will eventually produce a summary of the configuration
+ like this:
+
+ Configured for `i686-pc-mingw32'.
+
+ Where should the build process find the source code? /path/to/emacs/sources
+ What compiler should emacs be built with? gcc -std=gnu99 -O0 -g3
+ Should Emacs use the GNU version of malloc? yes
+ Should Emacs use a relocating allocator for buffers? yes
+ Should Emacs use mmap(2) for buffer allocation? no
+ What window system should Emacs use? w32
+ What toolkit should Emacs use? none
+ Where do we find X Windows header files? NONE
+ Where do we find X Windows libraries? NONE
+ Does Emacs use -lXaw3d? no
+ Does Emacs use -lXpm? yes
+ Does Emacs use -ljpeg? yes
+ Does Emacs use -ltiff? yes
+ Does Emacs use a gif library? yes
+ Does Emacs use -lpng? yes
+ Does Emacs use -lrsvg-2? no
+ Does Emacs use imagemagick? no
+ Does Emacs use -lgpm? no
+ Does Emacs use -ldbus? no
+ Does Emacs use -lgconf? no
+ Does Emacs use GSettings? no
+ Does Emacs use -lselinux? no
+ Does Emacs use -lgnutls? yes
+ Does Emacs use -lxml2? yes
+ Does Emacs use -lfreetype? no
+ Does Emacs use -lm17n-flt? no
+ Does Emacs use -lotf? no
+ Does Emacs use -lxft? no
+ Does Emacs use toolkit scroll bars? yes
+
+ You are almost there, hang on.
+
+ If the output is significantly different, or if configure finishes
+ prematurely and displays some error message, you should examine the
+ configuration log in config.log and find the reason for the failure.
+
+ Once you succeeded in configuring Emacs, and just want to rebuild it
+ after updating your local repository from the main repository, you
+ don't need to re-run the configure script manually, unless you want
+ to change the configure-time options. Just typing "make" will
+ re-run configure if necessary with the exact same options you
+ specified originally, and then go on to invoking Make, described
+ below.
+
+* Running Make.
+
+ This is simple: just type "make" and sit back, watching the fun.
+
+ If you installed a snapshot build of Make, the build will be much
+ faster if you type "make -j N" instead, where N is the number of
+ independent processing units on your machine. E.g., on a core i7
+ system try using N of 6 or even 8.
+
+ When Make finishes, you can install the produced binaries:
+
+ make install
+
+ or, if you want the installed tree to go in a place different from
+ the configured one, type
+
+ make install prefix=WHEREVER
+
+ Congrats! You have built and installed your own Emacs!
+
+* Make targets
+
+ The following make targets may be used by users building the source
+ distribution, or users who have checked out of Bazaar after
+ an initial bootstrapping.
+
+ make
+ Builds Emacs from the available sources and pre-compiled lisp files.
+
+ make install
+ Installs the built programs and the auxiliary files.
+
+ make clean
+ Removes object and executable files produced by the build process in
+ the current configuration. After "make clean", you can rebuild with
+ the same configuration using make. useful when you want to be sure
+ that all of the products are built from coherent sources.
+
+ make distclean
+ In addition to the files removed by make clean, this also removes
+ Makefiles and other generated files to get back to the state of a
+ freshly unpacked source distribution. After make distclean, it is
+ necessary to run the configure script followed by "make", in order
+ to rebuild.
+
+ The following targets are intended only for use with the Bazaar sources.
+
+ make bootstrap
+ Removes all the auto-generated files and all the *.elc byte-compiled
+ files, and builds Emacs from scratch. Useful when some change in
+ basic Emacs functionality makes byte compilation of updated files
+ fail.
+
+ make maintainer-clean
+ Removes everything that can be recreated, including compiled Lisp
+ files, to get back to the state of a fresh Bazaar tree. After make
+ maintainer-clean, it is necessary to run configure and "make" or
+ "make bootstrap" to rebuild. Occasionally it may be necessary to
+ run this target after an update.
+
+* Optional image library support
+
+ In addition to its "native" image formats (pbm and xbm), Emacs can
+ handle other image types: xpm, tiff, gif, png, jpeg and experimental
+ support for svg.
+
+ To build Emacs with support for them, the corresponding headers must
+ be in the include path when the configure script is run. This is be
+ set up using the CPPFLAGS and CFLAGS variable specified on the
+ configure command line. The configure script will report whether it
+ was able to detect the headers. If the results of this testing
+ appear to be incorrect, please look for details in the file
+ config.log: it will show the failed test programs and compiler error
+ messages that should explain what is wrong. (Usually, any such
+ failures happen because some headers are missing due to bad
+ packaging of the image support libraries.)
+
+ Note that any file path passed to the compiler or linker must use
+ forward slashes, or double each backslash, as that is how Bash
+ works.
+
+ If the configure script finds the necessary headers, but they are
+ for some reason incompatible, or if you want to omit support for
+ some image library that is installed on your system for some other
+ reason, use the --without-PACKAGE option to configure, such as
+ --without-gif to omit GIF, --without-tiff to omit TIFF, etc.
+ Passing the --help option to the configure script displays all of
+ the supported --without-PACKAGE options.
+
+ To use the external image support, the DLLs implementing the
+ functionality must be found when Emacs first needs them, either on the
+ PATH, or in the same directory as emacs.exe. Failure to find a
+ library is not an error; the associated image format will simply be
+ unavailable. Note that once Emacs has determined that a library can
+ not be found, there's no way to force it to try again, other than
+ restarting. See the variable `dynamic-library-alist' to configure the
+ expected names of the libraries.
+
+ Some image libraries have dependencies on one another, or on zlib.
+ For example, tiff support depends on the jpeg library. If you did not
+ compile the libraries yourself, you must make sure that any dependency
+ is in the PATH or otherwise accessible and that the binaries are
+ compatible (for example, that they were built with the same compiler).
+
+ Binaries for the image libraries (among many others) can be found at
+ the GnuWin32 project. PNG, JPEG and TIFF libraries are also
+ included with GTK, which is installed along with other Free Software
+ that requires it. Note specifically that, due to some packaging
+ snafus in the GnuWin32-supplied image libraries, you will need to
+ download _source_ packages for some of the libraries in order to get
+ the header files necessary for building Emacs with image support.
+
+ For PNG images, we recommend to use versions 1.4.x and later of
+ libpng, because previous versions had security issues. You can find
+ precompiled libraries and headers on the GTK download page for
+ Windows (http://www.gtk.org/download/win32.php).
+
+ Versions 1.4.0 and later of libpng are binary incompatible with
+ earlier versions, so Emacs will only look for libpng libraries which
+ are compatible with the version it was compiled against. That
+ version is given by the value of the Lisp variable `libpng-version';
+ e.g., 10403 means version 1.4.3. The variable `dynamic-library-alist'
+ is automatically set to name only those DLL names that are known to
+ be compatible with the version given by `libpng-version'. If PNG
+ support does not work for you even though you have the support DLL
+ installed, check the name of the installed DLL against
+ `dynamic-library-alist' and the value of `libpng-version', and
+ download compatible DLLs if needed.
+
+* Optional GnuTLS support
+
+ If the configure script finds the gnutls/gnutls.h file in the
+ include path, Emacs is built with GnuTLS support by default; to
+ avoid that you can pass the argument --without-gnutls.
+
+ In order to support GnuTLS at runtime, a GnuTLS-enabled Emacs must
+ be able to find the relevant DLLs during startup; failure to do so
+ is not an error, but GnuTLS won't be available to the running
+ session.
+
+ You can get pre-built binaries (including any required DLL and the
+ header files) at http://sourceforge.net/projects/ezwinports/files/.
+
+* Optional libxml2 support
+
+ If the configure script finds the libxml/HTMLparser.h file in the
+ include path, Emacs is built with libxml2 support by default; to
+ avoid that you can pass the argument --without-libxml2.
+
+ In order to support libxml2 at runtime, a libxml2-enabled Emacs must
+ be able to find the relevant DLLs during startup; failure to do so
+ is not an error, but libxml2 features won't be available to the
+ running session.
+
+ One place where you can get pre-built Windows binaries of libxml2
+ (including any required DLL and the header files) is here:
+
+ http://sourceforge.net/projects/ezwinports/files/
+
+ For runtime support of libxml2, you will also need to install the
+ libiconv "development" tarball, because the libiconv headers need to
+ be available to the compiler when you compile with libxml2 support.
+ A MinGW port of libiconv can be found on the MinGW site:
+
+ http://sourceforge.net/projects/mingw/files/MinGW/Base/libiconv/
+
+ You need the libiconv-X.Y.Z-N-mingw32-dev.tar.lzma tarball from that
+ site.
+
+* Experimental SVG support
+
+ SVG support is currently experimental, and not built by default.
+ Specify --with-rsvg and ensure you have all the dependencies in your
+ include path. Unless you have built a minimalist librsvg yourself
+ (untested), librsvg depends on a significant chunk of GTK+ to build,
+ plus a few Gnome libraries, libxml2, libbz2 and zlib at runtime. The
+ easiest way to obtain the dependencies required for building is to
+ download a pre-bundled GTK+ development environment for Windows.
+
+ To use librsvg at runtime, ensure that librsvg and its dependencies
+ are on your PATH. If you didn't build librsvg yourself, you will
+ need to check with where you downloaded it from for the
+ dependencies, as there are different build options. If it is a
+ short list, then it most likely only lists the immediate
+ dependencies of librsvg, but the dependencies themselves have
+ dependencies - so don't download individual libraries from GTK+,
+ download and install the whole thing. If you think you've got all
+ the dependencies and SVG support is still not working, check your
+ PATH for other libraries that shadow the ones you downloaded.
+ Libraries of the same name from different sources may not be
+ compatible, this problem was encountered with libbzip2 from GnuWin32
+ with libcroco from gnome.org.
+
+ If you can see etc/images/splash.svg, then you have managed to get
+ SVG support working. Congratulations for making it through DLL hell
+ to this point. You'll probably find that some SVG images crash
+ Emacs. Problems have been observed in some images that contain
+ text, they seem to be a problem in the Windows port of Pango, or
+ maybe a problem with the way Cairo or librsvg is using it that
+ doesn't show up on other platforms.
+
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
diff --git a/nt/Makefile.in b/nt/Makefile.in
new file mode 100644
index 00000000000..3d5e1ca084c
--- /dev/null
+++ b/nt/Makefile.in
@@ -0,0 +1,212 @@
+# nt/Makefile for GNU Emacs.
+
+# Copyright (C) 2013 Free Software Foundation, Inc.
+
+# This file is part of GNU Emacs.
+
+# GNU Emacs is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# GNU Emacs is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
+
+# Avoid trouble on systems where the `SHELL' variable might be
+# inherited from the environment.
+SHELL = /bin/sh
+
+# ==================== Things `configure' will edit ====================
+
+CC=@CC@
+CFLAGS=@CFLAGS@
+version=@version@
+## Used in $archlibdir.
+configuration=@configuration@
+EXEEXT=@EXEEXT@
+C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
+C_SWITCH_MACHINE=@C_SWITCH_MACHINE@
+PROFILING_CFLAGS = @PROFILING_CFLAGS@
+WARN_CFLAGS = @WARN_CFLAGS@
+WERROR_CFLAGS = @WERROR_CFLAGS@
+
+# Program name transformation.
+TRANSFORM = @program_transform_name@
+
+# ==================== Where To Install Things ====================
+
+# The default location for installation. Everything is placed in
+# subdirectories of this directory. The default values for many of
+# the variables below are expressed in terms of this one, so you may
+# not need to change them. This is set with the --prefix option to
+# `../configure'.
+prefix=@prefix@
+
+# Like `prefix', but used for architecture-specific files. This is
+# set with the --exec-prefix option to `../configure'.
+exec_prefix=@exec_prefix@
+
+# Where to install Emacs and other binaries that people will want to
+# run directly (like etags). This is set with the --bindir option
+# to `../configure'.
+bindir=@bindir@
+
+# Where to install and expect executable files to be run by Emacs
+# rather than directly by users, and other architecture-dependent
+# data. ${archlibdir} is usually below this. This is set with the
+# --libexecdir option to `../configure'.
+libexecdir=@libexecdir@
+
+# Directory for local state files for all programs.
+localstatedir=@localstatedir@
+
+# Where to find the source code. This is set by the configure
+# script's `--srcdir' option. However, the value of ${srcdir} in
+# this makefile is not identical to what was specified with --srcdir,
+# since the variable here has `/lib-src' added at the end.
+
+# We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
+srcdir=@srcdir@
+VPATH=@srcdir@
+
+# The top-level source directory, also set by configure.
+top_srcdir=@top_srcdir@
+
+# ==================== Emacs-specific directories ====================
+
+# These variables hold the values Emacs will actually use. They are
+# based on the values of the standard Make variables above.
+
+# Where to put executables to be run by Emacs rather than the user.
+# This path usually includes the Emacs version and configuration name,
+# so that multiple configurations for multiple versions of Emacs may
+# be installed at once. This can be set with the --archlibdir option
+# to `../configure'.
+archlibdir=@archlibdir@
+
+# ==================== Utility Programs for the Build =================
+
+# ../configure figures out the correct values for these.
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+# By default, we uphold the dignity of our programs.
+INSTALL_STRIP =
+MKDIR_P = @MKDIR_P@
+
+# ========================== Lists of Files ===========================
+
+# Things that a user might actually run, which should be installed in bindir.
+INSTALLABLES = runemacs${EXEEXT} addpm${EXEEXT}
+
+# Things that Emacs runs internally, which should not be installed in bindir.
+UTILITIES = cmdproxy${EXEEXT} ddeclient${EXEEXT}
+
+# Things that Emacs runs during the build process.
+DONT_INSTALL = addsection${EXEEXT}
+
+# All files that are created by the linker, i.e., whose names end in ${EXEEXT}.
+EXE_FILES = ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
+
+# =========================== Configuration ===========================
+
+# MS-Windows resource files and resource compiler
+EMACSRES = @EMACSRES@
+EMACS_MANIFEST = @EMACS_MANIFEST@
+WINDRES = @WINDRES@
+
+## Extra libraries to use when linking addpm.
+LIBS_ADDPM = -lole32 -luuid
+
+## Compilation and linking flags
+BASE_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) \
+ $(WARN_CFLAGS) $(WERROR_CFLAGS) \
+ -I. -I${srcdir}
+
+ALL_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
+LINK_CFLAGS = ${BASE_CFLAGS} ${LDFLAGS} ${CFLAGS}
+CPP_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${CPPFLAGS} ${CFLAGS}
+
+all: ${EXE_FILES}
+
+.PHONY: all
+
+## Install the internal utilities. Until they are installed, we can
+## just run them directly from nt/.
+$(DESTDIR)${archlibdir}: all
+ @echo
+ @echo "Installing utilities run internally by Emacs."
+ umask 022; ${MKDIR_P} $(DESTDIR)${archlibdir}
+ if [ `cd $(DESTDIR)${archlibdir} && /bin/pwd` != `/bin/pwd` ]; then \
+ for file in ${UTILITIES}; do \
+ $(INSTALL_PROGRAM) $(INSTALL_STRIP) $$file $(DESTDIR)${archlibdir}/$$file ; \
+ done ; \
+ fi
+
+.PHONY: install uninstall mostlyclean clean distclean maintainer-clean
+.PHONY: extraclean check tags
+
+install: $(DESTDIR)${archlibdir}
+ @echo
+ @echo "Installing utilities for users to run."
+ umask 022; ${MKDIR_P} $(DESTDIR)${bindir}
+ for file in ${INSTALLABLES} ; do \
+ $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} $(DESTDIR)${bindir}/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \
+ done
+
+uninstall:
+ for file in ${INSTALLABLES}; do \
+ rm -f $(DESTDIR)${bindir}/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \
+ done
+ if [ -d $(DESTDIR)${archlibdir} ]; then \
+ (cd $(DESTDIR)${archlibdir} && rm -f ${UTILITIES}) \
+ fi
+
+mostlyclean:
+ -rm -f core *.o
+
+clean: mostlyclean
+ -rm -f ${EXE_FILES}
+
+distclean: clean
+ -rm -f TAGS
+ -rm -f Makefile
+
+maintainer-clean: distclean
+ true
+
+extraclean: maintainer-clean
+ -rm -f *~ \#*
+
+## Test the contents of the directory.
+check:
+ @echo "We don't have any tests for the nt/ directory yet."
+
+tags: TAGS
+TAGS: ${EXE_FILES:${EXEEXT}=.c}
+ ../lib-src/etags *.[ch]
+
+## Build the programs
+addsection${EXEEXT}: ${srcdir}/addsection.c
+ $(CC) ${ALL_CFLAGS} ${srcdir}/addsection.c -o addsection${EXEEXT}
+
+addpm${EXEEXT}: ${srcdir}/addpm.c ../src/epaths.h
+ $(CC) ${ALL_CFLAGS} ${srcdir}/addpm.c $(LIBS_ADDPM) -o addpm${EXEEXT}
+
+ddeclient${EXEEXT}: ${srcdir}/ddeclient.c
+ $(CC) ${ALL_CFLAGS} ${srcdir}/ddeclient.c -o ddeclient${EXEEXT}
+
+cmdproxy${EXEEXT}: ${srcdir}/cmdproxy.c
+ $(CC) ${ALL_CFLAGS} ${srcdir}/cmdproxy.c -o cmdproxy${EXEEXT}
+
+runemacs${EXEEXT}: ${srcdir}/runemacs.c $(EMACSRES)
+ $(CC) ${ALL_CFLAGS} ${srcdir}/runemacs.c $(EMACSRES) -mwindows \
+ -o runemacs${EXEEXT}
+
+emacs.res: ${srcdir}/emacs.rc ${srcdir}/icons/emacs.ico ${srcdir}/$(EMACS_MANIFEST)
+ ${WINDRES} -O coff -o emacs.res ${srcdir}/emacs.rc
diff --git a/nt/addpm.c b/nt/addpm.c
index 688e0167334..48c77821c8c 100644
--- a/nt/addpm.c
+++ b/nt/addpm.c
@@ -50,6 +50,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <shlobj.h>
#include <ddeml.h>
+#ifndef OLD_PATHS
+#include "../src/epaths.h"
+#endif
+
HDDEDATA CALLBACK
DdeCallback (UINT uType, UINT uFmt, HCONV hconv,
HSZ hsz1, HSZ hsz2, HDDEDATA hdata,
@@ -76,6 +80,7 @@ static struct entry
}
env_vars[] =
{
+#ifdef OLD_PATHS
{"emacs_dir", NULL},
{"EMACSLOADPATH", "%emacs_dir%/site-lisp;%emacs_dir%/../site-lisp;%emacs_dir%/lisp;%emacs_dir%/leim"},
{"SHELL", "%emacs_dir%/bin/cmdproxy.exe"},
@@ -86,6 +91,18 @@ env_vars[] =
/* {"INFOPATH", "%emacs_dir%/info"}, */
{"EMACSDOC", "%emacs_dir%/etc"},
{"TERM", "cmd"}
+#else /* !OLD_PATHS */
+ {"emacs_dir", NULL},
+ {"EMACSLOADPATH", PATH_SITELOADSEARCH ";" PATH_LOADSEARCH},
+ {"SHELL", PATH_EXEC "/cmdproxy.exe"},
+ {"EMACSDATA", PATH_DATA},
+ {"EMACSPATH", PATH_EXEC},
+ /* We no longer set INFOPATH because Info-default-directory-list
+ is then ignored. */
+ /* {"INFOPATH", "%emacs_dir%/info"}, */
+ {"EMACSDOC", PATH_DOC},
+ {"TERM", "cmd"}
+#endif
};
BOOL
diff --git a/nt/epaths.nt b/nt/epaths.nt
new file mode 100644
index 00000000000..1e418550d52
--- /dev/null
+++ b/nt/epaths.nt
@@ -0,0 +1,89 @@
+/* Hey Emacs, this is -*- C -*- code! */
+/* epaths.in file for MS-Windows build that uses the configure script.
+
+ Since Emacs on Windows must be relocatable to any directory, it
+ cannot have here hard-coded directories determined at configure
+ time. Therefore, each directory must begin with %emacs_dir%, which
+ is resolved at startup to the root of the Emacs installation tree
+ (see w32.c:init_environment).
+
+ This file is edited at configure time to replace @VER@ by the Emacs
+ version being built (e.g., 25.9.77), @CFG@ by the canonical name of
+ the host system (e.g., i686-pc-mingw32), and @SRC@ by the root of
+ the Emacs source tree used to build Emacs. */
+/*
+Copyright (C) 1993, 1995, 1997, 1999, 2001-2013 Free Software
+Foundation, Inc.
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
+
+
+/* Together with PATH_SITELOADSEARCH, this gives the default value of
+ load-path, which is the search path for the Lisp function "load".
+ Configure (using "make epaths-force") sets this to
+ ${standardlisppath}, which typically has a value like:
+ <datadir>/emacs/VERSION/lisp:<datadir>/emacs/VERSION/leim
+ where datadir is eg /usr/local/share.
+*/
+#define PATH_LOADSEARCH "%emacs_dir%/share/emacs/@VER@/lisp;%emacs_dir%/share/emacs/@VER@/leim"
+
+/* Like PATH_LOADSEARCH, but contains the non-standard pieces.
+ These are the site-lisp directories, typically something like
+ <datadir>/emacs/VERSION/site-lisp:<datadir>/emacs/site-lisp
+ Configure prepends any $locallisppath, as set by the
+ --enable-locallisppath argument.
+ This is combined with PATH_LOADSEARCH to make the default load-path.
+ If the --no-site-lisp option is used, this piece is excluded.
+*/
+#define PATH_SITELOADSEARCH "%emacs_dir%/share/emacs/@VER@/site-lisp;%emacs_dir%/share/emacs/site-lisp"
+
+/* Like PATH_LOADSEARCH, but used only during the build process
+ when Emacs is dumping. Configure (using "make epaths-force") sets
+ this to $buildlisppath, which normally has the value: <srcdir>/lisp.
+*/
+#define PATH_DUMPLOADSEARCH "@SRC@/lisp"
+
+/* The extra search path for programs to invoke. This is appended to
+ whatever the PATH environment variable says to set the Lisp
+ variable exec-path and the first file name in it sets the Lisp
+ variable exec-directory. exec-directory is used for finding
+ executables and other architecture-dependent files. */
+#define PATH_EXEC "%emacs_dir%/libexec/emacs/@VER@/@CFG@"
+
+/* Where Emacs should look for its architecture-independent data
+ files, like the NEWS file. The lisp variable data-directory
+ is set to this value. */
+#define PATH_DATA "%emacs_dir%/share/emacs/@VER@/etc"
+
+/* Where Emacs should look for X bitmap files.
+ The lisp variable x-bitmap-file-path is set based on this value. */
+#define PATH_BITMAPS ""
+
+/* Where Emacs should look for its docstring file. The lisp variable
+ doc-directory is set to this value. */
+#define PATH_DOC "%emacs_dir%/share/emacs/@VER@/etc"
+
+/* Where the configuration process believes the info tree lives. The
+ lisp variable configure-info-directory gets its value from this
+ macro, and is then used to set the Info-default-directory-list. */
+#define PATH_INFO "%emacs_dir%/share/info"
+
+/* Where Emacs should store game score files. */
+#define PATH_GAME "%emacs_dir%/var/games/emacs"
+
+/* Where Emacs should look for the application default file. */
+#define PATH_X_DEFAULTS ""
+
diff --git a/nt/gnulib.mk b/nt/gnulib.mk
new file mode 100644
index 00000000000..d0fa88239dc
--- /dev/null
+++ b/nt/gnulib.mk
@@ -0,0 +1,858 @@
+## This file is an edited copy if ../lib/gnulib.mk.
+##
+## The purpose of the edits is to avoid generating any headers
+## which would conflict with either the headers we have in nt/inc,
+## or with MinGW system headers and subsequent redirection of some
+## functions in nt/inc/ms-w32.h.
+##
+## In general, do NOT remove anything from ../lib/gnulib.mk that
+## doesn't need to be removed, to minimize the differences from
+## upstream gnulib.mk and thus make the maintenance easier. Every
+## header file whose generation is controlled by configure-time tests
+## does NOT need to be removed; instead, force the configure script to
+## accept whatever MinGW has to offer, by defining the appropriate
+## Autoconf variable in the nt/mingw-cfg.site file. Headers that are
+## generated conditionally have the tell-tale "if GL_GENERATE_foo_H"
+## condition before their Makefile snippet in this file. Likewise, do
+## NOT remove gnulib modules which introduce header files that don't
+## exist in MinGW and in nt/inc/, since they cannot possibly clash
+## with anything. Gnulib modules that introduce source *.c files also
+## need not be removed; if they define functions that could clash with
+## the w32 substitutes in Emacs, disable their compilation by defining
+## suitable variables in nt/mingw-cfg.site.
+##
+## Process this file with automake to produce Makefile.in.
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this file. If not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License,
+# this file may be distributed as part of a program that
+# contains a configuration script generated by Autoconf, under
+# the same distribution terms as the rest of that program.
+#
+# Generated by gnulib-tool.
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=dup --avoid=errno --avoid=fchdir --avoid=fcntl --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat close-stream crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl-h fdatasync fdopendir filemode fstatat fsync getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings memrchr mktime pselect pthread_sigmask putenv readlink readlinkat sig2str socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub unsetenv utimens warnings
+
+
+MOSTLYCLEANFILES += core *.stackdump
+
+noinst_LIBRARIES += libgnu.a
+
+libgnu_a_SOURCES =
+libgnu_a_LIBADD = $(gl_LIBOBJS)
+libgnu_a_DEPENDENCIES = $(gl_LIBOBJS)
+EXTRA_libgnu_a_SOURCES =
+
+## begin gnulib module alloca-opt
+
+BUILT_SOURCES += $(ALLOCA_H)
+
+# We need the following in order to create <alloca.h> when the system
+# doesn't have one that works with the given compiler.
+if GL_GENERATE_ALLOCA_H
+alloca.h: alloca.in.h $(top_builddir)/config.status
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ cat $(srcdir)/alloca.in.h; \
+ } > $@-t && \
+ mv -f $@-t $@
+else
+alloca.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += alloca.h alloca.h-t
+
+EXTRA_DIST += alloca.in.h
+
+## end gnulib module alloca-opt
+
+## begin gnulib module c-ctype
+
+libgnu_a_SOURCES += c-ctype.h c-ctype.c
+
+## end gnulib module c-ctype
+
+## begin gnulib module c-strcase
+
+libgnu_a_SOURCES += c-strcase.h c-strcasecmp.c c-strncasecmp.c
+
+## end gnulib module c-strcase
+
+## begin gnulib module close-stream
+
+libgnu_a_SOURCES += close-stream.c
+
+EXTRA_DIST += close-stream.h
+
+## end gnulib module close-stream
+
+## begin gnulib module crypto/md5
+
+libgnu_a_SOURCES += md5.c
+
+EXTRA_DIST += md5.h
+
+## end gnulib module crypto/md5
+
+## begin gnulib module crypto/sha1
+
+libgnu_a_SOURCES += sha1.c
+
+EXTRA_DIST += sha1.h
+
+## end gnulib module crypto/sha1
+
+## begin gnulib module crypto/sha256
+
+libgnu_a_SOURCES += sha256.c
+
+EXTRA_DIST += sha256.h
+
+## end gnulib module crypto/sha256
+
+## begin gnulib module crypto/sha512
+
+libgnu_a_SOURCES += sha512.c
+
+EXTRA_DIST += sha512.h
+
+## end gnulib module crypto/sha512
+
+## begin gnulib module dosname
+
+if gl_GNULIB_ENABLED_dosname
+
+endif
+EXTRA_DIST += dosname.h
+
+## end gnulib module dosname
+
+## begin gnulib module dtoastr
+
+libgnu_a_SOURCES += dtoastr.c
+
+EXTRA_DIST += ftoastr.c ftoastr.h
+
+EXTRA_libgnu_a_SOURCES += ftoastr.c
+
+## end gnulib module dtoastr
+
+## begin gnulib module dtotimespec
+
+libgnu_a_SOURCES += dtotimespec.c
+
+## end gnulib module dtotimespec
+
+## begin gnulib module dup2
+
+
+EXTRA_DIST += dup2.c
+
+EXTRA_libgnu_a_SOURCES += dup2.c
+
+## end gnulib module dup2
+
+## begin gnulib module euidaccess
+
+if gl_GNULIB_ENABLED_euidaccess
+
+endif
+EXTRA_DIST += euidaccess.c
+
+EXTRA_libgnu_a_SOURCES += euidaccess.c
+
+## end gnulib module euidaccess
+
+## begin gnulib module execinfo
+
+BUILT_SOURCES += $(EXECINFO_H)
+
+# We need the following in order to create <execinfo.h> when the system
+# doesn't have one that works.
+if GL_GENERATE_EXECINFO_H
+execinfo.h: execinfo.in.h $(top_builddir)/config.status
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ cat $(srcdir)/execinfo.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+else
+execinfo.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += execinfo.h execinfo.h-t
+
+EXTRA_DIST += execinfo.c execinfo.in.h
+
+EXTRA_libgnu_a_SOURCES += execinfo.c
+
+## end gnulib module execinfo
+
+## begin gnulib module faccessat
+
+
+EXTRA_DIST += at-func.c faccessat.c
+
+EXTRA_libgnu_a_SOURCES += at-func.c faccessat.c
+
+## end gnulib module faccessat
+
+## begin gnulib module fdatasync
+
+
+EXTRA_DIST += fdatasync.c
+
+EXTRA_libgnu_a_SOURCES += fdatasync.c
+
+## end gnulib module fdatasync
+
+## begin gnulib module fdopendir
+
+
+EXTRA_DIST += fdopendir.c
+
+EXTRA_libgnu_a_SOURCES += fdopendir.c
+
+## end gnulib module fdopendir
+
+## begin gnulib module filemode
+
+libgnu_a_SOURCES += filemode.c
+
+EXTRA_DIST += filemode.h
+
+## end gnulib module filemode
+
+## begin gnulib module fpending
+
+
+EXTRA_DIST += fpending.c fpending.h
+
+EXTRA_libgnu_a_SOURCES += fpending.c
+
+## end gnulib module fpending
+
+## begin gnulib module fstatat
+
+
+EXTRA_DIST += at-func.c fstatat.c
+
+EXTRA_libgnu_a_SOURCES += at-func.c fstatat.c
+
+## end gnulib module fstatat
+
+## begin gnulib module fsync
+
+
+EXTRA_DIST += fsync.c
+
+EXTRA_libgnu_a_SOURCES += fsync.c
+
+## end gnulib module fsync
+
+## begin gnulib module getgroups
+
+if gl_GNULIB_ENABLED_getgroups
+
+endif
+EXTRA_DIST += getgroups.c
+
+EXTRA_libgnu_a_SOURCES += getgroups.c
+
+## end gnulib module getgroups
+
+## begin gnulib module getloadavg
+
+
+EXTRA_DIST += getloadavg.c
+
+EXTRA_libgnu_a_SOURCES += getloadavg.c
+
+## end gnulib module getloadavg
+
+## begin gnulib module getopt-posix
+
+BUILT_SOURCES += $(GETOPT_H)
+
+# We need the following in order to create <getopt.h> when the system
+# doesn't have one that works with the given compiler.
+getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \
+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ < $(srcdir)/getopt.in.h; \
+ } > $@-t && \
+ mv -f $@-t $@
+MOSTLYCLEANFILES += getopt.h getopt.h-t
+
+EXTRA_DIST += getopt.c getopt.in.h getopt1.c getopt_int.h
+
+EXTRA_libgnu_a_SOURCES += getopt.c getopt1.c
+
+## end gnulib module getopt-posix
+
+## begin gnulib module gettext-h
+
+if gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36
+libgnu_a_SOURCES += gettext.h
+
+endif
+## end gnulib module gettext-h
+
+## begin gnulib module gettime
+
+libgnu_a_SOURCES += gettime.c
+
+## end gnulib module gettime
+
+## begin gnulib module gettimeofday
+
+
+EXTRA_DIST += gettimeofday.c
+
+EXTRA_libgnu_a_SOURCES += gettimeofday.c
+
+## end gnulib module gettimeofday
+
+## begin gnulib module group-member
+
+if gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1
+
+endif
+EXTRA_DIST += group-member.c
+
+EXTRA_libgnu_a_SOURCES += group-member.c
+
+## end gnulib module group-member
+
+## begin gnulib module ignore-value
+
+
+EXTRA_DIST += ignore-value.h
+
+## end gnulib module ignore-value
+
+## begin gnulib module intprops
+
+
+EXTRA_DIST += intprops.h
+
+## end gnulib module intprops
+
+## begin gnulib module lstat
+
+
+EXTRA_DIST += lstat.c
+
+EXTRA_libgnu_a_SOURCES += lstat.c
+
+## end gnulib module lstat
+
+## begin gnulib module memrchr
+
+
+EXTRA_DIST += memrchr.c
+
+EXTRA_libgnu_a_SOURCES += memrchr.c
+
+## end gnulib module memrchr
+
+## begin gnulib module mktime
+
+
+EXTRA_DIST += mktime-internal.h mktime.c
+
+EXTRA_libgnu_a_SOURCES += mktime.c
+
+## end gnulib module mktime
+
+## begin gnulib module openat-h
+
+if gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7
+
+endif
+EXTRA_DIST += openat.h
+
+## end gnulib module openat-h
+
+## begin gnulib module pathmax
+
+if gl_GNULIB_ENABLED_pathmax
+
+endif
+EXTRA_DIST += pathmax.h
+
+## end gnulib module pathmax
+
+## begin gnulib module pselect
+
+
+EXTRA_DIST += pselect.c
+
+EXTRA_libgnu_a_SOURCES += pselect.c
+
+## end gnulib module pselect
+
+## begin gnulib module pthread_sigmask
+
+
+EXTRA_DIST += pthread_sigmask.c
+
+EXTRA_libgnu_a_SOURCES += pthread_sigmask.c
+
+## end gnulib module pthread_sigmask
+
+## begin gnulib module putenv
+
+
+EXTRA_DIST += putenv.c
+
+EXTRA_libgnu_a_SOURCES += putenv.c
+
+## end gnulib module putenv
+
+## begin gnulib module readlink
+
+
+EXTRA_DIST += readlink.c
+
+EXTRA_libgnu_a_SOURCES += readlink.c
+
+## end gnulib module readlink
+
+## begin gnulib module readlinkat
+
+
+EXTRA_DIST += at-func.c readlinkat.c
+
+EXTRA_libgnu_a_SOURCES += at-func.c readlinkat.c
+
+## end gnulib module readlinkat
+
+## begin gnulib module root-uid
+
+if gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c
+
+endif
+EXTRA_DIST += root-uid.h
+
+## end gnulib module root-uid
+
+## begin gnulib module sig2str
+
+
+EXTRA_DIST += sig2str.c sig2str.h
+
+EXTRA_libgnu_a_SOURCES += sig2str.c
+
+## end gnulib module sig2str
+
+## begin gnulib module snippet/_Noreturn
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all Makefile.am that
+# need it. This is ensured by the applicability 'all' defined above.
+
+_NORETURN_H=$(top_srcdir)/build-aux/snippet/_Noreturn.h
+
+EXTRA_DIST += $(top_srcdir)/build-aux/snippet/_Noreturn.h
+
+## end gnulib module snippet/_Noreturn
+
+## begin gnulib module snippet/arg-nonnull
+
+# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+# statements but through direct file reference. Therefore this snippet must be
+# present in all Makefile.am that need it. This is ensured by the applicability
+# 'all' defined above.
+
+BUILT_SOURCES += arg-nonnull.h
+# The arg-nonnull.h that gets inserted into generated .h files is the same as
+# build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut
+# off.
+arg-nonnull.h: $(top_srcdir)/build-aux/snippet/arg-nonnull.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ sed -n -e '/GL_ARG_NONNULL/,$$p' \
+ < $(top_srcdir)/build-aux/snippet/arg-nonnull.h \
+ > $@-t && \
+ mv $@-t $@
+MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
+
+ARG_NONNULL_H=arg-nonnull.h
+
+EXTRA_DIST += $(top_srcdir)/build-aux/snippet/arg-nonnull.h
+
+## end gnulib module snippet/arg-nonnull
+
+## begin gnulib module snippet/c++defs
+
+# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+# statements but through direct file reference. Therefore this snippet must be
+# present in all Makefile.am that need it. This is ensured by the applicability
+# 'all' defined above.
+
+BUILT_SOURCES += c++defs.h
+# The c++defs.h that gets inserted into generated .h files is the same as
+# build-aux/snippet/c++defs.h, except that it has the copyright header cut off.
+c++defs.h: $(top_srcdir)/build-aux/snippet/c++defs.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ sed -n -e '/_GL_CXXDEFS/,$$p' \
+ < $(top_srcdir)/build-aux/snippet/c++defs.h \
+ > $@-t && \
+ mv $@-t $@
+MOSTLYCLEANFILES += c++defs.h c++defs.h-t
+
+CXXDEFS_H=c++defs.h
+
+EXTRA_DIST += $(top_srcdir)/build-aux/snippet/c++defs.h
+
+## end gnulib module snippet/c++defs
+
+## begin gnulib module snippet/warn-on-use
+
+BUILT_SOURCES += warn-on-use.h
+# The warn-on-use.h that gets inserted into generated .h files is the same as
+# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut
+# off.
+warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ sed -n -e '/^.ifndef/,$$p' \
+ < $(top_srcdir)/build-aux/snippet/warn-on-use.h \
+ > $@-t && \
+ mv $@-t $@
+MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
+
+WARN_ON_USE_H=warn-on-use.h
+
+EXTRA_DIST += $(top_srcdir)/build-aux/snippet/warn-on-use.h
+
+## end gnulib module snippet/warn-on-use
+
+## begin gnulib module stat
+
+if gl_GNULIB_ENABLED_stat
+
+endif
+EXTRA_DIST += stat.c
+
+EXTRA_libgnu_a_SOURCES += stat.c
+
+## end gnulib module stat
+
+## begin gnulib module stat-time
+
+libgnu_a_SOURCES += stat-time.c
+
+EXTRA_DIST += stat-time.h
+
+## end gnulib module stat-time
+
+## begin gnulib module stdalign
+
+BUILT_SOURCES += $(STDALIGN_H)
+
+# We need the following in order to create <stdalign.h> when the system
+# doesn't have one that works.
+if GL_GENERATE_STDALIGN_H
+stdalign.h: stdalign.in.h $(top_builddir)/config.status
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ cat $(srcdir)/stdalign.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+else
+stdalign.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += stdalign.h stdalign.h-t
+
+EXTRA_DIST += stdalign.in.h
+
+## end gnulib module stdalign
+
+## begin gnulib module stdarg
+
+BUILT_SOURCES += $(STDARG_H)
+
+# We need the following in order to create <stdarg.h> when the system
+# doesn't have one that works with the given compiler.
+if GL_GENERATE_STDARG_H
+stdarg.h: stdarg.in.h $(top_builddir)/config.status
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STDARG_H''@|$(NEXT_STDARG_H)|g' \
+ < $(srcdir)/stdarg.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+else
+stdarg.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += stdarg.h stdarg.h-t
+
+EXTRA_DIST += stdarg.in.h
+
+## end gnulib module stdarg
+
+## begin gnulib module stdbool
+
+BUILT_SOURCES += $(STDBOOL_H)
+
+# We need the following in order to create <stdbool.h> when the system
+# doesn't have one that works.
+if GL_GENERATE_STDBOOL_H
+stdbool.h: stdbool.in.h $(top_builddir)/config.status
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+else
+stdbool.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += stdbool.h stdbool.h-t
+
+EXTRA_DIST += stdbool.in.h
+
+## end gnulib module stdbool
+
+## begin gnulib module stddef
+
+BUILT_SOURCES += $(STDDEF_H)
+
+# We need the following in order to create <stddef.h> when the system
+# doesn't have one that works with the given compiler.
+if GL_GENERATE_STDDEF_H
+stddef.h: stddef.in.h $(top_builddir)/config.status
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \
+ -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \
+ -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \
+ < $(srcdir)/stddef.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+else
+stddef.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += stddef.h stddef.h-t
+
+EXTRA_DIST += stddef.in.h
+
+## end gnulib module stddef
+
+## begin gnulib module stdint
+
+BUILT_SOURCES += $(STDINT_H)
+
+# We need the following in order to create <stdint.h> when the system
+# doesn't have one that works with the given compiler.
+if GL_GENERATE_STDINT_H
+stdint.h: stdint.in.h $(top_builddir)/config.status
+ $(AM_V_GEN)rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+ -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \
+ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
+ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
+ -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
+ -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
+ -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
+ -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
+ -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
+ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
+ -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \
+ -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \
+ -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \
+ -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \
+ -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \
+ -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \
+ -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \
+ -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \
+ -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \
+ -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \
+ -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
+ -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
+ -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
+ < $(srcdir)/stdint.in.h; \
+ } > $@-t && \
+ mv $@-t $@
+else
+stdint.h: $(top_builddir)/config.status
+ rm -f $@
+endif
+MOSTLYCLEANFILES += stdint.h stdint.h-t
+
+EXTRA_DIST += stdint.in.h
+
+## end gnulib module stdint
+
+## begin gnulib module strftime
+
+libgnu_a_SOURCES += strftime.c
+
+EXTRA_DIST += strftime.h
+
+## end gnulib module strftime
+
+## begin gnulib module strtoimax
+
+
+EXTRA_DIST += strtoimax.c
+
+EXTRA_libgnu_a_SOURCES += strtoimax.c
+
+## end gnulib module strtoimax
+
+## begin gnulib module strtoll
+
+if gl_GNULIB_ENABLED_strtoll
+
+endif
+EXTRA_DIST += strtol.c strtoll.c
+
+EXTRA_libgnu_a_SOURCES += strtol.c strtoll.c
+
+## end gnulib module strtoll
+
+## begin gnulib module strtoull
+
+if gl_GNULIB_ENABLED_strtoull
+
+endif
+EXTRA_DIST += strtol.c strtoul.c strtoull.c
+
+EXTRA_libgnu_a_SOURCES += strtol.c strtoul.c strtoull.c
+
+## end gnulib module strtoull
+
+## begin gnulib module strtoumax
+
+
+EXTRA_DIST += strtoimax.c strtoumax.c
+
+EXTRA_libgnu_a_SOURCES += strtoimax.c strtoumax.c
+
+## end gnulib module strtoumax
+
+## begin gnulib module symlink
+
+
+EXTRA_DIST += symlink.c
+
+EXTRA_libgnu_a_SOURCES += symlink.c
+
+## end gnulib module symlink
+
+## begin gnulib module time_r
+
+
+EXTRA_DIST += time_r.c
+
+EXTRA_libgnu_a_SOURCES += time_r.c
+
+## end gnulib module time_r
+
+## begin gnulib module timespec
+
+libgnu_a_SOURCES += timespec.c
+
+EXTRA_DIST += timespec.h
+
+## end gnulib module timespec
+
+## begin gnulib module timespec-add
+
+libgnu_a_SOURCES += timespec-add.c
+
+## end gnulib module timespec-add
+
+## begin gnulib module timespec-sub
+
+libgnu_a_SOURCES += timespec-sub.c
+
+## end gnulib module timespec-sub
+
+## begin gnulib module u64
+
+libgnu_a_SOURCES += u64.c
+
+EXTRA_DIST += u64.h
+
+## end gnulib module u64
+
+## begin gnulib module unsetenv
+
+
+EXTRA_DIST += unsetenv.c
+
+EXTRA_libgnu_a_SOURCES += unsetenv.c
+
+## end gnulib module unsetenv
+
+## begin gnulib module utimens
+
+libgnu_a_SOURCES += utimens.c
+
+EXTRA_DIST += utimens.h
+
+## end gnulib module utimens
+
+## begin gnulib module verify
+
+if gl_GNULIB_ENABLED_verify
+
+endif
+EXTRA_DIST += verify.h
+
+## end gnulib module verify
+
+## begin gnulib module xalloc-oversized
+
+if gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec
+
+endif
+EXTRA_DIST += xalloc-oversized.h
+
+## end gnulib module xalloc-oversized
+
+
+mostlyclean-local: mostlyclean-generic
+ @for dir in '' $(MOSTLYCLEANDIRS); do \
+ if test -n "$$dir" && test -d $$dir; then \
+ echo "rmdir $$dir"; rmdir $$dir; \
+ fi; \
+ done; \
+ :
diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h
index c67f07b99b3..65540f238e5 100644
--- a/nt/inc/ms-w32.h
+++ b/nt/inc/ms-w32.h
@@ -67,7 +67,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#endif
#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))
-#define HAVE___BUILTIN_UNWIND_INIT 1
+# ifndef HAVE___BUILTIN_UNWIND_INIT
+# define HAVE___BUILTIN_UNWIND_INIT 1
+# endif
#endif
/* This isn't perfect, as some systems might have the page file in
@@ -99,8 +101,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#endif
#ifdef __GNUC__
-# define restrict __restrict__
+/* config.h may have defined already. */
+# ifndef restrict
+# define restrict __restrict__
+# endif
#else
+ /* FIXME: should we define to __restrict, which MSVC supports? */
# define restrict
#endif
@@ -138,9 +144,6 @@ extern char *getenv ();
/* Make a leaner executable. */
#define WIN32_LEAN_AND_MEAN 1
-#ifdef HAVE_STRINGS_H
-#include "strings.h"
-#endif
#include <sys/types.h>
#ifndef MAXPATHLEN
@@ -148,8 +151,12 @@ extern char *getenv ();
#endif
#ifdef HAVE_NTGUI
-#define HAVE_WINDOW_SYSTEM 1
-#define HAVE_MENUS 1
+# ifndef HAVE_WINDOW_SYSTEM
+# define HAVE_WINDOW_SYSTEM 1
+# endif
+# ifndef HAVE_MENUS
+# define HAVE_MENUS 1
+# endif
#endif
/* Get some redefinitions in place. */
@@ -248,9 +255,6 @@ extern int sys_unlink (const char *);
#define execvp _execvp
#define fdatasync _commit
#define fdopen _fdopen
-#ifndef fileno
-#define fileno _fileno
-#endif
#define fsync _commit
#define ftruncate _chsize
#define getpid _getpid
@@ -266,9 +270,6 @@ typedef int pid_t;
#define popen _popen
#define pclose _pclose
#define umask _umask
-#ifndef _MSC_VER
-#define utimbuf _utimbuf
-#endif
#define strdup _strdup
#define strupr _strupr
#define strnicmp _strnicmp
@@ -285,10 +286,6 @@ int _getpid (void);
array, and triggers an error message. */
#include <time.h>
#define tzname _tzname
-#if !defined (_MSC_VER) || (_MSC_VER < 1400)
-#undef utime
-#define utime _utime
-#endif
/* 'struct timespec' is used by time-related functions in lib/ and
elsewhere, but we don't use lib/time.h where the structure is
@@ -327,6 +324,9 @@ extern struct tm *localtime_r (time_t const * restrict, struct tm * restrict);
#include <io.h>
#include <stdio.h>
#endif /* !_MSC_VER */
+#ifndef fileno
+#define fileno _fileno
+#endif
/* Defines that we need that aren't in the standard signal.h. */
#define SIGHUP 1 /* Hang up */
@@ -351,9 +351,11 @@ typedef int sigset_t;
typedef int ssize_t;
#endif
-#ifndef _POSIX /* MinGW64 */
+#ifdef _W64 /* MinGW64 */
+#ifndef _POSIX
typedef _sigset_t sigset_t;
#endif
+#endif
typedef void (_CALLBACK_ *signal_handler) (int);
extern signal_handler sys_signal (int, signal_handler);
@@ -389,10 +391,12 @@ extern int sys_kill (int, int);
#define getdefdir(_drv, _buf) _getdcwd (_drv, _buf, MAXPATHLEN)
#endif
+#ifndef EMACS_CONFIGURATION
extern char *get_emacs_configuration (void);
extern char *get_emacs_configuration_options (void);
#define EMACS_CONFIGURATION get_emacs_configuration ()
#define EMACS_CONFIG_OPTIONS get_emacs_configuration_options ()
+#endif
/* Define this so that winsock.h definitions don't get included with
windows.h. For this to have proper effect, config.h must always be
@@ -446,10 +450,14 @@ extern void * memrchr (void const *, int, size_t);
#if defined (__MINGW32__)
/* Define to 1 if the system has the type `long long int'. */
-# define HAVE_LONG_LONG_INT 1
+# ifndef HAVE_LONG_LONG_INT
+# define HAVE_LONG_LONG_INT 1
+# endif
/* Define to 1 if the system has the type `unsigned long long int'. */
-# define HAVE_UNSIGNED_LONG_LONG_INT 1
+# ifndef HAVE_UNSIGNED_LONG_LONG_INT
+# define HAVE_UNSIGNED_LONG_LONG_INT 1
+# endif
#endif
diff --git a/nt/inc/sys/socket.h b/nt/inc/sys/socket.h
index 6029778394b..99227d75d28 100644
--- a/nt/inc/sys/socket.h
+++ b/nt/inc/sys/socket.h
@@ -43,8 +43,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#undef FD_ZERO
#endif
-/* avoid duplicate definition of timeval */
-#ifdef HAVE_TIMEVAL
+/* Avoid duplicate definition of timeval. MinGW uses _TIMEVAL_DEFINED
+ in sys/time.h to avoid that. */
+#if defined (HAVE_TIMEVAL) && defined (_MSC_VER)
#define timeval ws_timeval
#endif
@@ -62,7 +63,9 @@ typedef unsigned short uint16_t;
#undef MUST_REDEF_SELECT
#endif
-/* revert to our version of FD_SET */
+/* Revert to our version of FD_SET, but not when included from test
+ programs run by configure. */
+#ifdef EMACS_CONFIG_H
#undef FD_SET
#undef FD_CLR
#undef FD_ISSET
@@ -71,8 +74,9 @@ typedef unsigned short uint16_t;
/* allow us to provide our own version of fd_set */
#define fd_set ws_fd_set
#include "w32.h"
+#endif /* EMACS_CONFIG_H */
-#ifdef HAVE_TIMEVAL
+#if defined (HAVE_TIMEVAL) && defined (_MSC_VER)
#undef timeval
#endif
diff --git a/nt/inc/sys/stat.h b/nt/inc/sys/stat.h
index f6785c56477..f1d8341141e 100644
--- a/nt/inc/sys/stat.h
+++ b/nt/inc/sys/stat.h
@@ -83,6 +83,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define S_TYPEISSHM(p) 0
#define S_TYPEISTMO(p) 0
+#define UTIME_NOW (-1)
+#define UTIME_OMIT (-2)
+
struct stat {
unsigned __int64 st_ino; /* ino_t in sys/types.h is too narrow */
dev_t st_dev;
@@ -99,6 +102,39 @@ struct stat {
char st_gname[260];
};
+/* These are here to avoid compiler warnings when using wchar.h. */
+struct _stat
+{
+ _dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */
+ _ino_t st_ino; /* Always zero ? */
+ _mode_t st_mode; /* See above constants */
+ short st_nlink; /* Number of links. */
+ short st_uid; /* User: Maybe significant on NT ? */
+ short st_gid; /* Group: Ditto */
+ _dev_t st_rdev; /* Seems useless (not even filled in) */
+ _off_t st_size; /* File size in bytes */
+ time_t st_atime; /* Accessed date (always 00:00 hrs local
+ * on FAT) */
+ time_t st_mtime; /* Modified time */
+ time_t st_ctime; /* Creation time */
+};
+
+#if defined (__MSVCRT__)
+struct _stati64 {
+ _dev_t st_dev;
+ _ino_t st_ino;
+ _mode_t st_mode;
+ short st_nlink;
+ short st_uid;
+ short st_gid;
+ _dev_t st_rdev;
+ __int64 st_size;
+ time_t st_atime;
+ time_t st_mtime;
+ time_t st_ctime;
+};
+#endif
+
/* Internal variable for asking 'stat'/'lstat' to produce accurate
info about owner and group of files. */
extern int w32_stat_get_owner_group;
diff --git a/nt/inc/sys/time.h b/nt/inc/sys/time.h
index 80c725385bb..87ad9d3ff0d 100644
--- a/nt/inc/sys/time.h
+++ b/nt/inc/sys/time.h
@@ -9,12 +9,23 @@
/* The guards are for MinGW64, which defines these structs on its
system headers which are included by ms-w32.h. */
#ifndef _W64
+/* Allow inclusion of sys/time.h and winsock2.h in any order. Needed
+ for running the configure test, which is only relevant to MinGW. */
+#ifndef _TIMEVAL_DEFINED
+#define _TIMEVAL_DEFINED
struct timeval
{
long tv_sec; /* seconds */
long tv_usec; /* microseconds */
};
-#endif
+#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
+#define timercmp(tvp, uvp, cmp) \
+ (((tvp)->tv_sec != (uvp)->tv_sec) ? \
+ ((tvp)->tv_sec cmp (uvp)->tv_sec) : \
+ ((tvp)->tv_usec cmp (uvp)->tv_usec))
+#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
+#endif /* _TIMEVAL_DEFINED */
+#endif /* _W64 */
#ifndef _TIMEZONE_DEFINED
struct timezone
@@ -24,7 +35,10 @@ struct timezone
};
#endif
-void gettimeofday (struct timeval *, struct timezone *);
+/* This needs to be compatible with Posix signature, in order to pass
+ the configure test for the type of the second argument. See
+ m4/gettimeofday.m4. */
+int gettimeofday (struct timeval *restrict, struct timezone *restrict);
#define ITIMER_REAL 0
#define ITIMER_PROF 1
diff --git a/nt/inc/unistd.h b/nt/inc/unistd.h
index e07c46533f7..8ad8cf213b1 100644
--- a/nt/inc/unistd.h
+++ b/nt/inc/unistd.h
@@ -3,6 +3,9 @@
#ifndef _UNISTD_H
#define _UNISTD_H
+#include <sys/types.h>
+#include <pwd.h>
+
/* On Microsoft platforms, <stdlib.h> declares 'environ'; on POSIX
platforms, <unistd.h> does. Every file in Emacs that includes
<unistd.h> also includes <stdlib.h>, so there's no need to declare
diff --git a/nt/makefile.w32-in b/nt/makefile.w32-in
index d3e1c8e2228..0c2f6324188 100644
--- a/nt/makefile.w32-in
+++ b/nt/makefile.w32-in
@@ -29,6 +29,8 @@ TMP_DIST_DIR = emacs-$(VERSION)
TRES = $(BLD)/emacs.res
CLIENTRES = $(BLD)/emacsclient.res
+LOCAL_FLAGS = -DOLD_PATHS=1
+
XMFLAGS =
ALL = $(BLD)/addpm.exe $(BLD)/ddeclient.exe $(BLD)/runemacs.exe \
diff --git a/nt/mingw-cfg.site b/nt/mingw-cfg.site
new file mode 100644
index 00000000000..78bfa2bb758
--- /dev/null
+++ b/nt/mingw-cfg.site
@@ -0,0 +1,74 @@
+#! /bin/sh
+# Site defaults for the MinGW configuration of GNU Emacs.
+
+# We want to use getopt.h from gnulib
+ac_cv_header_getopt_h=no
+
+# Implemented in w32.c
+ac_cv_func_acl_set_file=yes
+# Autoconf's test program is not smart enough, and fails to detect gethostname
+ac_cv_func_gethostname=yes
+# Implemented as sys_select in w32proc.c
+ac_cv_func_select=yes
+ac_cv_func_pselect=yes
+gl_cv_sig_pselect=yes
+gl_cv_func_pselect_detects_ebadf=yes
+# Implemented as sys_shutdown in w32.c
+ac_cv_func_shutdown=yes
+# Implemented in w32proc.c
+ac_cv_func_setitimer=yes
+# Implemented as sys_sendto in w32.c
+ac_cv_func_sendto=yes
+# Implemented as sys_recvfrom in w32.c
+ac_cv_func_recvfrom=yes
+# Implemented as sys_getsockname in w32.c
+ac_cv_func_getsockname=yes
+# Implemented as sys_getpeername in w32.c
+ac_cv_func_getpeername=yes
+# Implemented as sys_socket in w32.c
+ac_cv_func_socket=yes
+# Implemented in w32.c
+ac_cv_func_readlink=yes
+ac_cv_func_symlink=yes
+# Avoid run-time tests of readlink and symlink, which will fail
+gl_cv_func_readlink_works=yes
+gl_cv_func_symlink_works=yes
+ac_cv_func_readlinkat=yes
+ac_cv_func_faccessat=yes
+# We don't need fdopendir
+ac_cv_func_fdopendir="not-needed"
+gl_cv_func_fdopendir_works="no-but-not-needed-so-yes"
+# Implemented in w32.c
+ac_cv_func_lstat=yes
+gl_cv_func_lstat_dereferences_slashed_symlink=yes
+ac_cv_func_fstatat=yes
+gl_cv_func_fstatat_zero_flag=yes
+# Aliased to _commit in ms-w32.h
+ac_cv_func_fsync=yes
+ac_cv_func_fdatasync=yes
+# Implemented in w32proc.c
+ac_cv_func_pthread_sigmask=yes
+# Avoid gnulib replacement
+gl_threads_api=posix
+gl_cv_func_pthread_sigmask_return_works=yes
+gl_cv_func_pthread_sigmask_unblock_works="not relevant"
+# Implemented in w32proc.c
+emacs_cv_langinfo_codeset=yes
+# Declared in ms-w32.h
+ac_cv_have_decl_alarm=yes
+# Avoid including the gnulib dup2 module
+gl_cv_func_dup2_works=yes
+# Defined in w32.c
+ac_cv_func_getloadavg=yes
+# Avoid compiling gnulib mktime
+gl_cv_func_working_mktime=yes
+# Implemented in w32.c
+ac_cv_have_decl_unsetenv=yes
+ac_cv_func_unsetenv=yes
+gt_cv_func_unsetenv_ret='int'
+gl_cv_func_unsetenv_works=yes
+gl_cv_func_stat_dir_slash=yes
+gl_cv_func_stat_file_slash=yes
+ac_cv_func_random=yes
+# Implemented in w32.c as sys_putenv
+gl_cv_func_svid_putenv=yes
diff --git a/nt/msysconfig.sh b/nt/msysconfig.sh
new file mode 100644
index 00000000000..97aeb6e6118
--- /dev/null
+++ b/nt/msysconfig.sh
@@ -0,0 +1,39 @@
+#! /bin/sh
+### msysconfig.sh - Run the top-level 'configure' script as approriate
+### for the MinGW/MSYS build of a native MS-Windows port of Emacs.
+
+## Copyright (C) 2013 Free Software Foundation, Inc.
+
+## Author: Eli Zaretskii <eliz@gnu.org>
+
+## This file is part of GNU Emacs.
+
+## GNU Emacs is free software: you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation, either version 3 of the License, or
+## (at your option) any later version.
+
+## GNU Emacs is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+
+## You should have received a copy of the GNU General Public License
+## along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
+
+### Commentary:
+
+## The Posix 'configure' script needs a few tweaks to produce desired
+## results when running under MSYS with the purpose of configuring
+## Emacs for the MinGW MS-Windows build. Rather than asking users to
+## type these tweaks every time they configure the package, we provide
+## this helper scripts which takes care of the mundane things.
+
+### Code:
+
+srcdir=`dirname "$0"`
+parent=`dirname "$srcdir"`
+
+## The nt/mingw-cfg.site file provides various autoconf variables that
+## are needed for a successful MinGW build.
+CONFIG_SITE="$srcdir/mingw-cfg.site" $parent/configure "$@"
diff --git a/src/ChangeLog b/src/ChangeLog
index 5164dc8ff8d..31764cad485 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2013-04-22 Paul Eggert <eggert@cs.ucla.edu>
+
+ * Makefile.in (bootstrap-clean): Remove stamp-h1 too.
+ Without this fix, "make distclean" leaves stamp-h1 behind.
+
2013-04-20 Erik Charlebois <erikcharlebois@gmail.com>
* w32fns.c (w32_fullscreen_rect): New function to compute the
diff --git a/src/Makefile.in b/src/Makefile.in
index c6a067a1ade..d12f8dbe130 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -260,10 +260,13 @@ W32_OBJ=@W32_OBJ@
W32_LIBS=@W32_LIBS@
## emacs.res if HAVE_W32
-W32_RES=@W32_RES@
+EMACSRES = @EMACSRES@
+## emacs-*.manifest if HAVE_W32
+EMACS_MANIFEST = @EMACS_MANIFEST@
## If HAVE_W32, compiler arguments for including
## the resource file in the binary.
-## XXX -Wl,-b -Wl,pe-i386 -Wl,emacs.res
+## Cygwin: -Wl,emacs.res
+## MinGW: emacs.res
W32_RES_LINK=@W32_RES_LINK@
## Empty if !HAVE_X_WINDOWS
@@ -272,6 +275,9 @@ W32_RES_LINK=@W32_RES_LINK@
## else xfont.o
FONT_OBJ=@FONT_OBJ@
+## Empty for MinGW, cm.o for the rest.
+CM_OBJ=@CM_OBJ@
+
LIBGPM = @LIBGPM@
## -lresolv, or empty.
@@ -292,6 +298,14 @@ GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
RUN_TEMACS = `/bin/pwd`/temacs
+## Invoke ../nt/addsection for MinGW, ":" elsewhere.
+TEMACS_POST_LINK = @TEMACS_POST_LINK@
+ADDSECTION = @ADDSECTION@
+EMACS_HEAPSIZE = @EMACS_HEAPSIZE@
+MINGW_TEMACS_POST_LINK = \
+ mv temacs$(EXEEXT) temacs.tmp; \
+ ../nt/addsection temacs.tmp temacs$(EXEEXT) EMHEAP $(EMACS_HEAPSIZE)
+
UNEXEC_OBJ = @UNEXEC_OBJ@
CANNOT_DUMP=@CANNOT_DUMP@
@@ -334,7 +348,7 @@ ALL_OBJC_CFLAGS=$(ALL_CFLAGS) $(GNU_OBJC_CFLAGS)
## be dumped as pure by dump-emacs.
base_obj = dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \
charset.o coding.o category.o ccl.o character.o chartab.o bidi.o \
- cm.o term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ) $(DBUS_OBJ) \
+ $(CM_OBJ) term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ) $(DBUS_OBJ) \
emacs.o keyboard.o macros.o keymap.o sysdep.o \
buffer.o filelock.o insdel.o marker.o \
minibuf.o fileio.o dired.o \
@@ -372,9 +386,9 @@ VMLIMIT_OBJ=@VMLIMIT_OBJ@
## ralloc.o if !SYSTEM_MALLOC && REL_ALLOC, else empty.
RALLOC_OBJ=@RALLOC_OBJ@
-## Empty on Cygwin, lastfile.o elsewhere.
+## Empty on Cygwin and MinGW, lastfile.o elsewhere.
PRE_ALLOC_OBJ=@PRE_ALLOC_OBJ@
-## lastfile.o on Cygwin, empty elsewhere.
+## lastfile.o on Cygwin and MinGW, empty elsewhere.
POST_ALLOC_OBJ=@POST_ALLOC_OBJ@
## List of object files that make-docfile should not be told about.
@@ -382,7 +396,9 @@ otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(GMALLOC_OBJ) $(RALLOC_OBJ) \
$(POST_ALLOC_OBJ) $(WIDGET_OBJ) $(LIBOBJS)
## All object files linked into temacs. $(VMLIMIT_OBJ) should be first.
-ALLOBJS = $(VMLIMIT_OBJ) $(obj) $(otherobj)
+## (On MinGW, firstfile.o should be before vm-limit.o.)
+FIRSTFILE_OBJ=@FIRSTFILE_OBJ@
+ALLOBJS = $(FIRSTFILE_OBJ) $(VMLIMIT_OBJ) $(obj) $(otherobj)
## Configure inserts the file lisp.mk at this point, defining $lisp.
@lisp_frag@
@@ -411,7 +427,8 @@ $(leimdir)/leim-list.el: bootstrap-emacs$(EXEEXT)
## Strictly speaking, emacs does not depend directly on all of $lisp,
## since not all pieces are used on all platforms. But DOC depends
## on all of $lisp, and emacs depends on DOC, so it is ok to use $lisp here.
-emacs$(EXEEXT): temacs$(EXEEXT) $(etc)/DOC $(lisp) $(leimdir)/leim-list.el
+emacs$(EXEEXT): temacs$(EXEEXT) $(ADDSECTION) \
+ $(etc)/DOC $(lisp) $(leimdir)/leim-list.el
if test "$(CANNOT_DUMP)" = "yes"; then \
rm -f emacs$(EXEEXT); \
ln temacs$(EXEEXT) emacs$(EXEEXT); \
@@ -463,10 +480,10 @@ $(lib)/libgnu.a: $(config_h)
cd $(lib) && $(MAKE) libgnu.a
temacs$(EXEEXT): stamp-oldxmenu $(ALLOBJS) \
- $(lib)/libgnu.a $(W32_RES)
+ $(lib)/libgnu.a $(EMACSRES)
$(CC) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \
- -o temacs $(ALLOBJS) $(lib)/libgnu.a $(LIBES) \
- $(W32_RES_LINK)
+ -o temacs $(ALLOBJS) $(lib)/libgnu.a $(W32_RES_LINK) $(LIBES)
+ $(TEMACS_POST_LINK)
test "$(CANNOT_DUMP)" = "yes" || \
test "X$(PAXCTL)" = X || $(PAXCTL) -r temacs$(EXEEXT)
@@ -509,8 +526,9 @@ doc.o: buildobj.h
emacs.res: $(ntsource)/emacs.rc \
$(ntsource)/icons/emacs.ico \
- $(ntsource)/emacs-x86.manifest
- $(WINDRES) -O COFF -o $@ $(ntsource)/emacs.rc
+ $(ntsource)/$(EMACS_MANIFEST)
+ $(WINDRES) -O COFF --include-dir=$(srcdir)/../nt \
+ -o $@ $(ntsource)/emacs.rc
ns-app: emacs$(EXEEXT)
cd ../nextstep && $(MAKE) $(MFLAGS) all
@@ -532,7 +550,7 @@ clean: mostlyclean
## It should remove all files generated during a compilation/bootstrap,
## but not things like config.status or TAGS.
bootstrap-clean: clean
- rm -f epaths.h config.h config.stamp stamp-oldxmenu ../etc/DOC-*
+ rm -f epaths.h config.h config.stamp stamp-h1 stamp-oldxmenu ../etc/DOC-*
if test -f ./.gdbinit; then \
mv ./.gdbinit ./.gdbinit.save; \
if test -f "$(srcdir)/.gdbinit"; then rm -f ./.gdbinit.save; \
diff --git a/src/unexw32.c b/src/unexw32.c
index e8b553a87d3..a01ac799592 100644
--- a/src/unexw32.c
+++ b/src/unexw32.c
@@ -159,6 +159,14 @@ open_output_file (file_data *p_file, char *filename, unsigned long size)
HANDLE file_mapping;
void *file_base;
+ /* We delete any existing FILENAME because loadup.el will create a
+ hard link to it under the name emacs-XX.YY.ZZ.nn.exe. Evidently,
+ overwriting a file on Unix breaks any hard links to it, but that
+ doesn't happen on Windows. If we don't delete the file before
+ creating it, all the emacs-XX.YY.ZZ.nn.exe end up being hard
+ links to the same file, which defeats the purpose of these hard
+ links: being able to run previous builds. */
+ DeleteFile (filename);
file = CreateFile (filename, GENERIC_READ | GENERIC_WRITE, 0, NULL,
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
if (file == INVALID_HANDLE_VALUE)
diff --git a/src/w32.c b/src/w32.c
index 431826c4b82..7d63c73eb18 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -65,6 +65,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#undef localtime
#include "lisp.h"
+#include "epaths.h" /* for SHELL */
#include <pwd.h>
#include <grp.h>
@@ -2018,7 +2019,7 @@ init_environment (char ** argv)
{"PRELOAD_WINSOCK", NULL},
{"emacs_dir", "C:/emacs"},
{"EMACSLOADPATH", NULL},
- {"SHELL", "%emacs_dir%/bin/cmdproxy.exe"},
+ {"SHELL", "cmdproxy.exe"}, /* perhaps it is somewhere on PATH */
{"EMACSDATA", NULL},
{"EMACSPATH", NULL},
{"INFOPATH", NULL},
@@ -2094,9 +2095,12 @@ init_environment (char ** argv)
emacs_abort ();
*p = 0;
- if ((p = _mbsrchr (modname, '\\')) && xstrcasecmp (p, "\\bin") == 0)
+ if ((p = _mbsrchr (modname, '\\'))
+ /* From bin means installed Emacs, from src means uninstalled. */
+ && (xstrcasecmp (p, "\\bin") == 0 || xstrcasecmp (p, "\\src") == 0))
{
char buf[SET_ENV_BUF_SIZE];
+ int within_build_tree = xstrcasecmp (p, "\\src") == 0;
*p = 0;
for (p = modname; *p; p = CharNext (p))
@@ -2104,6 +2108,15 @@ init_environment (char ** argv)
_snprintf (buf, sizeof (buf)-1, "emacs_dir=%s", modname);
_putenv (strdup (buf));
+ /* If we are running from the Posix-like build tree, define
+ SHELL to point to our own cmdproxy. The loop below will
+ then disregard PATH_EXEC and the default value. */
+ if (within_build_tree)
+ {
+ _snprintf (buf, sizeof (buf) - 1,
+ "SHELL=%s/nt/cmdproxy.exe", modname);
+ _putenv (strdup (buf));
+ }
}
/* Handle running emacs from the build directory: src/oo-spd/i386/ */
@@ -2139,16 +2152,60 @@ init_environment (char ** argv)
if (!getenv (env_vars[i].name))
{
int dont_free = 0;
+ char bufc[SET_ENV_BUF_SIZE];
if ((lpval = w32_get_resource (env_vars[i].name, &dwType)) == NULL
/* Also ignore empty environment variables. */
|| *lpval == 0)
{
xfree (lpval);
- lpval = env_vars[i].def_value;
- dwType = REG_EXPAND_SZ;
dont_free = 1;
- if (!strcmp (env_vars[i].name, "HOME") && !appdata)
+ if (strcmp (env_vars[i].name, "SHELL") == 0)
+ {
+ /* Look for cmdproxy.exe in every directory in
+ PATH_EXEC. FIXME: This does not find cmdproxy
+ in nt/ when we run uninstalled. */
+ char fname[MAX_PATH];
+ const char *pstart = PATH_EXEC, *pend;
+
+ do {
+ pend = _mbschr (pstart, ';');
+ if (!pend)
+ pend = pstart + strlen (pstart);
+ /* Be defensive against series of ;;; characters. */
+ if (pend > pstart)
+ {
+ strncpy (fname, pstart, pend - pstart);
+ fname[pend - pstart] = '/';
+ strcpy (&fname[pend - pstart + 1], "cmdproxy.exe");
+ ExpandEnvironmentStrings ((LPSTR) fname, bufc,
+ sizeof (bufc));
+ if (check_existing (bufc))
+ {
+ lpval = bufc;
+ dwType = REG_SZ;
+ break;
+ }
+ }
+ if (*pend)
+ pstart = pend + 1;
+ else
+ pstart = pend;
+ if (!*pstart)
+ {
+ /* If not found in any directory, use the
+ default as the last resort. */
+ lpval = env_vars[i].def_value;
+ dwType = REG_EXPAND_SZ;
+ }
+ } while (*pstart);
+ }
+ else
+ {
+ lpval = env_vars[i].def_value;
+ dwType = REG_EXPAND_SZ;
+ }
+ if (strcmp (env_vars[i].name, "HOME") == 0 && !appdata)
Vdelayed_warnings_list
= Fcons (listn (CONSTYPE_HEAP, 2,
intern ("initialization"),
@@ -2394,8 +2451,8 @@ get_emacs_configuration_options (void)
#include <sys/timeb.h>
/* Emulate gettimeofday (Ulrich Leodolter, 1/11/95). */
-void
-gettimeofday (struct timeval *tv, struct timezone *tz)
+int
+gettimeofday (struct timeval *restrict tv, struct timezone *restrict tz)
{
struct _timeb tb;
_ftime (&tb);
@@ -2413,6 +2470,7 @@ gettimeofday (struct timeval *tv, struct timezone *tz)
tz->tz_minuteswest = tb.timezone; /* minutes west of Greenwich */
tz->tz_dsttime = tb.dstflag; /* type of dst correction */
}
+ return 0;
}
/* Emulate fdutimens. */