* etc/TODO: Add entry on printing.
[bpt/emacs.git] / nt / INSTALL
CommitLineData
7605d081
GM
1 Building and Installing Emacs on MS-Windows
2 using the MSYS and MinGW tools
a4a9692d 3
ba318903 4 Copyright (C) 2013-2014 Free Software Foundation, Inc.
7f6d64f8 5 See the end of the file for license conditions.
4b994b84 6
7605d081
GM
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).
67aeda8d 11
34cad827
EZ
12 Do not use this recipe with Cygwin. For building on Cygwin, use the
13 normal installation instructions, ../INSTALL.
14
7605d081 15* For the brave (a.k.a. "impatient"):
0939da72 16
7605d081
GM
17 For those who have a working MSYS/MinGW development environment and
18 are comfortable with running Posix configure scripts, here are the
19 concise instructions for configuring and building the native Windows
34cad827 20 binary of Emacs with these tools:
029e4603 21
7605d081
GM
22 0. Start the MSYS Bash window. Everything else below is done from
23 that window's Bash prompt.
89559104 24
7605d081
GM
25 0a. If you are building from the development trunk (as opposed to a
26 release tarball), produce the configure script, by typing from
27 the top-level Emacs source directory:
a8f91761 28
7605d081 29 ./autogen.sh
0939da72 30
7605d081
GM
31 1. If you want to build Emacs outside of the source tree
32 (recommended), create the build directory and chdir there.
0939da72 33
f4f38fad 34 2. Invoke the configure script:
a6fc3b5c 35
7605d081 36 - If you are building outside the source tree:
a6fc3b5c 37
f4f38fad 38 /PATH/TO/EMACS/SOURCE/TREE/configure --prefix=PREFIX ...
a6fc3b5c 39
7605d081 40 - If you are building in-place, i.e. inside the source tree:
a6fc3b5c 41
f4f38fad 42 ./configure --prefix=PREFIX ...
a6fc3b5c 43
7605d081
GM
44 It is always preferable to use --prefix to configure Emacs for
45 some specific location of its installed tree; the default
46 /usr/local is not suitable for Windows (see the detailed
d7265107 47 instructions for the reasons). The prefix must be absolute.
a6fc3b5c 48
7605d081
GM
49 You can pass other options to the configure script. Here's a
50 typical example (for an in-place debug build):
0939da72 51
34cad827 52 CFLAGS='-O0 -g3' ./configure --prefix=/d/usr/emacs --enable-checking='yes,glyphs'
0939da72 53
7605d081
GM
54 3. After the configure script finishes, it should display the
55 resulting configuration. After that, type
0939da72 56
7605d081 57 make
0939da72 58
7605d081
GM
59 Use "make -j N" if your MSYS Make supports parallel execution;
60 the build will take significantly less time in that case. Here N
61 is the number of simultaneous parallel jobs; use the number of
62 the cores on your system.
0939da72 63
7605d081 64 4. Install the produced binaries:
0939da72 65
7605d081 66 make install
0939da72 67
7605d081
GM
68 If you want the installation tree to go to a place that is
69 different from the one specified by --prefix, say
0939da72 70
7605d081 71 make install prefix=/where/ever/you/want
e84b63f1 72
7605d081 73 That's it!
e84b63f1 74
7605d081
GM
75 If these short instructions somehow fail, read the rest of this
76 file.
7a43121e 77
7605d081 78* Installing MinGW and MSYS
7a43121e 79
7605d081
GM
80 Make sure you carefully read the following two sections in their
81 entirety and install/configure the various packages as instructed.
82 A correct installation makes all the rest almost trivial; a botched
83 installation will likely make you miserable for quite some time.
e84b63f1 84
34cad827 85 There are two alternatives to installing MinGW + MSYS: using the GUI
7605d081
GM
86 installer, called mingw-get, provided by the MinGW project, or
87 manual installation. The next two sections describe each one of
88 these.
0939da72 89
7605d081 90** Installing MinGW and MSYS using mingw-get
0939da72 91
7605d081
GM
92 A nice installer, called mingw-get, is available for those who don't
93 like to mess with manual installations. You can download it from
94 here:
0939da72 95
7605d081 96 https://sourceforge.net/projects/mingw/files/Installer/mingw-get/
0939da72 97
7605d081
GM
98 (This installer only supports packages downloaded from the MinGW
99 site; for the rest you will still need the manual method.)
0939da72 100
7605d081
GM
101 After installing mingw-get, invoke it to install the packages that
102 are already selected by default on the "Select Components" screen of
103 its wizard.
0939da72 104
7605d081
GM
105 After that, use "mingw-get install PACKAGE" to install the following
106 additional packages:
0939da72 107
7605d081
GM
108 . msys-base
109 . mingw-developer-toolkit
0939da72 110
7605d081
GM
111 (We recommend that you refrain from installing the MSYS Texinfo
112 package, which is part of msys-base, because it might produce mixed
113 EOL format when installing Info files. Instead, install the MinGW
114 port of Texinfo, see the ezwinports URL below. To uninstall the
115 MSYS Texinfo, after installing it as part of msys-base, invoke the
116 command "mingw-get remove msys-texinfo".)
0939da72 117
9db5046c
EZ
118 In addition, building Emacs from the development repository requires
119 pkg-config to be installed. As the MinGW project does not offer it,
120 you will have to install it from elsewhere; see below (search for
121 "pkg-config").
122
7605d081
GM
123 At this point, you should be ready to configure and build Emacs in
124 its basic configuration. Skip to the "Generating the configure
125 script" section for the build instructions. If you want to build it
126 with image support and other optional libraries, read about the
127 optional libraries near the end of this document, before you start
128 the build. Also, consider installing additional MinGW packages that
129 are required/recommended, especially if you are building from the
31466836 130 repository, as described in the next section.
195e32b7 131
7605d081
GM
132** Installing MinGW and MSYS manually
133
134*** MinGW
135
136 You will need to install the MinGW port of GCC and Binutils, and the
137 MinGW runtime and Windows API distributions, to compile Emacs. You
138 can find these on the MinGW download/Base page:
139
140 https://sourceforge.net/projects/mingw/files/MinGW/Base/
141
142 In general, install the latest stable versions of the following
143 MinGW packages from that page: gcc, binutils, mingw-rt, w32api. You
144 only need the 'bin' and the 'dll' tarballs of each of the above.
145
146 MinGW packages are distributed as .tar.lzma compressed archives. To
147 install the packages manually, we recommend to use the Windows port
148 of the 'bsdtar' program to unpack the tarballs. 'bsdtar' is
149 available as part of the 'libarchive' package from here:
12d70bbb 150
970b321f
EZ
151 http://sourceforge.net/projects/ezwinports/files/
152
7605d081
GM
153 The recommended place to install these packages is a single tree
154 starting from some directory on a drive other than the system drive
155 C:. A typical example would be D:\usr, with D:\usr\bin holding the
156 binaries and DLLs (should be added to your Path environment
157 variable), D:\usr\include holding the include files, D:\usr\lib
158 holding the static and import libraries, D:\usr\share holding docs,
159 message catalogs, and package-specific subdirectories, etc.
160
161 Having all the headers and libraries in a single place will greatly
162 reduce the number of -I and -L flags you will have to pass to the
163 configure script (see below), as these files will be right where the
164 compiler expects them.
165
166 We specifically do NOT recommend installing packages below
167 "C:\Program Files" or "C:\Program Files (x86)". These directories
168 are protected on versions of Windows from Vista and on, and you will
169 have difficulties updating and maintaining your installation later,
170 due to UAC elevation prompts, file virtualization, etc. You *have*
171 been warned!
172
173 Additional MinGW packages are required/recommended, especially if
31466836 174 you are building from the repository:
7605d081
GM
175
176 . Texinfo (needed to produce the Info manuals when building from
34cad827 177 bzr/git, and for "make install")
7605d081
GM
178
179 Available from http://sourceforge.net/projects/ezwinports/files/.
180
9db5046c
EZ
181 . pkg-config (invoked by the configure script to look for optional
182 packages; _required_ for building from the development
183 repository, as some components of pkg-config are needed to run
184 the autoconf and aclocal scripts)
7605d081 185
9db5046c 186 Available from http://www.gtk.org/download/win32.php
7605d081 187
9db5046c 188 . gzip (needed to compress files during "make install")
7605d081 189
9db5046c 190 Available from http://gnuwin32.sourceforge.net/packages/gzip.htm.
7605d081
GM
191
192 Each package might list other packages as prerequisites on its
193 download page (under "Runtime requirements"); download those as
194 well. (Using the mingw-get installer will fetch those prerequisites
195 automatically for you.) A missing prerequisite will manifest itself
196 by the program failing to run and presenting a pop-up dialog that
197 states the missing or incompatible DLL; be sure to find and install
198 these missing DLLs.
199
200 Once you think you have MinGW installed, test the installation by
201 building a trivial "hello, world!" program, and make sure that it
202 builds without any error messages and the binary works when run.
203
204*** MSYS
205
206 You will need a reasonably full MSYS installation. MSYS is an
207 environment needed to run the Posix configure scripts and the
208 resulting Makefile's, in order to produce native Windows binaries
209 using the MinGW compiler and runtime libraries. Here's the list of
210 MSYS packages that are required:
211
212 . All the packages from the MSYS Base distribution, listed here:
213
214 https://sourceforge.net/projects/mingw/files/MSYS/Base/
215
216 . Additional packages listed below, from the MSYS Extension
217 distribution here:
218
219 https://sourceforge.net/projects/mingw/files/MSYS/Extension/
220
221 - flex
222 - bison
223 - m4
224 - perl
225 - mktemp
226
227 These should only be needed if you intend to build development
31466836 228 versions of Emacs from the repository.
7605d081 229
31466836 230 . Additional packages (needed only if building from the
7605d081
GM
231 repository): Automake and Autoconf. They are available from
232 here:
233
234 http://sourceforge.net/projects/ezwinports/files/automake-1.11.6-msys-bin.zip/download
235 http://sourceforge.net/projects/ezwinports/files/autoconf-2.65-msys-bin.zip/download
236
237 MSYS packages are distributed as .tar.lzma compressed archives. To
238 install the packages manually, we recommend to use the Windows port
239 of the 'bsdtar' program, already mentioned above.
240
1e125ee2
EZ
241 MSYS packages should be installed in a separate tree from MinGW.
242 For example, use D:\MSYS or D:\usr\MSYS as the top-level directory
243 from which you unpack all of the MSYS packages.
244
245 After installing Automake and Autoconf, make sure any of the *.m4
246 files you might have in your MinGW installation (e.g., pkg.m4 that
247 comes with pkg-config) also exist in the MSYS installation tree, in
248 the share/aclocal directory. Those *.m4 files which exist in the
249 MinGW tree, but not in the MSYS tree should be copied there.
250
7605d081
GM
251 If/when you are confident in your MinGW/MSYS installation, and want
252 to speed up the builds, we recommend installing a pre-release
253 version of Make from here:
254
255 https://sourceforge.net/projects/mingwbuilds/files/external-binary-packages/
256
257 These are snapshot builds of many packages, but you only need
258 make.exe from there. The advantage of this make.exe is that it
259 supports parallel builds, so you can use "make -j N" to considerably
260 speed up your builds.
261
262 Several users reported that MSYS 1.0.18 causes Make to hang in
263 parallel builds. If you bump into this, we suggest to downgrade to
264 MSYS 1.0.17, which doesn't have that problem.
265
266 For each of these packages, install the 'bin' and 'dll' tarballs of
267 their latest stable releases. If there's an 'ext' tarball (e.g.,
268 msysCORE and Coreutils have it), download and install those as well.
269
270 Each package might list other packages as prerequisites on its
271 download page (under "Runtime requirements"); download those as
272 well. (Using the mingw-get installer will fetch those prerequisites
273 automatically for you.) A missing prerequisite will manifest itself
274 by the program failing to run and presenting a pop-up dialog that
275 states the missing or incompatible DLL; be sure to find and install
276 these missing DLLs.
277
7605d081
GM
278 Do NOT add the MSYS bin directory to your Windows Path! Only the
279 MinGW bin directory should be on Path. When you install MSYS, it
280 creates a shortcut on your desktop that invokes the MSYS Bash shell
281 in a Command Prompt window; that shell is already set up so that the
282 MSYS bin directory is on PATH ahead of any other directory. Thus,
283 Bash will find MSYS executables first, which is exactly what you
284 need.
285
286 At this point, you are ready to build Emacs in its basic
287 configuration. If you want to build it with image support and other
288 optional libraries, read about that near the end of this document.
289
290* Generating the configure script
291
292 If you are building a release or pretest tarball, skip this section,
293 because the configure script is already present in the tarball.
294
31466836 295 To build a development snapshot from the Emacs repository,
7605d081 296 you will first need to generate the configure script and a few other
4dde498b 297 auto-generated files.
7605d081
GM
298
299 To generate the configure script, type this at the MSYS Bash prompt
300 from the top-level directory of the Emacs tree:
301
302 ./autogen.sh
303
304 If successful, this command should produce the following output:
305
306 $ ./autogen.sh
307 Checking whether you have the necessary tools...
ac4c50ad 308 (Read INSTALL.REPO for more details on building Emacs)
7605d081
GM
309
310 Checking for autoconf (need at least version 2.65)...
311 ok
312 Checking for automake (need at least version 1.11)...
313 ok
1e125ee2
EZ
314 Checking for pkg-config (need at least version 0.9.0)...
315 ok
316 Checking for pkg.m4...
317 ok
7605d081
GM
318 Your system has the required tools, running autoreconf...
319 You can now run `./configure'.
320
321* Configuring Emacs for MinGW:
322
323 Now it's time to run the configure script. You can do that either
324 from a separate build directory that is outside of the Emacs source
325 tree (recommended), or from inside the source tree. The former is
326 recommended because it allows you to have several different builds,
327 e.g., an optimized build and an unoptimized one, of the same
328 revision of the source tree; the source tree will be left in its
329 pristine state, without any build products.
330
331 You invoke the configure script like this:
332
f4f38fad 333 /PATH/TO/EMACS/SOURCE/TREE/configure --prefix=PREFIX ...
7605d081
GM
334
335 or, if you are building in-place, i.e. inside the source tree:
336
f4f38fad 337 ./configure --prefix=PREFIX ...
7605d081
GM
338
339 Here PREFIX is the place where you eventually want to install Emacs
340 once built, e.g. /d/usr. We recommend to always use --prefix when
341 building Emacs on Windows, because the default '/usr/local' is not
342 appropriate for Windows: it will be mapped by MSYS to something like
343 C:\MSYS\local, and it will defeat the purpose of PREFIX, which is to
344 install programs in a single coherent tree resembling Posix systems.
345 Such a single-tree installation makes sure all the other programs
346 and packages ported from GNU or Unix systems will work seamlessly
347 together. Where exactly is the root of that tree on your system is
348 something only you, the user who builds Emacs, can know, and the
349 Emacs build process cannot guess, because usually there's no
350 '/usr/local' directory on any drive on Windows systems.
351
352 Do NOT use Windows-style x:/foo/bar file names on the configure
353 script command line; use the MSYS-style /x/foo/bar instead. Using
354 Windows-style file names was reported to cause subtle and hard to
355 figure out problems during the build. This applies both to the
356 command switches, such as --prefix=, and to the absolute file name
f4f38fad 357 of 'configure', if you are building outside of the source tree.
7605d081
GM
358
359 You can pass additional options to the configure script, for the
360 full list type
361
f4f38fad 362 ./configure --help
7605d081
GM
363
364 As explained in the help text, you may need to tell the script what
365 are the optional flags to invoke the compiler. This is needed if
366 some of your headers and libraries, e.g., those belonging to
367 optional image libraries, are installed in places where the compiler
368 normally doesn't look for them. (Remember that advice above to
369 avoid such situations? here's is where you will start paying for
370 disregarding that recommendation.) For example, if you have libpng
371 headers in C:\emacs\libs\libpng-1.2.37-lib\include and jpeg library
372 headers in C:\emacs\libs\jpeg-6b-4-lib\include, you will need to say
373 something like this:
374
f4f38fad 375 CPPFLAGS='-I/c/emacs/libs/libpng-1.2.37-lib/include -I/c/emacs/libs/jpeg-6b-4-lib/include' ./configure --prefix=PREFIX
7605d081
GM
376
377 which is quite a mouth-full, especially if you have more directories
378 to specify... Perhaps you may wish to revisit your installation
379 decisions now.
380
381 If you have a global site-lisp directory from previous Emacs
382 installation, and you want Emacs to continue using it, specify it
f4f38fad 383 via the --enable-locallisppath switch to 'configure', like this:
7605d081 384
f4f38fad 385 ./configure --prefix=PREFIX --enable-locallisppath="/d/usr/share/emacs/VERSION/site-lisp:/d/wherever/site-lisp"
7605d081
GM
386
387 Use the normal MSYS /d/foo/bar style to specify directories by their
388 absolute file names.
389
390 A few frequently used options are needed when you want to produce an
391 unoptimized binary with runtime checks enabled:
392
34cad827 393 CFLAGS='-O0 -g3' ./configure --prefix=PREFIX --enable-checking='yes,glyphs'
7605d081
GM
394
395 Once invoked, the configure script will run for some time, and, if
396 successful, will eventually produce a summary of the configuration
34cad827 397 similar to this:
7605d081
GM
398
399 Configured for `i686-pc-mingw32'.
400
401 Where should the build process find the source code? /path/to/emacs/sources
402 What compiler should emacs be built with? gcc -std=gnu99 -O0 -g3
403 Should Emacs use the GNU version of malloc? yes
404 Should Emacs use a relocating allocator for buffers? yes
405 Should Emacs use mmap(2) for buffer allocation? no
406 What window system should Emacs use? w32
407 What toolkit should Emacs use? none
408 Where do we find X Windows header files? NONE
409 Where do we find X Windows libraries? NONE
410 Does Emacs use -lXaw3d? no
411 Does Emacs use -lXpm? yes
412 Does Emacs use -ljpeg? yes
413 Does Emacs use -ltiff? yes
414 Does Emacs use a gif library? yes
415 Does Emacs use -lpng? yes
416 Does Emacs use -lrsvg-2? no
417 Does Emacs use imagemagick? no
418 Does Emacs use -lgpm? no
419 Does Emacs use -ldbus? no
420 Does Emacs use -lgconf? no
421 Does Emacs use GSettings? no
422 Does Emacs use -lselinux? no
423 Does Emacs use -lgnutls? yes
424 Does Emacs use -lxml2? yes
425 Does Emacs use -lfreetype? no
426 Does Emacs use -lm17n-flt? no
427 Does Emacs use -lotf? no
428 Does Emacs use -lxft? no
429 Does Emacs use toolkit scroll bars? yes
430
431 You are almost there, hang on.
432
433 If the output is significantly different, or if configure finishes
434 prematurely and displays some error message, you should examine the
435 configuration log in config.log and find the reason for the failure.
436
437 Once you succeeded in configuring Emacs, and just want to rebuild it
438 after updating your local repository from the main repository, you
439 don't need to re-run the configure script manually, unless you want
440 to change the configure-time options. Just typing "make" will
441 re-run configure if necessary with the exact same options you
442 specified originally, and then go on to invoking Make, described
443 below.
444
445* Running Make.
446
447 This is simple: just type "make" and sit back, watching the fun.
448
449 If you installed a snapshot build of Make, the build will be much
450 faster if you type "make -j N" instead, where N is the number of
451 independent processing units on your machine. E.g., on a core i7
452 system try using N of 6 or even 8. (If this hangs, see the notes
453 above about downgrading to MSYS 1.0.17.)
454
455 When Make finishes, you can install the produced binaries:
456
457 make install
458
459 or, if you want the installed tree to go in a place different from
460 the configured one, type
461
462 make install prefix=WHEREVER
463
464 Congrats! You have built and installed your own Emacs!
465
466* Make targets
467
468 The following make targets may be used by users building the source
31466836 469 distribution, or users who have checked out of the repository after
7605d081
GM
470 an initial bootstrapping.
471
472 make
473 Builds Emacs from the available sources and pre-compiled lisp files.
474
475 make install
476 Installs the built programs and the auxiliary files.
477
478 make clean
479 Removes object and executable files produced by the build process in
480 the current configuration. After "make clean", you can rebuild with
481 the same configuration using make. useful when you want to be sure
482 that all of the products are built from coherent sources.
483
484 make distclean
485 In addition to the files removed by make clean, this also removes
486 Makefiles and other generated files to get back to the state of a
487 freshly unpacked source distribution. After make distclean, it is
488 necessary to run the configure script followed by "make", in order
489 to rebuild.
490
31466836
ER
491 The following targets are intended only for use with the repository
492 sources.
7605d081
GM
493
494 make bootstrap
495 Removes all the auto-generated files and all the *.elc byte-compiled
496 files, and builds Emacs from scratch. Useful when some change in
497 basic Emacs functionality makes byte compilation of updated files
498 fail.
499
500 make maintainer-clean
501 Removes everything that can be recreated, including compiled Lisp
31466836 502 files, to get back to the state of a fresh repository tree. After make
7605d081
GM
503 maintainer-clean, it is necessary to run configure and "make" or
504 "make bootstrap" to rebuild. Occasionally it may be necessary to
505 run this target after an update.
591cbed1 506
bfd889ed
JR
507* Optional image library support
508
3dfbc6d8 509 In addition to its "native" image formats (pbm and xbm), Emacs can
8bc63b1a 510 handle other image types: xpm, tiff, gif, png, jpeg and experimental
707a78b2 511 support for svg.
6d96d18f 512
8bc63b1a 513 To build Emacs with support for them, the corresponding headers must
7605d081
GM
514 be in the include path and libraries should be where the linker
515 looks for them, when the configure script is run. If needed, this
516 can be set up using the CPPFLAGS and CFLAGS variable specified on
517 the configure command line. The configure script will report
518 whether it was able to detect the headers and libraries. If the
519 results of this testing appear to be incorrect, please look for
8bc63b1a
JR
520 details in the file config.log: it will show the failed test
521 programs and compiler error messages that should explain what is
522 wrong. (Usually, any such failures happen because some headers are
523 missing due to bad packaging of the image support libraries.)
bfd889ed 524
a917e3f2 525 Note that any file path passed to the compiler or linker must use
7605d081
GM
526 forward slashes, or double each backslash, as that is how Bash
527 works.
528
529 If the configure script finds the necessary headers and libraries,
530 but they are for some reason incompatible, or if you want to omit
531 support for some image library that is installed on your system for
532 some other reason, use the --without-PACKAGE option to configure,
533 such as --without-gif to omit GIF, --without-tiff to omit TIFF, etc.
534 Passing the --help option to the configure script displays all of
535 the supported --without-PACKAGE options.
a917e3f2 536
3dfbc6d8 537 To use the external image support, the DLLs implementing the
bd7bdff8
JB
538 functionality must be found when Emacs first needs them, either on the
539 PATH, or in the same directory as emacs.exe. Failure to find a
540 library is not an error; the associated image format will simply be
541 unavailable. Note that once Emacs has determined that a library can
542 not be found, there's no way to force it to try again, other than
2e288d54 543 restarting. See the variable `dynamic-library-alist' to configure the
bd7bdff8 544 expected names of the libraries.
3dfbc6d8
JB
545
546 Some image libraries have dependencies on one another, or on zlib.
547 For example, tiff support depends on the jpeg library. If you did not
548 compile the libraries yourself, you must make sure that any dependency
5739d6f8 549 is in the PATH or otherwise accessible and that the binaries are
3dfbc6d8
JB
550 compatible (for example, that they were built with the same compiler).
551
5be1c984
EZ
552 For PNG images, we recommend to use versions 1.4.x and later of
553 libpng, because previous versions had security issues. You can find
554 precompiled libraries and headers on the GTK download page for
63135762
EZ
555 Windows (http://www.gtk.org/download/win32.php for 32-bit builds and
556 http://www.gtk.org/download/win64.php for 64-bit builds). The
557 ezwinports site, http://sourceforge.net/projects/ezwinports/files/
558 also offers PNG (as well as other image libraries), which are
559 usually newer.
5be1c984
EZ
560
561 Versions 1.4.0 and later of libpng are binary incompatible with
562 earlier versions, so Emacs will only look for libpng libraries which
563 are compatible with the version it was compiled against. That
564 version is given by the value of the Lisp variable `libpng-version';
3d4cad2c 565 e.g., 10403 means version 1.4.3. The variable `dynamic-library-alist'
5be1c984
EZ
566 is automatically set to name only those DLL names that are known to
567 be compatible with the version given by `libpng-version'. If PNG
568 support does not work for you even though you have the support DLL
569 installed, check the name of the installed DLL against
3d4cad2c 570 `dynamic-library-alist' and the value of `libpng-version', and
5be1c984
EZ
571 download compatible DLLs if needed.
572
71358845
EZ
573 For GIF images, we recommend to use versions 5.0.0 or later of
574 giflib, as it is much enhanced wrt previous versions. You can find
575 precompiled binaries and headers for giflib on the ezwinports site,
576 http://sourceforge.net/projects/ezwinports/files/.
577
578 Version 5.0.0 and later of giflib are binary incompatible with
579 previous versions (the signatures of several functions have
580 changed), so Emacs will only look for giflib libraries that are
581 compatible with the version it was compiled against. Similar to
582 libpng, that version is given by the value of the Lisp variable
583 `libgif-version'; e.g., 50005 means version 5.0.5. The variable
584 `dynamic-library-alist' is automatically set to name only those DLL
585 libraries that are known to be compatible with the version given by
586 `libgif-version'.
587
c8740fa2
EZ
588 For JPEG images, you will need libjpeg 6b or later, which will be
589 called libjpeg-N.dll, jpeg62.dll, libjpeg.dll, or jpeg.dll. You can
590 find these on the ezwinports site.
591
592 TIFF images require libTIFF 3.0 or later, which will be called
593 libtiffN.dll or libtiff-N.dll or libtiff.dll. These can be found on
594 the ezwinports site.
595
63135762
EZ
596 Pre-built versions of librsvg and its dependencies can be found in
597 one of these places:
598
599 1. http://sourceforge.net/projects/ezwinports/files/
600
601 This site includes a minimal (as much as possible for librsvg)
602 build of the library and its dependencies; it is also more
603 up-to-date with the latest upstream versions. However, it
604 currently only offers 32-bit builds. For building Emacs, you
605 need to download from this site all of the following *-bin.zip
606 archives:
607
608 librsvg, gdk-pixbuf, cairo, glib
609
610 The 'bin' archives on this site include both header files and the
611 libraries needed for building with librsvg and for running Emacs.
612 The librsvg archive includes all the shared libraries needed to
613 run Emacs with SVG support; the other 3 packages are required
614 because the compiler needs to see their header files when
615 building Emacs.
616
617 2. GTK project download site for Windows (see above for 2 URLs,
618 either for 32-bit builds or 64-bit builds)
619
620 This is the official Windows download site of the GTK project.
621 Its builds of librsvg are fatter, but are currently the only
622 alternative for 64-bit builds. The easiest way to obtain the
623 dependencies required for building from this site is to download
624 a pre-bundled GTK+ development environment for Windows. If you
625 would nevertheless like to download only the packages that are
626 strictly required, then, as of the time of this writing, here's
627 the list of GTK+ packages you will need:
628
629 librsvg, pango, freetype-2.4.11, freetype-2.4.2, croco, cairo,
630 glib, gdk-pixbuf, fontconfig, libpng-1.4.x, libpng-1.5.x,
631 libffi, libxml2, zlib
632
633 The GTK download page provides 2 separate archives for each
634 package: a 'bin' (binary) archive with programs and DLLs, and a
635 'dev' (development) archive with header files, import libraries,
636 and pkg-config files; download and install both archives for each
637 package you need. (Sources of each package are available in a
638 separate, 3rd archive.)
639
640 As you see, some libraries for using this site's librsvg are
641 needed in more than one version -- this is because librsvg and
642 some of its dependencies were linked against different versions
643 of those libraries, and will look only for those DLLs when you
644 invoke SVG function. So there's a bit of "DLL hell" involved
645 here, but at least in theory this should work, as each library
646 will dynamically link only against its dependencies, even if
647 another version of the same library is already loaded. In
648 particular, at least 2 different versions of libpng will have to
649 be installed on your machine. When you install these libpng
650 versions, be sure to keep the header files and the pkg-config
651 files in sync, i.e. install both the 'bin' and 'dev' archives of
652 the same libpng version together.
653
654 To use librsvg at runtime, ensure that librsvg and its dependencies
655 are on your PATH, or in the same directory as the emacs.exe binary.
656 If you are downloading from the ezwinports site, you only need to
657 install a single archive, librsvg-X.Y.Z-w32-bin.zip, which includes
658 all the dependency DLLs. For the GTK project site, download the
659 'bin' archives for each of the libraries mentioned above.
660
661 If you think you've got all the dependencies and SVG support is
662 still not working, check your PATH for other libraries that shadow
663 the ones you downloaded. Libraries of the same name from different
664 sources may not be compatible, this problem was encountered in the
665 past, e.g., with libcroco from gnome.org.
666
667 If you can see etc/images/splash.svg, then you have managed to get
668 SVG support working. Congratulations for making it through DLL hell
669 to this point. For some SVG images, you'll probably see error
670 messages from Glib about failed assertions, or warnings from Pango
671 about failure to load fonts (installing the missing fonts should fix
672 the latter kind of problems). Problems have been observed in some
673 images that contain text, they seem to be a problem in the Windows
674 port of Pango, or maybe a problem with the way Cairo or librsvg is
675 using it that doesn't show up on other platforms. However, Emacs
676 should not crash due to these issues. If you eventually find the
677 SVG support too unstable to your taste, you can rebuild Emacs
678 without it by specifying the --without-rsvg switch to the configure
679 script.
680
681 Binaries for the other image libraries can be found on the
682 ezwinports site or at the GnuWin32 project (the latter are generally
683 very old, so not recommended). Note specifically that, due to some
684 packaging snafus in the GnuWin32-supplied image libraries, you will
685 need to download _source_ packages for some of the libraries in
686 order to get the header files necessary for building Emacs with
687 image support.
71358845 688
fd4af8d9
TZ
689* Optional GnuTLS support
690
7605d081
GM
691 To compile with GnuTLS, you will need pkg-config to be installed, as
692 the configure script invokes pkg-config to find out which compiler
693 switches to use for GnuTLS. See above for the URL where you can
694 find pkg-config for Windows.
695
696 You will also need to install the p11-kit package, which is a
697 dependency of GnuTLS, and its header files are needed for
698 compilation of programs that use GnuTLS. You can find p11-kit on
699 the same site as GnuTLS, see the URL below.
700
701 If the configure script finds the GnuTLS header files and libraries
702 on your system, Emacs is built with GnuTLS support by default; to
703 avoid that you can pass the argument --without-gnutls.
fd4af8d9 704
0898ca10
JB
705 In order to support GnuTLS at runtime, a GnuTLS-enabled Emacs must
706 be able to find the relevant DLLs during startup; failure to do so
707 is not an error, but GnuTLS won't be available to the running
708 session.
709
710 You can get pre-built binaries (including any required DLL and the
8dc96b40 711 header files) at http://sourceforge.net/projects/ezwinports/files/.
fd4af8d9 712
9078ead6
EZ
713* Optional libxml2 support
714
7605d081
GM
715 To compile with libxml2, you will need pkg-config to be installed,
716 as the configure script invokes pkg-config to find out which
717 compiler switches to use for libxml2. See above for the URL where
718 you can find pkg-config for Windows.
719
720 If the configure script finds the libxml2 header files and libraries
721 on your system, Emacs is built with libxml2 support by default; to
722 avoid that you can pass the argument --without-libxml2.
9078ead6
EZ
723
724 In order to support libxml2 at runtime, a libxml2-enabled Emacs must
725 be able to find the relevant DLLs during startup; failure to do so
726 is not an error, but libxml2 features won't be available to the
727 running session.
728
729 One place where you can get pre-built Windows binaries of libxml2
730 (including any required DLL and the header files) is here:
731
732 http://sourceforge.net/projects/ezwinports/files/
733
7605d081
GM
734 For runtime support of libxml2, you will also need to install the
735 libiconv "development" tarball, because the libiconv headers need to
736 be available to the compiler when you compile with libxml2 support.
737 A MinGW port of libiconv can be found on the MinGW site:
9078ead6
EZ
738
739 http://sourceforge.net/projects/mingw/files/MinGW/Base/libiconv/
740
741 You need the libiconv-X.Y.Z-N-mingw32-dev.tar.lzma tarball from that
742 site.
743
7f6d64f8
GM
744\f
745This file is part of GNU Emacs.
4b994b84 746
eef0be9e 747GNU Emacs is free software: you can redistribute it and/or modify
7f6d64f8 748it under the terms of the GNU General Public License as published by
eef0be9e
GM
749the Free Software Foundation, either version 3 of the License, or
750(at your option) any later version.
4b994b84 751
7f6d64f8
GM
752GNU Emacs is distributed in the hope that it will be useful,
753but WITHOUT ANY WARRANTY; without even the implied warranty of
754MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
755GNU General Public License for more details.
756
757You should have received a copy of the GNU General Public License
eef0be9e 758along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.