Allow packages to change the hl-line overlay priority
[emacs.git] / nt / INSTALL
blob9f543151a94baf76c0869988b0d4c440a2fb1609
1                     Building and Installing Emacs on MS-Windows
2                           using the MSYS and MinGW tools
4   Copyright (C) 2013-2021 Free Software Foundation, Inc.
5   See the end of the file for license conditions.
7 The MSYS/MinGW build described here is supported on versions of
8 Windows starting with Windows XP and newer.  Building on Windows 2000
9 and Windows 9X is not supported (but the Emacs binary produced by this
10 build will run on Windows 9X and newer systems).
12   Do not use this recipe with Cygwin.  For building on Cygwin, use the
13   normal installation instructions, ../INSTALL.
15   For building Emacs using the MinGW64/MSYS2 toolchain, see the
16   instructions in the file INSTALL.W64 in this directory.
18 * For the brave (a.k.a. "impatient"):
20   For those who have a working MSYS/MinGW development environment and
21   are comfortable with running Posix configure scripts, here are the
22   concise instructions for configuring and building the native Windows
23   binary of Emacs with these tools:
25   0. Start the MSYS Bash window.  Everything else below is done from
26      that window's Bash prompt.
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:
32       ./autogen.sh
34   1. If you want to build Emacs outside of the source tree
35      (recommended), create the build directory and chdir there.
37   2. Invoke the configure script:
39       - If you are building outside the source tree:
41         /PATH/TO/EMACS/SOURCE/TREE/configure --prefix=PREFIX ...
43       - If you are building in-place, i.e. inside the source tree:
45         ./configure --prefix=PREFIX ...
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 (see the detailed
50      instructions for the reasons).  The prefix must be absolute.
52      You can pass other options to the configure script.  Here's a
53      typical example (for an in-place debug build):
55        ./configure --prefix=/d/usr/emacs --enable-checking='yes,glyphs' \
56          CFLAGS='-O0 -g3'
58   3. After the configure script finishes, it should display the
59      resulting configuration.  After that, type
61        make
63      Use "make -j N" if your MSYS Make supports parallel execution;
64      the build will take significantly less time in that case.  Here N
65      is the number of simultaneous parallel jobs; use the number of
66      the cores on your system.
68   4. Install the produced binaries:
70        make install
72      If you want the installation tree to go to a place that is
73      different from the one specified by --prefix, say
75        make install prefix=/where/ever/you/want
77   That's it!
79   If these short instructions somehow fail, read the rest of this
80   file.
82 * Installing Git for Windows
84   Skip this section if you already have Git installed and configured,
85   or if you are building from the release tarball, not from the
86   development repository.
88   Git for Windows is available from this download page:
90     https://github.com/git-for-windows/git/releases
92   That page offers both 32-bit and 64-bit installations; pick the one
93   suitable for your OS.  In general, we recommend to install a 64-bit
94   Git if you have a 64-bit Windows system; the 32-bit Git will run on
95   64-bit Windows just fine, but might run into memory problems where
96   the 64-bit Git won't.
98   During Git installation, be sure to select the "Checkout as-is,
99   commit as-is" option from the "Configure line ending conversions"
100   dialog.  Otherwise, Git will convert text files to DOS-style CRLF
101   end-of-line (EOL) format, which will cause subtle problems when
102   building Emacs, because MSYS tools (see below) used to build Emacs
103   use binary file I/O that preserves the CR characters that get in the
104   way of some text-processing tools, like 'makeinfo' and the commands
105   invoked by the autogen.sh script.
107   If you already have Git installed and configured with some other EOL
108   conversion option, you will need to reconfigure it, removing the
109   following variables from all of your .gitconfig files:
111     core.eol
112     core.safecrlf
113     core.autocrlf
115   If you cloned the Emacs directory before changing these config
116   variables, you will have to delete the repository and re-clone it
117   after the change.
119   The instructions for cloning the Emacs repository can be found on
120   the Emacs's Savannah project page:
122     https://savannah.gnu.org/projects/emacs
124 * Installing MinGW and MSYS
126   Make sure you carefully read the following two sections in their
127   entirety and install/configure the various packages as instructed.
128   A correct installation makes all the rest almost trivial; a botched
129   installation will likely make you miserable for quite some time.
131   There are two alternatives to installing MinGW + MSYS: using the GUI
132   installer, called mingw-get, provided by the MinGW project, or
133   manual installation.  The next two sections describe each one of
134   these.
136 ** Installing MinGW and MSYS using mingw-get
138   A nice installer, called mingw-get, is available for those who don't
139   like to mess with manual installations.  You can download it from
140   here:
142     https://sourceforge.net/projects/mingw/files/Installer/mingw-get/
144   (This installer only supports packages downloaded from the MinGW
145   site; for the rest you will still need the manual method.)
147   After installing mingw-get, invoke it to install the packages that
148   are already selected by default on the "Select Components" screen of
149   its wizard.
151   After that, use "mingw-get install PACKAGE" to install the following
152   additional packages:
154    . msys-base
155    . mingw-developer-toolkit
157   When the installation ends, perform the post-installation steps
158   described on this page of the MinGW site:
160     http://www.mingw.org/wiki/Getting_Started
162   in the "After Installing You Should ..." section.  These steps are
163   important for making your installation complete, and in particular
164   will produce a desktop shortcut for running the MSYS Bash shell,
165   from which you will configure and build Emacs.  Once you've made the
166   shortcut, double-click on it to open the MSYS Bash shell window,
167   where you will proceed with the rest of these instructions.
169   In addition, we suggest to modify your system-wide Path variable to
170   include the 'bin' subdirectory of your top-level MinGW installation
171   directory, the one you specified to mingw-get ("C:\MinGW" by
172   default).  This will allow you to invoke the MinGW development
173   tools, like GCC, from the Windows cmd.exe shell windows or from
174   other Windows programs (including Emacs, after you build and install
175   it).
177   (We recommend that you refrain from installing the MSYS Texinfo
178   package, which is part of msys-base, because it might produce mixed
179   EOL format when installing Info files.  Instead, install the MinGW
180   port of Texinfo, see the ezwinports URL below.  To uninstall the
181   MSYS Texinfo, after installing it as part of msys-base, invoke the
182   command "mingw-get remove msys-texinfo", or mark "msys-texinfo" for
183   removal in the mingw-get GUI, then select Installation->Apply Changes.)
185   (Similarly, we recommend to refrain from installing the MinGW
186   Autoconf package; instead, install its MSYS build available from the
187   ezwinports site, see below.)
189   At this point, you should be ready to configure and build Emacs in
190   its basic configuration.  Skip to the "Generating the configure
191   script" section for the build instructions.  If you want to build it
192   with image support and other optional libraries, read about the
193   optional libraries near the end of this document, before you start
194   the build.  Also, consider installing additional MinGW packages that
195   are required/recommended, especially if you are building from the
196   development repository, as described in the next section.
198 ** Installing MinGW and MSYS manually
200 *** MinGW
202   You will need to install the MinGW port of GCC and Binutils, and the
203   MinGW runtime and Windows API distributions, to compile Emacs.  You
204   can find these on the MinGW download/Base page:
206     https://sourceforge.net/projects/mingw/files/MinGW/Base/
208   In general, install the latest stable versions of the following
209   MinGW packages from that page: gcc, binutils, mingw-rt, w32api.  You
210   only need the 'bin' and the 'dll' tarballs of each of the above.
212   MinGW packages are distributed as .tar.lzma compressed archives.  To
213   install the packages manually, we recommend to use the Windows port
214   of the 'bsdtar' program to unpack the tarballs.  'bsdtar' is
215   available as part of the 'libarchive' package from here:
217     http://sourceforge.net/projects/ezwinports/files/
219   The recommended place to install these packages is a single tree
220   starting from some directory on a drive other than the system drive
221   C:.  A typical example would be D:\usr, with D:\usr\bin holding the
222   binaries and DLLs (should be added to your Path environment
223   variable), D:\usr\include holding the include files, D:\usr\lib
224   holding the static and import libraries, D:\usr\share holding docs,
225   message catalogs, and package-specific subdirectories, etc.
227   Having all the headers and libraries in a single place will greatly
228   reduce the number of -I and -L flags you will have to pass to the
229   configure script (see below), as these files will be right where the
230   compiler expects them.
232   We specifically do NOT recommend installing packages below
233   "C:\Program Files" or "C:\Program Files (x86)".  These directories
234   are protected on versions of Windows from Vista and on, and you will
235   have difficulties updating and maintaining your installation later,
236   due to UAC elevation prompts, file virtualization, etc.  You *have*
237   been warned!
239   Additional MinGW packages are required/recommended, especially if
240   you are building from the development repository:
242    . Texinfo (needed to produce the Info manuals when building from
243      the repository, and for "make install")
245      Available from http://sourceforge.net/projects/ezwinports/files/.
247    . pkg-config (invoked by the configure script to look for optional
248      packages)
250      Available from http://sourceforge.net/projects/ezwinports/files/.
252    . gzip (needed to compress files during "make install")
254      Available from http://gnuwin32.sourceforge.net/packages/gzip.htm.
256   Each package might list other packages as prerequisites on its
257   download page (under "Runtime requirements"); download those as
258   well.  (Using the mingw-get installer will fetch those prerequisites
259   automatically for you.)  A missing prerequisite will manifest itself
260   by the program failing to run and presenting a pop-up dialog that
261   states the missing or incompatible DLL; be sure to find and install
262   these missing DLLs.
264   Once you think you have MinGW installed, test the installation by
265   building a trivial "hello, world!" program, and make sure that it
266   builds without any error messages and the binary works when run.
268 *** MSYS
270   You will need a reasonably full MSYS installation.  MSYS is an
271   environment needed to run the Posix configure scripts and the
272   resulting Makefile's, in order to produce native Windows binaries
273   using the MinGW compiler and runtime libraries.  Here's the list of
274   MSYS packages that are required:
276    . All the packages from the MSYS Base distribution, listed here:
278      https://sourceforge.net/projects/mingw/files/MSYS/Base/
280    . Additional packages listed below, from the MSYS Extension
281      distribution here:
283      https://sourceforge.net/projects/mingw/files/MSYS/Extension/
285       - flex
286       - bison
287       - m4
288       - perl
289       - mktemp
291      These should only be needed if you intend to build development
292      versions of Emacs from the repository.
294    . Additional package (needed only if building from the repository):
295      Autoconf.  It is available from here:
297        http://sourceforge.net/projects/ezwinports/files/autoconf-2.65-msys-bin.zip/download
299   MSYS packages are distributed as .tar.lzma compressed archives.  To
300   install the packages manually, we recommend to use the Windows port
301   of the 'bsdtar' program, already mentioned above.
303   MSYS packages should be installed in a separate tree from MinGW.
304   For example, use D:\MSYS or D:\usr\MSYS as the top-level directory
305   from which you unpack all of the MSYS packages.
307   After installing Autoconf, make sure any of the *.m4 files you might
308   have in your MinGW installation also exist in the MSYS installation
309   tree, in the share/aclocal directory.  Those *.m4 files which exist
310   in the MinGW tree, but not in the MSYS tree should be copied there.
312   If/when you are confident in your MinGW/MSYS installation, and want
313   to speed up the builds, we recommend installing a pre-release
314   version of Make from here:
316      https://sourceforge.net/projects/mingwbuilds/files/external-binary-packages/
318   These are snapshot builds of many packages, but you only need
319   make.exe from there.  The advantage of this make.exe is that it
320   supports parallel builds, so you can use "make -j N" to considerably
321   speed up your builds.
323   Several users reported that MSYS 1.0.18 causes Make to hang in
324   parallel builds.  If you bump into this, we suggest to downgrade to
325   MSYS 1.0.17, which doesn't have that problem.
327   For each of these packages, install the 'bin' and 'dll' tarballs of
328   their latest stable releases.  If there's an 'ext' tarball (e.g.,
329   msysCORE and Coreutils have it), download and install those as well.
331   Each package might list other packages as prerequisites on its
332   download page (under "Runtime requirements"); download those as
333   well.  (Using the mingw-get installer will fetch those prerequisites
334   automatically for you.)  A missing prerequisite will manifest itself
335   by the program failing to run and presenting a pop-up dialog that
336   states the missing or incompatible DLL; be sure to find and install
337   these missing DLLs.
339   Do NOT add the MSYS bin directory to your Windows Path!  Only the
340   MinGW bin directory should be on Path.  When you install MSYS, it
341   creates a shortcut on your desktop that invokes the MSYS Bash shell
342   in a Command Prompt window; that shell is already set up so that the
343   MSYS bin directory is on PATH ahead of any other directory.  Thus,
344   Bash will find MSYS executables first, which is exactly what you
345   need.
347 * Starting the MSYS Bash shell
349   For most reliable and predictable results, we recommend to start
350   Bash by clicking the "MSYS" icon on your desktop.  That icon is
351   created when you install MSYS, and using it is the official way of
352   running the MSYS tools.
354   For other methods of starting the shell, make sure Bash is invoked
355   with the "--login" command-line switch.
357   When the shell window opens and you get the shell prompt, change to
358   the directory where you intend to build Emacs.
360   At this point, you are ready to build Emacs in its basic
361   configuration.  If you want to build it with image support and other
362   optional libraries, read about that near the end of this document.
364 * Generating the configure script
366   If you are building a release or pretest tarball, skip this section,
367   because the configure script is already present in the tarball.
369   To build a development snapshot from the Emacs repository,
370   you will first need to generate the configure script and a few other
371   auto-generated files.
373   To generate the configure script, type this at the MSYS Bash prompt
374   from the top-level directory of the Emacs source tree:
376      ./autogen.sh
378   If successful, this command should produce the following output:
380      $ ./autogen.sh
381      Checking whether you have the necessary tools...
382      (Read INSTALL.REPO for more details on building Emacs)
383      Checking for autoconf (need at least version 2.65) ... ok
384      Your system has the required tools.
385      Building aclocal.m4 ...
386      Running 'autoreconf -fi -I m4' ...
387      You can now run './configure'.
389   If the script fails because it cannot find Git, you will need to
390   arrange for the MSYS Bash's PATH to include the Git's 'bin'
391   subdirectory, where there's the git.exe executable.
393 * Configuring Emacs for MinGW:
395   Now it's time to run the configure script.  You can do that either
396   from a separate build directory that is outside of the Emacs source
397   tree (recommended), or from inside the source tree.  The former is
398   recommended because it allows you to have several different builds,
399   e.g., an optimized build and an unoptimized one, of the same
400   revision of the source tree; the source tree will be left in its
401   pristine state, without any build products.
403   You invoke the configure script like this:
405      /PATH/TO/EMACS/SOURCE/TREE/configure --prefix=PREFIX ...
407   or, if you are building in-place, i.e. inside the source tree:
409      ./configure --prefix=PREFIX ...
411   Here PREFIX is the place where you eventually want to install Emacs
412   once built, e.g. /d/usr.  We recommend to always use --prefix when
413   building Emacs on Windows, because the default '/usr/local' is not
414   appropriate for Windows: it will be mapped by MSYS to something like
415   C:\MSYS\local, and it will defeat the purpose of PREFIX, which is to
416   install programs in a single coherent tree resembling Posix systems.
417   Such a single-tree installation makes sure all the other programs
418   and packages ported from GNU or Unix systems will work seamlessly
419   together.  Where exactly is the root of that tree on your system is
420   something only you, the user who builds Emacs, can know, and the
421   Emacs build process cannot guess, because usually there's no
422   '/usr/local' directory on any drive on Windows systems.
424   Do NOT use Windows-style x:/foo/bar file names on the configure
425   script command line; use the MSYS-style /x/foo/bar instead.  Using
426   Windows-style file names was reported to cause subtle and hard to
427   figure out problems during the build.  This applies both to the
428   command switches, such as --prefix=, and to the absolute file name
429   of 'configure', if you are building outside of the source tree.
431   You can pass additional options to the configure script, for the
432   full list type
434      ./configure --help
436   As explained in the help text, you may need to tell the script what
437   are the optional flags to invoke the compiler.  This is needed if
438   some of your headers and libraries, e.g., those belonging to
439   optional image libraries, are installed in places where the compiler
440   normally doesn't look for them.  (Remember that advice above to
441   avoid such situations? here's is where you will start paying for
442   disregarding that recommendation.)  For example, if you have libpng
443   headers in C:\emacs\libs\libpng-1.2.37-lib\include and jpeg library
444   headers in C:\emacs\libs\jpeg-6b-4-lib\include, you will need to say
445   something like this:
447     CPPFLAGS='-I/c/emacs/libs/libpng-1.2.37-lib/include -I/c/emacs/libs/jpeg-6b-4-lib/include' ./configure --prefix=PREFIX
449   which is quite a mouth-full, especially if you have more directories
450   to specify...  Perhaps you may wish to revisit your installation
451   decisions now.
453   If you have a global site-lisp directory from previous Emacs
454   installation, and you want Emacs to continue using it, specify it
455   via the --enable-locallisppath switch to 'configure', like this:
457    ./configure --prefix=PREFIX --enable-locallisppath="/d/usr/share/emacs/VERSION/site-lisp:/d/wherever/site-lisp"
459   Use the normal MSYS /d/foo/bar style to specify directories by their
460   absolute file names.
462   A few frequently used options are needed when you want to produce an
463   unoptimized binary with runtime checks enabled:
465      ./configure --prefix=PREFIX --enable-checking='yes,glyphs' \
466        CFLAGS='-O0 -g3'
468   Once invoked, the configure script will run for some time, and, if
469   successful, will eventually produce a summary of the configuration
470   similar to this:
472      Configured for 'i686-pc-mingw32'.
474        Where should the build process find the source code?    /path/to/emacs/sources
475        What compiler should emacs be built with?               gcc  -std=gnu99 -O0 -g3
476        Should Emacs use the GNU version of malloc?             no
477          (The GNU allocators don't work with this system configuration.)
478        Should Emacs use a relocating allocator for buffers?    no
479        Should Emacs use mmap(2) for buffer allocation?         yes
480        What window system should Emacs use?                    w32
481        What toolkit should Emacs use?                          none
482        Where do we find X Windows header files?                NONE
483        Where do we find X Windows libraries?                   NONE
484        Does Emacs use -lXaw3d?                                 no
485        Does Emacs use -lXpm?                                   yes
486        Does Emacs use -ljpeg?                                  yes
487        Does Emacs use -ltiff?                                  yes
488        Does Emacs use a gif library?                           yes
489        Does Emacs use a png library?                           yes
490        Does Emacs use -lrsvg-2?                                yes
491        Does Emacs use cairo?                                   no
492        Does Emacs use -llcms2?                                 yes
493        Does Emacs use imagemagick?                             no
494        Does Emacs support sound?                               no
495        Does Emacs use -lgpm?                                   no
496        Does Emacs use -ldbus?                                  no
497        Does Emacs use -lgconf?                                 no
498        Does Emacs use GSettings?                               no
499        Does Emacs use a file notification library?             yes (w32)
500        Does Emacs use access control lists?                    yes
501        Does Emacs use -lselinux?                               no
502        Does Emacs use -lgnutls?                                yes
503        Does Emacs use -lxml2?                                  yes
504        Does Emacs use -lfreetype?                              no
505        Does Emacs use HarfBuzz?                                yes
506        Does Emacs use -lm17n-flt?                              no
507        Does Emacs use -lotf?                                   no
508        Does Emacs use -lxft?                                   no
509        Does Emacs use -lsystemd?                               no
510        Does Emacs use -ljansson?                               yes
511        Does Emacs use the GMP library?                         yes
512        Does Emacs directly use zlib?                           yes
513        Does Emacs have dynamic modules support?                yes
514        Does Emacs use toolkit scroll bars?                     yes
515        Does Emacs support Xwidgets?                            no
516        Does Emacs have threading support in lisp?              yes
517        Does Emacs support the portable dumper?                 yes
518        Does Emacs support the legacy unexec dumping?           no
519        Which dumping strategy does Emacs use?                  pdumper
521   You are almost there, hang on.
523   If the output is significantly different, or if configure finishes
524   prematurely and displays some error message, you should examine the
525   configuration log in config.log and find the reason for the failure.
527   Once you succeeded in configuring Emacs, and just want to rebuild it
528   after updating your local repository from the main repository, you
529   don't need to re-run the configure script manually, unless you want
530   to change the configure-time options.  Just typing "make" will
531   re-run configure if necessary with the exact same options you
532   specified originally, and then go on to invoking Make, described
533   below.
535 * Running Make.
537   This is simple: just type "make" and sit back, watching the fun.
539   If you  installed a snapshot build  of Make, the build  will be much
540   faster if  you type "make  -j N" instead, where  N is the  number of
541   independent processing  units on your  machine.  E.g., on a  core i7
542   system try using  N of 6 or  even 8.  (If this hangs,  see the notes
543   above about downgrading to MSYS 1.0.17.)
545   When Make finishes, you can install the produced binaries:
547     make install
549   or, if you want the installed tree to go in a place different from
550   the configured one, type
552     make install prefix=WHEREVER
554   Congrats!  You have built and installed your own Emacs!
556 * Make targets
558   The following make targets may be used by users building the source
559   distribution, or users who have checked out of the repository after
560   an initial bootstrapping.
562   make
563   Builds Emacs from the available sources and pre-compiled lisp files.
565   make install
566   Installs the built programs and the auxiliary files.
568   make clean
569   Removes object and executable files produced by the build process in
570   the current configuration.  After "make clean", you can rebuild with
571   the same configuration using make.  useful when you want to be sure
572   that all of the products are built from coherent sources.
574   make distclean
575   In addition to the files removed by make clean, this also removes
576   Makefiles and other generated files to get back to the state of a
577   freshly unpacked source distribution.  After make distclean, it is
578   necessary to run the configure script followed by "make", in order
579   to rebuild.
581   The following targets are intended only for use with the repository
582   sources.
584   make bootstrap
585   Removes all the auto-generated files and all the *.elc byte-compiled
586   files, and builds Emacs from scratch.  Useful when some change in
587   basic Emacs functionality makes byte compilation of updated files
588   fail.
590   make maintainer-clean
591   Removes everything that can be recreated, including compiled Lisp
592   files, to get back to the state of a fresh repository tree.  After make
593   maintainer-clean, it is necessary to run configure and "make" or
594   "make bootstrap" to rebuild.  Occasionally it may be necessary to
595   run this target after an update.
597 * Optional image library support
599   In addition to its "native" image formats (pbm and xbm), Emacs can
600   handle other image types: xpm, tiff, gif, png, jpeg and experimental
601   support for svg.
603   To build Emacs with support for them, the corresponding headers must
604   be in the include path and libraries should be where the linker
605   looks for them, when the configure script is run.  If needed, this
606   can be set up using the CPPFLAGS and CFLAGS variable specified on
607   the configure command line.  The configure script will report
608   whether it was able to detect the headers and libraries.  If the
609   results of this testing appear to be incorrect, please look for
610   details in the file config.log: it will show the failed test
611   programs and compiler error messages that should explain what is
612   wrong.  (Usually, any such failures happen because some headers are
613   missing due to bad packaging of the image support libraries.)
615   Note that any file path passed to the compiler or linker must use
616   forward slashes, or double each backslash, as that is how Bash
617   works.
619   If the configure script finds the necessary headers and libraries,
620   but they are for some reason incompatible, or if you want to omit
621   support for some image library that is installed on your system for
622   some other reason, use the --without-PACKAGE option to configure,
623   such as --without-gif to omit GIF, --without-tiff to omit TIFF, etc.
624   Passing the --help option to the configure script displays all of
625   the supported --without-PACKAGE options.
627   To use the external image support, the DLLs implementing the
628   functionality must be found when Emacs first needs them, either on the
629   PATH, or in the same directory as emacs.exe.  Failure to find a
630   library is not an error; the associated image format will simply be
631   unavailable.  Note that once Emacs has determined that a library can
632   not be found, there's no way to force it to try again, other than
633   restarting.  See the variable `dynamic-library-alist' to configure the
634   expected names of the libraries.
636   Some image libraries have dependencies on one another, or on zlib.
637   For example, tiff support depends on the jpeg library.  If you did not
638   compile the libraries yourself, you must make sure that any dependency
639   is in the PATH or otherwise accessible and that the binaries are
640   compatible (for example, that they were built with the same compiler).
642   To support XPM images (required for color tool-bar icons), you will
643   need the libXpm library.  It is available from the ezwinports site,
644   http://sourceforge.net/projects/ezwinports/files/ and from
645   https://ftp.gnu.org/gnu/emacs/windows/.
647   For PNG images, we recommend to use versions 1.4.x and later of
648   libpng, because previous versions had security issues.  You can find
649   precompiled libraries and headers on the ezwinports site and on
650   ftp.gnu.org.
652   Versions 1.4.0 and later of libpng are binary incompatible with
653   earlier versions, so Emacs will only look for libpng libraries which
654   are compatible with the version it was compiled against.  That
655   version is given by the value of the Lisp variable `libpng-version';
656   e.g., 10403 means version 1.4.3.  The variable `dynamic-library-alist'
657   is automatically set to name only those DLL names that are known to
658   be compatible with the version given by `libpng-version'.  If PNG
659   support does not work for you even though you have the support DLL
660   installed, check the name of the installed DLL against
661   `dynamic-library-alist' and the value of `libpng-version', and
662   download compatible DLLs if needed.
664   For GIF images, we recommend to use versions 5.0.0 or later of
665   giflib, as it is much enhanced wrt previous versions.  You can find
666   precompiled binaries and headers for giflib on the ezwinports site,
667   http://sourceforge.net/projects/ezwinports/files/ and on
668   https://ftp.gnu.org/gnu/emacs/windows/.
670   Version 5.0.0 and later of giflib are binary incompatible with
671   previous versions (the signatures of several functions have
672   changed), so Emacs will only look for giflib libraries that are
673   compatible with the version it was compiled against.  Similar to
674   libpng, that version is given by the value of the Lisp variable
675   `libgif-version'; e.g., 50005 means version 5.0.5.  The variable
676   `dynamic-library-alist' is automatically set to name only those DLL
677   libraries that are known to be compatible with the version given by
678   `libgif-version'.
680   For JPEG images, you will need libjpeg 6b or later, which will be
681   called libjpeg-N.dll, jpeg62.dll, libjpeg.dll, or jpeg.dll.  You can
682   find these on the ezwinports site and on ftp.gnu.org.
684   TIFF images require libTIFF 3.0 or later, which will be called
685   libtiffN.dll or libtiff-N.dll or libtiff.dll.  These can be found on
686   the ezwinports site.
688   Pre-built versions of librsvg and its dependencies can be found
689   here:
691     http://sourceforge.net/projects/ezwinports/files/
693     This site includes a minimal (as much as possible for librsvg)
694     build of the library and its dependencies; it is also more
695     up-to-date with the latest upstream versions.  However, it
696     currently only offers 32-bit builds.  For building Emacs, you need
697     to download from this site all of the following *-bin.zip
698     archives:
700       librsvg, gdk-pixbuf, cairo, glib
702     The 'bin' archives on this site include both header files and the
703     libraries needed for building with librsvg and for running Emacs.
704     The librsvg archive includes all the shared libraries needed to
705     run Emacs with SVG support; the other 3 packages are required
706     because the compiler needs to see their header files when building
707     Emacs.
709     https://ftp.gnu.org/gnu/emacs/windows/
711     More fat ports, from the MSYS2 project.
713   To use librsvg at runtime, ensure that librsvg and its dependencies
714   are on your PATH, or in the same directory as the emacs.exe binary.
715   If you are downloading from the ezwinports site, you only need to
716   install a single archive, librsvg-X.Y.Z-w32-bin.zip, which includes
717   all the dependency DLLs.
719   If you think you've got all the dependencies and SVG support is
720   still not working, check your PATH for other libraries that shadow
721   the ones you downloaded.  Libraries of the same name from different
722   sources may not be compatible, this problem was encountered in the
723   past, e.g., with libcroco from gnome.org.
725   If you can see etc/images/splash.svg, then you have managed to get
726   SVG support working.  Congratulations for making it through DLL hell
727   to this point.  For some SVG images, you'll probably see error
728   messages from Glib about failed assertions, or warnings from Pango
729   about failure to load fonts (installing the missing fonts should fix
730   the latter kind of problems).  Problems have been observed in some
731   images that contain text, they seem to be a problem in the Windows
732   port of Pango, or maybe a problem with the way Cairo or librsvg is
733   using it that doesn't show up on other platforms.  However, Emacs
734   should not crash due to these issues.  If you eventually find the
735   SVG support too unstable to your taste, you can rebuild Emacs
736   without it by specifying the --without-rsvg switch to the configure
737   script.
739   Binaries for the other image libraries can be found on the
740   ezwinports site or at the GnuWin32 project (the latter are generally
741   very old, so not recommended).  Note specifically that, due to some
742   packaging snafus in the GnuWin32-supplied image libraries, you will
743   need to download _source_ packages for some of the libraries in
744   order to get the header files necessary for building Emacs with
745   image support.
747 * Optional GnuTLS support
749   To compile with GnuTLS, you will need pkg-config to be installed, as
750   the configure script invokes pkg-config to find out which compiler
751   switches to use for GnuTLS.  See above for the URL where you can
752   find pkg-config for Windows.
754   You will also need to install the p11-kit package, which is a
755   dependency of GnuTLS, and its header files are needed for
756   compilation of programs that use GnuTLS.  You can find p11-kit on
757   the same site as GnuTLS, see the URL below.
759   If the configure script finds the GnuTLS header files and libraries
760   on your system, Emacs is built with GnuTLS support by default; to
761   avoid that you can pass the argument --without-gnutls.
763   In order to support GnuTLS at runtime, a GnuTLS-enabled Emacs must
764   be able to find the relevant DLLs during startup; failure to do so
765   is not an error, but GnuTLS won't be available to the running
766   session.
768   You can get pre-built binaries (including any required DLL and the
769   header files) at http://sourceforge.net/projects/ezwinports/files/
770   and on https://ftp.gnu.org/gnu/emacs/windows/.
772 * Optional libxml2 support
774   To compile with libxml2, you will need pkg-config to be installed,
775   as the configure script invokes pkg-config to find out which
776   compiler switches to use for libxml2.  See above for the URL where
777   you can find pkg-config for Windows.
779   If the configure script finds the libxml2 header files and libraries
780   on your system, Emacs is built with libxml2 support by default; to
781   avoid that you can pass the argument --without-libxml2.
783   In order to support libxml2 at runtime, a libxml2-enabled Emacs must
784   be able to find the relevant DLLs during startup; failure to do so
785   is not an error, but libxml2 features won't be available to the
786   running session.
788   One place where you can get pre-built Windows binaries of libxml2
789   (including any required DLL and the header files) is here:
791      http://sourceforge.net/projects/ezwinports/files/
792      https://ftp.gnu.org/gnu/emacs/windows/
794   For runtime support of libxml2, you will also need to install the
795   libiconv "development" tarball, because the libiconv headers need to
796   be available to the compiler when you compile with libxml2 support.
797   A MinGW port of libiconv can be found on the MinGW site:
799    http://sourceforge.net/projects/mingw/files/MinGW/Base/libiconv/
801   You need the libiconv-X.Y.Z-N-mingw32-dev.tar.lzma tarball from that
802   site.
804 * Optional support for decompressing text
806   Emacs can decompress text if compiled with the zlib library.
807   Prebuilt binaries of zlib DLL (for 32-bit builds of Emacs) are
808   available from the ezwinports site and on ftp.gnu.org; see above for
809   the URLs.
811   (This library is also a prerequisite for several image libraries, so
812   you may already have it; look for zlib1.dll or libz-1.dll.)
814 * Optional support for lcms2 library
816   Emacs can expose some capabilities of the Little CMS color
817   management engine to Lisp programs using the lcms2 library.
818   Prebuilt binaries of lcms2 DLL (for 32-bit builds of Emacs) are
819   available from the ezwinports site and from the MSYS2 project.
821 * Optional support for JSON
823   Emacs can provide built-in support for JSON parsing and
824   serialization using the libjansson library.  Prebuilt binaries of
825   the libjansson DLL (for 32-bit builds of Emacs) are available from
826   the ezwinports site and from the MSYS2 project.
828 * Optional support for HarfBuzzz shaping library
830   Emacs supports display of complex scripts and Arabic shaping.  The
831   preferred library for that is HarfBuzz; prebuilt binaries are
832   available from the ezwinports site (for 32-bit builds of Emacs) and
833   from the MSYS2 project.  If HarfBuzz is not available, Emacs will
834   use the Uniscribe shaping engine that is part of MS-Windows.
837 This file is part of GNU Emacs.
839 GNU Emacs is free software: you can redistribute it and/or modify
840 it under the terms of the GNU General Public License as published by
841 the Free Software Foundation, either version 3 of the License, or
842 (at your option) any later version.
844 GNU Emacs is distributed in the hope that it will be useful,
845 but WITHOUT ANY WARRANTY; without even the implied warranty of
846 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
847 GNU General Public License for more details.
849 You should have received a copy of the GNU General Public License
850 along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.