Correct buggy dispatch logic.
[bpt/emacs.git] / nt / INSTALL
index b0a1d92..0c1ae49 100644 (file)
@@ -1,15 +1,18 @@
                      Building and Installing Emacs
                on Windows NT/2K/XP and Windows 95/98/ME
 
-  Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+  Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
     Free Software Foundation, Inc.
   See the end of the file for license conditions.
 
 * For the impatient
 
   Here are the concise instructions for configuring and building the
-  native Win32 binary of Emacs on Windows, for those who want to skip
-  the complex explanations and ``just do it'':
+  native Windows binary of Emacs, for those who want to skip the
+  complex explanations and ``just do it'':
+
+  Do not use this recipe with Cygwin.  For building on Cygwin,
+  use the normal installation instructions, ../INSTALL.
 
   1. Change to the `nt' directory (the directory of this file):
 
@@ -26,7 +29,8 @@
        command.com /c configure.bat
 
   3. Run the Make utility suitable for your environment.  If you build
-     with the Microsoft's Visual C compiler:
+     with the Microsoft's Visual C compiler (but see notes about using
+     VC++ 8.0 and later below):
 
        nmake
 
 
 * Preliminaries
 
+  If you want to build a Cygwin port of Emacs, use the instructions in
+  the INSTALL file in the main Emacs directory (the parent of this
+  directory).  These instructions are for building a native Windows
+  binary of Emacs.
+
   If you used WinZip to unpack the distribution, we suggest to
   remove the files and unpack again with a different program!
   WinZip is known to create some subtle and hard to debug problems,
   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
   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
 
 * Supported development environments
 
-  To compile Emacs, you will need either Microsoft Visual C++ 2.0 or
-  later and nmake, or a Windows port of GCC 2.95 or later with MinGW
-  and W32 API support and a port of GNU Make.  You can use the Cygwin
-  ports of GCC, but Emacs requires the MinGW headers and libraries to
-  build (latest versions of the Cygwin toolkit, at least since v1.3.3,
-  include the MinGW headers and libraries as an integral part).
+  To compile Emacs, you will need either Microsoft Visual C++ 2.0, or
+  later up to 7.0, and nmake, or a Windows port of GCC 2.95 or later
+  with MinGW and W32 API support and a port of GNU Make.  You can use
+  the Cygwin ports of GCC, but Emacs requires the MinGW headers and
+  libraries to build (latest versions of the Cygwin toolkit, at least
+  since v1.3.3, include the MinGW headers and libraries as an integral
+  part).
 
-  Note that building Emacs with Visual Studio 2005 is not supported at
-  this time.
+  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.
 
   The rest of this file assumes you have a working development
   environment.  If you just installed  such an environment, try
   building a trivial C "Hello world" program, and see if it works.  If
-  it doesn't work, resolve that problem first!
+  it doesn't work, resolve that problem first!  If you use Microsoft
+  Visual Studio .NET 2003, don't forget to run the VCVARS32.BAT batch
+  file from the `Bin' subdirectory of the directory where you have
+  installed VS.NET.
 
   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
     cygwin compiled gmake 3.77:          fails[1, 5]   fails[2, 5]
     cygwin compiled make 3.78.1:         fails[5]      fails[2, 5]
     cygwin compiled make 3.79.1:         fails[3, 5]   fails[2?, 5]
-    cygwin compiled make 3.80:           fails?[6]     fails?[6]
-    cygwin compiled make 3.81:           fails         fails?[6]
+    cygwin compiled make 3.80:           okay[6]       fails?[7]
+    cygwin compiled make 3.81:           fails         fails?[7]
     mingw32 compiled make 3.79.1:        okay          okay
