Merge: Use pthread_sigmask, not sigprocmask (Bug#9010).
[bpt/emacs.git] / nt / INSTALL
index 3157961..b4a9701 100644 (file)
@@ -1,8 +1,7 @@
-                     Building and Installing Emacs
-               on Windows NT/2K/XP and Windows 95/98/ME
+                   Building and Installing Emacs on Windows
+                          (from 95 to 7 and beyond)
 
-  Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-    Free Software Foundation, Inc.
+  Copyright (C) 2001-2011  Free Software Foundation, Inc.
   See the end of the file for license conditions.
 
 * For the impatient
   Do not use this recipe with Cygwin.  For building on Cygwin,
   use the normal installation instructions, ../INSTALL.
 
+  If you have a Cygwin or MSYS port of Bash on your Path, you will be
+  better off removing it from PATH.  (For details, search for "MSYS
+  sh.exe" below.)
+
   1. Change to the `nt' directory (the directory of this file):
 
        cd nt
@@ -46,7 +49,7 @@
      or
        gmake
 
-     (If you are building from CVS, say "make bootstrap" or "nmake
+     (If you are building from Bazaar, say "make bootstrap" or "nmake
      bootstrap" instead, and avoid using Cygwin make.)
 
      With GNU Make, you can use the -j command-line option to have
@@ -60,8 +63,8 @@
      up to 4 simultaneous commands at once in the top-level Make, and
      up to 3 in each one of the recursive Make's.
 
-  4. Generate the Info manuals (only if you are building out of CVS, and
-     if you have makeinfo.exe installed):
+  4. Generate the Info manuals (only if you are building out of Bazaar,
+     and if you have makeinfo.exe installed):
 
      make info
 
   directories, etc.  We suggest to use djtarnt.exe from the GNU FTP
   site.
 
-  If you are building out of CVS, then some files in this directory
-  (.bat files, nmake.defs and makefile.w32-in) may need the line-ends
-  fixing first. The easiest way to do this and avoid future conflicts
-  is to run the following command in this (emacs/nt) directory:
-
-     cvs update -kb
-
-  Alternatively, use programs that convert end-of-line format, such as
-  dos2unix and unix2dos available from GnuWin32 or dtou and utod from
-  the DJGPP project.
-
-  Additionally, the files lisp/international/uni-*.el and
-  lisp/ldefs-boot.el need Unix line ends due to some embedded ^M
-  characters that are not at the end of the line.  So in the
-  lisp/international directory you should run the following command, or
-  use dos2unix on those files.
-
-     cvs update -kb uni-*.el
-
-  and in the lisp directory, use the command:
-
-     cvs update -kb lisp/ldefs-boot.el
-
-  In addition to this file, you should also read INSTALL.CVS in the
+  In addition to this file, you should also read INSTALL.BZR in the
   parent directory, and make sure that you have a version of
   "touch.exe" in your path, and that it will create files that do not
   yet exist.
   since v1.3.3, include the MinGW headers and libraries as an integral
   part).
 
-  Note that building Emacs with Visual Studio 2005 (VC++ 8.0) is not
-  supported at this time, due to changes introduced by Microsoft into
-  the libraries shipped with the compiler.
+  Note that building Emacs with Visual Studio 2005 (VC++ 8.0) and
+  later is not supported at this time, due to changes introduced by
+  Microsoft into the libraries shipped with the compiler.
 
   The rest of this file assumes you have a working development
   environment.  If you just installed  such an environment, try
   If you use the MinGW port of GCC and GNU Make to build Emacs, there
   are some compatibility issues wrt Make and the shell that is run by
   Make, either the standard COMMAND.COM/CMD.EXE supplied with Windows
-  or sh.exe., a port of a Unixy shell.  For reference, below is a list
+  or sh.exe, a port of a Unixy shell.  For reference, below is a list
   of which builds of GNU Make are known to work or not, and whether
   they work in the presence and/or absence of sh.exe, the Cygwin port
-  of Bash. Note that any version of Make that is compiled with Cygwin
-  will only work with Cygwin tools, due to the use of cygwin style
+  of Bash.  Note that any version of Make that is compiled with Cygwin
+  will only work with Cygwin tools, due to the use of Cygwin style
   paths.  This means Cygwin Make is unsuitable for building parts of
   Emacs that need to invoke Emacs itself (leim and "make bootstrap",
   for example).  Also see the Trouble-shooting section below if you
   decide to go ahead and use Cygwin make.
 
-  In addition, using 4NT as your shell is known to fail the build process,
-  at least for 4NT version 3.01.  Use CMD.EXE, the default Windows shell,
-  instead. MSYS sh.exe also appears to cause various problems. If you have
-  MSYS installed, try "make SHELL=cmd.exe" to force the use of cmd.exe
-  instead of sh.exe.
+  In addition, using 4NT or TCC as your shell is known to fail the
+  build process, at least since 4NT version 3.01.  Use CMD.EXE, the
+  default Windows shell, instead.  MSYS sh.exe also appears to cause
+  various problems, e.g., it is known to cause failures in commands
+  like "cmd /c FOO" in the Makefiles, because it thinks "/c" is a
+  Unix-style file name that needs conversion to the Windows format.
+  If you have MSYS installed, try "make SHELL=cmd.exe" to force the
+  use of cmd.exe instead of the MSYS sh.exe.
 
                                          sh exists     no sh
 
         emacs source with text!=binary.
     [2] fails when needs to invoke shell commands; okay invoking gcc etc.
     [3] requires LC_MESSAGES support to build; cannot build with early
-        versions of cygwin.
+        versions of Cygwin.
     [4] may fail on Windows 9X and Windows ME; if so, install Bash.
     [5] fails when building leim due to the use of cygwin style paths.
         May work if building emacs without leim.
   like this, we recommend the use of the supported compilers mentioned
   in the previous paragraph.
 
-  You will also need a copy of the Posix cp, rm and mv programs.  These
-  and other useful Posix utilities can be obtained from one of several
+  You will also need a copy of the POSIX cp, rm and mv programs.  These
+  and other useful POSIX utilities can be obtained from one of several
   projects:
 
   * http://gnuwin32.sourceforge.net/              ( GnuWin32 )
   * http://www.cygwin.com/                        ( Cygwin   )
   * http://unxutils.sourceforge.net/              ( UnxUtils )
 
-  If you build Emacs on Windows 9X or ME, not on Windows 2K/XP or
-  Windows NT, we suggest to install the Cygwin port of Bash.  That is
-  because the native Windows shell COMMAND.COM is too limited; the
-  Emacs build procedure tries very hard to support even such limited
-  shells, but as none of the Windows developers of Emacs work on
-  Windows 9x, we cannot guarantee that it works without a more
-  powerful shell.
+  If you build Emacs on 16-bit versions of Windows (9X or ME), we
+  suggest to install the Cygwin port of Bash.  That is because the
+  native Windows shell COMMAND.COM is too limited; the Emacs build
+  procedure tries very hard to support even such limited shells, but
+  as none of the Windows developers of Emacs work on Windows 9X, we
+  cannot guarantee that it works without a more powerful shell.
 
   Additional instructions and help for building Emacs on Windows can be
   found at the Emacs Wiki:
     http://ourcomments.org/Emacs/w32-build-emacs.html
     http://derekslager.com/blog/posts/2007/01/emacs-hack-3-compile-emacs-from-cvs-on-windows.ashx
 
-  The second URL above includes instructions for building with MSVC,
-  as well as with MinGW, while the first URL covers only MinGW, but
-  has more details about it.
+  Both of those pages were written before Emacs switched from CVS to
+  Bazaar, but the parts about building Emacs still apply in Bazaar.
+  The second URL has instructions for building with MSVC, as well as
+  with MinGW, while the first URL covers only MinGW, but has more
+  details about it.
 
 * Configuring
 
   absolutely sure the produced binaries will never need to be run under
   a debugger.
 
+  Because of limitations of the stock Windows command shells, special
+  care is needed to pass some characters in the arguments of the
+  --cflags and --ldflags options.  Backslashes should not be used in
+  file names passed to the compiler and linker via these options.  Use
+  forward slashes instead.  If the arguments to these two options
+  include the `=' character, like when passing a -DFOO=bar preprocessor
+  option, the argument with the `=' character should be enclosed in
+  quotes, like this:
+
+    configure --cflags "-DFOO=bar"
+
+  Support for options that include the `=' character require "command
+  extensions" to be enabled.  (They are enabled by default, but your
+  system administrator could have changed that.  See "cmd /?" for
+  details.)  If command extensions are disabled, a warning message might
+  be displayed informing you that "using parameters that include the =
+  character by enclosing them in quotes will not be supported."
+
+  You may also use the --cflags and --ldflags options to pass
+  additional parameters to the compiler and linker, respectively; they
+  are frequently used to pass -I and -L flags to specify supplementary
+  include and library directories.  If a directory name includes
+  spaces, you will need to enclose it in quotes, as follows
+  -I"C:/Program Files/GnuTLS-2.10.1/include".  Note that only the
+  directory name is enclosed in quotes, not the entire argument.  Also
+  note that this functionality is only supported if command extensions
+  are available.  If command extensions are disabled and you attempt to
+  use this functionality you may see the following warning message
+  "Error in --cflags argument: ... Backslashes and quotes cannot be
+  used with --cflags.  Please use forward slashes for filenames and
+  paths (e.g. when passing directories to -I)."
+  
   N.B.  It is normal to see a few error messages output while configure
   is running, when gcc support is being tested.  These cannot be
-  suppressed because of limitations in the Windows 9x command.com shell.
+  suppressed because of limitations in the Windows 9X command.com shell.
 
   You are encouraged to look at the file config.log which shows details
   for failed tests, after configure.bat finishes.  Any unexplained failure
 * Optional image library support
 
   In addition to its "native" image formats (pbm and xbm), Emacs can
-  handle other image types: xpm, tiff, gif, png and jpeg (postscript is
-  currently unsupported on Windows).  To build Emacs with support for
-  them, the corresponding headers must be in the include path when the
-  configure script is run.  This can be setup using environment
-  variables, or by specifying --cflags -I... options on the command-line
-  to configure.bat.  The configure script will report whether it was
-  able to detect the headers.  If the results of this testing appear to be
-  incorrect, please look for details in the file config.log: it will show
-  the failed test programs and compiler error messages that should explain
-  what is wrong.  (Usually, any such failures happen because some headers
-  are missing due to bad packaging of the image support libraries.)
+  handle other image types: xpm, tiff, gif, png, jpeg and experimental
+  support for svg.
+
+  To build Emacs with support for them, the corresponding headers must
+  be in the include path when the configure script is run.  This can
+  be setup using environment variables, or by specifying --cflags
+  -I... options on the command-line to configure.bat.  The configure
+  script will report whether it was able to detect the headers.  If
+  the results of this testing appear to be incorrect, please look for
+  details in the file config.log: it will show the failed test
+  programs and compiler error messages that should explain what is
+  wrong.  (Usually, any such failures happen because some headers are
+  missing due to bad packaging of the image support libraries.)
+
+  Note that any file path passed to the compiler or linker must use
+  forward slashes; using backslashes will cause compiler warnings or
+  errors about unrecognized escape sequences.
 
   To use the external image support, the DLLs implementing the
   functionality must be found when Emacs first needs them, either on the
   library is not an error; the associated image format will simply be
   unavailable.  Note that once Emacs has determined that a library can
   not be found, there's no way to force it to try again, other than
-  restarting.  See the variable `image-library-alist' to configure the
+  restarting.  See the variable `dynamic-library-alist' to configure the
   expected names of the libraries.
 
   Some image libraries have dependencies on one another, or on zlib.
   If GTK 2.0 is installed, addpm will arrange for its image libraries
   to be on the DLL search path for Emacs.
 
+  For PNG images, we recommend to use versions 1.4.x and later of
+  libpng, because previous versions had security issues.  You can find
+  precompiled libraries and headers on the GTK download page for
+  Windows (http://www.gtk.org/download-windows.html).
+
+  Versions 1.4.0 and later of libpng are binary incompatible with
+  earlier versions, so Emacs will only look for libpng libraries which
+  are compatible with the version it was compiled against.  That
+  version is given by the value of the Lisp variable `libpng-version';
+  e.g., 10403 means version 1.4.3.  The variable `dynamic-library-alist'
+  is automatically set to name only those DLL names that are known to
+  be compatible with the version given by `libpng-version'.  If PNG
+  support does not work for you even though you have the support DLL
+  installed, check the name of the installed DLL against
+  `dynamic-library-alist' and the value of `libpng-version', and
+  download compatible DLLs if needed.
+
+* Optional GnuTLS support
+
+  If configure.bat finds the gnutls/gnutls.h file in the include path,
+  Emacs is built with GnuTLS support by default; to avoid that you can
+  pass the argument --without-gnutls.
+
+  In order to support GnuTLS at runtime, a GnuTLS-enabled Emacs must
+  be able to find the relevant DLLs during startup; failure to do so
+  is not an error, but GnuTLS won't be available to the running
+  session.
+
+  You can get pre-built binaries (including any required DLL and the
+  gnutls.h file) and an installer at http://josefsson.org/gnutls4win/.
+
+* Experimental SVG support
+
+  SVG support is currently experimental, and not built by default.
+  Specify --with-svg and ensure you have all the dependencies in your
+  include path.  Unless you have built a minimalist librsvg yourself
+  (untested), librsvg depends on a significant chunk of GTK+ to build,
+  plus a few Gnome libraries, libxml2, libbz2 and zlib at runtime.  The
+  easiest way to obtain the dependencies required for building is to
+  download a pre-bundled GTK+ development environment for Windows.
+  GTK puts its header files all over the place, so you will need to
+  run pkgconfig to list the include path you will need (either passed
+  to configure.bat as --cflags options, or set in the environment).
+
+  To use librsvg at runtime, ensure that librsvg and its dependencies
+  are on your PATH.  If you didn't build librsvg yourself, you will
+  need to check with where you downloaded it from for the
+  dependencies, as there are different build options.  If it is a
+  short list, then it most likely only lists the immediate
+  dependencies of librsvg, but the dependencies themselves have
+  dependencies - so don't download individual libraries from GTK+,
+  download and install the whole thing.  If you think you've got all
+  the dependencies and SVG support is still not working, check your
+  PATH for other libraries that shadow the ones you downloaded.
+  Libraries of the same name from different sources may not be
+  compatible, this problem was encountered with libbzip2 from GnuWin32
+  with libcroco from gnome.org.
+
+  If you can see etc/images/splash.svg, then you have managed to get
+  SVG support working.  Congratulations for making it through DLL hell
+  to this point.  You'll probably find that some SVG images crash
+  Emacs.  Problems have been observed in some images that contain
+  text, they seem to be a problem in the Windows port of Pango, or
+  maybe a problem with the way Cairo or librsvg is using it that
+  doesn't show up on other platforms.
+
 * Building
 
   After running configure, simply run the appropriate `make' program for
   your compiler to build Emacs.  For MSVC, this is nmake; for GCC, it is
-  GNU make.  (If you are building out of CVS, say "make bootstrap" or
+  GNU make.  (If you are building out of Bazaar, say "make bootstrap" or
   "nmake bootstrap" instead.)
 
   As the files are compiled, you will see some warning messages
   each one of the recursive Make's; you can use other numbers of jobs,
   if you wish.
 
-  If you are building from CVS, the following commands will produce
-  the Info manuals (which are not part of the CVS repository):
+  If you are building from Bazaar, the following commands will produce
+  the Info manuals (which are not part of the Bazaar sources):
 
     make info
   or
 * Make targets
 
   The following make targets may be used by users building the source
-  distribution, or users who have checked out of CVS after
+  distribution, or users who have checked out of Bazaar after
   an initial bootstrapping.
 
   make
   make distclean
   In addition to the files removed by make clean, this also removes
   Makefiles and other generated files to get back to the state of a
-  freshly unpacked source distribution. Note that this will not remove
+  freshly unpacked source distribution.  Note that this will not remove
   installed files, or the results of builds performed with different
   compiler or optimization options than the current configuration.
   After make distclean, it is necessary to run configure.bat followed
   Removes the installed files in the bin subdirectory in addition to
   the files removed by make cleanall.
 
+  make dist
+  Builds Emacs from the available sources and pre-compiled lisp files.
+  Packages Emacs binaries as full distribution and barebin distribution.
 
-  The following targets are intended only for users who have checked out
-  of CVS.
+  The following targets are intended only for use with the Bazaar sources.
 
   make bootstrap
   Creates a temporary emacs binary with lisp source files and
   emacs is redumped with the compiled lisp.
 
   make recompile
-  Recompiles any changed lisp files after a cvs update.  This saves
+  Recompiles any changed lisp files after an update.  This saves
   doing a full bootstrap after every update.  If this or a subsequent
   make fail, you probably need to perform a full bootstrap, though
   running this target multiple times may eventually sort out the
 
   make maintainer-clean
   Removes everything that can be recreated, including compiled lisp
-  files, to get back to the state of a fresh CVS checkout.  After make
+  files, to get back to the state of a fresh Bazaar tree.  After make
   maintainer-clean, it is necessary to run configure.bat and make
   bootstrap to rebuild.  Occasionally it may be necessary to run this
-  target after a cvs update.
+  target after an update.
+
+* Creating binary distributions
+
+  Binary distributions (full and barebin distributions) can be
+  automatically built and packaged from source tarballs or a bzr
+  checkout.
+
+  When building Emacs binary distributions, the --distfiles argument
+  to configure.bat specifies files to be included in the bin directory
+  of the binary distributions. This is intended for libraries that are
+  not built as part of Emacs, e.g. image libraries.
+
+  For example, specifying
+
+       --distfiles D:\distfiles\libXpm.dll
+
+  results in libXpm.dll being copied from D:\distfiles to the
+  bin directory before packaging starts.
+
+  Multiple files can be specified using multiple --distfiles arguments:
+
+       --distfiles D:\distfiles\libXpm.dll --distfiles C:\jpeglib\jpeg.dll
+
+  For packaging the binary distributions, the 'dist' make target uses
+  7-Zip (http://www.7-zip.org), which must be installed and available
+  on the Windows Path.
 
 
 * Trouble-shooting
 
   The main problems that are likely to be encountered when building
   Emacs stem from using an old version of GCC, or old MinGW or W32 API
-  headers.  Additionally, cygwin ports of GNU make may require the Emacs
+  headers.  Additionally, Cygwin ports of GNU make may require the Emacs
   source tree to be mounted with text!=binary, because the makefiles
   generated by configure.bat necessarily use DOS line endings.  Also,
-  cygwin ports of make must run in UNIX mode, either by specifying
+  Cygwin ports of make must run in UNIX mode, either by specifying
   --unix on the command line, or MAKE_MODE=UNIX in the environment.
 
   When configure runs, it attempts to detect when GCC itself, or the