aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog28
-rw-r--r--GNUmakefile7
-rw-r--r--Makefile.in71
-rw-r--r--configure.ac528
-rw-r--r--etc/ChangeLog4
-rw-r--r--etc/NEWS10
-rw-r--r--leim/ChangeLog4
-rw-r--r--leim/Makefile.in4
-rw-r--r--lib-src/ChangeLog24
-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/ChangeLog15
-rw-r--r--lisp/Makefile.in22
-rw-r--r--lisp/loadup.el20
-rw-r--r--lisp/subr.el16
-rw-r--r--nt/ChangeLog45
-rw-r--r--nt/INSTALL10
-rw-r--r--nt/INSTALL.MSYS640
-rw-r--r--nt/Makefile.in212
-rw-r--r--nt/addpm.c17
-rw-r--r--nt/epaths.nt89
-rw-r--r--nt/gnulib.mk902
-rw-r--r--nt/inc/ms-w32.h55
-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.site106
-rw-r--r--nt/msysconfig.sh39
-rw-r--r--src/ChangeLog24
-rw-r--r--src/Makefile.in42
-rw-r--r--src/unexw32.c8
-rw-r--r--src/w32.c72
37 files changed, 2964 insertions, 228 deletions
diff --git a/ChangeLog b/ChangeLog
index ce2014288e6..f47d2b70585 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,31 @@
12013-05-16 Eli Zaretskii <eliz@gnu.org>
2
3 * lib/Makefile.am: If building for MS-Windows, include
4 nt/gnulib.mk instead of lib/gnulib.mk.
5
6 * configure.ac: Adapt to MSYS build on MS-Windows.
7
8 * Makefile.in (NTDIR): New variable, for the MSYS build on
9 MS-Windows.
10 (SUBDIR): Add $(NTDIR).
11 (.PHONY): Add epaths-force-w32.
12 (msys_to_w32): New variable.
13 (epaths-force-w32, install-nt, uninstall-nt): New targets.
14 (lib-src src): Add $(NTLIB) to prerequisites.
15 (lib lib-src lisp leim nt): Add 'nt'.
16 (config.status): Use $(CFG).
17 (.PHONY): Add install-$(NTDIR) and uninstall-$(NTDIR).
18 (install, install-arch-dep): Add install-$(NTDIR).
19 (uninstall): Depend on uninstall-$(NTDIR).
20 (mostlyclean, clean, distclean, bootstrap-clean): Add 'nt'.
21
22 * GNUmakefile (CFG): New variable, uses mingw-cfg.site as
23 CONFIG_SITE for the MSYS build on MS-Windows.
24 (Makefile): Use $(CFG).
25
26 * .bzrignore: Ignore *.res, *.tmp, and *.map. Remove
27 src/emacs.res.
28
12013-05-16 Paul Eggert <eggert@cs.ucla.edu> 292013-05-16 Paul Eggert <eggert@cs.ucla.edu>
2 30
3 Merge from gnulib, incorporating: 31 Merge from gnulib, incorporating:
diff --git a/GNUmakefile b/GNUmakefile
index b829e93b498..a2a630ba9d5 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -32,6 +32,11 @@
32# run "configure" by hand. But run autogen.sh first, if the source 32# run "configure" by hand. But run autogen.sh first, if the source
33# was checked out directly from the repository. 33# was checked out directly from the repository.
34 34
35ifneq ($(MSYSTEM),)
36CFG = CONFIG_SITE=$(CURDIR)/nt/mingw-cfg.site
37else
38CFG =
39endif
35 40
36# If a Makefile already exists, just use it. 41# If a Makefile already exists, just use it.
37 42
@@ -70,7 +75,7 @@ configure:
70Makefile: configure 75Makefile: configure
71 @echo >&2 'There seems to be no Makefile in this directory.' 76 @echo >&2 'There seems to be no Makefile in this directory.'
72 @echo >&2 'Running ./configure ...' 77 @echo >&2 'Running ./configure ...'
73 ./configure 78 $(CFG) ./configure
74 @echo >&2 'Makefile built.' 79 @echo >&2 'Makefile built.'
75 80
76endif 81endif
diff --git a/Makefile.in b/Makefile.in
index 3c1feae5945..583aa99f83d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -93,6 +93,9 @@ version=@version@
93### for, like `mips-dec-ultrix' or `sparc-sun-sunos'. 93### for, like `mips-dec-ultrix' or `sparc-sun-sunos'.
94configuration=@configuration@ 94configuration=@configuration@
95 95
96### The nt/ subdirectory gets built only for MinGW
97NTDIR=@NTDIR@
98
96# ==================== Where To Install Things ==================== 99# ==================== Where To Install Things ====================
97 100
98# Location to install Emacs.app under GNUstep / Mac OS X. 101# Location to install Emacs.app under GNUstep / Mac OS X.
@@ -272,23 +275,23 @@ EMACS = ${EMACS_NAME}${EXEEXT}
272EMACSFULL = `echo emacs-${version} | sed '$(TRANSFORM)'`${EXEEXT} 275EMACSFULL = `echo emacs-${version} | sed '$(TRANSFORM)'`${EXEEXT}
273 276
274# Subdirectories to make recursively. 277# Subdirectories to make recursively.
275SUBDIR = lib lib-src src lisp leim 278SUBDIR = $(NTDIR) lib lib-src src lisp leim
276 279
277# The subdir makefiles created by config.status. 280# The subdir makefiles created by config.status.
278SUBDIR_MAKEFILES_IN = @SUBDIR_MAKEFILES_IN@ 281SUBDIR_MAKEFILES_IN = @SUBDIR_MAKEFILES_IN@
279SUBDIR_MAKEFILES = `echo $(SUBDIR_MAKEFILES_IN:.in=) | sed 's|$(srcdir)/||g'` 282SUBDIR_MAKEFILES = `echo $(SUBDIR_MAKEFILES_IN:.in=) | sed 's|$(srcdir)/||g'`
280 283
281# Subdirectories to install, and where they'll go. 284# Subdirectories to install, and where they'll go. lib-src's and nt's
282# lib-src's makefile knows how to install it, so we don't do that here. 285# makefiles know how to install them, so we don't do that here.
283# Directories that cannot simply be copied, eg info, 286# Directories that cannot simply be copied, eg info, are treated
284# are treated separately. 287# separately. quail appears twice because in out-of-tree builds, it
285# quail appears twice because in out-of-tree builds, it exists twice. 288# exists twice.
286COPYDIR = ${srcdir}/etc ${srcdir}/lisp ${srcdir}/leim/ja-dic ${srcdir}/leim/quail leim/quail 289COPYDIR = ${srcdir}/etc ${srcdir}/lisp ${srcdir}/leim/ja-dic ${srcdir}/leim/quail leim/quail
287COPYDESTS = $(DESTDIR)${etcdir} $(DESTDIR)${lispdir} $(DESTDIR)${leimdir}/ja-dic $(DESTDIR)${leimdir}/quail $(DESTDIR)${leimdir}/quail 290COPYDESTS = $(DESTDIR)${etcdir} $(DESTDIR)${lispdir} $(DESTDIR)${leimdir}/ja-dic $(DESTDIR)${leimdir}/quail $(DESTDIR)${leimdir}/quail
288 291
289all: ${SUBDIR} 292all: ${SUBDIR}
290 293
291.PHONY: all ${SUBDIR} blessmail epaths-force FRC 294.PHONY: all ${SUBDIR} blessmail epaths-force epaths-force-w32 FRC
292 295
293removenullpaths=sed -e 's/^://g' -e 's/:$$//g' -e 's/::/:/g' 296removenullpaths=sed -e 's/^://g' -e 's/:$$//g' -e 's/::/:/g'
294 297
@@ -315,7 +318,20 @@ epaths-force: FRC
315 -e 's;\(#.*PATH_DOC\).*$$;\1 "${docdir}";') && \ 318 -e 's;\(#.*PATH_DOC\).*$$;\1 "${docdir}";') && \
316 ${srcdir}/build-aux/move-if-change epaths.h.$$$$ src/epaths.h 319 ${srcdir}/build-aux/move-if-change epaths.h.$$$$ src/epaths.h
317 320
318lib-src src: lib 321# Convert MSYS-style /x/foo file name into x:/foo that Windows can grok.
322msys_to_w32=sed -e 's,^/\([A-Za-z]\)/,\1:/,'
323
324# The w32 build needs a slightly different editing, and it uses
325# nt/epaths.nt as the template.
326epaths-force-w32: FRC
327 @(w32srcdir=`echo "${srcdir}" | ${msys_to_w32}` ; \
328 sed < ${srcdir}/nt/epaths.nt > epaths.h.$$$$ \
329 -e '/^.*#/s/@VER@/${version}/g' \
330 -e '/^.*#/s/@CFG@/${configuration}/g' \
331 -e "/^.*#/s|@SRC@|$${w32srcdir}|g") && \
332 ${srcdir}/build-aux/move-if-change epaths.h.$$$$ src/epaths.h
333
334lib-src src: $(NTDIR) lib
319 335
320src: lib-src FRC 336src: lib-src FRC
321 337
@@ -324,7 +340,7 @@ src: lib-src FRC
324lisp leim: src 340lisp leim: src
325 341
326# These targets should be "${SUBDIR} without `src'". 342# These targets should be "${SUBDIR} without `src'".
327lib lib-src lisp leim: Makefile FRC 343lib lib-src lisp leim nt: Makefile FRC
328 cd $@ && $(MAKE) all $(MFLAGS) \ 344 cd $@ && $(MAKE) all $(MFLAGS) \
329 CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \ 345 CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \
330 LDFLAGS='${LDFLAGS}' MAKE='${MAKE}' 346 LDFLAGS='${LDFLAGS}' MAKE='${MAKE}'
@@ -378,9 +394,9 @@ $(MAKEFILE_NAME): config.status $(srcdir)/src/config.in \
378 394
379config.status: ${srcdir}/configure ${srcdir}/lisp/version.el 395config.status: ${srcdir}/configure ${srcdir}/lisp/version.el
380 if [ -x ./config.status ]; then \ 396 if [ -x ./config.status ]; then \
381 ./config.status --recheck; \ 397 $(CFG) ./config.status --recheck; \
382 else \ 398 else \
383 $(srcdir)/configure $(CONFIGURE_FLAGS); \ 399 $(CFG) $(srcdir)/configure $(CONFIGURE_FLAGS); \
384 fi 400 fi
385 401
386AUTOCONF_INPUTS = $(srcdir)/configure.ac $(srcdir)/aclocal.m4 402AUTOCONF_INPUTS = $(srcdir)/configure.ac $(srcdir)/aclocal.m4
@@ -417,13 +433,14 @@ $(srcdir)/src/stamp-h.in: $(AUTOCONF_INPUTS)
417# ==================== Installation ==================== 433# ==================== Installation ====================
418 434
419.PHONY: install install-arch-dep install-arch-indep install-doc install-info 435.PHONY: install install-arch-dep install-arch-indep install-doc install-info
420.PHONY: install-man install-etc install-strip uninstall 436.PHONY: install-man install-etc install-strip install-$(NTDIR)
437.PHONY: uninstall uninstall-$(NTDIR)
421 438
422## If we let lib-src do its own installation, that means we 439## If we let lib-src do its own installation, that means we
423## don't have to duplicate the list of utilities to install in 440## don't have to duplicate the list of utilities to install in
424## this Makefile as well. 441## this Makefile as well.
425 442
426install: all install-arch-indep install-doc install-arch-dep blessmail 443install: all install-arch-indep install-doc install-arch-dep install-$(NTDIR) blessmail
427 @true 444 @true
428 445
429## Ensure that $subdir contains a subdirs.el file. 446## Ensure that $subdir contains a subdirs.el file.
@@ -444,7 +461,7 @@ write_subdir=if [ -f $${subdir}/subdirs.el ]; \
444### Install the executables that were compiled specifically for this machine. 461### Install the executables that were compiled specifically for this machine.
445### We do install-arch-indep first because the executable needs the 462### We do install-arch-indep first because the executable needs the
446### Lisp files and DOC file to work properly. 463### Lisp files and DOC file to work properly.
447install-arch-dep: src install-arch-indep install-doc 464install-arch-dep: src install-arch-indep install-doc install-$(NTDIR)
448 umask 022; ${MKDIR_P} $(DESTDIR)${bindir} 465 umask 022; ${MKDIR_P} $(DESTDIR)${bindir}
449 cd lib-src && \ 466 cd lib-src && \
450 $(MAKE) install $(MFLAGS) prefix=${prefix} \ 467 $(MAKE) install $(MFLAGS) prefix=${prefix} \
@@ -464,6 +481,16 @@ install-arch-dep: src install-arch-indep install-doc
464 rm -rf ${ns_appresdir}/share; \ 481 rm -rf ${ns_appresdir}/share; \
465 fi 482 fi
466 483
484### Windows-specific install target for installing programs produced
485### in nt/, and its Posix do-nothing shadow.
486install-:
487install-nt:
488 cd $(NTDIR) && \
489 $(MAKE) install $(MFLAGS) prefix=${prefix} \
490 exec_prefix=${exec_prefix} bindir=${bindir} \
491 libexecdir=${libexecdir} archlibdir=${archlibdir} \
492 INSTALL_STRIP=${INSTALL_STRIP}
493
467## In the share directory, we are deleting: 494## In the share directory, we are deleting:
468## applications (with emacs.desktop, also found in etc/) 495## applications (with emacs.desktop, also found in etc/)
469## emacs (basically empty except for unneeded site-lisp directories) 496## emacs (basically empty except for unneeded site-lisp directories)
@@ -678,11 +705,12 @@ install-strip:
678### create (but not the noninstalled files such as `make all' would create). 705### create (but not the noninstalled files such as `make all' would create).
679### 706###
680### Don't delete the lisp and etc directories if they're in the source tree. 707### Don't delete the lisp and etc directories if they're in the source tree.
681uninstall: 708uninstall: uninstall-$(NTDIR)
682 cd lib-src && \ 709 cd lib-src && \
683 $(MAKE) $(MFLAGS) uninstall \ 710 $(MAKE) $(MFLAGS) uninstall \
684 prefix=${prefix} exec_prefix=${exec_prefix} \ 711 prefix=${prefix} exec_prefix=${exec_prefix} \
685 bindir=${bindir} libexecdir=${libexecdir} archlibdir=${archlibdir} 712 bindir=${bindir} libexecdir=${libexecdir} archlibdir=${archlibdir}
713
686 -unset CDPATH; \ 714 -unset CDPATH; \
687 for dir in $(DESTDIR)${lispdir} $(DESTDIR)${etcdir} ; do \ 715 for dir in $(DESTDIR)${lispdir} $(DESTDIR)${etcdir} ; do \
688 if [ -d $${dir} ]; then \ 716 if [ -d $${dir} ]; then \
@@ -727,6 +755,15 @@ uninstall:
727 [ -s $${file} ] || rm -f $$file; \ 755 [ -s $${file} ] || rm -f $$file; \
728 done 756 done
729 757
758### Windows-specific uninstall target for removing programs produced
759### in nt/, and its Posix do-nothing shadow.
760uninstall-:
761uninstall-nt:
762 cd $(NTDIR) && \
763 $(MAKE) $(MFLAGS) uninstall \
764 prefix=${prefix} exec_prefix=${exec_prefix} \
765 bindir=${bindir} libexecdir=${libexecdir} archlibdir=${archlibdir}
766
730FRC: 767FRC:
731 768
732# ==================== Cleaning up and miscellanea ==================== 769# ==================== Cleaning up and miscellanea ====================
@@ -744,6 +781,7 @@ mostlyclean: FRC
744 (cd lwlib; $(MAKE) $(MFLAGS) mostlyclean) 781 (cd lwlib; $(MAKE) $(MFLAGS) mostlyclean)
745 (cd lib; $(MAKE) $(MFLAGS) mostlyclean) 782 (cd lib; $(MAKE) $(MFLAGS) mostlyclean)
746 (cd lib-src; $(MAKE) $(MFLAGS) mostlyclean) 783 (cd lib-src; $(MAKE) $(MFLAGS) mostlyclean)
784 (cd nt; $(MAKE) $(MFLAGS) mostlyclean)
747 -(cd doc/emacs && $(MAKE) $(MFLAGS) mostlyclean) 785 -(cd doc/emacs && $(MAKE) $(MFLAGS) mostlyclean)
748 -(cd doc/misc && $(MAKE) $(MFLAGS) mostlyclean) 786 -(cd doc/misc && $(MAKE) $(MFLAGS) mostlyclean)
749 -(cd doc/lispref && $(MAKE) $(MFLAGS) mostlyclean) 787 -(cd doc/lispref && $(MAKE) $(MFLAGS) mostlyclean)
@@ -765,6 +803,7 @@ clean: FRC
765 (cd lwlib; $(MAKE) $(MFLAGS) clean) 803 (cd lwlib; $(MAKE) $(MFLAGS) clean)
766 (cd lib; $(MAKE) $(MFLAGS) clean) 804 (cd lib; $(MAKE) $(MFLAGS) clean)
767 (cd lib-src; $(MAKE) $(MFLAGS) clean) 805 (cd lib-src; $(MAKE) $(MFLAGS) clean)
806 (cd nt; $(MAKE) $(MFLAGS) clean)
768 -(cd doc/emacs && $(MAKE) $(MFLAGS) clean) 807 -(cd doc/emacs && $(MAKE) $(MFLAGS) clean)
769 -(cd doc/misc && $(MAKE) $(MFLAGS) clean) 808 -(cd doc/misc && $(MAKE) $(MFLAGS) clean)
770 -(cd doc/lispref && $(MAKE) $(MFLAGS) clean) 809 -(cd doc/lispref && $(MAKE) $(MFLAGS) clean)
@@ -791,6 +830,7 @@ distclean: FRC
791 (cd lwlib; $(MAKE) $(MFLAGS) distclean) 830 (cd lwlib; $(MAKE) $(MFLAGS) distclean)
792 (cd lib; $(MAKE) $(MFLAGS) distclean) 831 (cd lib; $(MAKE) $(MFLAGS) distclean)
793 (cd lib-src; $(MAKE) $(MFLAGS) distclean) 832 (cd lib-src; $(MAKE) $(MFLAGS) distclean)
833 (cd nt; $(MAKE) $(MFLAGS) distclean)
794 (cd doc/emacs && $(MAKE) $(MFLAGS) distclean) 834 (cd doc/emacs && $(MAKE) $(MFLAGS) distclean)
795 (cd doc/misc && $(MAKE) $(MFLAGS) distclean) 835 (cd doc/misc && $(MAKE) $(MFLAGS) distclean)
796 (cd doc/lispref && $(MAKE) $(MFLAGS) distclean) 836 (cd doc/lispref && $(MAKE) $(MFLAGS) distclean)
@@ -809,6 +849,7 @@ bootstrap-clean: FRC
809 (cd lwlib; $(MAKE) $(MFLAGS) maintainer-clean) 849 (cd lwlib; $(MAKE) $(MFLAGS) maintainer-clean)
810 (cd lib; $(MAKE) $(MFLAGS) maintainer-clean) 850 (cd lib; $(MAKE) $(MFLAGS) maintainer-clean)
811 (cd lib-src; $(MAKE) $(MFLAGS) maintainer-clean) 851 (cd lib-src; $(MAKE) $(MFLAGS) maintainer-clean)
852 (cd nt; $(MAKE) $(MFLAGS) maintainer-clean)
812 -(cd doc/emacs && $(MAKE) $(MFLAGS) maintainer-clean) 853 -(cd doc/emacs && $(MAKE) $(MFLAGS) maintainer-clean)
813 -(cd doc/misc && $(MAKE) $(MFLAGS) maintainer-clean) 854 -(cd doc/misc && $(MAKE) $(MFLAGS) maintainer-clean)
814 -(cd doc/lispref && $(MAKE) $(MFLAGS) maintainer-clean) 855 -(cd doc/lispref && $(MAKE) $(MFLAGS) maintainer-clean)
diff --git a/configure.ac b/configure.ac
index a52e25249c6..54f499e2126 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])
192OPTION_DEFAULT_ON([xaw3d],[don't use Xaw3d]) 192OPTION_DEFAULT_ON([xaw3d],[don't use Xaw3d])
193OPTION_DEFAULT_ON([xim],[don't use X11 XIM]) 193OPTION_DEFAULT_ON([xim],[don't use X11 XIM])
194OPTION_DEFAULT_OFF([ns],[use NeXTstep (Cocoa or GNUstep) windowing system]) 194OPTION_DEFAULT_OFF([ns],[use NeXTstep (Cocoa or GNUstep) windowing system])
195OPTION_DEFAULT_OFF([w32], [use native MS Windows GUI]) 195OPTION_DEFAULT_OFF([w32], [use native MS Windows GUI in a Cygwin build])
196 196
197OPTION_DEFAULT_ON([gpm],[don't use -lgpm for mouse support on a GNU/Linux console]) 197OPTION_DEFAULT_ON([gpm],[don't use -lgpm for mouse support on a GNU/Linux console])
198OPTION_DEFAULT_ON([dbus],[don't compile with D-Bus support]) 198OPTION_DEFAULT_ON([dbus],[don't compile with D-Bus support])
@@ -376,7 +376,7 @@ AC_ARG_ENABLE(gtk-deprecation-warnings,
376## Make sure CDPATH doesn't affect cd (in case PWD is relative). 376## Make sure CDPATH doesn't affect cd (in case PWD is relative).
377unset CDPATH 377unset CDPATH
378case "${srcdir}" in 378case "${srcdir}" in
379 /* ) ;; 379 [[\\/]]* | ?:[[\\/]]*) ;;
380 . ) 380 . )
381 ## We may be able to use the $PWD environment variable to make this 381 ## We may be able to use the $PWD environment variable to make this
382 ## absolute. But sometimes PWD is inaccurate. 382 ## absolute. But sometimes PWD is inaccurate.
@@ -554,6 +554,11 @@ case "${canonical}" in
554 i[3456]86-*-* ) 554 i[3456]86-*-* )
555 case "${canonical}" in 555 case "${canonical}" in
556 *-darwin* ) opsys=darwin ;; 556 *-darwin* ) opsys=darwin ;;
557 *-mingw32 )
558 opsys=mingw32
559 # MinGW overrides and adds some system headers in nt/inc.
560 GCC_TEST_OPTIONS="-I $srcdir/nt/inc"
561 ;;
557 *-sysv4.2uw* ) opsys=unixware ;; 562 *-sysv4.2uw* ) opsys=unixware ;;
558 *-sysv5uw* ) opsys=unixware ;; 563 *-sysv5uw* ) opsys=unixware ;;
559 *-sysv5OpenUNIX* ) opsys=unixware ;; 564 *-sysv5OpenUNIX* ) opsys=unixware ;;
@@ -602,6 +607,11 @@ else
602 test "x$NON_GCC_TEST_OPTIONS" != x && CC="$CC $NON_GCC_TEST_OPTIONS" 607 test "x$NON_GCC_TEST_OPTIONS" != x && CC="$CC $NON_GCC_TEST_OPTIONS"
603fi 608fi
604 609
610dnl This is used in lib/Makefile.am to use nt/gnulib.mk, the
611dnl alternative to lib/gnulib.mk, so as to avoid generating header files
612dnl that clash with MinGW.
613AM_CONDITIONAL([BUILDING_FOR_WINDOWSNT], [test "x$opsys" = "xmingw32"])
614
605# Avoid gnulib's tests for HAVE_WORKING_O_NOATIME and HAVE_WORKING_O_NOFOLLOW, 615# Avoid gnulib's tests for HAVE_WORKING_O_NOATIME and HAVE_WORKING_O_NOFOLLOW,
606# as we don't use them. 616# as we don't use them.
607AC_DEFUN([gl_FCNTL_O_FLAGS]) 617AC_DEFUN([gl_FCNTL_O_FLAGS])
@@ -635,6 +645,9 @@ if test "$ac_test_CFLAGS" != set; then
635 if test $emacs_cv_prog_cc_g3 != yes; then 645 if test $emacs_cv_prog_cc_g3 != yes; then
636 CFLAGS=$emacs_save_CFLAGS 646 CFLAGS=$emacs_save_CFLAGS
637 fi 647 fi
648 if test $opsys = mingw32; then
649 CFLAGS="$CFLAGS -gdwarf-2"
650 fi
638 fi 651 fi
639 652
640 case $CFLAGS in 653 case $CFLAGS in
@@ -852,6 +865,16 @@ fi
852AC_SUBST(LN_S_FILEONLY) 865AC_SUBST(LN_S_FILEONLY)
853 866
854 867
868dnl AC_PROG_LN_S sets LN_S to 'cp -pR' for MinGW, on the premise that 'ln'
869dnl doesn't support links to directories, as in "ln file dir". But that
870dnl use is non-portable, and OTOH MinGW wants to use hard links for Emacs
871dnl executables at "make install" time.
872dnl See http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00475.html
873dnl for more details.
874if test "$opsys" = "mingw32"; then
875 LN_S="ln"
876fi
877
855AC_PATH_PROG(INSTALL_INFO, install-info, :, 878AC_PATH_PROG(INSTALL_INFO, install-info, :,
856 $PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin) 879 $PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin)
857dnl Don't use GZIP, which is used by gzip for additional parameters. 880dnl Don't use GZIP, which is used by gzip for additional parameters.
@@ -957,7 +980,6 @@ AC_SUBST(CANNOT_DUMP)
957UNEXEC_OBJ=unexelf.o 980UNEXEC_OBJ=unexelf.o
958case "$opsys" in 981case "$opsys" in
959 # MSDOS uses unexcoff.o 982 # MSDOS uses unexcoff.o
960 # MSWindows uses unexw32.o
961 aix4-2) 983 aix4-2)
962 UNEXEC_OBJ=unexaix.o 984 UNEXEC_OBJ=unexaix.o
963 ;; 985 ;;
@@ -970,6 +992,9 @@ case "$opsys" in
970 hpux10-20 | hpux11) 992 hpux10-20 | hpux11)
971 UNEXEC_OBJ=unexhp9k800.o 993 UNEXEC_OBJ=unexhp9k800.o
972 ;; 994 ;;
995 mingw32)
996 UNEXEC_OBJ=unexw32.o
997 ;;
973 sol2-10) 998 sol2-10)
974 # Use the Solaris dldump() function, called from unexsol.c, to dump 999 # Use the Solaris dldump() function, called from unexsol.c, to dump
975 # emacs, instead of the generic ELF dump code found in unexelf.c. 1000 # emacs, instead of the generic ELF dump code found in unexelf.c.
@@ -1064,6 +1089,7 @@ C_SWITCH_SYSTEM=
1064## additional optimization. --nils@exp-math.uni-essen.de 1089## additional optimization. --nils@exp-math.uni-essen.de
1065test "$opsys" = "aix4.2" && test "x$GCC" != "xyes" && \ 1090test "$opsys" = "aix4.2" && test "x$GCC" != "xyes" && \
1066 C_SWITCH_SYSTEM="-ma -qmaxmem=4000" 1091 C_SWITCH_SYSTEM="-ma -qmaxmem=4000"
1092test "$opsys" = "mingw32" && C_SWITCH_SYSTEM="-mtune=pentium4"
1067## gnu-linux might need -D_BSD_SOURCE on old libc5 systems. 1093## gnu-linux might need -D_BSD_SOURCE on old libc5 systems.
1068## It is redundant in glibc2, since we define _GNU_SOURCE. 1094## It is redundant in glibc2, since we define _GNU_SOURCE.
1069AC_SUBST(C_SWITCH_SYSTEM) 1095AC_SUBST(C_SWITCH_SYSTEM)
@@ -1083,8 +1109,8 @@ case "$opsys" in
1083 ## Motif needs -lgen. 1109 ## Motif needs -lgen.
1084 unixware) LIBS_SYSTEM="-lsocket -lnsl -lelf -lgen" ;; 1110 unixware) LIBS_SYSTEM="-lsocket -lnsl -lelf -lgen" ;;
1085esac 1111esac
1086AC_SUBST(LIBS_SYSTEM)
1087 1112
1113AC_SUBST(LIBS_SYSTEM)
1088 1114
1089### Make sure subsequent tests use flags consistent with the build flags. 1115### Make sure subsequent tests use flags consistent with the build flags.
1090 1116
@@ -1122,6 +1148,10 @@ case $opsys in
1122 ;; 1148 ;;
1123 hpux10-20 | hpux11 ) 1149 hpux10-20 | hpux11 )
1124 ;; 1150 ;;
1151 mingw32 )
1152 LIB_MATH=
1153 SYSTEM_TYPE=windows-nt
1154 ;;
1125 dnl NB this may be adjusted below. 1155 dnl NB this may be adjusted below.
1126 netbsd | openbsd ) 1156 netbsd | openbsd )
1127 SYSTEM_TYPE=berkeley-unix 1157 SYSTEM_TYPE=berkeley-unix
@@ -1197,11 +1227,15 @@ AC_DEFUN([PKG_CHECK_MODULES], [
1197 fi 1227 fi
1198]) 1228])
1199 1229
1200
1201if test "${with_sound}" != "no"; then 1230if test "${with_sound}" != "no"; then
1202 # Sound support for GNU/Linux and the free BSDs. 1231 # Sound support for GNU/Linux, the free BSDs, and MinGW.
1203 AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h soundcard.h, 1232 AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h soundcard.h mmsystem.h,
1204 have_sound_header=yes) 1233 have_sound_header=yes, [], [
1234 #ifdef __MINGW32__
1235 #define WIN32_LEAN_AND_MEAN
1236 #include <windows.h>
1237 #endif
1238 ])
1205 # Emulation library used on NetBSD. 1239 # Emulation library used on NetBSD.
1206 AC_CHECK_LIB(ossaudio, _oss_ioctl, LIBSOUND=-lossaudio, LIBSOUND=) 1240 AC_CHECK_LIB(ossaudio, _oss_ioctl, LIBSOUND=-lossaudio, LIBSOUND=)
1207 AC_SUBST(LIBSOUND) 1241 AC_SUBST(LIBSOUND)
@@ -1241,7 +1275,7 @@ if test "${with_sound}" != "no"; then
1241 if test x$have_sound_header = xyes || test $HAVE_ALSA = yes; then 1275 if test x$have_sound_header = xyes || test $HAVE_ALSA = yes; then
1242 case "$opsys" in 1276 case "$opsys" in
1243 dnl defined __FreeBSD__ || defined __NetBSD__ || defined __linux__ 1277 dnl defined __FreeBSD__ || defined __NetBSD__ || defined __linux__
1244 gnu-linux|freebsd|netbsd) 1278 gnu-linux|freebsd|netbsd|mingw32)
1245 AC_DEFINE(HAVE_SOUND, 1, [Define to 1 if you have sound support.]) 1279 AC_DEFINE(HAVE_SOUND, 1, [Define to 1 if you have sound support.])
1246 ;; 1280 ;;
1247 esac 1281 esac
@@ -1563,31 +1597,98 @@ AC_SUBST(NS_OBJC_OBJ)
1563HAVE_W32=no 1597HAVE_W32=no
1564W32_OBJ= 1598W32_OBJ=
1565W32_LIBS= 1599W32_LIBS=
1566W32_RES= 1600EMACSRES=
1601CLIENTRES=
1602CLIENTW=
1567W32_RES_LINK= 1603W32_RES_LINK=
1604EMACS_MANIFEST=
1568if test "${with_w32}" != no; then 1605if test "${with_w32}" != no; then
1569 if test "${opsys}" != "cygwin"; then 1606 case "${opsys}" in
1570 AC_MSG_ERROR([Using w32 with an autotools build is only supported for Cygwin.]) 1607 cygwin)
1608 AC_CHECK_HEADER([windows.h], [HAVE_W32=yes],
1609 [AC_MSG_ERROR([`--with-w32' was specified, but windows.h
1610 cannot be found.])])
1611 ;;
1612 mingw32)
1613 ## Using --with-w32 with MinGW is a no-op, but we allow it.
1614 ;;
1615 *)
1616 AC_MSG_ERROR([Using w32 with an autotools build is only supported for Cygwin and MinGW32.])
1617 ;;
1618 esac
1619fi
1620
1621if test "${opsys}" = "mingw32"; then
1622 AC_MSG_CHECKING([whether Windows API headers are recent enough])
1623 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1624 #include <windows.h>
1625 #include <usp10.h>]],
1626 [[void test(PIMAGE_NT_HEADERS pHeader)
1627 {PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pHeader);}]])],
1628 [emacs_cv_w32api=yes
1629 HAVE_W32=yes],
1630 emacs_cv_w32api=no)
1631 AC_MSG_RESULT($emacs_cv_w32api)
1632 if test "${emacs_cv_w32api}" = "no"; then
1633 AC_MSG_ERROR([the Windows API headers are too old to support this build.])
1571 fi 1634 fi
1572 AC_CHECK_HEADER([windows.h], [HAVE_W32=yes], 1635fi
1573 [AC_MSG_ERROR([`--with-w32' was specified, but windows.h 1636
1574 cannot be found.])]) 1637FIRSTFILE_OBJ=
1638NTDIR=
1639LIBS_ECLIENT=
1640LIB_WSOCK32=
1641NTLIB=
1642CM_OBJ="cm.o"
1643XARGS_LIMIT=
1644if test "${HAVE_W32}" = "yes"; then
1575 AC_DEFINE(HAVE_NTGUI, 1, [Define to use native MS Windows GUI.]) 1645 AC_DEFINE(HAVE_NTGUI, 1, [Define to use native MS Windows GUI.])
1576 AC_CHECK_TOOL(WINDRES, [windres], 1646 AC_CHECK_TOOL(WINDRES, [windres],
1577 [AC_MSG_ERROR([No resource compiler found.])]) 1647 [AC_MSG_ERROR([No resource compiler found.])])
1578 W32_OBJ="w32fns.o w32menu.o w32reg.o w32font.o w32term.o" 1648 W32_OBJ="w32fns.o w32menu.o w32reg.o w32font.o w32term.o"
1579 W32_OBJ="$W32_OBJ w32xfns.o w32select.o w32uniscribe.o" 1649 W32_OBJ="$W32_OBJ w32xfns.o w32select.o w32uniscribe.o"
1580 W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32" 1650 EMACSRES="emacs.res"
1581 W32_LIBS="$W32_LIBS -lusp10 -lcomctl32 -lwinspool" 1651 case "$canonical" in
1582 W32_RES="emacs.res" 1652 x86_64-*-*) EMACS_MANIFEST="emacs-x64.manifest" ;;
1583 # Tell the linker that emacs.res is an object (which we compile from 1653 *) EMACS_MANIFEST="emacs-x86.manifest" ;;
1584 # the rc file), not a linker script. 1654 esac
1585 W32_RES_LINK="-Wl,emacs.res" 1655 if test "${opsys}" = "cygwin"; then
1656 W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32"
1657 W32_LIBS="$W32_LIBS -lusp10 -lcomctl32 -lwinspool"
1658 # Tell the linker that emacs.res is an object (which we compile from
1659 # the rc file), not a linker script.
1660 W32_RES_LINK="-Wl,emacs.res"
1661 else
1662 W32_OBJ="$W32_OBJ w32.o w32console.o w32heap.o w32inevt.o w32proc.o"
1663 W32_OBJ="$W32_OBJ w32notify.o"
1664 W32_LIBS="$W32_LIBS -lwinmm -lgdi32 -lcomdlg32"
1665 W32_LIBS="$W32_LIBS -lmpr -lwinspool -lole32 -lcomctl32 -lusp10"
1666 W32_RES_LINK="\$(EMACSRES)"
1667 CLIENTRES="emacsclient.res"
1668 CLIENTW="emacsclientw\$(EXEEXT)"
1669 FIRSTFILE_OBJ=firstfile.o
1670 NTDIR=nt
1671 CM_OBJ=
1672 LIBS_ECLIENT="-lcomctl32"
1673 LIB_WSOCK32="-lwsock32"
1674 NTLIB="ntlib.$ac_objext"
1675 XARGS_LIMIT="-s 10000"
1676 fi
1586fi 1677fi
1587AC_SUBST(W32_OBJ) 1678AC_SUBST(W32_OBJ)
1588AC_SUBST(W32_LIBS) 1679AC_SUBST(W32_LIBS)
1589AC_SUBST(W32_RES) 1680AC_SUBST(EMACSRES)
1681AC_SUBST(EMACS_MANIFEST)
1682AC_SUBST(CLIENTRES)
1683AC_SUBST(CLIENTW)
1590AC_SUBST(W32_RES_LINK) 1684AC_SUBST(W32_RES_LINK)
1685AC_SUBST(FIRSTFILE_OBJ)
1686AC_SUBST(NTDIR)
1687AC_SUBST(CM_OBJ)
1688AC_SUBST(LIBS_ECLIENT)
1689AC_SUBST(LIB_WSOCK32)
1690AC_SUBST(NTLIB)
1691AC_SUBST(XARGS_LIMIT)
1591 1692
1592if test "${HAVE_W32}" = "yes"; then 1693if test "${HAVE_W32}" = "yes"; then
1593 window_system=w32 1694 window_system=w32
@@ -1912,7 +2013,7 @@ fi
1912 2013
1913### Use -lrsvg-2 if available, unless `--with-rsvg=no' is specified. 2014### Use -lrsvg-2 if available, unless `--with-rsvg=no' is specified.
1914HAVE_RSVG=no 2015HAVE_RSVG=no
1915if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes"; then 2016if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes" || test "${opsys}" = "mingw32"; then
1916 if test "${with_rsvg}" != "no"; then 2017 if test "${with_rsvg}" != "no"; then
1917 RSVG_REQUIRED=2.11.0 2018 RSVG_REQUIRED=2.11.0
1918 RSVG_MODULE="librsvg-2.0 >= $RSVG_REQUIRED" 2019 RSVG_MODULE="librsvg-2.0 >= $RSVG_REQUIRED"
@@ -1955,43 +2056,45 @@ HAVE_GTK=no
1955GTK_OBJ= 2056GTK_OBJ=
1956check_gtk2=no 2057check_gtk2=no
1957gtk3_pkg_errors= 2058gtk3_pkg_errors=
1958if test "${with_gtk3}" = "yes" || test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then 2059if test "${opsys}" != "mingw32"; then
1959 GLIB_REQUIRED=2.28 2060 if test "${with_gtk3}" = "yes" || test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then
1960 GTK_REQUIRED=3.0 2061 GLIB_REQUIRED=2.28
1961 GTK_MODULES="gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED" 2062 GTK_REQUIRED=3.0
1962 2063 GTK_MODULES="gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
1963 dnl Checks for libraries. 2064
1964 PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no) 2065 dnl Checks for libraries.
1965 if test "$pkg_check_gtk" = "no" && test "$with_gtk3" = "yes"; then 2066 PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no)
1966 AC_MSG_ERROR($GTK_PKG_ERRORS) 2067 if test "$pkg_check_gtk" = "no" && test "$with_gtk3" = "yes"; then
1967 fi 2068 AC_MSG_ERROR($GTK_PKG_ERRORS)
1968 if test "$pkg_check_gtk" = "yes"; then 2069 fi
1969 AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.]) 2070 if test "$pkg_check_gtk" = "yes"; then
1970 GTK_OBJ=emacsgtkfixed.o 2071 AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.])
1971 term_header=gtkutil.h 2072 GTK_OBJ=emacsgtkfixed.o
1972 USE_GTK_TOOLKIT="GTK3" 2073 term_header=gtkutil.h
1973 if test "x$ac_enable_gtk_deprecation_warnings" = x; then 2074 USE_GTK_TOOLKIT="GTK3"
1974 GTK_CFLAGS="$GTK_CFLAGS -DGDK_DISABLE_DEPRECATION_WARNINGS" 2075 if test "x$ac_enable_gtk_deprecation_warnings" = x; then
1975 fi 2076 GTK_CFLAGS="$GTK_CFLAGS -DGDK_DISABLE_DEPRECATION_WARNINGS"
1976 else 2077 fi
1977 check_gtk2=yes 2078 else
1978 gtk3_pkg_errors="$GTK_PKG_ERRORS " 2079 check_gtk2=yes
2080 gtk3_pkg_errors="$GTK_PKG_ERRORS "
2081 fi
1979 fi 2082 fi
1980fi
1981 2083
1982if test "${with_gtk2}" = "yes" || test "$check_gtk2" = "yes"; then 2084 if test "${with_gtk2}" = "yes" || test "$check_gtk2" = "yes"; then
1983 GLIB_REQUIRED=2.10 2085 GLIB_REQUIRED=2.10
1984 GTK_REQUIRED=2.10 2086 GTK_REQUIRED=2.10
1985 GTK_MODULES="gtk+-2.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED" 2087 GTK_MODULES="gtk+-2.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
1986 2088
1987 dnl Checks for libraries. 2089 dnl Checks for libraries.
1988 PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no) 2090 PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no)
1989 if test "$pkg_check_gtk" = "no" && 2091 if test "$pkg_check_gtk" = "no" &&
1990 { test "$with_gtk" = yes || test "$with_gtk2" = "yes"; } 2092 { test "$with_gtk" = yes || test "$with_gtk2" = "yes"; }
1991 then 2093 then
1992 AC_MSG_ERROR($gtk3_pkg_errors$GTK_PKG_ERRORS) 2094 AC_MSG_ERROR($gtk3_pkg_errors$GTK_PKG_ERRORS)
2095 fi
2096 test "$pkg_check_gtk" = "yes" && USE_GTK_TOOLKIT="GTK2"
1993 fi 2097 fi
1994 test "$pkg_check_gtk" = "yes" && USE_GTK_TOOLKIT="GTK2"
1995fi 2098fi
1996 2099
1997if test x"$pkg_check_gtk" = xyes; then 2100if test x"$pkg_check_gtk" = xyes; then
@@ -2161,6 +2264,8 @@ if test "${with_gnutls}" = "yes" ; then
2161 AC_DEFINE(HAVE_GNUTLS, 1, [Define if using GnuTLS.]) 2264 AC_DEFINE(HAVE_GNUTLS, 1, [Define if using GnuTLS.])
2162 fi 2265 fi
2163 2266
2267 OLD_CFLAGS=$CFLAGS
2268 OLD_LIBS=$LIBS
2164 CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS" 2269 CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
2165 LIBS="$LIBGNUTLS_LIBS $LIBS" 2270 LIBS="$LIBGNUTLS_LIBS $LIBS"
2166 AC_CHECK_FUNCS(gnutls_certificate_set_verify_function, HAVE_GNUTLS_CALLBACK_CERTIFICATE_VERIFY=yes) 2271 AC_CHECK_FUNCS(gnutls_certificate_set_verify_function, HAVE_GNUTLS_CALLBACK_CERTIFICATE_VERIFY=yes)
@@ -2168,6 +2273,13 @@ if test "${with_gnutls}" = "yes" ; then
2168 if test "${HAVE_GNUTLS_CALLBACK_CERTIFICATE_VERIFY}" = "yes"; then 2273 if test "${HAVE_GNUTLS_CALLBACK_CERTIFICATE_VERIFY}" = "yes"; then
2169 AC_DEFINE(HAVE_GNUTLS_CALLBACK_CERTIFICATE_VERIFY, 1, [Define if using GnuTLS certificate verification callbacks.]) 2274 AC_DEFINE(HAVE_GNUTLS_CALLBACK_CERTIFICATE_VERIFY, 1, [Define if using GnuTLS certificate verification callbacks.])
2170 fi 2275 fi
2276
2277 # Windows loads GnuTLS dynamically
2278 if test "${opsys}" = "mingw32"; then
2279 CFLAGS=$OLD_CFLAGS
2280 LIBS=$OLD_LIBS
2281 LIBGNUTLS_LIBS=
2282 fi
2171fi 2283fi
2172 2284
2173AC_SUBST(LIBGNUTLS_LIBS) 2285AC_SUBST(LIBGNUTLS_LIBS)
@@ -2283,6 +2395,9 @@ case $opsys in
2283 hpux* | aix4-2 ) 2395 hpux* | aix4-2 )
2284 test "X$ac_cv_lib_Xmu_XmuConvertStandardSelection" != "Xyes" && LIBXMU= 2396 test "X$ac_cv_lib_Xmu_XmuConvertStandardSelection" != "Xyes" && LIBXMU=
2285 ;; 2397 ;;
2398 mingw32 )
2399 LIBXMU=
2400 ;;
2286esac 2401esac
2287AC_SUBST(LIBXMU) 2402AC_SUBST(LIBXMU)
2288 2403
@@ -2541,10 +2656,10 @@ AC_SUBST(M17N_FLT_CFLAGS)
2541AC_SUBST(M17N_FLT_LIBS) 2656AC_SUBST(M17N_FLT_LIBS)
2542 2657
2543### Use -lXpm if available, unless `--with-xpm=no'. 2658### Use -lXpm if available, unless `--with-xpm=no'.
2659### mingw32 doesn't use -lXpm, since it loads the library dynamically.
2544HAVE_XPM=no 2660HAVE_XPM=no
2545LIBXPM= 2661LIBXPM=
2546 2662if test "${HAVE_W32}" = "yes" && test "${opsys}" = "cygwin"; then
2547if test "${HAVE_W32}" = "yes"; then
2548 if test "${with_xpm}" != "no"; then 2663 if test "${with_xpm}" != "no"; then
2549 SAVE_CPPFLAGS="$CPPFLAGS" 2664 SAVE_CPPFLAGS="$CPPFLAGS"
2550 SAVE_LDFLAGS="$LDFLAGS" 2665 SAVE_LDFLAGS="$LDFLAGS"
@@ -2605,19 +2720,33 @@ no_return_alloc_pixels
2605 fi 2720 fi
2606fi 2721fi
2607 2722
2723### FIXME: Perhaps regroup to minimize code duplication due to MinGW's
2724### slightly different requirements wrt image libraries (it doesn't
2725### use -lXpm because it loads the xpm shared library dynamically at
2726### run time).
2727if test "${opsys}" = "mingw32"; then
2728 if test "${with_xpm}" != "no"; then
2729 AC_CHECK_HEADER(X11/xpm.h, HAVE_XPM=yes, HAVE_XPM=no, [
2730#define FOR_MSW 1])
2731 fi
2732
2733 if test "${HAVE_XPM}" = "yes"; then
2734 AC_DEFINE(HAVE_XPM, 1, [Define to 1 if you have the Xpm library (-lXpm).])
2735 fi
2736fi
2737
2608AC_SUBST(LIBXPM) 2738AC_SUBST(LIBXPM)
2609 2739
2610### Use -ljpeg if available, unless `--with-jpeg=no'. 2740### Use -ljpeg if available, unless `--with-jpeg=no'.
2741### mingw32 doesn't use -ljpeg, since it loads the library dynamically.
2611HAVE_JPEG=no 2742HAVE_JPEG=no
2612LIBJPEG= 2743LIBJPEG=
2613if test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then 2744if test "${opsys}" = "mingw32"; then
2614 if test "${with_jpeg}" != "no"; then 2745 if test "${with_jpeg}" != "no"; then
2615 dnl Checking for jpeglib.h can lose because of a redefinition of 2746 dnl Checking for jpeglib.h can lose because of a redefinition of
2616 dnl HAVE_STDLIB_H. 2747 dnl HAVE_STDLIB_H.
2617 AC_CHECK_HEADER(jerror.h, 2748 AC_CHECK_HEADER(jerror.h, HAVE_JPEG=yes, HAVE_JPEG=no)
2618 [AC_CHECK_LIB(jpeg, jpeg_destroy_compress, HAVE_JPEG=yes)])
2619 fi 2749 fi
2620
2621 AH_TEMPLATE(HAVE_JPEG, [Define to 1 if you have the jpeg library (-ljpeg).])dnl 2750 AH_TEMPLATE(HAVE_JPEG, [Define to 1 if you have the jpeg library (-ljpeg).])dnl
2622 if test "${HAVE_JPEG}" = "yes"; then 2751 if test "${HAVE_JPEG}" = "yes"; then
2623 AC_DEFINE(HAVE_JPEG) 2752 AC_DEFINE(HAVE_JPEG)
@@ -2629,6 +2758,25 @@ if test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
2629 [AC_MSG_WARN([libjpeg found, but not version 6b or later]) 2758 [AC_MSG_WARN([libjpeg found, but not version 6b or later])
2630 HAVE_JPEG=no]) 2759 HAVE_JPEG=no])
2631 fi 2760 fi
2761elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
2762 if test "${with_jpeg}" != "no"; then
2763 dnl Checking for jpeglib.h can lose because of a redefinition of
2764 dnl HAVE_STDLIB_H.
2765 AC_CHECK_HEADER(jerror.h,
2766 [AC_CHECK_LIB(jpeg, jpeg_destroy_compress, HAVE_JPEG=yes)])
2767 fi
2768
2769 AH_TEMPLATE(HAVE_JPEG, [Define to 1 if you have the jpeg library (-ljpeg).])dnl
2770 if test "${HAVE_JPEG}" = "yes"; then
2771 AC_DEFINE(HAVE_JPEG)
2772 AC_EGREP_CPP([version= *(6[2-9]|[7-9][0-9])],
2773 [#include <jpeglib.h>
2774 version=JPEG_LIB_VERSION
2775],
2776 [AC_DEFINE(HAVE_JPEG)],
2777 [AC_MSG_WARN([libjpeg found, but not version 6b or later])
2778 HAVE_JPEG=no])
2779 fi
2632 if test "${HAVE_JPEG}" = "yes"; then 2780 if test "${HAVE_JPEG}" = "yes"; then
2633 LIBJPEG=-ljpeg 2781 LIBJPEG=-ljpeg
2634 fi 2782 fi
@@ -2636,9 +2784,30 @@ fi
2636AC_SUBST(LIBJPEG) 2784AC_SUBST(LIBJPEG)
2637 2785
2638### Use -lpng if available, unless `--with-png=no'. 2786### Use -lpng if available, unless `--with-png=no'.
2787### mingw32 doesn't use -lpng, since it loads the library dynamically.
2639HAVE_PNG=no 2788HAVE_PNG=no
2640LIBPNG= 2789LIBPNG=
2641if test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then 2790if test "${opsys}" = "mingw32"; then
2791 if test "${with_png}" != "no"; then
2792 AC_CHECK_HEADER(png.h, HAVE_PNG=yes, HAVE_PNG=no)
2793 fi
2794 if test "${HAVE_PNG}" = "yes"; then
2795 AC_DEFINE(HAVE_PNG, 1, [Define to 1 if you have the png library (-lpng).])
2796
2797 AC_CHECK_DECL(png_longjmp,
2798 [],
2799 [AC_DEFINE(PNG_DEPSTRUCT, [],
2800 [Define to empty to suppress deprecation warnings when building
2801 with --enable-gcc-warnings and with libpng versions before 1.5,
2802 which lack png_longjmp.])],
2803 [[#ifdef HAVE_LIBPNG_PNG_H
2804 # include <libpng/png.h>
2805 #else
2806 # include <png.h>
2807 #endif
2808 ]])
2809 fi
2810elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
2642 if test "${with_png}" != "no"; then 2811 if test "${with_png}" != "no"; then
2643 # Debian unstable as of July 2003 has multiple libpngs, and puts png.h 2812 # Debian unstable as of July 2003 has multiple libpngs, and puts png.h
2644 # in /usr/include/libpng. 2813 # in /usr/include/libpng.
@@ -2669,9 +2838,17 @@ fi
2669AC_SUBST(LIBPNG) 2838AC_SUBST(LIBPNG)
2670 2839
2671### Use -ltiff if available, unless `--with-tiff=no'. 2840### Use -ltiff if available, unless `--with-tiff=no'.
2841### mingw32 doesn't use -ltiff, since it loads the library dynamically.
2672HAVE_TIFF=no 2842HAVE_TIFF=no
2673LIBTIFF= 2843LIBTIFF=
2674if test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then 2844if test "${opsys}" = "mingw32"; then
2845 if test "${with_tiff}" != "no"; then
2846 AC_CHECK_HEADER(tiffio.h, HAVE_TIFF=yes, HAVE_TIFF=no)
2847 fi
2848 if test "${HAVE_TIFF}" = "yes"; then
2849 AC_DEFINE(HAVE_TIFF, 1, [Define to 1 if you have the tiff library (-ltiff).])
2850 fi
2851elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes"; then
2675 if test "${with_tiff}" != "no"; then 2852 if test "${with_tiff}" != "no"; then
2676 AC_CHECK_HEADER(tiffio.h, 2853 AC_CHECK_HEADER(tiffio.h,
2677 [tifflibs="-lz -lm" 2854 [tifflibs="-lz -lm"
@@ -2689,9 +2866,17 @@ fi
2689AC_SUBST(LIBTIFF) 2866AC_SUBST(LIBTIFF)
2690 2867
2691### Use -lgif or -lungif if available, unless `--with-gif=no'. 2868### Use -lgif or -lungif if available, unless `--with-gif=no'.
2869### mingw32 doesn't use -lgif/-lungif, since it loads the library dynamically.
2692HAVE_GIF=no 2870HAVE_GIF=no
2693LIBGIF= 2871LIBGIF=
2694if test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no" \ 2872if test "${opsys}" = "mingw32"; then
2873 if test "${with_gif}" != "no"; then
2874 AC_CHECK_HEADER(gif_lib.h, HAVE_GIF=yes, HAVE_GIF=no)
2875 fi
2876 if test "${HAVE_GIF}" = "yes"; then
2877 AC_DEFINE(HAVE_GIF, 1, [Define to 1 if you have a gif (or ungif) library.])
2878 fi
2879elif test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no" \
2695 || test "${HAVE_W32}" = "yes"; then 2880 || test "${HAVE_W32}" = "yes"; then
2696 AC_CHECK_HEADER(gif_lib.h, 2881 AC_CHECK_HEADER(gif_lib.h,
2697# EGifPutExtensionLast only exists from version libungif-4.1.0b1. 2882# EGifPutExtensionLast only exists from version libungif-4.1.0b1.
@@ -2847,13 +3032,18 @@ fi
2847 3032
2848 3033
2849### Use libxml (-lxml2) if available 3034### Use libxml (-lxml2) if available
3035### mingw32 doesn't use -lxml2, since it loads the library dynamically.
2850HAVE_LIBXML2=no 3036HAVE_LIBXML2=no
2851if test "${with_xml2}" != "no"; then 3037if test "${with_xml2}" != "no"; then
2852 ### I'm not sure what the version number should be, so I just guessed. 3038 ### I'm not sure what the version number should be, so I just guessed.
2853 PKG_CHECK_MODULES(LIBXML2, libxml-2.0 > 2.6.17, HAVE_LIBXML2=yes, HAVE_LIBXML2=no) 3039 PKG_CHECK_MODULES(LIBXML2, libxml-2.0 > 2.6.17, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
2854 if test "${HAVE_LIBXML2}" = "yes"; then 3040 if test "${HAVE_LIBXML2}" = "yes"; then
2855 LIBS="$LIBXML2_LIBS $LIBS" 3041 if test "${opsys}" != "mingw32"; then
2856 AC_CHECK_LIB(xml2, htmlReadMemory, HAVE_LIBXML2=yes, HAVE_LIBXML2=no) 3042 LIBS="$LIBXML2_LIBS $LIBS"
3043 AC_CHECK_LIB(xml2, htmlReadMemory, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
3044 else
3045 LIBXML2_LIBS=""
3046 fi
2857 if test "${HAVE_LIBXML2}" = "yes"; then 3047 if test "${HAVE_LIBXML2}" = "yes"; then
2858 AC_DEFINE(HAVE_LIBXML2, 1, [Define to 1 if you have the libxml library (-lxml2).]) 3048 AC_DEFINE(HAVE_LIBXML2, 1, [Define to 1 if you have the libxml library (-lxml2).])
2859 else 3049 else
@@ -2866,6 +3056,10 @@ AC_SUBST(LIBXML2_LIBS)
2866AC_SUBST(LIBXML2_CFLAGS) 3056AC_SUBST(LIBXML2_CFLAGS)
2867 3057
2868# If netdb.h doesn't declare h_errno, we must declare it by hand. 3058# If netdb.h doesn't declare h_errno, we must declare it by hand.
3059# On MinGW, that is provided by nt/inc/sys/socket.h and w32.c.
3060if test "${opsys}" = "mingw32"; then
3061 emacs_cv_netdb_declares_h_errno=yes
3062fi
2869AC_CACHE_CHECK(whether netdb declares h_errno, 3063AC_CACHE_CHECK(whether netdb declares h_errno,
2870 emacs_cv_netdb_declares_h_errno, 3064 emacs_cv_netdb_declares_h_errno,
2871[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]], 3065[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]],
@@ -2876,8 +3070,10 @@ if test $emacs_cv_netdb_declares_h_errno = yes; then
2876fi 3070fi
2877 3071
2878# sqrt and other floating-point functions such as fmod and frexp 3072# sqrt and other floating-point functions such as fmod and frexp
2879# are found in -lm on most systems. 3073# are found in -lm on most systems, but mingw32 doesn't use -lm.
2880AC_CHECK_LIB(m, sqrt) 3074if test "${opsys}" != "mingw32"; then
3075 AC_CHECK_LIB(m, sqrt)
3076fi
2881 3077
2882# Check for mail-locking functions in a "mail" library. Probably this should 3078# Check for mail-locking functions in a "mail" library. Probably this should
2883# have the same check as for liblockfile below. 3079# have the same check as for liblockfile below.
@@ -2941,6 +3137,9 @@ case "$opsys" in
2941 test $ac_cv_header_maillock_h = yes && mail_lock=no 3137 test $ac_cv_header_maillock_h = yes && mail_lock=no
2942 fi 3138 fi
2943 ;; 3139 ;;
3140
3141 mingw32)
3142 mail_lock="none-needed" ;;
2944esac 3143esac
2945 3144
2946BLESSMAIL_TARGET= 3145BLESSMAIL_TARGET=
@@ -2949,6 +3148,8 @@ case "$mail_lock" in
2949 3148
2950 lockf) AC_DEFINE(MAIL_USE_LOCKF, 1, [Define if the mailer uses lockf to interlock the mail spool.]) ;; 3149 lockf) AC_DEFINE(MAIL_USE_LOCKF, 1, [Define if the mailer uses lockf to interlock the mail spool.]) ;;
2951 3150
3151 none-needed) ;;
3152
2952 *) BLESSMAIL_TARGET="need-blessmail" ;; 3153 *) BLESSMAIL_TARGET="need-blessmail" ;;
2953esac 3154esac
2954AC_SUBST(BLESSMAIL_TARGET) 3155AC_SUBST(BLESSMAIL_TARGET)
@@ -3020,25 +3221,29 @@ AC_DEFUN([tputs_link_source], [
3020 return 0; 3221 return 0;
3021 }]]) 3222 }]])
3022]) 3223])
3023# Maybe curses should be tried earlier? 3224if test "${opsys}" = "mingw32"; then
3024# See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9736#35 3225 msg='none required'
3025for tputs_library in '' tinfo ncurses terminfo termcap curses; do 3226else
3026 OLIBS=$LIBS 3227 # Maybe curses should be tried earlier?
3027 if test -z "$tputs_library"; then 3228 # See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9736#35
3028 LIBS_TERMCAP= 3229 for tputs_library in '' tinfo ncurses terminfo termcap curses; do
3029 msg='none required' 3230 OLIBS=$LIBS
3030 else 3231 if test -z "$tputs_library"; then
3031 LIBS_TERMCAP=-l$tputs_library 3232 LIBS_TERMCAP=
3032 msg=$LIBS_TERMCAP 3233 msg='none required'
3033 LIBS="$LIBS_TERMCAP $LIBS" 3234 else
3034 fi 3235 LIBS_TERMCAP=-l$tputs_library
3035 AC_RUN_IFELSE([tputs_link_source], [], [msg=no], 3236 msg=$LIBS_TERMCAP
3036 [AC_LINK_IFELSE([tputs_link_source], [], [msg=no])]) 3237 LIBS="$LIBS_TERMCAP $LIBS"
3037 LIBS=$OLIBS 3238 fi
3038 if test "X$msg" != Xno; then 3239 AC_RUN_IFELSE([tputs_link_source], [], [msg=no],
3039 break 3240 [AC_LINK_IFELSE([tputs_link_source], [], [msg=no])])
3040 fi 3241 LIBS=$OLIBS
3041done 3242 if test "X$msg" != Xno; then
3243 break
3244 fi
3245 done
3246fi
3042AC_MSG_RESULT([$msg]) 3247AC_MSG_RESULT([$msg])
3043if test "X$msg" = Xno; then 3248if test "X$msg" = Xno; then
3044 AC_MSG_ERROR([The required function `tputs' was not found in any library. 3249 AC_MSG_ERROR([The required function `tputs' was not found in any library.
@@ -3084,6 +3289,11 @@ fail;
3084 fi 3289 fi
3085 ;; 3290 ;;
3086 3291
3292 mingw32)
3293 TERMINFO=no
3294 LIBS_TERMCAP=
3295 ;;
3296
3087 netbsd) 3297 netbsd)
3088 if test "x$LIBS_TERMCAP" != "x-lterminfo"; then 3298 if test "x$LIBS_TERMCAP" != "x-lterminfo"; then
3089 TERMINFO=no 3299 TERMINFO=no
@@ -3373,11 +3583,14 @@ dnl AC_DEFINE(HAVE_TCATTR, 1, [Define to 1 if you have tcgetattr and tcsetatt
3373dnl fi 3583dnl fi
3374 3584
3375dnl Turned on June 1996 supposing nobody will mind it. 3585dnl Turned on June 1996 supposing nobody will mind it.
3376AC_DEFINE(AMPERSAND_FULL_NAME, 1, [Define to use the convention that & 3586dnl MinGW emulates passwd database, so this feature doesn't make sense there.
3377 in the full name stands for the login id.]) 3587if test "${opsys}" != "mingw32"; then
3588 AC_DEFINE(AMPERSAND_FULL_NAME, 1, [Define to use the convention that &
3589 in the full name stands for the login id.])
3590fi
3378 3591
3379dnl Every platform that uses configure (ie every non-MS platform) 3592dnl Every platform that uses configure supports this.
3380dnl supports this. There is a create-lockfiles option you can 3593dnl There is a create-lockfiles option you can
3381dnl customize if you do not want the lock files to be written. 3594dnl customize if you do not want the lock files to be written.
3382dnl So it is not clear that this #define still needs to exist. 3595dnl So it is not clear that this #define still needs to exist.
3383AC_DEFINE(CLASH_DETECTION, 1, [Define if you want lock files to be written, 3596AC_DEFINE(CLASH_DETECTION, 1, [Define if you want lock files to be written,
@@ -3387,7 +3600,9 @@ AC_DEFINE(CLASH_DETECTION, 1, [Define if you want lock files to be written,
3387dnl Everybody supports this, except MS. 3600dnl Everybody supports this, except MS.
3388dnl Seems like the kind of thing we should be testing for, though. 3601dnl Seems like the kind of thing we should be testing for, though.
3389## Note: PTYs are broken on darwin <6. Use at your own risk. 3602## Note: PTYs are broken on darwin <6. Use at your own risk.
3390AC_DEFINE(HAVE_PTYS, 1, [Define if the system supports pty devices.]) 3603if test "${opsys}" != "mingw32"; then
3604 AC_DEFINE(HAVE_PTYS, 1, [Define if the system supports pty devices.])
3605fi
3391 3606
3392dnl Everybody supports this, except MS-DOS. 3607dnl Everybody supports this, except MS-DOS.
3393dnl Seems like the kind of thing we should be testing for, though. 3608dnl Seems like the kind of thing we should be testing for, though.
@@ -3397,10 +3612,20 @@ AC_DEFINE(HAVE_SOCKETS, 1, [Define if the system supports
3397 3612
3398AH_TEMPLATE(INTERNAL_TERMINAL, [This is substituted when $TERM is "internal".]) 3613AH_TEMPLATE(INTERNAL_TERMINAL, [This is substituted when $TERM is "internal".])
3399 3614
3400AC_DEFINE(NULL_DEVICE, ["/dev/null"], [Name of the file to open to get 3615AH_TEMPLATE(NULL_DEVICE, [Name of the file to open to get
3401 a null file, or a data sink.]) 3616 a null file, or a data sink.])
3617if test "${opsys}" = "mingw32"; then
3618 AC_DEFINE(NULL_DEVICE, ["NUL:"])
3619else
3620 AC_DEFINE(NULL_DEVICE, ["/dev/null"])
3621fi
3402 3622
3403AC_DEFINE(SEPCHAR, [':'], [Character that separates PATH elements.]) 3623AH_TEMPLATE(SEPCHAR, [Character that separates PATH elements.])
3624if test "${opsys}" = "mingw32"; then
3625 AC_DEFINE(SEPCHAR, [';'])
3626else
3627 AC_DEFINE(SEPCHAR, [':'])
3628fi
3404 3629
3405dnl Everybody supports this, except MS-DOS. 3630dnl Everybody supports this, except MS-DOS.
3406AC_DEFINE(subprocesses, 1, [Define to enable asynchronous subprocesses.]) 3631AC_DEFINE(subprocesses, 1, [Define to enable asynchronous subprocesses.])
@@ -3411,19 +3636,28 @@ AC_DEFINE(USER_FULL_NAME, [pw->pw_gecos], [How to get a user's full name.])
3411AC_DEFINE(DIRECTORY_SEP, ['/'], 3636AC_DEFINE(DIRECTORY_SEP, ['/'],
3412 [Character that separates directories in a file name.]) 3637 [Character that separates directories in a file name.])
3413 3638
3414dnl Only used on MS platforms.
3415AH_TEMPLATE(DEVICE_SEP, [Character that separates a device in a file name.]) 3639AH_TEMPLATE(DEVICE_SEP, [Character that separates a device in a file name.])
3640if test "${opsys}" = "mingw32"; then
3641 dnl Only used on MS platforms.
3642 AC_DEFINE(DEVICE_SEP, ':')
3643 AC_DEFINE(IS_DEVICE_SEP(_c_), [((_c_) == DEVICE_SEP)],
3644 [Returns true if character is a device separator.])
3416 3645
3417AC_DEFINE(IS_DEVICE_SEP(_c_), 0, 3646 AC_DEFINE(IS_DIRECTORY_SEP(_c_), [((_c_) == '/' || (_c_) == '\\')],
3418 [Returns true if character is a device separator.]) 3647 [Returns true if character is a directory separator.])
3419 3648
3420AC_DEFINE(IS_DIRECTORY_SEP(_c_), [((_c_) == DIRECTORY_SEP)], 3649 AC_DEFINE(IS_ANY_SEP(_c_), [(IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP(_c_))],
3421 [Returns true if character is a directory separator.]) 3650 [Returns true if character is any form of separator.])
3651else
3652 AC_DEFINE(IS_DEVICE_SEP(_c_), 0,
3653 [Returns true if character is a device separator.])
3422 3654
3423dnl On MS, this also accepts IS_DEVICE_SEP. 3655 AC_DEFINE(IS_DIRECTORY_SEP(_c_), [((_c_) == DIRECTORY_SEP)],
3424AC_DEFINE(IS_ANY_SEP(_c_), [(IS_DIRECTORY_SEP (_c_))], 3656 [Returns true if character is a directory separator.])
3425 [Returns true if character is any form of separator.])
3426 3657
3658 AC_DEFINE(IS_ANY_SEP(_c_), [(IS_DIRECTORY_SEP (_c_))],
3659 [Returns true if character is any form of separator.])
3660fi
3427 3661
3428AH_TEMPLATE(NO_EDITRES, [Define if XEditRes should not be used.]) 3662AH_TEMPLATE(NO_EDITRES, [Define if XEditRes should not be used.])
3429 3663
@@ -3812,10 +4046,14 @@ else
3812 esac 4046 esac
3813fi dnl GCC? 4047fi dnl GCC?
3814 4048
4049dnl In a weird quirk, MS runtime uses _setjmp and longjmp.
3815AC_CACHE_CHECK([for _setjmp], [emacs_cv_func__setjmp], 4050AC_CACHE_CHECK([for _setjmp], [emacs_cv_func__setjmp],
3816 [AC_LINK_IFELSE( 4051 [AC_LINK_IFELSE(
3817 [AC_LANG_PROGRAM( 4052 [AC_LANG_PROGRAM(
3818 [[#include <setjmp.h> 4053 [[#include <setjmp.h>
4054 #ifdef __MINGW32__
4055 # define _longjmp longjmp
4056 #endif
3819 ]], 4057 ]],
3820 [[jmp_buf j; 4058 [[jmp_buf j;
3821 if (! _setjmp (j)) 4059 if (! _setjmp (j))
@@ -3910,6 +4148,14 @@ case $opsys in
3910 AC_DEFINE(IRIX6_5, [], [Define if the system is IRIX.]) 4148 AC_DEFINE(IRIX6_5, [], [Define if the system is IRIX.])
3911 ;; 4149 ;;
3912 4150
4151 mingw32)
4152 AC_DEFINE(DOS_NT, [])
4153 AC_DEFINE(WINDOWSNT, 1, [Define if compiling for native MS Windows.])
4154 if test "x$ac_enable_checking" != "x" ; then
4155 AC_DEFINE(EMACSDEBUG, 1, [Define to 1 to enable w32 debug facilities.])
4156 fi
4157 ;;
4158
3913 sol2*) 4159 sol2*)
3914 AC_DEFINE(USG, []) 4160 AC_DEFINE(USG, [])
3915 AC_DEFINE(USG5, []) 4161 AC_DEFINE(USG5, [])
@@ -3931,6 +4177,10 @@ AC_CACHE_CHECK([for usable FIONREAD], [emacs_cv_usable_FIONREAD],
3931 emacs_cv_usable_FIONREAD=no 4177 emacs_cv_usable_FIONREAD=no
3932 ;; 4178 ;;
3933 4179
4180 mingw32)
4181 emacs_cv_usable_FIONREAD=yes
4182 ;;
4183
3934 *) 4184 *)
3935 AC_COMPILE_IFELSE( 4185 AC_COMPILE_IFELSE(
3936 [AC_LANG_PROGRAM([[#include <sys/types.h> 4186 [AC_LANG_PROGRAM([[#include <sys/types.h>
@@ -4071,6 +4321,12 @@ AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${emacs_config_options}",
4071AH_TEMPLATE(config_opsysfile, [Some platforms that do not use configure 4321AH_TEMPLATE(config_opsysfile, [Some platforms that do not use configure
4072 define this to include extra configuration information.]) 4322 define this to include extra configuration information.])
4073 4323
4324case $opsys in
4325 mingw32)
4326 AC_DEFINE(config_opsysfile, <ms-w32.h>, [])
4327 ;;
4328esac
4329
4074XMENU_OBJ= 4330XMENU_OBJ=
4075XOBJ= 4331XOBJ=
4076FONT_OBJ= 4332FONT_OBJ=
@@ -4131,12 +4387,14 @@ case "$USE_X_TOOLKIT" in
4131esac 4387esac
4132AC_SUBST(TOOLKIT_LIBW) 4388AC_SUBST(TOOLKIT_LIBW)
4133 4389
4134if test "$USE_X_TOOLKIT" = "none"; then 4390if test "${opsys}" != "mingw32"; then
4135 LIBXT_OTHER="\$(LIBXSM)" 4391 if test "$USE_X_TOOLKIT" = "none"; then
4136 OLDXMENU_TARGET="really-oldXMenu" 4392 LIBXT_OTHER="\$(LIBXSM)"
4137else 4393 OLDXMENU_TARGET="really-oldXMenu"
4138 LIBXT_OTHER="\$(LIBXMU) -lXt \$(LIBXTR6) -lXext" 4394 else
4139 OLDXMENU_TARGET="really-lwlib" 4395 LIBXT_OTHER="\$(LIBXMU) -lXt \$(LIBXTR6) -lXext"
4396 OLDXMENU_TARGET="really-lwlib"
4397 fi
4140fi 4398fi
4141AC_SUBST(LIBXT_OTHER) 4399AC_SUBST(LIBXT_OTHER)
4142 4400
@@ -4210,6 +4468,10 @@ if test "$opsys" = "cygwin"; then
4210 ## Cygwin differs because of its unexec(). 4468 ## Cygwin differs because of its unexec().
4211 PRE_ALLOC_OBJ= 4469 PRE_ALLOC_OBJ=
4212 POST_ALLOC_OBJ=lastfile.o 4470 POST_ALLOC_OBJ=lastfile.o
4471elif test "$opsys" = "mingw32"; then
4472 CYGWIN_OBJ=
4473 PRE_ALLOC_OBJ=
4474 POST_ALLOC_OBJ=lastfile.o
4213else 4475else
4214 CYGWIN_OBJ= 4476 CYGWIN_OBJ=
4215 PRE_ALLOC_OBJ=lastfile.o 4477 PRE_ALLOC_OBJ=lastfile.o
@@ -4237,6 +4499,12 @@ gl_INIT
4237CFLAGS=$SAVE_CFLAGS 4499CFLAGS=$SAVE_CFLAGS
4238LIBS=$SAVE_LIBS 4500LIBS=$SAVE_LIBS
4239 4501
4502if test "${opsys}" = "mingw32"; then
4503 CPPFLAGS="$CPPFLAGS -DUSE_CRT_DLL=1 -I $srcdir/nt/inc"
4504 # Remove unneeded switches from the value of CC that goes to Makefiles
4505 CC=`echo $CC | sed -e "s,$GCC_TEST_OPTIONS,,"`
4506fi
4507
4240case "$opsys" in 4508case "$opsys" in
4241 aix4-2) LD_SWITCH_SYSTEM_TEMACS="-Wl,-bnodelcsect" ;; 4509 aix4-2) LD_SWITCH_SYSTEM_TEMACS="-Wl,-bnodelcsect" ;;
4242 4510
@@ -4273,6 +4541,16 @@ case "$opsys" in
4273 ## It seems clearer therefore to put this piece in LD_SWITCH_SYSTEM_TEMACS. 4541 ## It seems clearer therefore to put this piece in LD_SWITCH_SYSTEM_TEMACS.
4274 gnu*) LD_SWITCH_SYSTEM_TEMACS="\$(LD_SWITCH_X_SITE_RPATH)" ;; 4542 gnu*) LD_SWITCH_SYSTEM_TEMACS="\$(LD_SWITCH_X_SITE_RPATH)" ;;
4275 4543
4544 mingw32)
4545 ## MinGW64 does not prepend an underscore to symbols, so we must
4546 ## pass a different -entry switch to linker. FIXME: It is better
4547 ## to make the entry points the same by changing unexw32.c.
4548 case "$canonical" in
4549 x86_64-*-*) LD_SWITCH_SYSTEM_TEMACS="-Wl,-stack,0x00800000 -Wl,-heap,0x00100000 -Wl,-image-base,0x01000000 -Wl,-entry,_start -Wl,-Map,./temacs.map" ;;
4550 *) LD_SWITCH_SYSTEM_TEMACS="-Wl,-stack,0x00800000 -Wl,-heap,0x00100000 -Wl,-image-base,0x01000000 -Wl,-entry,__start -Wl,-Map,./temacs.map" ;;
4551 esac
4552 ;;
4553
4276 openbsd) LD_SWITCH_SYSTEM_TEMACS='-nopie' ;; 4554 openbsd) LD_SWITCH_SYSTEM_TEMACS='-nopie' ;;
4277 4555
4278 *) LD_SWITCH_SYSTEM_TEMACS= ;; 4556 *) LD_SWITCH_SYSTEM_TEMACS= ;;
@@ -4287,6 +4565,24 @@ fi
4287 4565
4288AC_SUBST(LD_SWITCH_SYSTEM_TEMACS) 4566AC_SUBST(LD_SWITCH_SYSTEM_TEMACS)
4289 4567
4568## MinGW-specific post-link processing of temacs.
4569TEMACS_POST_LINK=":"
4570ADDSECTION=
4571EMACS_HEAPSIZE=
4572if test "${opsys}" = "mingw32"; then
4573 TEMACS_POST_LINK="\$(MINGW_TEMACS_POST_LINK)"
4574 ADDSECTION="../nt/addsection\$(EXEEXT)"
4575 ## Preload heap size of temacs.exe in MB.
4576 case "$canonical" in
4577 x86_64-*-*) EMACS_HEAPSIZE=42 ;;
4578 *) EMACS_HEAPSIZE=27 ;;
4579 esac
4580fi
4581
4582AC_SUBST(ADDSECTION)
4583AC_SUBST(TEMACS_POST_LINK)
4584AC_SUBST(EMACS_HEAPSIZE)
4585
4290## Common for all window systems 4586## Common for all window systems
4291if test "$window_system" != "none"; then 4587if test "$window_system" != "none"; then
4292 AC_DEFINE(HAVE_WINDOW_SYSTEM, 1, [Define if you have a window system.]) 4588 AC_DEFINE(HAVE_WINDOW_SYSTEM, 1, [Define if you have a window system.])
@@ -4445,12 +4741,12 @@ dnl This will work, but you get a config.status that is not quite right
4445dnl (see http://lists.gnu.org/archive/html/bug-autoconf/2008-08/msg00028.html). 4741dnl (see http://lists.gnu.org/archive/html/bug-autoconf/2008-08/msg00028.html).
4446dnl That doesn't have any obvious consequences for Emacs, but on the whole 4742dnl That doesn't have any obvious consequences for Emacs, but on the whole
4447dnl it seems better to just live with the duplication. 4743dnl it seems better to just live with the duplication.
4448SUBDIR_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" 4744SUBDIR_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"
4449 4745
4450AC_CONFIG_FILES([Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile \ 4746AC_CONFIG_FILES([Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile \
4451 doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile \ 4747 doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile \
4452 doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile \ 4748 doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile \
4453 leim/Makefile nextstep/Makefile]) 4749 leim/Makefile nextstep/Makefile nt/Makefile])
4454 4750
4455dnl test/ is not present in release tarfiles. 4751dnl test/ is not present in release tarfiles.
4456opt_makefile=test/automated/Makefile 4752opt_makefile=test/automated/Makefile
@@ -4493,8 +4789,12 @@ dnl by configure. This also explains the `move-if-change' test and
4493dnl the use of force in the `epaths-force' rule in Makefile.in. 4789dnl the use of force in the `epaths-force' rule in Makefile.in.
4494AC_CONFIG_COMMANDS([epaths], [ 4790AC_CONFIG_COMMANDS([epaths], [
4495echo creating src/epaths.h 4791echo creating src/epaths.h
4496${MAKE-make} MAKEFILE_NAME=do-not-make-Makefile epaths-force 4792if test "${opsys}" = "mingw32"; then
4497], [GCC="$GCC" CPPFLAGS="$CPPFLAGS"]) 4793 ${MAKE-make} MAKEFILE_NAME=do-not-make-Makefile epaths-force-w32
4794else
4795 ${MAKE-make} MAKEFILE_NAME=do-not-make-Makefile epaths-force
4796fi
4797], [GCC="$GCC" CPPFLAGS="$CPPFLAGS" opsys="$opsys"])
4498 4798
4499AC_CONFIG_COMMANDS([gdbinit], [ 4799AC_CONFIG_COMMANDS([gdbinit], [
4500if test ! -f src/.gdbinit && test -f "$srcdir/src/.gdbinit"; then 4800if test ! -f src/.gdbinit && test -f "$srcdir/src/.gdbinit"; then
diff --git a/etc/ChangeLog b/etc/ChangeLog
index f4f17ac29cf..b516d1aef65 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,7 @@
12013-05-16 Eli Zaretskii <eliz@gnu.org>
2
3 * NEWS: Advertise the MSYS build on MS-Windows.
4
12013-05-15 Stefan Monnier <monnier@iro.umontreal.ca> 52013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
2 6
3 * .gitignore: Don't ignore DOC-* any more. 7 * .gitignore: Don't ignore DOC-* any more.
diff --git a/etc/NEWS b/etc/NEWS
index 5f238988820..fc0eaf33640 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -29,7 +29,15 @@ build time, like libacl on GNU/Linux. To prevent this, use the
29configure option `--disable-acl'. 29configure option `--disable-acl'.
30 30
31** The configure option --with-crt-dir has been removed. 31** The configure option --with-crt-dir has been removed.
32It is no longer needed, as the crt*.o files are no longer linked specially. 32It is no longer needed, as the crt*.o files are no longer linked
33specially.
34
35** Emacs for MS-Windows can now be built by running the configure script
36using the MSYS environment and MinGW development tools.
37This is from now on the preferred method of building Emacs on
38MS-Windows. The Windows-specific configure.bat and makefile.w32-in
39files are deprecated. See the file nt/INSTALL.MSYS for detailed
40instructions.
33 41
34 42
35* Startup Changes in Emacs 24.4 43* Startup Changes in Emacs 24.4
diff --git a/leim/ChangeLog b/leim/ChangeLog
index 64954ddad85..f86fb23eb5e 100644
--- a/leim/ChangeLog
+++ b/leim/ChangeLog
@@ -1,3 +1,7 @@
12013-05-16 Eli Zaretskii <eliz@gnu.org>
2
3 * Makefile.in (leim-list.el, check-declare): Use reveal-filename.
4
12013-04-01 Paul Eggert <eggert@cs.ucla.edu> 52013-04-01 Paul Eggert <eggert@cs.ucla.edu>
2 6
3 Use UTF-8 for most files with non-ASCII characters (Bug#13936). 7 Use UTF-8 for most files with non-ASCII characters (Bug#13936).
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
140 --eval "(update-leim-list-file \".\")" ; \ 140 --eval "(update-leim-list-file \".\")" ; \
141 else \ 141 else \
142 ${RUN_EMACS} -l ${buildlisppath}/international/quail \ 142 ${RUN_EMACS} -l ${buildlisppath}/international/quail \
143 --eval "(update-leim-list-file \".\" \"${srcdir}\")" ; \ 143 --eval "(update-leim-list-file \".\" (reveal-filename \"${srcdir}\"))" ; \
144 fi 144 fi
145 sed -n '/^[^;]/ p' < ${srcdir}/leim-ext.el >> $@ 145 sed -n '/^[^;]/ p' < ${srcdir}/leim-ext.el >> $@
146 146
@@ -199,4 +199,4 @@ extraclean: maintainer-clean
199 199
200check-declare: 200check-declare:
201 $(RUN_EMACS) -l $(buildlisppath)/emacs-lisp/check-declare \ 201 $(RUN_EMACS) -l $(buildlisppath)/emacs-lisp/check-declare \
202 --eval '(check-declare-directory "$(srcdir)")' 202 --eval '(check-declare-directory (reveal-filename "$(srcdir)"))'
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 63108cae9a9..6ff653b7be6 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,27 @@
12013-05-16 Eli Zaretskii <eliz@gnu.org>
2
3 * update-game-score.c [WINDOWSNT]: Include "ntlib.h".
4
5 * ntlib.h (sleep): Update prototype.
6 (geteuid): Add prototype.
7
8 * ntlib.c (sleep): Now returns an unsigned value.
9 (getgid): New function.
10
11 * Makefile.in (CLIENTW, LIB_WSOCK32, LIBS_ECLIENT, NTLIB)
12 (CLIENTRES, WINDRES, NTINC, NTDEPS): New variables.
13 (INSTALLABLES): Add $(CLIENTW).
14 (LIBS_MOVE): Use $(LIB_WSOCK32).
15 ($(DESTDIR)${archlibdir}): Use $(EXEEXT) on update-game-score.
16 (test-distrib${EXEEXT}): Use $(EXEEXT) on test-distrib.
17 (etags${EXEEXT}, ebrowse${EXEEXT}, ctags${EXEEXT})
18 (profile${EXEEXT}, make-docfile${EXEEXT}, movemail${EXEEXT})
19 (emacsclient${EXEEXT}, hexl${EXEEXT}, update-game-score${EXEEXT}):
20 Add $(NTLIB) to prerequisites. Use $(EXEEXT).
21 (pop.o): Add pop.h to prerequisites.
22 (emacsclientw${EXEEXT}, ntlib.o): New targets.
23 (emacsclient.res): New target.
24
12013-05-15 Stefan Monnier <monnier@iro.umontreal.ca> 252013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
2 26
3 * makefile.w32-in ($(DOC)): Use DOC rather than DOC-X. 27 * makefile.w32-in ($(DOC)): Use DOC rather than DOC-X.
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@
113 113
114# ========================== Lists of Files =========================== 114# ========================== Lists of Files ===========================
115 115
116# emacsclientw.exe for MinGW, empty otherwise
117CLIENTW = @CLIENTW@
118
116# Things that a user might actually run, which should be installed in bindir. 119# Things that a user might actually run, which should be installed in bindir.
117INSTALLABLES = etags${EXEEXT} ctags${EXEEXT} emacsclient${EXEEXT} \ 120INSTALLABLES = etags${EXEEXT} ctags${EXEEXT} emacsclient${EXEEXT} $(CLIENTW) \
118 ebrowse${EXEEXT} 121 ebrowse${EXEEXT}
119 122
120INSTALLABLE_SCRIPTS = grep-changelog 123INSTALLABLE_SCRIPTS = grep-changelog
@@ -163,10 +166,21 @@ LIBS_MAIL=@LIBS_MAIL@
163LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ 166LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
164## empty or -lrt or -lposix4 if HAVE_FDATASYNC 167## empty or -lrt or -lposix4 if HAVE_FDATASYNC
165LIB_FDATASYNC = @LIB_FDATASYNC@ 168LIB_FDATASYNC = @LIB_FDATASYNC@
169## empty or -lwsock2 for MinGW
170LIB_WSOCK32=@LIB_WSOCK32@
166 171
167## Extra libraries to use when linking movemail. 172## Extra libraries to use when linking movemail.
168LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \ 173LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \
169 $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV) 174 $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV) $(LIB_WSOCK32)
175
176## Extra libraries when linking emacsclient
177## (empty or -lcomctl32 for MinGW)
178LIBS_ECLIENT = @LIBS_ECLIENT@
179
180## Extra object files for linking for MinGW
181NTLIB = @NTLIB@
182CLIENTRES = @CLIENTRES@
183WINDRES = @WINDRES@
170 184
171## Some systems define this to request special libraries. 185## Some systems define this to request special libraries.
172LIBS_SYSTEM = @LIBS_SYSTEM@ 186LIBS_SYSTEM = @LIBS_SYSTEM@
@@ -227,7 +241,7 @@ $(DESTDIR)${archlibdir}: all
227 umask 022; ${MKDIR_P} $(DESTDIR)${gamedir}; \ 241 umask 022; ${MKDIR_P} $(DESTDIR)${gamedir}; \
228 touch $(DESTDIR)${gamedir}/snake-scores; \ 242 touch $(DESTDIR)${gamedir}/snake-scores; \
229 touch $(DESTDIR)${gamedir}/tetris-scores 243 touch $(DESTDIR)${gamedir}/tetris-scores
230 -if chown ${gameuser} $(DESTDIR)${archlibdir}/update-game-score && chmod u+s $(DESTDIR)${archlibdir}/update-game-score; then \ 244 -if chown ${gameuser} $(DESTDIR)${archlibdir}/update-game-score${EXEEXT} && chmod u+s $(DESTDIR)${archlibdir}/update-game-score${EXEEXT}; then \
231 chown ${gameuser} $(DESTDIR)${gamedir}; \ 245 chown ${gameuser} $(DESTDIR)${gamedir}; \
232 chmod u=rwx,g=rwx,o=rx $(DESTDIR)${gamedir}; \ 246 chmod u=rwx,g=rwx,o=rx $(DESTDIR)${gamedir}; \
233 fi 247 fi
@@ -292,7 +306,7 @@ TAGS: etags${EXEEXT}
292## distribute Emacs. If they were clobbered, all the .elc files were 306## distribute Emacs. If they were clobbered, all the .elc files were
293## clobbered too. 307## clobbered too.
294test-distrib${EXEEXT}: ${srcdir}/test-distrib.c 308test-distrib${EXEEXT}: ${srcdir}/test-distrib.c
295 $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c 309 $(CC) ${ALL_CFLAGS} -o test-distrib${EXEEXT} ${srcdir}/test-distrib.c
296 ./test-distrib ${srcdir}/testfile 310 ./test-distrib ${srcdir}/testfile
297 311
298../lib/libgnu.a: $(config_h) 312../lib/libgnu.a: $(config_h)
@@ -302,47 +316,68 @@ regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h $(config_h)
302 ${CC} -c ${CPP_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER \ 316 ${CC} -c ${CPP_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER \
303 ${srcdir}/../src/regex.c 317 ${srcdir}/../src/regex.c
304 318
305etags${EXEEXT}: ${srcdir}/etags.c regex.o $(config_h) 319etags${EXEEXT}: ${srcdir}/etags.c regex.o $(NTLIB) $(config_h)
306 $(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" \ 320 $(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" \
307 -DVERSION="\"${version}\"" ${srcdir}/etags.c \ 321 -DVERSION="\"${version}\"" ${srcdir}/etags.c \
308 regex.o $(LOADLIBES) -o etags 322 regex.o $(LOADLIBES) $(NTLIB) -o etags${EXEEXT}
309 323
310ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(config_h) 324ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(NTLIB) \
325 $(config_h)
311 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \ 326 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \
312 ${srcdir}/ebrowse.c $(LOADLIBES) -o ebrowse 327 ${srcdir}/ebrowse.c $(LOADLIBES) $(NTLIB) -o ebrowse${EXEEXT}
313 328
314## We depend on etags to assure that parallel makes do not write two 329## We depend on etags to assure that parallel makes do not write two
315## etags.o files on top of each other. 330## etags.o files on top of each other.
316ctags${EXEEXT}: etags${EXEEXT} 331ctags${EXEEXT}: etags${EXEEXT}
317 $(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" \ 332 $(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" \
318 -DVERSION="\"${version}\"" ${srcdir}/etags.c \ 333 -DVERSION="\"${version}\"" ${srcdir}/etags.c \
319 regex.o $(LOADLIBES) -o ctags 334 regex.o $(LOADLIBES) $(NTLIB) -o ctags${EXEEXT}
320 335
321profile${EXEEXT}: ${srcdir}/profile.c $(config_h) 336profile${EXEEXT}: ${srcdir}/profile.c $(NTLIB) $(config_h)
322 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c \ 337 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c \
323 $(LOADLIBES) $(LIB_CLOCK_GETTIME) -o profile 338 $(LOADLIBES) $(NTLIB) $(LIB_CLOCK_GETTIME) -o profile${EXEEXT}
324 339
325make-docfile${EXEEXT}: ${srcdir}/make-docfile.c $(config_h) 340make-docfile${EXEEXT}: ${srcdir}/make-docfile.c $(NTLIB) $(config_h)
326 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) \ 341 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) $(NTLIB) \
327 -o make-docfile 342 -o make-docfile${EXEEXT}
328 343
329movemail${EXEEXT}: ${srcdir}/movemail.c pop.o $(config_h) 344movemail${EXEEXT}: ${srcdir}/movemail.c pop.o $(NTLIB) $(config_h)
330 $(CC) ${ALL_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c pop.o \ 345 $(CC) ${ALL_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c pop.o \
331 $(LOADLIBES) $(LIBS_MOVE) -o movemail 346 $(LOADLIBES) $(NTLIB) $(LIBS_MOVE) -o movemail${EXEEXT}
332 347
333pop.o: ${srcdir}/pop.c ${srcdir}/../lib/min-max.h $(config_h) 348pop.o: ${srcdir}/pop.c ${srcdir}/pop.h ${srcdir}/../lib/min-max.h $(config_h)
334 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c 349 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
335 350
336emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(config_h) 351emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(config_h)
337 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c \ 352 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c \
338 -DVERSION="\"${version}\"" \ 353 -DVERSION="\"${version}\"" $(NTLIB) $(LOADLIBES) $(LIB_FDATASYNC) \
339 $(LOADLIBES) $(LIB_FDATASYNC) -o emacsclient 354 $(LIB_WSOCK32) $(LIBS_ECLIENT) -o emacsclient${EXEEXT}
355
356emacsclientw${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(CLIENTRES) $(config_h)
357 $(CC) ${ALL_CFLAGS} $(CLIENTRES) -mwindows ${srcdir}/emacsclient.c \
358 -DVERSION="\"${version}\"" $(LOADLIBES) $(LIB_FDATASYNC) \
359 $(LIB_WSOCK32) $(LIBS_ECLIENT) -o emacsclientw${EXEEXT}
340 360
341hexl${EXEEXT}: ${srcdir}/hexl.c $(config_h) 361NTINC = ${srcdir}/../nt/inc
342 $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl 362NTDEPS = $(NTINC)/ms-w32.h $(NTINC)/sys/stat.h $(NTINC)/inttypes.h \
363 $(NTINC)/stdint.h $(NTINC)/pwd.h $(NTINC)/sys/time.h $(NTINC)/stdbool.h \
364 $(NTINC)/sys/wait.h $(NTINC)/unistd.h $(NTINC)/sys/file.h $(NTINC)/netdb.h
343 365
344update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(config_h) 366# The dependency on $(NTDEPS) is a trick intended to cause recompile of
367# programs on MinGW whenever some private header in nt/inc is modified.
368ntlib.o: ${srcdir}/ntlib.c ${srcdir}/ntlib.h $(NTDEPS)
369 $(CC) -c ${CPP_CFLAGS} ${srcdir}/ntlib.c
370
371hexl${EXEEXT}: ${srcdir}/hexl.c $(NTLIB) $(config_h)
372 $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl${EXEEXT}
373
374update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(NTLIB) $(config_h)
345 $(CC) ${ALL_CFLAGS} -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \ 375 $(CC) ${ALL_CFLAGS} -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \
346 ${srcdir}/update-game-score.c $(LOADLIBES) -o update-game-score 376 ${srcdir}/update-game-score.c $(LOADLIBES) $(NTLIB) \
377 -o update-game-score${EXEEXT}
378
379emacsclient.res: $(NTINC)/../emacsclient.rc
380 $(WINDRES) -O coff --include-dir=$(NTINC)/.. -o emacsclient.res \
381 $(NTINC)/../emacsclient.rc
347 382
348## Makefile ends here. 383## 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
49/* Emulate sleep...we could have done this with a define, but that 49/* Emulate sleep...we could have done this with a define, but that
50 would necessitate including windows.h in the files that used it. 50 would necessitate including windows.h in the files that used it.
51 This is much easier. */ 51 This is much easier. */
52void 52unsigned
53sleep (unsigned long seconds) 53sleep (unsigned seconds)
54{ 54{
55 Sleep (seconds * 1000); 55 Sleep (seconds * 1000);
56 return 0;
56} 57}
57 58
58/* Get the current working directory. */ 59/* Get the current working directory. */
@@ -138,6 +139,12 @@ getuid (void)
138} 139}
139 140
140unsigned 141unsigned
142geteuid (void)
143{
144 return getuid ();
145}
146
147unsigned
141getgid (void) 148getgid (void)
142{ 149{
143 return 0; 150 return 0;
@@ -415,4 +422,3 @@ lstat (const char * path, struct stat * buf)
415{ 422{
416 return stat (path, buf); 423 return stat (path, buf);
417} 424}
418
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.
16You should have received a copy of the GNU General Public License 16You should have received a copy of the GNU General Public License
17along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ 17along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
18 18
19
20#include <pwd.h> 19#include <pwd.h>
21#include <malloc.h> 20#include <malloc.h>
22 21
@@ -29,12 +28,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
29#ifdef sleep 28#ifdef sleep
30#undef sleep 29#undef sleep
31#endif 30#endif
32void sleep (unsigned long seconds); 31unsigned sleep (unsigned seconds);
33char *getwd (char *dir); 32char *getwd (char *dir);
34int getppid (void); 33int getppid (void);
35char * getlogin (void); 34char * getlogin (void);
36char * cuserid (char * s); 35char * cuserid (char * s);
37unsigned getuid (void); 36unsigned getuid (void);
37unsigned geteuid (void);
38unsigned getegid (void); 38unsigned getegid (void);
39unsigned getgid (void); 39unsigned getgid (void);
40int setuid (unsigned uid); 40int 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/>. */
46#include <sys/stat.h> 46#include <sys/stat.h>
47#include <getopt.h> 47#include <getopt.h>
48 48
49#ifdef WINDOWSNT
50#include "ntlib.h"
51#endif
52
49#define MAX_ATTEMPTS 5 53#define MAX_ATTEMPTS 5
50#define MAX_SCORES 200 54#define MAX_SCORES 200
51#define MAX_DATA_LEN 1024 55#define MAX_DATA_LEN 1024
diff --git a/lib/Makefile.am b/lib/Makefile.am
index c72e0904221..f76d0d3928d 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -9,6 +9,10 @@ SUFFIXES =
9AM_CFLAGS = $(PROFILING_CFLAGS) $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS) 9AM_CFLAGS = $(PROFILING_CFLAGS) $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS)
10DEFAULT_INCLUDES = -I. -I$(top_srcdir)/lib -I../src -I$(top_srcdir)/src 10DEFAULT_INCLUDES = -I. -I$(top_srcdir)/lib -I../src -I$(top_srcdir)/src
11 11
12if BUILDING_FOR_WINDOWSNT
13include ../nt/gnulib.mk
14else
12include gnulib.mk 15include gnulib.mk
13 16
14libgnu_a_SOURCES += openat-die.c save-cwd.c 17libgnu_a_SOURCES += openat-die.c save-cwd.c
18endif
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e6f56664a52..a33796ce24f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,18 @@
12013-05-16 Eli Zaretskii <eliz@gnu.org>
2
3 * subr.el (reveal-filename): New function.
4
5 * loadup.el: Compute Emacs executable versions on MS-Windows,
6 where executables have the .exe extension. Add a hard link
7 emacs-XX.YY.ZZ.exe on MS-Windows.
8
9 * Makefile.in (XARGS_LIMIT): New variable.
10 (custom-deps, finder-data, autoloads)
11 ($(MH_E_DIR)/mh-loaddefs.el, $(TRAMP_DIR)/tramp-loaddefs.el)
12 ($(CAL_DIR)/cal-loaddefs.el, $(CAL_DIR)/diary-loaddefs.el)
13 ($(CAL_DIR)/hol-loaddefs.el): Use reveal-filename.
14 (compile-main): Limit xargs according to $(XARGS_LIMIT).
15
12013-05-16 Leo Liu <sdl.web@gmail.com> 162013-05-16 Leo Liu <sdl.web@gmail.com>
2 17
3 * progmodes/octave.el (octave-indent-defun): Mark obsolete. 18 * progmodes/octave.el (octave-indent-defun): Mark obsolete.
diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index c8707df15df..138ad5abfa6 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -24,6 +24,10 @@ abs_top_builddir = @abs_top_builddir@
24lisp = $(srcdir) 24lisp = $(srcdir)
25VPATH = $(srcdir) 25VPATH = $(srcdir)
26 26
27# Empty for all systems except MinGW, where xargs needs an explicit
28# limitation.
29XARGS_LIMIT = @XARGS_LIMIT@
30
27# You can specify a different executable on the make command line, 31# You can specify a different executable on the make command line,
28# e.g. "make EMACS=../src/emacs ...". 32# e.g. "make EMACS=../src/emacs ...".
29 33
@@ -160,21 +164,21 @@ $(lisp)/cus-load.el:
160custom-deps: doit 164custom-deps: doit
161 cd $(lisp); $(setwins_almost); \ 165 cd $(lisp); $(setwins_almost); \
162 echo Directories: $$wins; \ 166 echo Directories: $$wins; \
163 $(emacs) -l cus-dep --eval '(setq generated-custom-dependencies-file "$(lisp)/cus-load.el")' -f custom-make-dependencies $$wins 167 $(emacs) -l cus-dep --eval '(setq generated-custom-dependencies-file (reveal-filename "$(lisp)/cus-load.el"))' -f custom-make-dependencies $$wins
164 168
165$(lisp)/finder-inf.el: 169$(lisp)/finder-inf.el:
166 $(MAKE) $(MFLAGS) finder-data 170 $(MAKE) $(MFLAGS) finder-data
167finder-data: doit 171finder-data: doit
168 cd $(lisp); $(setwins_almost); \ 172 cd $(lisp); $(setwins_almost); \
169 echo Directories: $$wins; \ 173 echo Directories: $$wins; \
170 $(emacs) -l finder --eval '(setq generated-finder-keywords-file "$(lisp)/finder-inf.el")' -f finder-compile-keywords-make-dist $$wins 174 $(emacs) -l finder --eval '(setq generated-finder-keywords-file (reveal-filename "$(lisp)/finder-inf.el"))' -f finder-compile-keywords-make-dist $$wins
171 175
172# The chmod +w is to handle env var CVSREAD=1. 176# The chmod +w is to handle env var CVSREAD=1.
173autoloads: $(LOADDEFS) doit 177autoloads: $(LOADDEFS) doit
174 cd $(lisp) && chmod +w $(AUTOGEN_VCS) 178 cd $(lisp) && chmod +w $(AUTOGEN_VCS)
175 cd $(lisp); $(setwins_almost); \ 179 cd $(lisp); $(setwins_almost); \
176 echo Directories: $$wins; \ 180 echo Directories: $$wins; \
177 $(emacs) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins 181 $(emacs) -l autoload --eval '(setq generated-autoload-file (reveal-filename "$(lisp)/loaddefs.el"))' -f batch-update-autoloads $$wins
178 182
179# This is required by the bootstrap-emacs target in ../src/Makefile, so 183# This is required by the bootstrap-emacs target in ../src/Makefile, so
180# we know that if we have an emacs executable, we also have a subdirs.el. 184# we know that if we have an emacs executable, we also have a subdirs.el.
@@ -274,7 +278,7 @@ compile-main: compile-clean
274 test -f $$el || continue; \ 278 test -f $$el || continue; \
275 test ! -f $${el}c && GREP_OPTIONS= grep '^;.*no-byte-compile: t' $$el > /dev/null && continue; \ 279 test ! -f $${el}c && GREP_OPTIONS= grep '^;.*no-byte-compile: t' $$el > /dev/null && continue; \
276 echo "$${el}c"; \ 280 echo "$${el}c"; \
277 done | xargs echo) | \ 281 done | xargs $(XARGS_LIMIT) echo) | \
278 while read chunk; do \ 282 while read chunk; do \
279 $(MAKE) $(MFLAGS) compile-targets EMACS="$(EMACS)" TARGETS="$$chunk"; \ 283 $(MAKE) $(MFLAGS) compile-targets EMACS="$(EMACS)" TARGETS="$$chunk"; \
280 done 284 done
@@ -369,7 +373,7 @@ mh-autoloads: $(MH_E_DIR)/mh-loaddefs.el
369$(MH_E_DIR)/mh-loaddefs.el: $(MH_E_SRC) 373$(MH_E_DIR)/mh-loaddefs.el: $(MH_E_SRC)
370 $(emacs) -l autoload \ 374 $(emacs) -l autoload \
371 --eval "(setq generate-autoload-cookie \";;;###mh-autoload\")" \ 375 --eval "(setq generate-autoload-cookie \";;;###mh-autoload\")" \
372 --eval "(setq generated-autoload-file \"$@\")" \ 376 --eval "(setq generated-autoload-file (reveal-filename \"$@\"))" \
373 --eval "(setq make-backup-files nil)" \ 377 --eval "(setq make-backup-files nil)" \
374 -f batch-update-autoloads $(MH_E_DIR) 378 -f batch-update-autoloads $(MH_E_DIR)
375 379
@@ -387,7 +391,7 @@ TRAMP_SRC = $(TRAMP_DIR)/tramp.el $(TRAMP_DIR)/tramp-adb.el \
387$(TRAMP_DIR)/tramp-loaddefs.el: $(TRAMP_SRC) 391$(TRAMP_DIR)/tramp-loaddefs.el: $(TRAMP_SRC)
388 $(emacs) -l autoload \ 392 $(emacs) -l autoload \
389 --eval "(setq generate-autoload-cookie \";;;###tramp-autoload\")" \ 393 --eval "(setq generate-autoload-cookie \";;;###tramp-autoload\")" \
390 --eval "(setq generated-autoload-file \"$@\")" \ 394 --eval "(setq generated-autoload-file (reveal-filename \"$@\"))" \
391 --eval "(setq make-backup-files nil)" \ 395 --eval "(setq make-backup-files nil)" \
392 -f batch-update-autoloads $(TRAMP_DIR) 396 -f batch-update-autoloads $(TRAMP_DIR)
393 397
@@ -409,21 +413,21 @@ CAL_SRC = $(CAL_DIR)/cal-bahai.el $(CAL_DIR)/cal-china.el \
409$(CAL_DIR)/cal-loaddefs.el: $(CAL_SRC) 413$(CAL_DIR)/cal-loaddefs.el: $(CAL_SRC)
410 $(emacs) -l autoload \ 414 $(emacs) -l autoload \
411 --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \ 415 --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \
412 --eval "(setq generated-autoload-file \"$@\")" \ 416 --eval "(setq generated-autoload-file (reveal-filename \"$@\"))" \
413 --eval "(setq make-backup-files nil)" \ 417 --eval "(setq make-backup-files nil)" \
414 -f batch-update-autoloads $(CAL_DIR) 418 -f batch-update-autoloads $(CAL_DIR)
415 419
416$(CAL_DIR)/diary-loaddefs.el: $(CAL_SRC) 420$(CAL_DIR)/diary-loaddefs.el: $(CAL_SRC)
417 $(emacs) -l autoload \ 421 $(emacs) -l autoload \
418 --eval "(setq generate-autoload-cookie \";;;###diary-autoload\")" \ 422 --eval "(setq generate-autoload-cookie \";;;###diary-autoload\")" \
419 --eval "(setq generated-autoload-file \"$@\")" \ 423 --eval "(setq generated-autoload-file (reveal-filename \"$@\"))" \
420 --eval "(setq make-backup-files nil)" \ 424 --eval "(setq make-backup-files nil)" \
421 -f batch-update-autoloads $(CAL_DIR) 425 -f batch-update-autoloads $(CAL_DIR)
422 426
423$(CAL_DIR)/hol-loaddefs.el: $(CAL_SRC) 427$(CAL_DIR)/hol-loaddefs.el: $(CAL_SRC)
424 $(emacs) -l autoload \ 428 $(emacs) -l autoload \
425 --eval "(setq generate-autoload-cookie \";;;###holiday-autoload\")" \ 429 --eval "(setq generate-autoload-cookie \";;;###holiday-autoload\")" \
426 --eval "(setq generated-autoload-file \"$@\")" \ 430 --eval "(setq generated-autoload-file (reveal-filename \"$@\"))" \
427 --eval "(setq make-backup-files nil)" \ 431 --eval "(setq make-backup-files nil)" \
428 -f batch-update-autoloads $(CAL_DIR) 432 -f batch-update-autoloads $(CAL_DIR)
429 433
diff --git a/lisp/loadup.el b/lisp/loadup.el
index a2e0d8ecec5..5764cdec7eb 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -290,9 +290,12 @@
290 (equal (nth 4 command-line-args) "dump")) 290 (equal (nth 4 command-line-args) "dump"))
291 (not (eq system-type 'ms-dos))) 291 (not (eq system-type 'ms-dos)))
292 (let* ((base (concat "emacs-" emacs-version ".")) 292 (let* ((base (concat "emacs-" emacs-version "."))
293 (exelen (if (eq system-type 'windows-nt) -4))
293 (files (file-name-all-completions base default-directory)) 294 (files (file-name-all-completions base default-directory))
294 (versions (mapcar (function (lambda (name) 295 (versions (mapcar (function
295 (string-to-number (substring name (length base))))) 296 (lambda (name)
297 (string-to-number
298 (substring name (length base) exelen))))
296 files))) 299 files)))
297 (setq emacs-bzr-version (condition-case nil (emacs-bzr-get-version) 300 (setq emacs-bzr-version (condition-case nil (emacs-bzr-get-version)
298 (error nil))) 301 (error nil)))
@@ -376,18 +379,25 @@
376 (dump-emacs "emacs" "temacs") 379 (dump-emacs "emacs" "temacs")
377 (message "%d pure bytes used" pure-bytes-used) 380 (message "%d pure bytes used" pure-bytes-used)
378 ;; Recompute NAME now, so that it isn't set when we dump. 381 ;; Recompute NAME now, so that it isn't set when we dump.
379 (if (not (or (memq system-type '(ms-dos windows-nt)) 382 (if (not (or (eq system-type 'ms-dos)
380 ;; Don't bother adding another name if we're just 383 ;; Don't bother adding another name if we're just
381 ;; building bootstrap-emacs. 384 ;; building bootstrap-emacs.
382 (equal (nth 3 command-line-args) "bootstrap") 385 (equal (nth 3 command-line-args) "bootstrap")
383 (equal (nth 4 command-line-args) "bootstrap"))) 386 (equal (nth 4 command-line-args) "bootstrap")))
384 (let ((name (concat "emacs-" emacs-version))) 387 (let ((name (concat "emacs-" emacs-version))
388 (exe (if (eq system-type 'windows-nt) ".exe" "")))
385 (while (string-match "[^-+_.a-zA-Z0-9]+" name) 389 (while (string-match "[^-+_.a-zA-Z0-9]+" name)
386 (setq name (concat (downcase (substring name 0 (match-beginning 0))) 390 (setq name (concat (downcase (substring name 0 (match-beginning 0)))
387 "-" 391 "-"
388 (substring name (match-end 0))))) 392 (substring name (match-end 0)))))
393 (setq name (concat name exe))
389 (message "Adding name %s" name) 394 (message "Adding name %s" name)
390 (add-name-to-file "emacs" name t))) 395 ;; When this runs on Windows, invocation-directory is not
396 ;; necessarily the current directory.
397 (add-name-to-file (expand-file-name (concat "emacs" exe)
398 invocation-directory)
399 (expand-file-name name invocation-directory)
400 t)))
391 (kill-emacs))) 401 (kill-emacs)))
392 402
393;; For machines with CANNOT_DUMP defined in config.h, 403;; For machines with CANNOT_DUMP defined in config.h,
diff --git a/lisp/subr.el b/lisp/subr.el
index 177e9a84a58..9bf11a13ef6 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -4678,4 +4678,20 @@ as alpha versions."
4678 (prin1-to-string (make-hash-table))))) 4678 (prin1-to-string (make-hash-table)))))
4679 (provide 'hashtable-print-readable)) 4679 (provide 'hashtable-print-readable))
4680 4680
4681;; This is used in lisp/Makefile.in and in leim/Makefile.in to
4682;; generate file names for autoloads, custom-deps, and finder-data.
4683(defun reveal-filename (file)
4684 "Produce the real file name for FILE.
4685
4686On systems other than MS-Windows, just returns FILE.
4687On MS-Windows, converts /d/foo/bar form of file names
4688passed by MSYS Make into d:/foo/bar that Emacs can grok.
4689
4690This function is called from lisp/Makefile."
4691 (when (and (eq system-type 'windows-nt)
4692 (string-match "\\`/[a-zA-Z]/" file))
4693 (setq file (concat (substring file 1 2) ":" (substring file 2))))
4694 file)
4695
4696
4681;;; subr.el ends here 4697;;; subr.el ends here
diff --git a/nt/ChangeLog b/nt/ChangeLog
index b66871e319b..80b6390d368 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,48 @@
12013-05-16 Eli Zaretskii <eliz@gnu.org>
2
3 * msysconfig.sh: New file.
4
5 * mingw-cfg.site: New file.
6
7 * makefile.w32-in (LOCAL_FLAGS): Add -DOLD_PATHS=1.
8
9 * inc/unistd.h: Include pwd.h and sys/types.h.
10
11 * inc/sys/time.h (_TIMEVAL_DEFINED, timerisset, timercmp)
12 (timerclear): Define.
13 (gettimeofday): Adjust signature to be Posix compatible, by using
14 the 'restrict' keyword.
15
16 * inc/sys/stat.h (UTIME_NOW, UTIME_OMIT): Define.
17 (struct _stat, struct _stati64): Define.
18
19 * inc/sys/socket.h (timeval): Define only for MSVC.
20 (FD_SET, FD_CLR, FD_ISSET, fd_set): Redefine only if
21 EMACS_CONFIG_H is defined.
22 (timeval): Undefine only for MSVC.
23
24 * inc/ms-w32.h (HAVE___BUILTIN_UNWIND_INIT, restrict)
25 (HAVE_WINDOW_SYSTEM, HAVE_MENUS, EMACS_CONFIGURATION)
26 (EMACS_CONFIG_OPTIONS, HAVE_LONG_LONG_INT)
27 (HAVE_UNSIGNED_LONG_LONG_INT): Define only if not already defined.
28 (fileno): Move definition after including stdio.h.
29 (sigset_t): Guard typedef by _W64.
30
31 * gnulib.mk: New file.
32
33 * epaths.nt: New file.
34
35 * addpm.c [!OLD_PATHS]: Include src/epaths.h, instead of having a
36 copy of the file names there.
37 <env_vars> [!OLD_PATHS]: Use macros from epaths.h instead of
38 literal strings.
39
40 * Makefile.in: New file.
41
42 * INSTALL.MSYS: New file.
43
44 * INSTALL: Mention INSTALL.MSYS.
45
12013-05-15 Stefan Monnier <monnier@iro.umontreal.ca> 462013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
2 47
3 * makefile.w32-in (clean, top-distclean): DOC-X doesn't exist any more. 48 * makefile.w32-in (clean, top-distclean): DOC-X doesn't exist any more.
diff --git a/nt/INSTALL b/nt/INSTALL
index 0c4b50f0c28..8abd8aff920 100644
--- a/nt/INSTALL
+++ b/nt/INSTALL
@@ -13,9 +13,13 @@
13 Do not use this recipe with Cygwin. For building on Cygwin, 13 Do not use this recipe with Cygwin. For building on Cygwin,
14 use the normal installation instructions, ../INSTALL. 14 use the normal installation instructions, ../INSTALL.
15 15
16 If you have a Cygwin or MSYS port of Bash on your Path, you will be 16 Do not use these instructions with MSYS environment. For building
17 better off removing it from PATH. (For details, search for "MSYS 17 the native Windows binary with MinGW and MSYS, follow the
18 sh.exe" below.) 18 instructions in the file INSTALL.MSYS in this directory.
19
20 For building without MSYS, if you have a Cygwin or MSYS port of Bash
21 on your Path, you will be better off removing it from PATH. (For
22 details, search for "MSYS sh.exe" below.)
19 23
20 1. Change to the `nt' directory (the directory of this file): 24 1. Change to the `nt' directory (the directory of this file):
21 25
diff --git a/nt/INSTALL.MSYS b/nt/INSTALL.MSYS
new file mode 100644
index 00000000000..05ba6c65b22
--- /dev/null
+++ b/nt/INSTALL.MSYS
@@ -0,0 +1,640 @@
1 Building and Installing Emacs on MS-Windows
2 using the MSYS and MinGW tools
3
4 Copyright (C) 2013 Free Software Foundation, Inc.
5 See the end of the file for license conditions.
6
7The MSYS/MinGW build described here is supported on versions of
8Windows starting with Windows 2000 and newer. Windows 9X are not
9supported (but the Emacs binary produced by this build will run on
10Windows 9X as well).
11
12* For the brave (a.k.a. "impatient"):
13
14 For those who have a working MSYS/MinGW development environment and
15 are comfortable with running Posix configure scripts, here are the
16 concise instructions for configuring and building the native Windows
17 binary of Emacs with these tools.
18
19 Do not use this recipe with Cygwin. For building on Cygwin, use the
20 normal installation instructions, ../INSTALL.
21
22 Do not use these instructions if you don't have MSYS installed; for
23 that, see the file INSTALL in this directory.
24
25 0. Start the MSYS Bash window. Everything else below is done from
26 that window's Bash prompt.
27
28 0a. If you are building from the development trunk (as opposed to a
29 release tarball), produce the configure script, by typing from
30 the top-level Emacs source directory:
31
32 ./autogen.sh
33
34 1. If you want to build Emacs outside of the source tree
35 (recommended), create the build directory and chdir there.
36
37 2. Invoke the MSYS-specific configure script:
38
39 - If you are building outside the source tree:
40
41 /PATH/TO/EMACS/SOURCE/TREE/nt/msysconfig.sh --prefix=PREFIX ...
42
43 - If you are building in-place, i.e. inside the source tree:
44
45 ./nt/msysconfig.sh --prefix=PREFIX ...
46
47 It is always preferable to use --prefix to configure Emacs for
48 some specific location of its installed tree; the default
49 /usr/local is not suitable for Windows.
50
51 You can pass other options to the configure script. Here's a
52 typical example (for an in-place debug build):
53
54 CPPFLAGS='-DGLYPH_DEBUG=1' CFLAGS='-O0 -g3' ./nt/msysconfig.sh --prefix=d:/usr/emacs --enable-checking
55
56 3. After the configure script finishes, it should display the
57 resulting configuration. After that, type
58
59 make
60
61 Use "make -j N" if your MSYS Make supports parallel execution;
62 the build will take significantly less time in that case. Here N
63 is the number of simultaneous parallel jobs; use the number of
64 the cores on your system.
65
66 4. Install the produced binaries:
67
68 make install
69
70 If you want the installation tree to go to a place that is
71 different from the one specified by --prefix, say
72
73 make install prefix=/where/ever/you/want
74
75 That's it!
76
77 If these short instructions somehow fail, read the rest of this
78 file.
79
80* Installing MinGW and MSYS
81
82 Make sure you carefully read the following two sections in their
83 entirety and install/configure the various packages as instructed.
84 A correct installation makes all the rest almost trivial; a botched
85 installation will likely make you miserable for quite some time.
86
87 There are two alternative to installing MinGW + MSYS: using the GUI
88 installer, called mingw-get, provided by the MinGW project, or
89 manual installation. The next two sections describe each one of
90 these.
91
92** Installing MinGW and MSYS using mingw-get
93
94 A nice GUI installer, called mingw-get, is available for those who
95 don't like to mess with manual installations. You can download it
96 from here:
97
98 https://sourceforge.net/projects/mingw/files/Installer/mingw-get/
99
100 (This installer only supports packages downloaded from the MinGW
101 site; for the rest you will still need the manual method.)
102
103 After installing mingw-get, invoke it to install the packages that
104 are already selected by default on the "Select Components" screen of
105 its wizard.
106
107 After that, use "ming-get install PACKAGE" to install the following
108 additional packages:
109
110 . msys-base
111 . mingw-developer-toolkit
112 . msys-automake
113
114 (We recommend that you refrain from installing the MSYS Texinfo
115 package, which is part of msys-base, because it might produce mixed
116 EOL format when installing Info files. Instead, install the MinGW
117 port of Texinfo, see the ezwinports URL below.)
118
119 At this point, you should be ready to configure and build Emacs in
120 its basic configuration. Skip to the "Generating the configure
121 script" section for the build instructions. If you want to build it
122 with image support and other optional libraries, read about the
123 optional libraries near the end of this document, before you start
124 the build. Also, consider installing additional MinGW packages that
125 are required/recommended, especially if you are building from the
126 Bazaar repository, as described in the next section.
127
128** Installing MinGW and MSYS manually
129
130*** MinGW
131
132 You will need to install the MinGW port of GCC and Binutils, and the
133 MinGW runtime and Windows API distributions, to compile Emacs. You
134 can find these on the MinGW download/Base page:
135
136 https://sourceforge.net/projects/mingw/files/MinGW/Base/
137
138 In general, install the latest stable versions of the following
139 MinGW packages from that page: gcc, binutils, mingw-rt, w32api. You
140 only need the 'bin' and the 'dll' tarballs of each of the above.
141
142 MinGW packages are distributed as .tar.lzma compressed archives. To
143 install the packages manually, we recommend to use the Windows port
144 of the 'bsdtar' program to unpack the tarballs. 'bsdtar' is
145 available as part of the 'libarchive' package from here:
146
147 http://sourceforge.net/projects/ezwinports/files/
148
149 The recommended place to install these packages is a single tree
150 starting from some directory on a drive other than the system drive
151 C:. A typical example would be D:\usr, with D:\usr\bin holding the
152 binaries and DLLs (should be added to your Path environment
153 variable), D:\usr\include holding the include files, D:\usr\lib
154 holding the static and import libraries, D:\usr\share holding docs,
155 message catalogs, and package-specific subdirectories, etc.
156
157 Having all the headers and libraries in a single place will greatly
158 reduce the number of -I and -L flags you will have to pass to the
159 configure script (see below), as these files will be right where the
160 compiler expects them.
161
162 We specifically do NOT recommend installing packages below
163 "C:\Program Files" or "C:\Program Files (x86)". These directories
164 are protected on versions of Windows from Vista and on, and you will
165 have difficulties updating and maintaining your installation later,
166 due to UAC elevation prompts, file virtualization, etc. You *have*
167 been warned!
168
169 Additional MinGW packages are required/recommended, especially if
170 you are building from the Bazaar repository:
171
172 . Texinfo (needed to produce the Info manuals when building from
173 bzr, and for "make install")
174
175 Available from http://sourceforge.net/projects/ezwinports/files/.
176
177 . gzip (needed to compress files during "make install")
178
179 Available from http://gnuwin32.sourceforge.net/packages/gzip.htm.
180
181 . pkg-config (needed for building with some optional libraries,
182 such as GnuTLS and libxml2)
183
184 Available from http://www.gtk.org/download/win32.php
185
186 Each package might list other packages as prerequisites on its
187 download page (under "Runtime requirements"); download those as
188 well. (Using the GUI installer mingw-get will fetch those
189 prerequisites automatically for you.) A missing prerequisite will
190 manifest itself by the program failing to run and presenting a
191 pop-up dialog that states the missing or incompatible DLL; be sure
192 to find and install these missing DLLs.
193
194 Once you think you have MinGW installed, test the installation by
195 building a trivial "hello, world!" program, and make sure that it
196 builds without any error messages and the binary works when run.
197
198*** MSYS
199
200 You will need a reasonably full MSYS installation. MSYS is an
201 environment needed to run the Posix configure scripts and the
202 resulting Makefile's, in order to produce native Windows binaries
203 using the MinGW compiler and runtime libraries. Here's the list of
204 MSYS packages that are required:
205
206 . All the packages from the MSYS Base distribution, listed here:
207
208 https://sourceforge.net/projects/mingw/files/MSYS/Base/
209
210 . Additional packages listed below, from the MSYS Extension
211 distribution here:
212
213 https://sourceforge.net/projects/mingw/files/MSYS/Extension/
214
215 - flex
216 - bison
217 - m4
218 - perl
219 - mktemp
220
221 These should only be needed if you intend to build development
222 versions of Emacs from the Bazaar repository.
223
224 . Additional packages (needed only if building from the Bazaar
225 repository): Automake and Autoconf. They are available from
226 here:
227
228 http://sourceforge.net/projects/ezwinports/files/automake-1.11.6-msys-bin.zip/download
229 http://sourceforge.net/projects/ezwinports/files/autoconf-2.65-msys-bin.zip/download
230
231 MSYS packages are distributed as .tar.lzma compressed archives. To
232 install the packages manually, we recommend to use the Windows port
233 of the 'bsdtar' program, already mentioned above.
234
235 If/when you are confident in your MinGW/MSYS installation, and want
236 to speed up the builds, we recommend installing a pre-release
237 version of Make from here:
238
239 https://sourceforge.net/projects/mingwbuilds/files/external-binary-packages/
240
241 These are snapshot builds of many packages, but you only need
242 make.exe from there. The advantage of this make.exe is that it
243 supports parallel builds, so you can use "make -j N" to considerably
244 speed up your builds
245
246 For each of these packages, install the 'bin' and 'dll' tarballs of
247 their latest stable releases. If there's an 'ext' tarball (e.g.,
248 msysCORE and Coreutils have it), download and install those as well.
249
250 Each package might list other packages as prerequisites on its
251 download page (under "Runtime requirements"); download those as
252 well. (Using the GUI installer mingw-get will fetch those
253 prerequisites automatically for you.) A missing prerequisite will
254 manifest itself by the program failing to run and presenting a
255 pop-up dialog that states the missing or incompatible DLL; be sure
256 to find and install these missing DLLs.
257
258 MSYS packages should be installed in a separate tree from MinGW.
259 For example, use D:\MSYS or D:\usr\MSYS as the top-level directory
260 from which you unpack all of the MSYS packages.
261
262 Do NOT add the MSYS bin directory to your Windows Path! Only the
263 MinGW bin directory should be on Path. When you install MSYS, it
264 creates a shortcut on your desktop that invokes the MSYS Bash shell
265 in a Command Prompt window; that shell is already set up so that the
266 MSYS bin directory is on PATH ahead of any other directory. Thus,
267 Bash will find MSYS executables first, which is exactly what you
268 need.
269
270 At this point, you are ready to build Emacs in its basic
271 configuration. If you want to build it with image support and other
272 optional libraries, read about that near the end of this document.
273
274* Generating the configure script
275
276 If you are building a release or pretest tarball, skip this section,
277 because the configure script is already present in the tarball.
278
279 To build a development snapshot from the Emacs Bazaar repository,
280 you will first need to generate the configure script and a few other
281 auto-generated files. (If this step, described below, somehow
282 fails, you can use the files in the autogen/ directory instead, but
283 they might be outdated, and, most importantly, you are well advised
284 not to disregard any failures in your local build procedures, as
285 these are likely to be symptoms of incorrect installation that will
286 bite you down the road.)
287
288 To generate the configure script, type this at the MSYS Bash prompt
289 from the top-level directory of the Emacs tree:
290
291 ./autogen.sh
292
293 If successful, this command should produce the following output:
294
295 $ ./autogen.sh
296 Checking whether you have the necessary tools...
297 (Read INSTALL.BZR for more details on building Emacs)
298
299 Checking for autoconf (need at least version 2.65)...
300 ok
301 Checking for automake (need at least version 1.11)...
302 ok
303 Your system has the required tools, running autoreconf...
304 You can now run `./configure'.
305
306* Configuring Emacs for MinGW:
307
308 Now it's time to run the configure script. You can do that either
309 from a separate build directory that is outside of the Emacs source
310 tree (recommended), or from inside the source tree. The former is
311 recommended because it allows you to have several different builds,
312 e.g., an optimized build and an unoptimized one, of the same
313 revision of the source tree; the source tree will be left in its
314 pristine state, without any build products.
315
316 You invoke the configure script like this:
317
318 /PATH/TO/EMACS/SOURCE/TREE/nt/msysconfig.sh --prefix=PREFIX ...
319
320 or, if you are building in-place, i.e. inside the source tree:
321
322 ./nt/msysconfig.sh --prefix=PREFIX ...
323
324 Here PREFIX is the place where you eventually want to install Emacs
325 once built, e.g. d:/usr.
326
327 You can pass additional options to the configure script, for the
328 full list type
329
330 ./nt/msysconfig.sh --help
331
332 As explained in the help text, you may need to tell the script what
333 are the optional flags to invoke the compiler. This is needed if
334 some of your headers and libraries, e.g., those belonging to
335 optional image libraries, are installed in places where the compiler
336 normally doesn't look for them. (Remember that advice above to
337 avoid such situations? here's is where you will start paying for
338 disregarding that recommendation.) For example, if you have libpng
339 headers in C:\emacs\libs\libpng-1.2.37-lib\include and jpeg library
340 headers in C:\emacs\libs\jpeg-6b-4-lib\include, you will need to say
341 something like this:
342
343 CPPFLAGS='-Ic:/emacs/libs/libpng-1.2.37-lib/include -Ic:/emacs/libs/jpeg-6b-4-lib/include' ./nt/msysconfig.sh --prefix=PREFIX
344
345 which is quite a mouth-full, especially if you have more directories
346 to specify... Perhaps you may wish to revisit your installation
347 decisions now.
348
349 A few frequently used options are needed when you want to produce an
350 unoptimized binary with runtime checks enabled:
351
352 CPPFLAGS='-DGLYPH_DEBUG=1' CFLAGS='-O0 -g3' ./nt/msysconfig.sh --prefix=PREFIX --enable-checking
353
354 Once invoked, the configure script will run for some time, and, if
355 successful, will eventually produce a summary of the configuration
356 like this:
357
358 Configured for `i686-pc-mingw32'.
359
360 Where should the build process find the source code? /path/to/emacs/sources
361 What compiler should emacs be built with? gcc -std=gnu99 -O0 -g3
362 Should Emacs use the GNU version of malloc? yes
363 Should Emacs use a relocating allocator for buffers? yes
364 Should Emacs use mmap(2) for buffer allocation? no
365 What window system should Emacs use? w32
366 What toolkit should Emacs use? none
367 Where do we find X Windows header files? NONE
368 Where do we find X Windows libraries? NONE
369 Does Emacs use -lXaw3d? no
370 Does Emacs use -lXpm? yes
371 Does Emacs use -ljpeg? yes
372 Does Emacs use -ltiff? yes
373 Does Emacs use a gif library? yes
374 Does Emacs use -lpng? yes
375 Does Emacs use -lrsvg-2? no
376 Does Emacs use imagemagick? no
377 Does Emacs use -lgpm? no
378 Does Emacs use -ldbus? no
379 Does Emacs use -lgconf? no
380 Does Emacs use GSettings? no
381 Does Emacs use -lselinux? no
382 Does Emacs use -lgnutls? yes
383 Does Emacs use -lxml2? yes
384 Does Emacs use -lfreetype? no
385 Does Emacs use -lm17n-flt? no
386 Does Emacs use -lotf? no
387 Does Emacs use -lxft? no
388 Does Emacs use toolkit scroll bars? yes
389
390 You are almost there, hang on.
391
392 If the output is significantly different, or if configure finishes
393 prematurely and displays some error message, you should examine the
394 configuration log in config.log and find the reason for the failure.
395
396 Once you succeeded in configuring Emacs, and just want to rebuild it
397 after updating your local repository from the main repository, you
398 don't need to re-run the configure script manually, unless you want
399 to change the configure-time options. Just typing "make" will
400 re-run configure if necessary with the exact same options you
401 specified originally, and then go on to invoking Make, described
402 below.
403
404* Running Make.
405
406 This is simple: just type "make" and sit back, watching the fun.
407
408 If you installed a snapshot build of Make, the build will be much
409 faster if you type "make -j N" instead, where N is the number of
410 independent processing units on your machine. E.g., on a core i7
411 system try using N of 6 or even 8.
412
413 When Make finishes, you can install the produced binaries:
414
415 make install
416
417 or, if you want the installed tree to go in a place different from
418 the configured one, type
419
420 make install prefix=WHEREVER
421
422 Congrats! You have built and installed your own Emacs!
423
424* Make targets
425
426 The following make targets may be used by users building the source
427 distribution, or users who have checked out of Bazaar after
428 an initial bootstrapping.
429
430 make
431 Builds Emacs from the available sources and pre-compiled lisp files.
432
433 make install
434 Installs the built programs and the auxiliary files.
435
436 make clean
437 Removes object and executable files produced by the build process in
438 the current configuration. After "make clean", you can rebuild with
439 the same configuration using make. useful when you want to be sure
440 that all of the products are built from coherent sources.
441
442 make distclean
443 In addition to the files removed by make clean, this also removes
444 Makefiles and other generated files to get back to the state of a
445 freshly unpacked source distribution. After make distclean, it is
446 necessary to run the configure script followed by "make", in order
447 to rebuild.
448
449 The following targets are intended only for use with the Bazaar sources.
450
451 make bootstrap
452 Removes all the auto-generated files and all the *.elc byte-compiled
453 files, and builds Emacs from scratch. Useful when some change in
454 basic Emacs functionality makes byte compilation of updated files
455 fail.
456
457 make maintainer-clean
458 Removes everything that can be recreated, including compiled Lisp
459 files, to get back to the state of a fresh Bazaar tree. After make
460 maintainer-clean, it is necessary to run configure and "make" or
461 "make bootstrap" to rebuild. Occasionally it may be necessary to
462 run this target after an update.
463
464* Optional image library support
465
466 In addition to its "native" image formats (pbm and xbm), Emacs can
467 handle other image types: xpm, tiff, gif, png, jpeg and experimental
468 support for svg.
469
470 To build Emacs with support for them, the corresponding headers must
471 be in the include path and libraries should be where the linker
472 looks for them, when the configure script is run. If needed, this
473 can be set up using the CPPFLAGS and CFLAGS variable specified on
474 the configure command line. The configure script will report
475 whether it was able to detect the headers and libraries. If the
476 results of this testing appear to be incorrect, please look for
477 details in the file config.log: it will show the failed test
478 programs and compiler error messages that should explain what is
479 wrong. (Usually, any such failures happen because some headers are
480 missing due to bad packaging of the image support libraries.)
481
482 Note that any file path passed to the compiler or linker must use
483 forward slashes, or double each backslash, as that is how Bash
484 works.
485
486 If the configure script finds the necessary headers and libraries,
487 but they are for some reason incompatible, or if you want to omit
488 support for some image library that is installed on your system for
489 some other reason, use the --without-PACKAGE option to configure,
490 such as --without-gif to omit GIF, --without-tiff to omit TIFF, etc.
491 Passing the --help option to the configure script displays all of
492 the supported --without-PACKAGE options.
493
494 To use the external image support, the DLLs implementing the
495 functionality must be found when Emacs first needs them, either on the
496 PATH, or in the same directory as emacs.exe. Failure to find a
497 library is not an error; the associated image format will simply be
498 unavailable. Note that once Emacs has determined that a library can
499 not be found, there's no way to force it to try again, other than
500 restarting. See the variable `dynamic-library-alist' to configure the
501 expected names of the libraries.
502
503 Some image libraries have dependencies on one another, or on zlib.
504 For example, tiff support depends on the jpeg library. If you did not
505 compile the libraries yourself, you must make sure that any dependency
506 is in the PATH or otherwise accessible and that the binaries are
507 compatible (for example, that they were built with the same compiler).
508
509 Binaries for the image libraries (among many others) can be found at
510 the GnuWin32 project. PNG, JPEG and TIFF libraries are also
511 included with GTK, which is installed along with other Free Software
512 that requires it. Note specifically that, due to some packaging
513 snafus in the GnuWin32-supplied image libraries, you will need to
514 download _source_ packages for some of the libraries in order to get
515 the header files necessary for building Emacs with image support.
516
517 For PNG images, we recommend to use versions 1.4.x and later of
518 libpng, because previous versions had security issues. You can find
519 precompiled libraries and headers on the GTK download page for
520 Windows (http://www.gtk.org/download/win32.php).
521
522 Versions 1.4.0 and later of libpng are binary incompatible with
523 earlier versions, so Emacs will only look for libpng libraries which
524 are compatible with the version it was compiled against. That
525 version is given by the value of the Lisp variable `libpng-version';
526 e.g., 10403 means version 1.4.3. The variable `dynamic-library-alist'
527 is automatically set to name only those DLL names that are known to
528 be compatible with the version given by `libpng-version'. If PNG
529 support does not work for you even though you have the support DLL
530 installed, check the name of the installed DLL against
531 `dynamic-library-alist' and the value of `libpng-version', and
532 download compatible DLLs if needed.
533
534* Optional GnuTLS support
535
536 To compile with GnuTLS, you will need pkg-config to be installed, as
537 the configure script invokes pkg-config to find out which compiler
538 switches to use for GnuTLS. See above for the URL where you can
539 find pkg-config for Windows.
540
541 You will also need to install the p11-kit package, which is a
542 dependency of GnuTLS, and its header files are needed for
543 compilation of programs that use GnuTLS. You can find p11-kit on
544 the same site as GnuTLS, see the URL below.
545
546 If the configure script finds the GnuTLS header files and libraries
547 on your system, Emacs is built with GnuTLS support by default; to
548 avoid that you can pass the argument --without-gnutls.
549
550 In order to support GnuTLS at runtime, a GnuTLS-enabled Emacs must
551 be able to find the relevant DLLs during startup; failure to do so
552 is not an error, but GnuTLS won't be available to the running
553 session.
554
555 You can get pre-built binaries (including any required DLL and the
556 header files) at http://sourceforge.net/projects/ezwinports/files/.
557
558* Optional libxml2 support
559
560 To compile with libxml2, you will need pkg-config to be installed,
561 as the configure script invokes pkg-config to find out which
562 compiler switches to use for libxml2. See above for the URL where
563 you can find pkg-config for Windows.
564
565 If the configure script finds the libxml2 header files and libraries
566 on your system, Emacs is built with libxml2 support by default; to
567 avoid that you can pass the argument --without-libxml2.
568
569 In order to support libxml2 at runtime, a libxml2-enabled Emacs must
570 be able to find the relevant DLLs during startup; failure to do so
571 is not an error, but libxml2 features won't be available to the
572 running session.
573
574 One place where you can get pre-built Windows binaries of libxml2
575 (including any required DLL and the header files) is here:
576
577 http://sourceforge.net/projects/ezwinports/files/
578
579 For runtime support of libxml2, you will also need to install the
580 libiconv "development" tarball, because the libiconv headers need to
581 be available to the compiler when you compile with libxml2 support.
582 A MinGW port of libiconv can be found on the MinGW site:
583
584 http://sourceforge.net/projects/mingw/files/MinGW/Base/libiconv/
585
586 You need the libiconv-X.Y.Z-N-mingw32-dev.tar.lzma tarball from that
587 site.
588
589* Experimental SVG support
590
591 To compile with SVG, you will need pkg-config to be installed, as
592 the configure script invokes pkg-config to find out which compiler
593 switches to use for SVG. See above for the URL where you can find
594 pkg-config for Windows.
595
596 SVG support is currently experimental, and not built by default.
597 Specify --with-rsvg and ensure you have all the dependencies in your
598 include path. Unless you have built a minimalist librsvg yourself
599 (untested), librsvg depends on a significant chunk of GTK+ to build,
600 plus a few Gnome libraries, libxml2, libbz2 and zlib at runtime. The
601 easiest way to obtain the dependencies required for building is to
602 download a pre-bundled GTK+ development environment for Windows.
603
604 To use librsvg at runtime, ensure that librsvg and its dependencies
605 are on your PATH. If you didn't build librsvg yourself, you will
606 need to check with where you downloaded it from for the
607 dependencies, as there are different build options. If it is a
608 short list, then it most likely only lists the immediate
609 dependencies of librsvg, but the dependencies themselves have
610 dependencies - so don't download individual libraries from GTK+,
611 download and install the whole thing. If you think you've got all
612 the dependencies and SVG support is still not working, check your
613 PATH for other libraries that shadow the ones you downloaded.
614 Libraries of the same name from different sources may not be
615 compatible, this problem was encountered with libbzip2 from GnuWin32
616 with libcroco from gnome.org.
617
618 If you can see etc/images/splash.svg, then you have managed to get
619 SVG support working. Congratulations for making it through DLL hell
620 to this point. You'll probably find that some SVG images crash
621 Emacs. Problems have been observed in some images that contain
622 text, they seem to be a problem in the Windows port of Pango, or
623 maybe a problem with the way Cairo or librsvg is using it that
624 doesn't show up on other platforms.
625
626
627This file is part of GNU Emacs.
628
629GNU Emacs is free software: you can redistribute it and/or modify
630it under the terms of the GNU General Public License as published by
631the Free Software Foundation, either version 3 of the License, or
632(at your option) any later version.
633
634GNU Emacs is distributed in the hope that it will be useful,
635but WITHOUT ANY WARRANTY; without even the implied warranty of
636MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
637GNU General Public License for more details.
638
639You should have received a copy of the GNU General Public License
640along 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 @@
1# nt/Makefile for GNU Emacs.
2
3# Copyright (C) 2013 Free Software Foundation, Inc.
4
5# This file is part of GNU Emacs.
6
7# GNU Emacs is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11
12# GNU Emacs is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16
17# You should have received a copy of the GNU General Public License
18# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
19
20# Avoid trouble on systems where the `SHELL' variable might be
21# inherited from the environment.
22SHELL = /bin/sh
23
24# ==================== Things `configure' will edit ====================
25
26CC=@CC@
27CFLAGS=@CFLAGS@
28version=@version@
29## Used in $archlibdir.
30configuration=@configuration@
31EXEEXT=@EXEEXT@
32C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
33C_SWITCH_MACHINE=@C_SWITCH_MACHINE@
34PROFILING_CFLAGS = @PROFILING_CFLAGS@
35WARN_CFLAGS = @WARN_CFLAGS@
36WERROR_CFLAGS = @WERROR_CFLAGS@
37
38# Program name transformation.
39TRANSFORM = @program_transform_name@
40
41# ==================== Where To Install Things ====================
42
43# The default location for installation. Everything is placed in
44# subdirectories of this directory. The default values for many of
45# the variables below are expressed in terms of this one, so you may
46# not need to change them. This is set with the --prefix option to
47# `../configure'.
48prefix=@prefix@
49
50# Like `prefix', but used for architecture-specific files. This is
51# set with the --exec-prefix option to `../configure'.
52exec_prefix=@exec_prefix@
53
54# Where to install Emacs and other binaries that people will want to
55# run directly (like etags). This is set with the --bindir option
56# to `../configure'.
57bindir=@bindir@
58
59# Where to install and expect executable files to be run by Emacs
60# rather than directly by users, and other architecture-dependent
61# data. ${archlibdir} is usually below this. This is set with the
62# --libexecdir option to `../configure'.
63libexecdir=@libexecdir@
64
65# Directory for local state files for all programs.
66localstatedir=@localstatedir@
67
68# Where to find the source code. This is set by the configure
69# script's `--srcdir' option. However, the value of ${srcdir} in
70# this makefile is not identical to what was specified with --srcdir,
71# since the variable here has `/lib-src' added at the end.
72
73# We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
74srcdir=@srcdir@
75VPATH=@srcdir@
76
77# The top-level source directory, also set by configure.
78top_srcdir=@top_srcdir@
79
80# ==================== Emacs-specific directories ====================
81
82# These variables hold the values Emacs will actually use. They are
83# based on the values of the standard Make variables above.
84
85# Where to put executables to be run by Emacs rather than the user.
86# This path usually includes the Emacs version and configuration name,
87# so that multiple configurations for multiple versions of Emacs may
88# be installed at once. This can be set with the --archlibdir option
89# to `../configure'.
90archlibdir=@archlibdir@
91
92# ==================== Utility Programs for the Build =================
93
94# ../configure figures out the correct values for these.
95INSTALL = @INSTALL@
96INSTALL_PROGRAM = @INSTALL_PROGRAM@
97INSTALL_SCRIPT = @INSTALL_SCRIPT@
98# By default, we uphold the dignity of our programs.
99INSTALL_STRIP =
100MKDIR_P = @MKDIR_P@
101
102# ========================== Lists of Files ===========================
103
104# Things that a user might actually run, which should be installed in bindir.
105INSTALLABLES = runemacs${EXEEXT} addpm${EXEEXT}
106
107# Things that Emacs runs internally, which should not be installed in bindir.
108UTILITIES = cmdproxy${EXEEXT} ddeclient${EXEEXT}
109
110# Things that Emacs runs during the build process.
111DONT_INSTALL = addsection${EXEEXT}
112
113# All files that are created by the linker, i.e., whose names end in ${EXEEXT}.
114EXE_FILES = ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
115
116# =========================== Configuration ===========================
117
118# MS-Windows resource files and resource compiler
119EMACSRES = @EMACSRES@
120EMACS_MANIFEST = @EMACS_MANIFEST@
121WINDRES = @WINDRES@
122
123## Extra libraries to use when linking addpm.
124LIBS_ADDPM = -lole32 -luuid
125
126## Compilation and linking flags
127BASE_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) \
128 $(WARN_CFLAGS) $(WERROR_CFLAGS) \
129 -I. -I${srcdir}
130
131ALL_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
132LINK_CFLAGS = ${BASE_CFLAGS} ${LDFLAGS} ${CFLAGS}
133CPP_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${CPPFLAGS} ${CFLAGS}
134
135all: ${EXE_FILES}
136
137.PHONY: all
138
139## Install the internal utilities. Until they are installed, we can
140## just run them directly from nt/.
141$(DESTDIR)${archlibdir}: all
142 @echo
143 @echo "Installing utilities run internally by Emacs."
144 umask 022; ${MKDIR_P} $(DESTDIR)${archlibdir}
145 if [ `cd $(DESTDIR)${archlibdir} && /bin/pwd` != `/bin/pwd` ]; then \
146 for file in ${UTILITIES}; do \
147 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $$file $(DESTDIR)${archlibdir}/$$file ; \
148 done ; \
149 fi
150
151.PHONY: install uninstall mostlyclean clean distclean maintainer-clean
152.PHONY: extraclean check tags
153
154install: $(DESTDIR)${archlibdir}
155 @echo
156 @echo "Installing utilities for users to run."
157 umask 022; ${MKDIR_P} $(DESTDIR)${bindir}
158 for file in ${INSTALLABLES} ; do \
159 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} $(DESTDIR)${bindir}/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \
160 done
161
162uninstall:
163 for file in ${INSTALLABLES}; do \
164 rm -f $(DESTDIR)${bindir}/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \
165 done
166 if [ -d $(DESTDIR)${archlibdir} ]; then \
167 (cd $(DESTDIR)${archlibdir} && rm -f ${UTILITIES}) \
168 fi
169
170mostlyclean:
171 -rm -f core *.o
172
173clean: mostlyclean
174 -rm -f ${EXE_FILES}
175
176distclean: clean
177 -rm -f TAGS
178 -rm -f Makefile
179
180maintainer-clean: distclean
181 true
182
183extraclean: maintainer-clean
184 -rm -f *~ \#*
185
186## Test the contents of the directory.
187check:
188 @echo "We don't have any tests for the nt/ directory yet."
189
190tags: TAGS
191TAGS: ${EXE_FILES:${EXEEXT}=.c}
192 ../lib-src/etags *.[ch]
193
194## Build the programs
195addsection${EXEEXT}: ${srcdir}/addsection.c
196 $(CC) ${ALL_CFLAGS} ${srcdir}/addsection.c -o addsection${EXEEXT}
197
198addpm${EXEEXT}: ${srcdir}/addpm.c ../src/epaths.h
199 $(CC) ${ALL_CFLAGS} ${srcdir}/addpm.c $(LIBS_ADDPM) -o addpm${EXEEXT}
200
201ddeclient${EXEEXT}: ${srcdir}/ddeclient.c
202 $(CC) ${ALL_CFLAGS} ${srcdir}/ddeclient.c -o ddeclient${EXEEXT}
203
204cmdproxy${EXEEXT}: ${srcdir}/cmdproxy.c
205 $(CC) ${ALL_CFLAGS} ${srcdir}/cmdproxy.c -o cmdproxy${EXEEXT}
206
207runemacs${EXEEXT}: ${srcdir}/runemacs.c $(EMACSRES)
208 $(CC) ${ALL_CFLAGS} ${srcdir}/runemacs.c $(EMACSRES) -mwindows \
209 -o runemacs${EXEEXT}
210
211emacs.res: ${srcdir}/emacs.rc ${srcdir}/icons/emacs.ico ${srcdir}/$(EMACS_MANIFEST)
212 ${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/>. */
50#include <shlobj.h> 50#include <shlobj.h>
51#include <ddeml.h> 51#include <ddeml.h>
52 52
53#ifndef OLD_PATHS
54#include "../src/epaths.h"
55#endif
56
53HDDEDATA CALLBACK 57HDDEDATA CALLBACK
54DdeCallback (UINT uType, UINT uFmt, HCONV hconv, 58DdeCallback (UINT uType, UINT uFmt, HCONV hconv,
55 HSZ hsz1, HSZ hsz2, HDDEDATA hdata, 59 HSZ hsz1, HSZ hsz2, HDDEDATA hdata,
@@ -76,6 +80,7 @@ static struct entry
76} 80}
77env_vars[] = 81env_vars[] =
78{ 82{
83#ifdef OLD_PATHS
79 {"emacs_dir", NULL}, 84 {"emacs_dir", NULL},
80 {"EMACSLOADPATH", "%emacs_dir%/site-lisp;%emacs_dir%/../site-lisp;%emacs_dir%/lisp;%emacs_dir%/leim"}, 85 {"EMACSLOADPATH", "%emacs_dir%/site-lisp;%emacs_dir%/../site-lisp;%emacs_dir%/lisp;%emacs_dir%/leim"},
81 {"SHELL", "%emacs_dir%/bin/cmdproxy.exe"}, 86 {"SHELL", "%emacs_dir%/bin/cmdproxy.exe"},
@@ -86,6 +91,18 @@ env_vars[] =
86 /* {"INFOPATH", "%emacs_dir%/info"}, */ 91 /* {"INFOPATH", "%emacs_dir%/info"}, */
87 {"EMACSDOC", "%emacs_dir%/etc"}, 92 {"EMACSDOC", "%emacs_dir%/etc"},
88 {"TERM", "cmd"} 93 {"TERM", "cmd"}
94#else /* !OLD_PATHS */
95 {"emacs_dir", NULL},
96 {"EMACSLOADPATH", PATH_SITELOADSEARCH ";" PATH_LOADSEARCH},
97 {"SHELL", PATH_EXEC "/cmdproxy.exe"},
98 {"EMACSDATA", PATH_DATA},
99 {"EMACSPATH", PATH_EXEC},
100 /* We no longer set INFOPATH because Info-default-directory-list
101 is then ignored. */
102 /* {"INFOPATH", "%emacs_dir%/info"}, */
103 {"EMACSDOC", PATH_DOC},
104 {"TERM", "cmd"}
105#endif
89}; 106};
90 107
91BOOL 108BOOL
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 @@
1/* Hey Emacs, this is -*- C -*- code! */
2/* epaths.in file for MS-Windows build that uses the configure script.
3
4 Since Emacs on Windows must be relocatable to any directory, it
5 cannot have here hard-coded directories determined at configure
6 time. Therefore, each directory must begin with %emacs_dir%, which
7 is resolved at startup to the root of the Emacs installation tree
8 (see w32.c:init_environment).
9
10 This file is edited at configure time to replace @VER@ by the Emacs
11 version being built (e.g., 25.9.77), @CFG@ by the canonical name of
12 the host system (e.g., i686-pc-mingw32), and @SRC@ by the root of
13 the Emacs source tree used to build Emacs. */
14/*
15Copyright (C) 1993, 1995, 1997, 1999, 2001-2013 Free Software
16Foundation, Inc.
17
18This file is part of GNU Emacs.
19
20GNU Emacs is free software: you can redistribute it and/or modify
21it under the terms of the GNU General Public License as published by
22the Free Software Foundation, either version 3 of the License, or
23(at your option) any later version.
24
25GNU Emacs is distributed in the hope that it will be useful,
26but WITHOUT ANY WARRANTY; without even the implied warranty of
27MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28GNU General Public License for more details.
29
30You should have received a copy of the GNU General Public License
31along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
32
33
34/* Together with PATH_SITELOADSEARCH, this gives the default value of
35 load-path, which is the search path for the Lisp function "load".
36 Configure (using "make epaths-force") sets this to
37 ${standardlisppath}, which typically has a value like:
38 <datadir>/emacs/VERSION/lisp:<datadir>/emacs/VERSION/leim
39 where datadir is eg /usr/local/share.
40*/
41#define PATH_LOADSEARCH "%emacs_dir%/share/emacs/@VER@/lisp;%emacs_dir%/share/emacs/@VER@/leim"
42
43/* Like PATH_LOADSEARCH, but contains the non-standard pieces.
44 These are the site-lisp directories, typically something like
45 <datadir>/emacs/VERSION/site-lisp:<datadir>/emacs/site-lisp
46 Configure prepends any $locallisppath, as set by the
47 --enable-locallisppath argument.
48 This is combined with PATH_LOADSEARCH to make the default load-path.
49 If the --no-site-lisp option is used, this piece is excluded.
50*/
51#define PATH_SITELOADSEARCH "%emacs_dir%/share/emacs/@VER@/site-lisp;%emacs_dir%/share/emacs/site-lisp"
52
53/* Like PATH_LOADSEARCH, but used only during the build process
54 when Emacs is dumping. Configure (using "make epaths-force") sets
55 this to $buildlisppath, which normally has the value: <srcdir>/lisp.
56*/
57#define PATH_DUMPLOADSEARCH "@SRC@/lisp"
58
59/* The extra search path for programs to invoke. This is appended to
60 whatever the PATH environment variable says to set the Lisp
61 variable exec-path and the first file name in it sets the Lisp
62 variable exec-directory. exec-directory is used for finding
63 executables and other architecture-dependent files. */
64#define PATH_EXEC "%emacs_dir%/libexec/emacs/@VER@/@CFG@"
65
66/* Where Emacs should look for its architecture-independent data
67 files, like the NEWS file. The lisp variable data-directory
68 is set to this value. */
69#define PATH_DATA "%emacs_dir%/share/emacs/@VER@/etc"
70
71/* Where Emacs should look for X bitmap files.
72 The lisp variable x-bitmap-file-path is set based on this value. */
73#define PATH_BITMAPS ""
74
75/* Where Emacs should look for its docstring file. The lisp variable
76 doc-directory is set to this value. */
77#define PATH_DOC "%emacs_dir%/share/emacs/@VER@/etc"
78
79/* Where the configuration process believes the info tree lives. The
80 lisp variable configure-info-directory gets its value from this
81 macro, and is then used to set the Info-default-directory-list. */
82#define PATH_INFO "%emacs_dir%/share/info"
83
84/* Where Emacs should store game score files. */
85#define PATH_GAME "%emacs_dir%/var/games/emacs"
86
87/* Where Emacs should look for the application default file. */
88#define PATH_X_DEFAULTS ""
89
diff --git a/nt/gnulib.mk b/nt/gnulib.mk
new file mode 100644
index 00000000000..ac4fc2768d9
--- /dev/null
+++ b/nt/gnulib.mk
@@ -0,0 +1,902 @@
1## This file is an edited copy if ../lib/gnulib.mk.
2##
3## The purpose of the edits is to avoid generating any headers
4## which would conflict with either the headers we have in nt/inc,
5## or with MinGW system headers and subsequent redirection of some
6## functions in nt/inc/ms-w32.h.
7##
8## In general, do NOT remove anything from ../lib/gnulib.mk that
9## doesn't need to be removed, to minimize the differences from
10## upstream gnulib.mk and thus make the maintenance easier. Every
11## header file whose generation is controlled by configure-time tests
12## does NOT need to be removed; instead, force the configure script to
13## accept whatever MinGW has to offer, by defining the appropriate
14## Autoconf variable in the nt/mingw-cfg.site file. Headers that are
15## generated conditionally have the tell-tale "if GL_GENERATE_foo_H"
16## condition before their Makefile snippet in this file. Likewise, do
17## NOT remove gnulib modules which introduce header files that don't
18## exist in MinGW and in nt/inc/, since they cannot possibly clash
19## with anything. Gnulib modules that introduce source *.c files also
20## need not be removed; if they define functions that could clash with
21## the w32 substitutes in Emacs, disable their compilation by defining
22## suitable variables in nt/mingw-cfg.site.
23##
24## Process this file with automake to produce Makefile.in.
25# Copyright (C) 2002-2013 Free Software Foundation, Inc.
26#
27# This file is free software; you can redistribute it and/or modify
28# it under the terms of the GNU General Public License as published by
29# the Free Software Foundation; either version 3 of the License, or
30# (at your option) any later version.
31#
32# This file is distributed in the hope that it will be useful,
33# but WITHOUT ANY WARRANTY; without even the implied warranty of
34# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35# GNU General Public License for more details.
36#
37# You should have received a copy of the GNU General Public License
38# along with this file. If not, see <http://www.gnu.org/licenses/>.
39#
40# As a special exception to the GNU General Public License,
41# this file may be distributed as part of a program that
42# contains a configuration script generated by Autoconf, under
43# the same distribution terms as the rest of that program.
44#
45# Generated by gnulib-tool.
46# 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=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 qacl 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
47
48
49MOSTLYCLEANFILES += core *.stackdump
50
51noinst_LIBRARIES += libgnu.a
52
53libgnu_a_SOURCES =
54libgnu_a_LIBADD = $(gl_LIBOBJS)
55libgnu_a_DEPENDENCIES = $(gl_LIBOBJS)
56EXTRA_libgnu_a_SOURCES =
57
58## begin gnulib module alloca-opt
59
60BUILT_SOURCES += $(ALLOCA_H)
61
62# We need the following in order to create <alloca.h> when the system
63# doesn't have one that works with the given compiler.
64if GL_GENERATE_ALLOCA_H
65alloca.h: alloca.in.h $(top_builddir)/config.status
66 $(AM_V_GEN)rm -f $@-t $@ && \
67 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
68 cat $(srcdir)/alloca.in.h; \
69 } > $@-t && \
70 mv -f $@-t $@
71else
72alloca.h: $(top_builddir)/config.status
73 rm -f $@
74endif
75MOSTLYCLEANFILES += alloca.h alloca.h-t
76
77EXTRA_DIST += alloca.in.h
78
79## end gnulib module alloca-opt
80
81## begin gnulib module c-ctype
82
83libgnu_a_SOURCES += c-ctype.h c-ctype.c
84
85## end gnulib module c-ctype
86
87## begin gnulib module c-strcase
88
89libgnu_a_SOURCES += c-strcase.h c-strcasecmp.c c-strncasecmp.c
90
91## end gnulib module c-strcase
92
93## begin gnulib module close-stream
94
95libgnu_a_SOURCES += close-stream.c
96
97EXTRA_DIST += close-stream.h
98
99## end gnulib module close-stream
100
101## begin gnulib module crypto/md5
102
103libgnu_a_SOURCES += md5.c
104
105EXTRA_DIST += md5.h
106
107## end gnulib module crypto/md5
108
109## begin gnulib module crypto/sha1
110
111libgnu_a_SOURCES += sha1.c
112
113EXTRA_DIST += sha1.h
114
115## end gnulib module crypto/sha1
116
117## begin gnulib module crypto/sha256
118
119libgnu_a_SOURCES += sha256.c
120
121EXTRA_DIST += sha256.h
122
123## end gnulib module crypto/sha256
124
125## begin gnulib module crypto/sha512
126
127libgnu_a_SOURCES += sha512.c
128
129EXTRA_DIST += sha512.h
130
131## end gnulib module crypto/sha512
132
133## begin gnulib module dosname
134
135if gl_GNULIB_ENABLED_dosname
136
137endif
138EXTRA_DIST += dosname.h
139
140## end gnulib module dosname
141
142## begin gnulib module dtoastr
143
144libgnu_a_SOURCES += dtoastr.c
145
146EXTRA_DIST += ftoastr.c ftoastr.h
147
148EXTRA_libgnu_a_SOURCES += ftoastr.c
149
150## end gnulib module dtoastr
151
152## begin gnulib module dtotimespec
153
154libgnu_a_SOURCES += dtotimespec.c
155
156## end gnulib module dtotimespec
157
158## begin gnulib module dup2
159
160
161EXTRA_DIST += dup2.c
162
163EXTRA_libgnu_a_SOURCES += dup2.c
164
165## end gnulib module dup2
166
167## begin gnulib module errno
168
169BUILT_SOURCES += $(ERRNO_H)
170
171# We need the following in order to create <errno.h> when the system
172# doesn't have one that is POSIX compliant.
173if GL_GENERATE_ERRNO_H
174errno.h: errno.in.h $(top_builddir)/config.status
175 $(AM_V_GEN)rm -f $@-t $@ && \
176 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
177 sed -e 's|@''GUARD_PREFIX''@|GL|g' \
178 -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
179 -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
180 -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
181 -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \
182 -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \
183 -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \
184 -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \
185 -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \
186 -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \
187 -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \
188 < $(srcdir)/errno.in.h; \
189 } > $@-t && \
190 mv $@-t $@
191else
192errno.h: $(top_builddir)/config.status
193 rm -f $@
194endif
195MOSTLYCLEANFILES += errno.h errno.h-t
196
197EXTRA_DIST += errno.in.h
198
199## end gnulib module errno
200
201## begin gnulib module euidaccess
202
203if gl_GNULIB_ENABLED_euidaccess
204
205endif
206EXTRA_DIST += euidaccess.c
207
208EXTRA_libgnu_a_SOURCES += euidaccess.c
209
210## end gnulib module euidaccess
211
212## begin gnulib module execinfo
213
214BUILT_SOURCES += $(EXECINFO_H)
215
216# We need the following in order to create <execinfo.h> when the system
217# doesn't have one that works.
218if GL_GENERATE_EXECINFO_H
219execinfo.h: execinfo.in.h $(top_builddir)/config.status
220 $(AM_V_GEN)rm -f $@-t $@ && \
221 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
222 cat $(srcdir)/execinfo.in.h; \
223 } > $@-t && \
224 mv $@-t $@
225else
226execinfo.h: $(top_builddir)/config.status
227 rm -f $@
228endif
229MOSTLYCLEANFILES += execinfo.h execinfo.h-t
230
231EXTRA_DIST += execinfo.c execinfo.in.h
232
233EXTRA_libgnu_a_SOURCES += execinfo.c
234
235## end gnulib module execinfo
236
237## begin gnulib module faccessat
238
239
240EXTRA_DIST += at-func.c faccessat.c
241
242EXTRA_libgnu_a_SOURCES += at-func.c faccessat.c
243
244## end gnulib module faccessat
245
246## begin gnulib module fdatasync
247
248
249EXTRA_DIST += fdatasync.c
250
251EXTRA_libgnu_a_SOURCES += fdatasync.c
252
253## end gnulib module fdatasync
254
255## begin gnulib module fdopendir
256
257
258EXTRA_DIST += fdopendir.c
259
260EXTRA_libgnu_a_SOURCES += fdopendir.c
261
262## end gnulib module fdopendir
263
264## begin gnulib module filemode
265
266libgnu_a_SOURCES += filemode.c
267
268EXTRA_DIST += filemode.h
269
270## end gnulib module filemode
271
272## begin gnulib module fpending
273
274
275EXTRA_DIST += fpending.c fpending.h
276
277EXTRA_libgnu_a_SOURCES += fpending.c
278
279## end gnulib module fpending
280
281## begin gnulib module fstatat
282
283
284EXTRA_DIST += at-func.c fstatat.c
285
286EXTRA_libgnu_a_SOURCES += at-func.c fstatat.c
287
288## end gnulib module fstatat
289
290## begin gnulib module fsync
291
292
293EXTRA_DIST += fsync.c
294
295EXTRA_libgnu_a_SOURCES += fsync.c
296
297## end gnulib module fsync
298
299## begin gnulib module getgroups
300
301if gl_GNULIB_ENABLED_getgroups
302
303endif
304EXTRA_DIST += getgroups.c
305
306EXTRA_libgnu_a_SOURCES += getgroups.c
307
308## end gnulib module getgroups
309
310## begin gnulib module getloadavg
311
312
313EXTRA_DIST += getloadavg.c
314
315EXTRA_libgnu_a_SOURCES += getloadavg.c
316
317## end gnulib module getloadavg
318
319## begin gnulib module getopt-posix
320
321BUILT_SOURCES += $(GETOPT_H)
322
323# We need the following in order to create <getopt.h> when the system
324# doesn't have one that works with the given compiler.
325getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
326 $(AM_V_GEN)rm -f $@-t $@ && \
327 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
328 sed -e 's|@''GUARD_PREFIX''@|GL|g' \
329 -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \
330 -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
331 -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
332 -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
333 -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \
334 -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
335 < $(srcdir)/getopt.in.h; \
336 } > $@-t && \
337 mv -f $@-t $@
338MOSTLYCLEANFILES += getopt.h getopt.h-t
339
340EXTRA_DIST += getopt.c getopt.in.h getopt1.c getopt_int.h
341
342EXTRA_libgnu_a_SOURCES += getopt.c getopt1.c
343
344## end gnulib module getopt-posix
345
346## begin gnulib module gettext-h
347
348if gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36
349libgnu_a_SOURCES += gettext.h
350
351endif
352## end gnulib module gettext-h
353
354## begin gnulib module gettime
355
356libgnu_a_SOURCES += gettime.c
357
358## end gnulib module gettime
359
360## begin gnulib module gettimeofday
361
362
363EXTRA_DIST += gettimeofday.c
364
365EXTRA_libgnu_a_SOURCES += gettimeofday.c
366
367## end gnulib module gettimeofday
368
369## begin gnulib module group-member
370
371if gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1
372
373endif
374EXTRA_DIST += group-member.c
375
376EXTRA_libgnu_a_SOURCES += group-member.c
377
378## end gnulib module group-member
379
380## begin gnulib module ignore-value
381
382
383EXTRA_DIST += ignore-value.h
384
385## end gnulib module ignore-value
386
387## begin gnulib module intprops
388
389
390EXTRA_DIST += intprops.h
391
392## end gnulib module intprops
393
394## begin gnulib module lstat
395
396
397EXTRA_DIST += lstat.c
398
399EXTRA_libgnu_a_SOURCES += lstat.c
400
401## end gnulib module lstat
402
403## begin gnulib module memrchr
404
405
406EXTRA_DIST += memrchr.c
407
408EXTRA_libgnu_a_SOURCES += memrchr.c
409
410## end gnulib module memrchr
411
412## begin gnulib module mktime
413
414
415EXTRA_DIST += mktime-internal.h mktime.c
416
417EXTRA_libgnu_a_SOURCES += mktime.c
418
419## end gnulib module mktime
420
421## begin gnulib module openat-h
422
423if gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7
424
425endif
426EXTRA_DIST += openat.h
427
428## end gnulib module openat-h
429
430## begin gnulib module pathmax
431
432if gl_GNULIB_ENABLED_pathmax
433
434endif
435EXTRA_DIST += pathmax.h
436
437## end gnulib module pathmax
438
439## begin gnulib module pselect
440
441
442EXTRA_DIST += pselect.c
443
444EXTRA_libgnu_a_SOURCES += pselect.c
445
446## end gnulib module pselect
447
448## begin gnulib module pthread_sigmask
449
450
451EXTRA_DIST += pthread_sigmask.c
452
453EXTRA_libgnu_a_SOURCES += pthread_sigmask.c
454
455## end gnulib module pthread_sigmask
456
457## begin gnulib module putenv
458
459
460EXTRA_DIST += putenv.c
461
462EXTRA_libgnu_a_SOURCES += putenv.c
463
464## end gnulib module putenv
465
466## begin gnulib module qacl
467
468libgnu_a_SOURCES += acl-errno-valid.c file-has-acl.c qcopy-acl.c
469
470EXTRA_DIST += acl-internal.h acl.h acl_entries.c
471
472EXTRA_libgnu_a_SOURCES += acl_entries.c
473
474## end gnulib module qacl
475
476## begin gnulib module readlink
477
478
479EXTRA_DIST += readlink.c
480
481EXTRA_libgnu_a_SOURCES += readlink.c
482
483## end gnulib module readlink
484
485## begin gnulib module readlinkat
486
487
488EXTRA_DIST += at-func.c readlinkat.c
489
490EXTRA_libgnu_a_SOURCES += at-func.c readlinkat.c
491
492## end gnulib module readlinkat
493
494## begin gnulib module root-uid
495
496if gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c
497
498endif
499EXTRA_DIST += root-uid.h
500
501## end gnulib module root-uid
502
503## begin gnulib module sig2str
504
505
506EXTRA_DIST += sig2str.c sig2str.h
507
508EXTRA_libgnu_a_SOURCES += sig2str.c
509
510## end gnulib module sig2str
511
512## begin gnulib module snippet/_Noreturn
513
514# Because this Makefile snippet defines a variable used by other
515# gnulib Makefile snippets, it must be present in all Makefile.am that
516# need it. This is ensured by the applicability 'all' defined above.
517
518_NORETURN_H=$(top_srcdir)/build-aux/snippet/_Noreturn.h
519
520EXTRA_DIST += $(top_srcdir)/build-aux/snippet/_Noreturn.h
521
522## end gnulib module snippet/_Noreturn
523
524## begin gnulib module snippet/arg-nonnull
525
526# The BUILT_SOURCES created by this Makefile snippet are not used via #include
527# statements but through direct file reference. Therefore this snippet must be
528# present in all Makefile.am that need it. This is ensured by the applicability
529# 'all' defined above.
530
531BUILT_SOURCES += arg-nonnull.h
532# The arg-nonnull.h that gets inserted into generated .h files is the same as
533# build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut
534# off.
535arg-nonnull.h: $(top_srcdir)/build-aux/snippet/arg-nonnull.h
536 $(AM_V_GEN)rm -f $@-t $@ && \
537 sed -n -e '/GL_ARG_NONNULL/,$$p' \
538 < $(top_srcdir)/build-aux/snippet/arg-nonnull.h \
539 > $@-t && \
540 mv $@-t $@
541MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
542
543ARG_NONNULL_H=arg-nonnull.h
544
545EXTRA_DIST += $(top_srcdir)/build-aux/snippet/arg-nonnull.h
546
547## end gnulib module snippet/arg-nonnull
548
549## begin gnulib module snippet/c++defs
550
551# The BUILT_SOURCES created by this Makefile snippet are not used via #include
552# statements but through direct file reference. Therefore this snippet must be
553# present in all Makefile.am that need it. This is ensured by the applicability
554# 'all' defined above.
555
556BUILT_SOURCES += c++defs.h
557# The c++defs.h that gets inserted into generated .h files is the same as
558# build-aux/snippet/c++defs.h, except that it has the copyright header cut off.
559c++defs.h: $(top_srcdir)/build-aux/snippet/c++defs.h
560 $(AM_V_GEN)rm -f $@-t $@ && \
561 sed -n -e '/_GL_CXXDEFS/,$$p' \
562 < $(top_srcdir)/build-aux/snippet/c++defs.h \
563 > $@-t && \
564 mv $@-t $@
565MOSTLYCLEANFILES += c++defs.h c++defs.h-t
566
567CXXDEFS_H=c++defs.h
568
569EXTRA_DIST += $(top_srcdir)/build-aux/snippet/c++defs.h
570
571## end gnulib module snippet/c++defs
572
573## begin gnulib module snippet/warn-on-use
574
575BUILT_SOURCES += warn-on-use.h
576# The warn-on-use.h that gets inserted into generated .h files is the same as
577# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut
578# off.
579warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h
580 $(AM_V_GEN)rm -f $@-t $@ && \
581 sed -n -e '/^.ifndef/,$$p' \
582 < $(top_srcdir)/build-aux/snippet/warn-on-use.h \
583 > $@-t && \
584 mv $@-t $@
585MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
586
587WARN_ON_USE_H=warn-on-use.h
588
589EXTRA_DIST += $(top_srcdir)/build-aux/snippet/warn-on-use.h
590
591## end gnulib module snippet/warn-on-use
592
593## begin gnulib module stat
594
595if gl_GNULIB_ENABLED_stat
596
597endif
598EXTRA_DIST += stat.c
599
600EXTRA_libgnu_a_SOURCES += stat.c
601
602## end gnulib module stat
603
604## begin gnulib module stat-time
605
606libgnu_a_SOURCES += stat-time.c
607
608EXTRA_DIST += stat-time.h
609
610## end gnulib module stat-time
611
612## begin gnulib module stdalign
613
614BUILT_SOURCES += $(STDALIGN_H)
615
616# We need the following in order to create <stdalign.h> when the system
617# doesn't have one that works.
618if GL_GENERATE_STDALIGN_H
619stdalign.h: stdalign.in.h $(top_builddir)/config.status
620 $(AM_V_GEN)rm -f $@-t $@ && \
621 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
622 cat $(srcdir)/stdalign.in.h; \
623 } > $@-t && \
624 mv $@-t $@
625else
626stdalign.h: $(top_builddir)/config.status
627 rm -f $@
628endif
629MOSTLYCLEANFILES += stdalign.h stdalign.h-t
630
631EXTRA_DIST += stdalign.in.h
632
633## end gnulib module stdalign
634
635## begin gnulib module stdarg
636
637BUILT_SOURCES += $(STDARG_H)
638
639# We need the following in order to create <stdarg.h> when the system
640# doesn't have one that works with the given compiler.
641if GL_GENERATE_STDARG_H
642stdarg.h: stdarg.in.h $(top_builddir)/config.status
643 $(AM_V_GEN)rm -f $@-t $@ && \
644 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
645 sed -e 's|@''GUARD_PREFIX''@|GL|g' \
646 -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
647 -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
648 -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
649 -e 's|@''NEXT_STDARG_H''@|$(NEXT_STDARG_H)|g' \
650 < $(srcdir)/stdarg.in.h; \
651 } > $@-t && \
652 mv $@-t $@
653else
654stdarg.h: $(top_builddir)/config.status
655 rm -f $@
656endif
657MOSTLYCLEANFILES += stdarg.h stdarg.h-t
658
659EXTRA_DIST += stdarg.in.h
660
661## end gnulib module stdarg
662
663## begin gnulib module stdbool
664
665BUILT_SOURCES += $(STDBOOL_H)
666
667# We need the following in order to create <stdbool.h> when the system
668# doesn't have one that works.
669if GL_GENERATE_STDBOOL_H
670stdbool.h: stdbool.in.h $(top_builddir)/config.status
671 $(AM_V_GEN)rm -f $@-t $@ && \
672 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
673 sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \
674 } > $@-t && \
675 mv $@-t $@
676else
677stdbool.h: $(top_builddir)/config.status
678 rm -f $@
679endif
680MOSTLYCLEANFILES += stdbool.h stdbool.h-t
681
682EXTRA_DIST += stdbool.in.h
683
684## end gnulib module stdbool
685
686## begin gnulib module stddef
687
688BUILT_SOURCES += $(STDDEF_H)
689
690# We need the following in order to create <stddef.h> when the system
691# doesn't have one that works with the given compiler.
692if GL_GENERATE_STDDEF_H
693stddef.h: stddef.in.h $(top_builddir)/config.status
694 $(AM_V_GEN)rm -f $@-t $@ && \
695 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
696 sed -e 's|@''GUARD_PREFIX''@|GL|g' \
697 -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
698 -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
699 -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
700 -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \
701 -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \
702 -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \
703 < $(srcdir)/stddef.in.h; \
704 } > $@-t && \
705 mv $@-t $@
706else
707stddef.h: $(top_builddir)/config.status
708 rm -f $@
709endif
710MOSTLYCLEANFILES += stddef.h stddef.h-t
711
712EXTRA_DIST += stddef.in.h
713
714## end gnulib module stddef
715
716## begin gnulib module stdint
717
718BUILT_SOURCES += $(STDINT_H)
719
720# We need the following in order to create <stdint.h> when the system
721# doesn't have one that works with the given compiler.
722if GL_GENERATE_STDINT_H
723stdint.h: stdint.in.h $(top_builddir)/config.status
724 $(AM_V_GEN)rm -f $@-t $@ && \
725 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
726 sed -e 's|@''GUARD_PREFIX''@|GL|g' \
727 -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
728 -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
729 -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
730 -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
731 -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \
732 -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
733 -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
734 -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
735 -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
736 -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
737 -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
738 -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
739 -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
740 -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \
741 -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \
742 -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \
743 -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \
744 -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \
745 -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \
746 -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \
747 -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \
748 -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \
749 -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \
750 -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
751 -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
752 -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
753 < $(srcdir)/stdint.in.h; \
754 } > $@-t && \
755 mv $@-t $@
756else
757stdint.h: $(top_builddir)/config.status
758 rm -f $@
759endif
760MOSTLYCLEANFILES += stdint.h stdint.h-t
761
762EXTRA_DIST += stdint.in.h
763
764## end gnulib module stdint
765
766## begin gnulib module strftime
767
768libgnu_a_SOURCES += strftime.c
769
770EXTRA_DIST += strftime.h
771
772## end gnulib module strftime
773
774## begin gnulib module strtoimax
775
776
777EXTRA_DIST += strtoimax.c
778
779EXTRA_libgnu_a_SOURCES += strtoimax.c
780
781## end gnulib module strtoimax
782
783## begin gnulib module strtoll
784
785if gl_GNULIB_ENABLED_strtoll
786
787endif
788EXTRA_DIST += strtol.c strtoll.c
789
790EXTRA_libgnu_a_SOURCES += strtol.c strtoll.c
791
792## end gnulib module strtoll
793
794## begin gnulib module strtoull
795
796if gl_GNULIB_ENABLED_strtoull
797
798endif
799EXTRA_DIST += strtol.c strtoul.c strtoull.c
800
801EXTRA_libgnu_a_SOURCES += strtol.c strtoul.c strtoull.c
802
803## end gnulib module strtoull
804
805## begin gnulib module strtoumax
806
807
808EXTRA_DIST += strtoimax.c strtoumax.c
809
810EXTRA_libgnu_a_SOURCES += strtoimax.c strtoumax.c
811
812## end gnulib module strtoumax
813
814## begin gnulib module symlink
815
816
817EXTRA_DIST += symlink.c
818
819EXTRA_libgnu_a_SOURCES += symlink.c
820
821## end gnulib module symlink
822
823## begin gnulib module time_r
824
825
826EXTRA_DIST += time_r.c
827
828EXTRA_libgnu_a_SOURCES += time_r.c
829
830## end gnulib module time_r
831
832## begin gnulib module timespec
833
834libgnu_a_SOURCES += timespec.c
835
836EXTRA_DIST += timespec.h
837
838## end gnulib module timespec
839
840## begin gnulib module timespec-add
841
842libgnu_a_SOURCES += timespec-add.c
843
844## end gnulib module timespec-add
845
846## begin gnulib module timespec-sub
847
848libgnu_a_SOURCES += timespec-sub.c
849
850## end gnulib module timespec-sub
851
852## begin gnulib module u64
853
854libgnu_a_SOURCES += u64.c
855
856EXTRA_DIST += u64.h
857
858## end gnulib module u64
859
860## begin gnulib module unsetenv
861
862
863EXTRA_DIST += unsetenv.c
864
865EXTRA_libgnu_a_SOURCES += unsetenv.c
866
867## end gnulib module unsetenv
868
869## begin gnulib module utimens
870
871libgnu_a_SOURCES += utimens.c
872
873EXTRA_DIST += utimens.h
874
875## end gnulib module utimens
876
877## begin gnulib module verify
878
879if gl_GNULIB_ENABLED_verify
880
881endif
882EXTRA_DIST += verify.h
883
884## end gnulib module verify
885
886## begin gnulib module xalloc-oversized
887
888if gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec
889
890endif
891EXTRA_DIST += xalloc-oversized.h
892
893## end gnulib module xalloc-oversized
894
895
896mostlyclean-local: mostlyclean-generic
897 @for dir in '' $(MOSTLYCLEANDIRS); do \
898 if test -n "$$dir" && test -d $$dir; then \
899 echo "rmdir $$dir"; rmdir $$dir; \
900 fi; \
901 done; \
902 :
diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h
index 9ff03994be2..29c8e383893 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/>. */
67#endif 67#endif
68 68
69#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)) 69#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))
70#define HAVE___BUILTIN_UNWIND_INIT 1 70# ifndef HAVE___BUILTIN_UNWIND_INIT
71# define HAVE___BUILTIN_UNWIND_INIT 1
72# endif
71#endif 73#endif
72 74
73/* This isn't perfect, as some systems might have the page file in 75/* 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/>. */
99#endif 101#endif
100 102
101#ifdef __GNUC__ 103#ifdef __GNUC__
102# define restrict __restrict__ 104/* config.h may have defined already. */
105# ifndef restrict
106# define restrict __restrict__
107# endif
103#else 108#else
109 /* FIXME: should we define to __restrict, which MSVC supports? */
104# define restrict 110# define restrict
105#endif 111#endif
106 112
@@ -138,9 +144,6 @@ extern char *getenv ();
138/* Make a leaner executable. */ 144/* Make a leaner executable. */
139#define WIN32_LEAN_AND_MEAN 1 145#define WIN32_LEAN_AND_MEAN 1
140 146
141#ifdef HAVE_STRINGS_H
142#include "strings.h"
143#endif
144#include <sys/types.h> 147#include <sys/types.h>
145 148
146#ifndef MAXPATHLEN 149#ifndef MAXPATHLEN
@@ -148,8 +151,12 @@ extern char *getenv ();
148#endif 151#endif
149 152
150#ifdef HAVE_NTGUI 153#ifdef HAVE_NTGUI
151#define HAVE_WINDOW_SYSTEM 1 154# ifndef HAVE_WINDOW_SYSTEM
152#define HAVE_MENUS 1 155# define HAVE_WINDOW_SYSTEM 1
156# endif
157# ifndef HAVE_MENUS
158# define HAVE_MENUS 1
159# endif
153#endif 160#endif
154 161
155/* Get some redefinitions in place. */ 162/* Get some redefinitions in place. */
@@ -248,9 +255,6 @@ extern int sys_unlink (const char *);
248#define execvp _execvp 255#define execvp _execvp
249#define fdatasync _commit 256#define fdatasync _commit
250#define fdopen _fdopen 257#define fdopen _fdopen
251#ifndef fileno
252#define fileno _fileno
253#endif
254#define fsync _commit 258#define fsync _commit
255#define ftruncate _chsize 259#define ftruncate _chsize
256#define getpid _getpid 260#define getpid _getpid
@@ -266,9 +270,6 @@ typedef int pid_t;
266#define popen _popen 270#define popen _popen
267#define pclose _pclose 271#define pclose _pclose
268#define umask _umask 272#define umask _umask
269#ifndef _MSC_VER
270#define utimbuf _utimbuf
271#endif
272#define strdup _strdup 273#define strdup _strdup
273#define strupr _strupr 274#define strupr _strupr
274#define strnicmp _strnicmp 275#define strnicmp _strnicmp
@@ -285,10 +286,6 @@ int _getpid (void);
285 array, and triggers an error message. */ 286 array, and triggers an error message. */
286#include <time.h> 287#include <time.h>
287#define tzname _tzname 288#define tzname _tzname
288#if !defined (_MSC_VER) || (_MSC_VER < 1400)
289#undef utime
290#define utime _utime
291#endif
292 289
293/* 'struct timespec' is used by time-related functions in lib/ and 290/* 'struct timespec' is used by time-related functions in lib/ and
294 elsewhere, but we don't use lib/time.h where the structure is 291 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);
327#include <io.h> 324#include <io.h>
328#include <stdio.h> 325#include <stdio.h>
329#endif /* !_MSC_VER */ 326#endif /* !_MSC_VER */
327#ifndef fileno
328#define fileno _fileno
329#endif
330 330
331/* Defines that we need that aren't in the standard signal.h. */ 331/* Defines that we need that aren't in the standard signal.h. */
332#define SIGHUP 1 /* Hang up */ 332#define SIGHUP 1 /* Hang up */
@@ -346,20 +346,21 @@ extern struct tm *localtime_r (time_t const * restrict, struct tm * restrict);
346#define ENOTSUP ENOSYS 346#define ENOTSUP ENOSYS
347#endif 347#endif
348 348
349/* WINDOWSNT <errno.h> doesn't define EOPNOTSUPP, and we don't have 349/* In case lib/errno.h is not used. */
350 'configure' working yet so we can't rely on the Gnulib replacement 350#ifndef EOPNOTSUPP
351 errno.h defining EOPNOTSUPP. Work around the problem by defining
352 it here. */
353#define EOPNOTSUPP 130 351#define EOPNOTSUPP 130
352#endif
354 353
355#ifdef _MSC_VER 354#ifdef _MSC_VER
356typedef int sigset_t; 355typedef int sigset_t;
357typedef int ssize_t; 356typedef int ssize_t;
358#endif 357#endif
359 358
360#ifndef _POSIX /* MinGW64 */ 359#ifdef _W64 /* MinGW64 */
360#ifndef _POSIX
361typedef _sigset_t sigset_t; 361typedef _sigset_t sigset_t;
362#endif 362#endif
363#endif
363 364
364typedef void (_CALLBACK_ *signal_handler) (int); 365typedef void (_CALLBACK_ *signal_handler) (int);
365extern signal_handler sys_signal (int, signal_handler); 366extern signal_handler sys_signal (int, signal_handler);
@@ -395,10 +396,12 @@ extern int sys_kill (int, int);
395#define getdefdir(_drv, _buf) _getdcwd (_drv, _buf, MAXPATHLEN) 396#define getdefdir(_drv, _buf) _getdcwd (_drv, _buf, MAXPATHLEN)
396#endif 397#endif
397 398
399#ifndef EMACS_CONFIGURATION
398extern char *get_emacs_configuration (void); 400extern char *get_emacs_configuration (void);
399extern char *get_emacs_configuration_options (void); 401extern char *get_emacs_configuration_options (void);
400#define EMACS_CONFIGURATION get_emacs_configuration () 402#define EMACS_CONFIGURATION get_emacs_configuration ()
401#define EMACS_CONFIG_OPTIONS get_emacs_configuration_options () 403#define EMACS_CONFIG_OPTIONS get_emacs_configuration_options ()
404#endif
402 405
403/* Define this so that winsock.h definitions don't get included with 406/* Define this so that winsock.h definitions don't get included with
404 windows.h. For this to have proper effect, config.h must always be 407 windows.h. For this to have proper effect, config.h must always be
@@ -452,10 +455,14 @@ extern void * memrchr (void const *, int, size_t);
452#if defined (__MINGW32__) 455#if defined (__MINGW32__)
453 456
454/* Define to 1 if the system has the type `long long int'. */ 457/* Define to 1 if the system has the type `long long int'. */
455# define HAVE_LONG_LONG_INT 1 458# ifndef HAVE_LONG_LONG_INT
459# define HAVE_LONG_LONG_INT 1
460# endif
456 461
457/* Define to 1 if the system has the type `unsigned long long int'. */ 462/* Define to 1 if the system has the type `unsigned long long int'. */
458# define HAVE_UNSIGNED_LONG_LONG_INT 1 463# ifndef HAVE_UNSIGNED_LONG_LONG_INT
464# define HAVE_UNSIGNED_LONG_LONG_INT 1
465# endif
459 466
460#endif 467#endif
461 468
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/>. */
43#undef FD_ZERO 43#undef FD_ZERO
44#endif 44#endif
45 45
46/* avoid duplicate definition of timeval */ 46/* Avoid duplicate definition of timeval. MinGW uses _TIMEVAL_DEFINED
47#ifdef HAVE_TIMEVAL 47 in sys/time.h to avoid that. */
48#if defined (HAVE_TIMEVAL) && defined (_MSC_VER)
48#define timeval ws_timeval 49#define timeval ws_timeval
49#endif 50#endif
50 51
@@ -62,7 +63,9 @@ typedef unsigned short uint16_t;
62#undef MUST_REDEF_SELECT 63#undef MUST_REDEF_SELECT
63#endif 64#endif
64 65
65/* revert to our version of FD_SET */ 66/* Revert to our version of FD_SET, but not when included from test
67 programs run by configure. */
68#ifdef EMACS_CONFIG_H
66#undef FD_SET 69#undef FD_SET
67#undef FD_CLR 70#undef FD_CLR
68#undef FD_ISSET 71#undef FD_ISSET
@@ -71,8 +74,9 @@ typedef unsigned short uint16_t;
71/* allow us to provide our own version of fd_set */ 74/* allow us to provide our own version of fd_set */
72#define fd_set ws_fd_set 75#define fd_set ws_fd_set
73#include "w32.h" 76#include "w32.h"
77#endif /* EMACS_CONFIG_H */
74 78
75#ifdef HAVE_TIMEVAL 79#if defined (HAVE_TIMEVAL) && defined (_MSC_VER)
76#undef timeval 80#undef timeval
77#endif 81#endif
78 82
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/>. */
83#define S_TYPEISSHM(p) 0 83#define S_TYPEISSHM(p) 0
84#define S_TYPEISTMO(p) 0 84#define S_TYPEISTMO(p) 0
85 85
86#define UTIME_NOW (-1)
87#define UTIME_OMIT (-2)
88
86struct stat { 89struct stat {
87 unsigned __int64 st_ino; /* ino_t in sys/types.h is too narrow */ 90 unsigned __int64 st_ino; /* ino_t in sys/types.h is too narrow */
88 dev_t st_dev; 91 dev_t st_dev;
@@ -99,6 +102,39 @@ struct stat {
99 char st_gname[260]; 102 char st_gname[260];
100}; 103};
101 104
105/* These are here to avoid compiler warnings when using wchar.h. */
106struct _stat
107{
108 _dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */
109 _ino_t st_ino; /* Always zero ? */
110 _mode_t st_mode; /* See above constants */
111 short st_nlink; /* Number of links. */
112 short st_uid; /* User: Maybe significant on NT ? */
113 short st_gid; /* Group: Ditto */
114 _dev_t st_rdev; /* Seems useless (not even filled in) */
115 _off_t st_size; /* File size in bytes */
116 time_t st_atime; /* Accessed date (always 00:00 hrs local
117 * on FAT) */
118 time_t st_mtime; /* Modified time */
119 time_t st_ctime; /* Creation time */
120};
121
122#if defined (__MSVCRT__)
123struct _stati64 {
124 _dev_t st_dev;
125 _ino_t st_ino;
126 _mode_t st_mode;
127 short st_nlink;
128 short st_uid;
129 short st_gid;
130 _dev_t st_rdev;
131 __int64 st_size;
132 time_t st_atime;
133 time_t st_mtime;
134 time_t st_ctime;
135};
136#endif
137
102/* Internal variable for asking 'stat'/'lstat' to produce accurate 138/* Internal variable for asking 'stat'/'lstat' to produce accurate
103 info about owner and group of files. */ 139 info about owner and group of files. */
104extern int w32_stat_get_owner_group; 140extern 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 @@
9/* The guards are for MinGW64, which defines these structs on its 9/* The guards are for MinGW64, which defines these structs on its
10 system headers which are included by ms-w32.h. */ 10 system headers which are included by ms-w32.h. */
11#ifndef _W64 11#ifndef _W64
12/* Allow inclusion of sys/time.h and winsock2.h in any order. Needed
13 for running the configure test, which is only relevant to MinGW. */
14#ifndef _TIMEVAL_DEFINED
15#define _TIMEVAL_DEFINED
12struct timeval 16struct timeval
13{ 17{
14 long tv_sec; /* seconds */ 18 long tv_sec; /* seconds */
15 long tv_usec; /* microseconds */ 19 long tv_usec; /* microseconds */
16}; 20};
17#endif 21#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
22#define timercmp(tvp, uvp, cmp) \
23 (((tvp)->tv_sec != (uvp)->tv_sec) ? \
24 ((tvp)->tv_sec cmp (uvp)->tv_sec) : \
25 ((tvp)->tv_usec cmp (uvp)->tv_usec))
26#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
27#endif /* _TIMEVAL_DEFINED */
28#endif /* _W64 */
18 29
19#ifndef _TIMEZONE_DEFINED 30#ifndef _TIMEZONE_DEFINED
20struct timezone 31struct timezone
@@ -24,7 +35,10 @@ struct timezone
24}; 35};
25#endif 36#endif
26 37
27void gettimeofday (struct timeval *, struct timezone *); 38/* This needs to be compatible with Posix signature, in order to pass
39 the configure test for the type of the second argument. See
40 m4/gettimeofday.m4. */
41int gettimeofday (struct timeval *restrict, struct timezone *restrict);
28 42
29#define ITIMER_REAL 0 43#define ITIMER_REAL 0
30#define ITIMER_PROF 1 44#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 @@
3#ifndef _UNISTD_H 3#ifndef _UNISTD_H
4#define _UNISTD_H 4#define _UNISTD_H
5 5
6#include <sys/types.h>
7#include <pwd.h>
8
6/* On Microsoft platforms, <stdlib.h> declares 'environ'; on POSIX 9/* On Microsoft platforms, <stdlib.h> declares 'environ'; on POSIX
7 platforms, <unistd.h> does. Every file in Emacs that includes 10 platforms, <unistd.h> does. Every file in Emacs that includes
8 <unistd.h> also includes <stdlib.h>, so there's no need to declare 11 <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 4aa1ea91d44..79ca22bf44e 100644
--- a/nt/makefile.w32-in
+++ b/nt/makefile.w32-in
@@ -29,6 +29,8 @@ TMP_DIST_DIR = emacs-$(VERSION)
29TRES = $(BLD)/emacs.res 29TRES = $(BLD)/emacs.res
30CLIENTRES = $(BLD)/emacsclient.res 30CLIENTRES = $(BLD)/emacsclient.res
31 31
32LOCAL_FLAGS = -DOLD_PATHS=1
33
32XMFLAGS = 34XMFLAGS =
33 35
34ALL = $(BLD)/addpm.exe $(BLD)/ddeclient.exe $(BLD)/runemacs.exe \ 36ALL = $(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..96cda2d624a
--- /dev/null
+++ b/nt/mingw-cfg.site
@@ -0,0 +1,106 @@
1#! /bin/sh
2# Site defaults for the MinGW configuration of GNU Emacs.
3#
4# This file's purpose is to short-circuit configure-time tests for
5# which we want to provide the results instead of letting the
6# 'configure' script do that. This is mainly for features that
7# 'configure' tests that are implemented as part of Emacs sources, not
8# as part of system libraries. The idea is to set shell variables
9# that appear to the script as cached values.
10#
11# For each header file foo.h you want to supply test results, set the
12# value of a shell variable ac_cv_header_foo_h. The value should be
13# yes if the header is deemed to exist, no otherwise. Or it could be
14# something else, if the value computed by 'configure' requires that.
15# In general, since nt/msysconfig.sh instructs GCC to use header files
16# in nt/inc, you should not need to futz with header file tests. But
17# there are exceptions, like with getopt.h below (which is a MinGW
18# system header, but we do not want to use it).
19#
20# For each library function foo you want to supply test results, set
21# the value of a shell variable ac_cv_func_foo. Again, the value is
22# determined by what 'configure' expects; sometimes it could be "not
23# needed" or whatever, see the examples below. In addition, you may
24# need to set the various gl_cv_* variables for those tests that come
25# from gnulib.
26#
27# In short, examine the test in 'configure' and push the knobs that
28# are necessary to steer the test in the direction you need, by
29# judicioulsy setting variables that control the test results.
30
31# We want to use getopt.h from gnulib
32ac_cv_header_getopt_h=no
33
34# ACL functions are implemented in w32.c
35ac_cv_search_acl_get_file="none required"
36ac_cv_func_acl_get_file=yes
37ac_cv_func_acl_set_file=yes
38ac_cv_func_acl_free=yes
39ac_cv_func_acl_from_text=yes
40gl_cv_func_working_acl_get_file=yes
41# Autoconf's test program is not smart enough, and fails to detect gethostname
42ac_cv_func_gethostname=yes
43# Implemented as sys_select in w32proc.c
44ac_cv_func_select=yes
45ac_cv_func_pselect=yes
46gl_cv_sig_pselect=yes
47gl_cv_func_pselect_detects_ebadf=yes
48# Implemented as sys_shutdown in w32.c
49ac_cv_func_shutdown=yes
50# Implemented in w32proc.c
51ac_cv_func_setitimer=yes
52# Implemented as sys_sendto in w32.c
53ac_cv_func_sendto=yes
54# Implemented as sys_recvfrom in w32.c
55ac_cv_func_recvfrom=yes
56# Implemented as sys_getsockname in w32.c
57ac_cv_func_getsockname=yes
58# Implemented as sys_getpeername in w32.c
59ac_cv_func_getpeername=yes
60# Implemented as sys_socket in w32.c
61ac_cv_func_socket=yes
62# Implemented in w32.c
63ac_cv_func_readlink=yes
64ac_cv_func_symlink=yes
65# Avoid run-time tests of readlink and symlink, which will fail
66gl_cv_func_readlink_works=yes
67gl_cv_func_symlink_works=yes
68ac_cv_func_readlinkat=yes
69ac_cv_func_faccessat=yes
70# We don't need fdopendir
71ac_cv_func_fdopendir="not-needed"
72gl_cv_func_fdopendir_works="no-but-not-needed-so-yes"
73# Implemented in w32.c
74ac_cv_func_lstat=yes
75gl_cv_func_lstat_dereferences_slashed_symlink=yes
76ac_cv_func_fstatat=yes
77gl_cv_func_fstatat_zero_flag=yes
78# Aliased to _commit in ms-w32.h
79ac_cv_func_fsync=yes
80ac_cv_func_fdatasync=yes
81# Implemented in w32proc.c
82ac_cv_func_pthread_sigmask=yes
83# Avoid gnulib replacement
84gl_threads_api=posix
85gl_cv_func_pthread_sigmask_return_works=yes
86gl_cv_func_pthread_sigmask_unblock_works="not relevant"
87# Implemented in w32proc.c
88emacs_cv_langinfo_codeset=yes
89# Declared in ms-w32.h
90ac_cv_have_decl_alarm=yes
91# Avoid including the gnulib dup2 module
92gl_cv_func_dup2_works=yes
93# Defined in w32.c
94ac_cv_func_getloadavg=yes
95# Avoid compiling gnulib mktime
96gl_cv_func_working_mktime=yes
97# Implemented in w32.c
98ac_cv_have_decl_unsetenv=yes
99ac_cv_func_unsetenv=yes
100gt_cv_func_unsetenv_ret='int'
101gl_cv_func_unsetenv_works=yes
102gl_cv_func_stat_dir_slash=yes
103gl_cv_func_stat_file_slash=yes
104ac_cv_func_random=yes
105# Implemented in w32.c as sys_putenv
106gl_cv_func_svid_putenv=yes
diff --git a/nt/msysconfig.sh b/nt/msysconfig.sh
new file mode 100644
index 00000000000..95e56f64c42
--- /dev/null
+++ b/nt/msysconfig.sh
@@ -0,0 +1,39 @@
1#! /bin/sh
2### msysconfig.sh - Run the top-level 'configure' script as approriate
3### for the MinGW/MSYS build of a native MS-Windows port of Emacs.
4
5## Copyright (C) 2013 Free Software Foundation, Inc.
6
7## Author: Eli Zaretskii <eliz@gnu.org>
8
9## This file is part of GNU Emacs.
10
11## GNU Emacs is free software: you can redistribute it and/or modify
12## it under the terms of the GNU General Public License as published by
13## the Free Software Foundation, either version 3 of the License, or
14## (at your option) any later version.
15
16## GNU Emacs is distributed in the hope that it will be useful,
17## but WITHOUT ANY WARRANTY; without even the implied warranty of
18## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19## GNU General Public License for more details.
20
21## You should have received a copy of the GNU General Public License
22## along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
23
24### Commentary:
25
26## The Posix 'configure' script needs a few tweaks to produce desired
27## results when running under MSYS with the purpose of configuring
28## Emacs for the MinGW MS-Windows build. Rather than asking users to
29## type these tweaks every time they configure the package, we provide
30## this helper script which takes care of the mundane things.
31
32### Code:
33
34srcdir=`dirname "$0"`
35parent=`dirname "$srcdir"`
36
37## The nt/mingw-cfg.site file provides various autoconf variables that
38## are needed for a successful MinGW build.
39CONFIG_SITE="$srcdir/mingw-cfg.site" $parent/configure "$@"
diff --git a/src/ChangeLog b/src/ChangeLog
index c45ec824919..e5308e2db3b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,27 @@
12013-05-16 Eli Zaretskii <eliz@gnu.org>
2
3 * w32.c: Include epaths.h.
4 (init_environment): Use cmdproxy.exe without leading directories.
5 Support emacs.exe in src; point SHELL to cmdproxy in ../nt in that
6 case.
7 (gettimeofday): Adjust signature and return value to Posix
8 expectations.
9
10 * unexw32.c (open_output_file): Delete the existing emacs.exe
11 before creating it, to break the hard link to the versioned
12 executable.
13
14 * Makefile.in (EMACS_MANIFEST, CM_OBJ, TEMACS_POST_LINK)
15 (ADDSECTION, EMACS_HEAPSIZE, MINGW_TEMACS_POST_LINK)
16 (FIRSTFILE_OBJ): New variables.
17 (W32_RES): Rename to EMACSRES. All users changed.
18 (base_obj): Use $(CM_OBJ).
19 (ALLOBJS): Use $(FIRSTFILE_OBJ).
20 (emacs$(EXEEXT)): Depend on $(ADDSECTION).
21 (temacs$(EXEEXT)): Use $(TEMACS_POST_LINK), and move
22 $(W32_RES_LINK) before $(LIBES).
23 (emacs.res): Depend on $(EMACS_MANIFEST). Put emacs.rc in nt.
24
12013-05-15 Stefan Monnier <monnier@iro.umontreal.ca> 252013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
2 26
3 * makefile.w32-in (DOC): Use just "DOC". 27 * makefile.w32-in (DOC): Use just "DOC".
diff --git a/src/Makefile.in b/src/Makefile.in
index 80d23b2d58b..c7a18363a5a 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -267,10 +267,13 @@ W32_OBJ=@W32_OBJ@
267W32_LIBS=@W32_LIBS@ 267W32_LIBS=@W32_LIBS@
268 268
269## emacs.res if HAVE_W32 269## emacs.res if HAVE_W32
270W32_RES=@W32_RES@ 270EMACSRES = @EMACSRES@
271## emacs-*.manifest if HAVE_W32
272EMACS_MANIFEST = @EMACS_MANIFEST@
271## If HAVE_W32, compiler arguments for including 273## If HAVE_W32, compiler arguments for including
272## the resource file in the binary. 274## the resource file in the binary.
273## XXX -Wl,-b -Wl,pe-i386 -Wl,emacs.res 275## Cygwin: -Wl,emacs.res
276## MinGW: emacs.res
274W32_RES_LINK=@W32_RES_LINK@ 277W32_RES_LINK=@W32_RES_LINK@
275 278
276## Empty if !HAVE_X_WINDOWS 279## Empty if !HAVE_X_WINDOWS
@@ -279,6 +282,9 @@ W32_RES_LINK=@W32_RES_LINK@
279## else xfont.o 282## else xfont.o
280FONT_OBJ=@FONT_OBJ@ 283FONT_OBJ=@FONT_OBJ@
281 284
285## Empty for MinGW, cm.o for the rest.
286CM_OBJ=@CM_OBJ@
287
282LIBGPM = @LIBGPM@ 288LIBGPM = @LIBGPM@
283 289
284## -lresolv, or empty. 290## -lresolv, or empty.
@@ -297,6 +303,14 @@ GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
297 303
298RUN_TEMACS = `/bin/pwd`/temacs 304RUN_TEMACS = `/bin/pwd`/temacs
299 305
306## Invoke ../nt/addsection for MinGW, ":" elsewhere.
307TEMACS_POST_LINK = @TEMACS_POST_LINK@
308ADDSECTION = @ADDSECTION@
309EMACS_HEAPSIZE = @EMACS_HEAPSIZE@
310MINGW_TEMACS_POST_LINK = \
311 mv temacs$(EXEEXT) temacs.tmp; \
312 ../nt/addsection temacs.tmp temacs$(EXEEXT) EMHEAP $(EMACS_HEAPSIZE)
313
300UNEXEC_OBJ = @UNEXEC_OBJ@ 314UNEXEC_OBJ = @UNEXEC_OBJ@
301 315
302CANNOT_DUMP=@CANNOT_DUMP@ 316CANNOT_DUMP=@CANNOT_DUMP@
@@ -339,7 +353,7 @@ ALL_OBJC_CFLAGS=$(ALL_CFLAGS) $(GNU_OBJC_CFLAGS)
339## be dumped as pure by dump-emacs. 353## be dumped as pure by dump-emacs.
340base_obj = dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \ 354base_obj = dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \
341 charset.o coding.o category.o ccl.o character.o chartab.o bidi.o \ 355 charset.o coding.o category.o ccl.o character.o chartab.o bidi.o \
342 cm.o term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ) $(DBUS_OBJ) \ 356 $(CM_OBJ) term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ) $(DBUS_OBJ) \
343 emacs.o keyboard.o macros.o keymap.o sysdep.o \ 357 emacs.o keyboard.o macros.o keymap.o sysdep.o \
344 buffer.o filelock.o insdel.o marker.o \ 358 buffer.o filelock.o insdel.o marker.o \
345 minibuf.o fileio.o dired.o \ 359 minibuf.o fileio.o dired.o \
@@ -377,9 +391,9 @@ VMLIMIT_OBJ=@VMLIMIT_OBJ@
377## ralloc.o if !SYSTEM_MALLOC && REL_ALLOC, else empty. 391## ralloc.o if !SYSTEM_MALLOC && REL_ALLOC, else empty.
378RALLOC_OBJ=@RALLOC_OBJ@ 392RALLOC_OBJ=@RALLOC_OBJ@
379 393
380## Empty on Cygwin, lastfile.o elsewhere. 394## Empty on Cygwin and MinGW, lastfile.o elsewhere.
381PRE_ALLOC_OBJ=@PRE_ALLOC_OBJ@ 395PRE_ALLOC_OBJ=@PRE_ALLOC_OBJ@
382## lastfile.o on Cygwin, empty elsewhere. 396## lastfile.o on Cygwin and MinGW, empty elsewhere.
383POST_ALLOC_OBJ=@POST_ALLOC_OBJ@ 397POST_ALLOC_OBJ=@POST_ALLOC_OBJ@
384 398
385## List of object files that make-docfile should not be told about. 399## List of object files that make-docfile should not be told about.
@@ -387,7 +401,9 @@ otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(GMALLOC_OBJ) $(RALLOC_OBJ) \
387 $(POST_ALLOC_OBJ) $(WIDGET_OBJ) $(LIBOBJS) 401 $(POST_ALLOC_OBJ) $(WIDGET_OBJ) $(LIBOBJS)
388 402
389## All object files linked into temacs. $(VMLIMIT_OBJ) should be first. 403## All object files linked into temacs. $(VMLIMIT_OBJ) should be first.
390ALLOBJS = $(VMLIMIT_OBJ) $(obj) $(otherobj) 404## (On MinGW, firstfile.o should be before vm-limit.o.)
405FIRSTFILE_OBJ=@FIRSTFILE_OBJ@
406ALLOBJS = $(FIRSTFILE_OBJ) $(VMLIMIT_OBJ) $(obj) $(otherobj)
391 407
392## Configure inserts the file lisp.mk at this point, defining $lisp. 408## Configure inserts the file lisp.mk at this point, defining $lisp.
393@lisp_frag@ 409@lisp_frag@
@@ -416,7 +432,8 @@ $(leimdir)/leim-list.el: bootstrap-emacs$(EXEEXT)
416## Strictly speaking, emacs does not depend directly on all of $lisp, 432## Strictly speaking, emacs does not depend directly on all of $lisp,
417## since not all pieces are used on all platforms. But DOC depends 433## since not all pieces are used on all platforms. But DOC depends
418## on all of $lisp, and emacs depends on DOC, so it is ok to use $lisp here. 434## on all of $lisp, and emacs depends on DOC, so it is ok to use $lisp here.
419emacs$(EXEEXT): temacs$(EXEEXT) $(etc)/DOC $(lisp) $(leimdir)/leim-list.el 435emacs$(EXEEXT): temacs$(EXEEXT) $(ADDSECTION) \
436 $(etc)/DOC $(lisp) $(leimdir)/leim-list.el
420 if test "$(CANNOT_DUMP)" = "yes"; then \ 437 if test "$(CANNOT_DUMP)" = "yes"; then \
421 rm -f emacs$(EXEEXT); \ 438 rm -f emacs$(EXEEXT); \
422 ln temacs$(EXEEXT) emacs$(EXEEXT); \ 439 ln temacs$(EXEEXT) emacs$(EXEEXT); \
@@ -468,10 +485,10 @@ $(lib)/libgnu.a: $(config_h)
468 cd $(lib) && $(MAKE) libgnu.a 485 cd $(lib) && $(MAKE) libgnu.a
469 486
470temacs$(EXEEXT): stamp-oldxmenu $(ALLOBJS) \ 487temacs$(EXEEXT): stamp-oldxmenu $(ALLOBJS) \
471 $(lib)/libgnu.a $(W32_RES) 488 $(lib)/libgnu.a $(EMACSRES)
472 $(CC) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \ 489 $(CC) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \
473 -o temacs $(ALLOBJS) $(lib)/libgnu.a $(LIBES) \ 490 -o temacs $(ALLOBJS) $(lib)/libgnu.a $(W32_RES_LINK) $(LIBES)
474 $(W32_RES_LINK) 491 $(TEMACS_POST_LINK)
475 test "$(CANNOT_DUMP)" = "yes" || \ 492 test "$(CANNOT_DUMP)" = "yes" || \
476 test "X$(PAXCTL)" = X || $(PAXCTL) -r temacs$(EXEEXT) 493 test "X$(PAXCTL)" = X || $(PAXCTL) -r temacs$(EXEEXT)
477 494
@@ -514,8 +531,9 @@ doc.o: buildobj.h
514 531
515emacs.res: $(ntsource)/emacs.rc \ 532emacs.res: $(ntsource)/emacs.rc \
516 $(ntsource)/icons/emacs.ico \ 533 $(ntsource)/icons/emacs.ico \
517 $(ntsource)/emacs-x86.manifest 534 $(ntsource)/$(EMACS_MANIFEST)
518 $(WINDRES) -O COFF -o $@ $(ntsource)/emacs.rc 535 $(WINDRES) -O COFF --include-dir=$(srcdir)/../nt \
536 -o $@ $(ntsource)/emacs.rc
519 537
520ns-app: emacs$(EXEEXT) 538ns-app: emacs$(EXEEXT)
521 cd ../nextstep && $(MAKE) $(MFLAGS) all 539 cd ../nextstep && $(MAKE) $(MFLAGS) all
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)
159 HANDLE file_mapping; 159 HANDLE file_mapping;
160 void *file_base; 160 void *file_base;
161 161
162 /* We delete any existing FILENAME because loadup.el will create a
163 hard link to it under the name emacs-XX.YY.ZZ.nn.exe. Evidently,
164 overwriting a file on Unix breaks any hard links to it, but that
165 doesn't happen on Windows. If we don't delete the file before
166 creating it, all the emacs-XX.YY.ZZ.nn.exe end up being hard
167 links to the same file, which defeats the purpose of these hard
168 links: being able to run previous builds. */
169 DeleteFile (filename);
162 file = CreateFile (filename, GENERIC_READ | GENERIC_WRITE, 0, NULL, 170 file = CreateFile (filename, GENERIC_READ | GENERIC_WRITE, 0, NULL,
163 CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); 171 CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
164 if (file == INVALID_HANDLE_VALUE) 172 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/>. */
65#undef localtime 65#undef localtime
66 66
67#include "lisp.h" 67#include "lisp.h"
68#include "epaths.h" /* for SHELL */
68 69
69#include <pwd.h> 70#include <pwd.h>
70#include <grp.h> 71#include <grp.h>
@@ -2018,7 +2019,7 @@ init_environment (char ** argv)
2018 {"PRELOAD_WINSOCK", NULL}, 2019 {"PRELOAD_WINSOCK", NULL},
2019 {"emacs_dir", "C:/emacs"}, 2020 {"emacs_dir", "C:/emacs"},
2020 {"EMACSLOADPATH", NULL}, 2021 {"EMACSLOADPATH", NULL},
2021 {"SHELL", "%emacs_dir%/bin/cmdproxy.exe"}, 2022 {"SHELL", "cmdproxy.exe"}, /* perhaps it is somewhere on PATH */
2022 {"EMACSDATA", NULL}, 2023 {"EMACSDATA", NULL},
2023 {"EMACSPATH", NULL}, 2024 {"EMACSPATH", NULL},
2024 {"INFOPATH", NULL}, 2025 {"INFOPATH", NULL},
@@ -2094,9 +2095,12 @@ init_environment (char ** argv)
2094 emacs_abort (); 2095 emacs_abort ();
2095 *p = 0; 2096 *p = 0;
2096 2097
2097 if ((p = _mbsrchr (modname, '\\')) && xstrcasecmp (p, "\\bin") == 0) 2098 if ((p = _mbsrchr (modname, '\\'))
2099 /* From bin means installed Emacs, from src means uninstalled. */
2100 && (xstrcasecmp (p, "\\bin") == 0 || xstrcasecmp (p, "\\src") == 0))
2098 { 2101 {
2099 char buf[SET_ENV_BUF_SIZE]; 2102 char buf[SET_ENV_BUF_SIZE];
2103 int within_build_tree = xstrcasecmp (p, "\\src") == 0;
2100 2104
2101 *p = 0; 2105 *p = 0;
2102 for (p = modname; *p; p = CharNext (p)) 2106 for (p = modname; *p; p = CharNext (p))
@@ -2104,6 +2108,15 @@ init_environment (char ** argv)
2104 2108
2105 _snprintf (buf, sizeof (buf)-1, "emacs_dir=%s", modname); 2109 _snprintf (buf, sizeof (buf)-1, "emacs_dir=%s", modname);
2106 _putenv (strdup (buf)); 2110 _putenv (strdup (buf));
2111 /* If we are running from the Posix-like build tree, define
2112 SHELL to point to our own cmdproxy. The loop below will
2113 then disregard PATH_EXEC and the default value. */
2114 if (within_build_tree)
2115 {
2116 _snprintf (buf, sizeof (buf) - 1,
2117 "SHELL=%s/nt/cmdproxy.exe", modname);
2118 _putenv (strdup (buf));
2119 }
2107 } 2120 }
2108 /* Handle running emacs from the build directory: src/oo-spd/i386/ */ 2121 /* Handle running emacs from the build directory: src/oo-spd/i386/ */
2109 2122
@@ -2139,16 +2152,60 @@ init_environment (char ** argv)
2139 if (!getenv (env_vars[i].name)) 2152 if (!getenv (env_vars[i].name))
2140 { 2153 {
2141 int dont_free = 0; 2154 int dont_free = 0;
2155 char bufc[SET_ENV_BUF_SIZE];
2142 2156
2143 if ((lpval = w32_get_resource (env_vars[i].name, &dwType)) == NULL 2157 if ((lpval = w32_get_resource (env_vars[i].name, &dwType)) == NULL
2144 /* Also ignore empty environment variables. */ 2158 /* Also ignore empty environment variables. */
2145 || *lpval == 0) 2159 || *lpval == 0)
2146 { 2160 {
2147 xfree (lpval); 2161 xfree (lpval);
2148 lpval = env_vars[i].def_value;
2149 dwType = REG_EXPAND_SZ;
2150 dont_free = 1; 2162 dont_free = 1;
2151 if (!strcmp (env_vars[i].name, "HOME") && !appdata) 2163 if (strcmp (env_vars[i].name, "SHELL") == 0)
2164 {
2165 /* Look for cmdproxy.exe in every directory in
2166 PATH_EXEC. FIXME: This does not find cmdproxy
2167 in nt/ when we run uninstalled. */
2168 char fname[MAX_PATH];
2169 const char *pstart = PATH_EXEC, *pend;
2170
2171 do {
2172 pend = _mbschr (pstart, ';');
2173 if (!pend)
2174 pend = pstart + strlen (pstart);
2175 /* Be defensive against series of ;;; characters. */
2176 if (pend > pstart)
2177 {
2178 strncpy (fname, pstart, pend - pstart);
2179 fname[pend - pstart] = '/';
2180 strcpy (&fname[pend - pstart + 1], "cmdproxy.exe");
2181 ExpandEnvironmentStrings ((LPSTR) fname, bufc,
2182 sizeof (bufc));
2183 if (check_existing (bufc))
2184 {
2185 lpval = bufc;
2186 dwType = REG_SZ;
2187 break;
2188 }
2189 }
2190 if (*pend)
2191 pstart = pend + 1;
2192 else
2193 pstart = pend;
2194 if (!*pstart)
2195 {
2196 /* If not found in any directory, use the
2197 default as the last resort. */
2198 lpval = env_vars[i].def_value;
2199 dwType = REG_EXPAND_SZ;
2200 }
2201 } while (*pstart);
2202 }
2203 else
2204 {
2205 lpval = env_vars[i].def_value;
2206 dwType = REG_EXPAND_SZ;
2207 }
2208 if (strcmp (env_vars[i].name, "HOME") == 0 && !appdata)
2152 Vdelayed_warnings_list 2209 Vdelayed_warnings_list
2153 = Fcons (listn (CONSTYPE_HEAP, 2, 2210 = Fcons (listn (CONSTYPE_HEAP, 2,
2154 intern ("initialization"), 2211 intern ("initialization"),
@@ -2394,8 +2451,8 @@ get_emacs_configuration_options (void)
2394#include <sys/timeb.h> 2451#include <sys/timeb.h>
2395 2452
2396/* Emulate gettimeofday (Ulrich Leodolter, 1/11/95). */ 2453/* Emulate gettimeofday (Ulrich Leodolter, 1/11/95). */
2397void 2454int
2398gettimeofday (struct timeval *tv, struct timezone *tz) 2455gettimeofday (struct timeval *restrict tv, struct timezone *restrict tz)
2399{ 2456{
2400 struct _timeb tb; 2457 struct _timeb tb;
2401 _ftime (&tb); 2458 _ftime (&tb);
@@ -2413,6 +2470,7 @@ gettimeofday (struct timeval *tv, struct timezone *tz)
2413 tz->tz_minuteswest = tb.timezone; /* minutes west of Greenwich */ 2470 tz->tz_minuteswest = tb.timezone; /* minutes west of Greenwich */
2414 tz->tz_dsttime = tb.dstflag; /* type of dst correction */ 2471 tz->tz_dsttime = tb.dstflag; /* type of dst correction */
2415 } 2472 }
2473 return 0;
2416} 2474}
2417 2475
2418/* Emulate fdutimens. */ 2476/* Emulate fdutimens. */