]> code.delx.au - gnu-emacs/blobdiff - nt/INSTALL
* doc/misc/org.texi: Fix previous change.
[gnu-emacs] / nt / INSTALL
index b4a97011922be07ccdca0779767c1b58125f4d7a..0c4b50f0c284819fa09095c1f31bd5c5feccffd9 100644 (file)
@@ -1,7 +1,7 @@
                    Building and Installing Emacs on Windows
                           (from 95 to 7 and beyond)
 
-  Copyright (C) 2001-201 Free Software Foundation, Inc.
+  Copyright (C) 2001-2013 Free Software Foundation, Inc.
   See the end of the file for license conditions.
 
 * For the impatient
 
        cd nt
 
-  2. Run configure.bat.  From the COMMAND.COM/CMD.EXE command prompt:
+  2. Run configure.bat.
+
+  2a.If you use MSVC, set up the build environment by running the
+     SetEnv.cmd batch file from the appropriate SDK directory.  (Skip
+     this step if you are using MinGW.)  For example:
+
+       "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x86 /Debug
+
+      if you are going to compile a debug version, or
+
+       "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x86 /Release
+
+      if you are going to compile an optimized version.
+
+  2b.From the COMMAND.COM/CMD.EXE command prompt type:
 
        configure
 
-     from a Unixy shell prompt:
+     From a Unixy shell prompt:
 
        cmd /c configure.bat
      or
        command.com /c configure.bat
 
   3. Run the Make utility suitable for your environment.  If you build
-     with the Microsoft's Visual C compiler (but see notes about using
-     VC++ 8.0 and later below):
+     with the Microsoft's Visual C compiler:
 
        nmake
 
      With GNU Make, you can use the -j command-line option to have
      Make execute several commands at once, like this:
 
+       gmake -j 2
+
+     (With versions of GNU Make before 3.82, you need also set the
+     XMFLAGS variable, like this:
+
        gmake -j 2 XMFLAGS="-j 2"
 
-     The XMFLAGS variable overrides the default behavior of GNU Make
-     on Windows, whereby recursive Make invocations reset the maximum
-     number of simultaneous commands to 1.  The above command allows
-     up to 4 simultaneous commands at once in the top-level Make, and
-     up to 3 in each one of the recursive Make's.
+     The XMFLAGS variable overrides the default behavior of version
+     3.82 and older of GNU Make on Windows, whereby recursive Make
+     invocations reset the maximum number of simultaneous commands to
+     1.  The above command allows 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 Bazaar,
      and if you have makeinfo.exe installed):
   WinZip is known to create some subtle and hard to debug problems,
   such as converting files to DOS CR-LF format, not creating empty
   directories, etc.  We suggest to use djtarnt.exe from the GNU FTP
-  site.
+  site.  For modern formats, such as .tar.xz, we suggest bsdtar.exe
+  from the libarchive package; its precompiled Windows binaries are
+  available from this site:
 
-  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.
+    http://sourceforge.net/projects/ezwinports/files/
+
+  In addition to this file, if you build a development snapshot, you
+  should also read INSTALL.BZR in the parent directory.
 
 * Supported development environments
 
   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 (VC++ 8.0) and
-  later is not supported at this time, due to changes introduced by
-  Microsoft into the libraries shipped with the compiler.
+  later and nmake, or a Windows port of GCC 2.95 or later with MinGW
+  and Windows 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).
 
   The rest of this file assumes you have a working development
-  environment.  If you just installed  such an environment, try
+  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!  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.
+  installed VS.NET.  With other versions of MSVC, run the SetEnv.cmd
+  batch file from the `Bin' subdirectory of the directory where you
+  have the SDK installed.
 
   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
   "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.
   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).
+  Windows (http://www.gtk.org/download/win32.php).
 
   Versions 1.4.0 and later of libpng are binary incompatible with
   earlier versions, so Emacs will only look for libpng libraries which
   session.
 
   You can get pre-built binaries (including any required DLL and the
-  gnutls.h file) and an installer at http://josefsson.org/gnutls4win/.
+  header files) at http://sourceforge.net/projects/ezwinports/files/.
+
+* Optional libxml2 support
+
+  If configure.bat finds the libxml/HTMLparser.h file in the include path,
+  Emacs is built with libxml2 support by default; to avoid that you can
+  pass the argument --without-libxml2.
+
+  In order to support libxml2 at runtime, a libxml2-enabled Emacs must
+  be able to find the relevant DLLs during startup; failure to do so
+  is not an error, but libxml2 features won't be available to the
+  running session.
+
+  One place where you can get pre-built Windows binaries of libxml2
+  (including any required DLL and the header files) is here:
+
+     http://sourceforge.net/projects/ezwinports/files/
+
+  To compile Emacs with libxml2 from that site, you will need to pass
+  the "--cflags -I/path/to/include/libxml2" option to configure.bat,
+  because libxml2 header files are installed in the include/libxml2
+  subdirectory of the directory where you unzip the binary
+  distribution.  Other binary distributions might use other
+  directories, although include/libxml2 is the canonical place where
+  libxml2 headers are installed on Posix platforms.
+
+  You will also need to install the libiconv "development" tarball,
+  because the libiconv headers need to be available to the compiler
+  when you compile with libxml2 support.  A MinGW port of libiconv can
+  be found on the MinGW site:
+
+   http://sourceforge.net/projects/mingw/files/MinGW/Base/libiconv/
+
+  You need the libiconv-X.Y.Z-N-mingw32-dev.tar.lzma tarball from that
+  site.
 
 * Experimental SVG support
 
   maybe a problem with the way Cairo or librsvg is using it that
   doesn't show up on other platforms.
 
+* Optional extra runtime checks
+
+  The configure.bat option --enable-checking builds Emacs with some
+  optional extra runtime checks and assertions enabled.  This may be
+  useful for debugging.
+
+* Optional extra libraries
+
+  You can pass --lib LIBNAME option to configure.bat to cause Emacs to
+  link with the specified library.  You can use this option more than once.
+
 * Building
 
   After running configure, simply run the appropriate `make' program for
 * 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
+  Emacs stem from using an old version of GCC, or old MinGW or Windows API
   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,
   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.
-  Older versions of the W32 API headers that come with Cygwin and MinGW
+  Older versions of the Windows 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.
   the debugger, and you will be able to debug the cause of the fatal
   error.
 
+  The single most important thing to find out when Emacs aborts or
+  crashes is where did that happen in the Emacs code.  This is called
+  "backtrace".
+
+  Emacs on Windows uses more than one thread.  When Emacs aborts due
+  to a fatal error, the current thread may not be the application
+  thread running Emacs code.  Therefore, to produce a meaningful
+  backtrace from a debugger, you need to instruct it to show the
+  backtrace for every thread.  With GDB, you do it like this:
+
+   (gdb) thread apply all backtrace
+
+  To run Emacs under a debugger to begin with, simply start it from
+  the debugger.  With GDB, chdir to the `src' directory (if you have
+  the source tree) or to a directory with the `.gdbinit' file (if you
+  don't have the source tree), and type these commands:
+
+    C:\whatever\src> gdb x:\path\to\emacs.exe
+    (gdb) run <ARGUMENTS TO EMACS>
+
+  Thereafter, use Emacs as usual; you can minimize the debugger
+  window, if you like.  The debugger will take control if and when
+  Emacs crashes.
+
   Emacs functions implemented in C use a naming convention that reflects
   their names in lisp.  The names of the C routines are the lisp names
   prefixed with 'F', and with dashes converted to underscores.  For