-    mingw32 compiled make 3.80:          okay          okay[6]
-    mingw32 compiled make 3.81:          okay          okay[7]
+    mingw32 compiled make 3.80:          okay          okay[7]
+    mingw32 compiled make 3.81:          okay          okay[8]
 
   Notes:
 
     [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.
-    [6] not recommended; please report if you try this combination.
-    [7] tested only on Windows XP.
+    [6] need to uncomment 3 lines in nt/gmake.defs that invoke `cygpath'
+       (look for "cygpath" near line 85 of gmake.defs).
+    [7] not recommended; please report if you try this combination.
+    [8] tested only on Windows XP.
 
   Other compilers may work, but specific reports from people that have
   tried suggest that the Intel C compiler (for example) may produce an
-  Emacs executable with strange filename completion behaviour.  Unless
+  Emacs executable with strange filename completion behavior.  Unless
   you would like to assist by finding and fixing the cause of any bugs
   like this, we recommend the use of the supported compilers mentioned
   in the previous paragraph.
 
     http://www.emacswiki.org/cgi-bin/wiki/WThirtyTwoInstallationKit
 
-  and at this URL:
+  and on these URLs:
 
     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.
 
 * Configuring
 
   To configure Emacs to build with GCC or MSVC, whichever is available,
   simply change to the `nt' subdirectory and run `configure.bat' with no
   options.  To see what options are available, run `configure --help'.
+  Do NOT use the --no-debug option to configure.bat unless you are
+  absolutely sure the produced binaries will never need to be run under
+  a debugger.
 
   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
-  surpressed 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
   Some image libraries have dependencies on one another, or on zlib.
   For example, tiff support depends on the jpeg library.  If you did not
   compile the libraries yourself, you must make sure that any dependency
-  is in the PATH or otherwise accesible and that the binaries are
+  is in the PATH or otherwise accessible and that the binaries are
   compatible (for example, that they were built with the same compiler).
 
   Binaries for the image libraries (among many others) can be found at
-  the GnuWin32 project.  These are built with MinGW, but they can be
-  used with both GCC/MinGW and MSVC builds of Emacs.  See the info on
-  http://ourcomments.org/Emacs/EmacsW32.html for more details about
-  installing image support libraries.
+  the GnuWin32 project.  PNG, JPEG and TIFF libraries are also
+  included with GTK, which is installed along with other Free Software
+  that requires it.  These are built with MinGW, but they can be used
+  with both GCC/MinGW and MSVC builds of Emacs.  See the info on
+  http://ourcomments.org/Emacs/w32-build-emacs.html, under "How to Get
+  Images Support", for more details about installing image support
+  libraries.  Note specifically that, due to some packaging snafus in
+  the GnuWin32-supplied image libraries, you will need to download
+  _source_ packages for some of the libraries in order to get the
+  header files necessary for building Emacs with image support.
+
+  If GTK 2.0 is installed, addpm will arrange for its image libraries
+  to be on the DLL search path for Emacs.
 
 * Building
 
   The install process will run addpm to setup the registry entries, and
   to create a Start menu icon for Emacs.
 
+* Make targets
+
+  The following make targets may be used by users building the source
+  distribution, or users who have checked out of CVS after
+  an initial bootstrapping.
+
+  make
+  Builds Emacs from the available sources and pre-compiled lisp files.
+
+  make install
+  Installs programs to the bin directory, and runs addpm to create
+  Start Menu icons.
+
+  make clean
+  Removes object and executable files produced by the build process in
+  the current configuration.  After make clean, you can rebuild with
+  the same configuration using make.
+
+  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
+  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
+  by make to rebuild.
+
+  make cleanall
+  Removes object and executable files that may have been created by
+  previous builds with different configure options, in addition to
+  the files produced by the current configuration.
+
+  make realclean
+  Removes the installed files in the bin subdirectory in addition to
+  the files removed by make cleanall.
+
+
+  The following targets are intended only for users who have checked out
+  of CVS.
+
+  make bootstrap
+  Creates a temporary emacs binary with lisp source files and
+  uses it to compile the lisp files.  Once the lisp files are built,
+  emacs is redumped with the compiled lisp.
+
+  make recompile
+  Recompiles any changed lisp files after a cvs 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
+  interdependencies.
+
+  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
+  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.
+
+
 * Trouble-shooting
 
   The main problems that are likely to be encountered when building
   headers it is using, are not suitable for building Emacs.  GCC version
   2.95 or later is needed, because that is when the Windows port gained
   sufficient support for anonymous structs and unions to cope with some
-  definitions from winnt.h that are used by addsection.c.  The W32 API
-  headers that come with Cygwin b20.1 are incomplete, and do not include
-  some definitions required by addsection.c, for instance.  Also, older
-  releases of the W32 API headers from Anders Norlander contain a typo
-  in the definition of IMAGE_FIRST_SECTION in winnt.h, which
-  addsection.c relies on.  Versions of w32api-xxx.zip from at least
-  1999-11-18 onwards are okay.
+  definitions from winnt.h that are used by addsection.c.
+  Older versions of the W32 API headers that come with Cygwin and MinGW
+  may be missing some definitions required by Emacs, or broken in other
+  ways.  In particular, uniscribe APIs were added to MinGW CVS only on
+  2006-03-26, so releases from before then cannot be used.
 
   When in doubt about correctness of what configure did, look at the file
   config.log, which shows all the failed test programs and compiler
 
   You should be able to debug Emacs using the debugger that is
   appropriate for the compiler you used, namely DevStudio or Windbg if
-  compiled with MSVC, or GDB if compiled with GCC.
+  compiled with MSVC, or GDB if compiled with GCC.  (GDB for Windows
+  is available from the MinGW site, http://www.mingw.org/download.shtml.)
 
   When Emacs aborts due to a fatal internal error, Emacs on Windows
   pops up an Emacs Abort Dialog asking you whether you want to debug
   should be displayed in its "Debug" output window.
 
   When you are in the process of debugging Emacs and you would like to
-  examine the contents of a Lisp_Object variable, popup the QuickWatch
+  examine the contents of a Lisp_Object variable, pop up the QuickWatch
   window (QuickWatch has an eyeglass symbol on its button in the
   toolbar).  In the text field at the top of the window, enter
   debug_print(<variable>) and hit return.  For example, start and run
@@ -424,7 +528,7 @@ This file is part of GNU Emacs.
 
 GNU Emacs is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
 any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,