1. If you want to build Emacs outside of the source tree
(recommended), create the build directory and chdir there.
- 2. Invoke the MSYS-specific configure script:
+ 2. Invoke the configure script:
- If you are building outside the source tree:
- /PATH/TO/EMACS/SOURCE/TREE/nt/msysconfig.sh --prefix=PREFIX ...
+ /PATH/TO/EMACS/SOURCE/TREE/configure --prefix=PREFIX ...
- If you are building in-place, i.e. inside the source tree:
- ./nt/msysconfig.sh --prefix=PREFIX ...
+ ./configure --prefix=PREFIX ...
It is always preferable to use --prefix to configure Emacs for
some specific location of its installed tree; the default
You can pass other options to the configure script. Here's a
typical example (for an in-place debug build):
- CPPFLAGS='-DGLYPH_DEBUG=1' CFLAGS='-O0 -g3' ./nt/msysconfig.sh --prefix=/d/usr/emacs --enable-checking
+ CPPFLAGS='-DGLYPH_DEBUG=1' CFLAGS='-O0 -g3' ./configure --prefix=/d/usr/emacs --enable-checking
3. After the configure script finishes, it should display the
resulting configuration. After that, type
To build a development snapshot from the Emacs Bazaar repository,
you will first need to generate the configure script and a few other
- auto-generated files. (If this step, described below, somehow
- fails, you can use the files in the autogen/ directory instead, but
- they might be outdated, and, most importantly, you are well advised
- not to disregard any failures in your local build procedures, as
- these are likely to be symptoms of incorrect installation that will
- bite you down the road.)
+ auto-generated files.
To generate the configure script, type this at the MSYS Bash prompt
from the top-level directory of the Emacs tree:
You invoke the configure script like this:
- /PATH/TO/EMACS/SOURCE/TREE/nt/msysconfig.sh --prefix=PREFIX ...
+ /PATH/TO/EMACS/SOURCE/TREE/configure --prefix=PREFIX ...
or, if you are building in-place, i.e. inside the source tree:
- ./nt/msysconfig.sh --prefix=PREFIX ...
+ ./configure --prefix=PREFIX ...
Here PREFIX is the place where you eventually want to install Emacs
once built, e.g. /d/usr. We recommend to always use --prefix when
Windows-style file names was reported to cause subtle and hard to
figure out problems during the build. This applies both to the
command switches, such as --prefix=, and to the absolute file name
- of msysconfig.sh, if you are building outside of the source tree.
+ of 'configure', if you are building outside of the source tree.
You can pass additional options to the configure script, for the
full list type
- ./nt/msysconfig.sh --help
+ ./configure --help
As explained in the help text, you may need to tell the script what
are the optional flags to invoke the compiler. This is needed if
headers in C:\emacs\libs\jpeg-6b-4-lib\include, you will need to say
something like this:
- CPPFLAGS='-I/c/emacs/libs/libpng-1.2.37-lib/include -I/c/emacs/libs/jpeg-6b-4-lib/include' ./nt/msysconfig.sh --prefix=PREFIX
+ CPPFLAGS='-I/c/emacs/libs/libpng-1.2.37-lib/include -I/c/emacs/libs/jpeg-6b-4-lib/include' ./configure --prefix=PREFIX
which is quite a mouth-full, especially if you have more directories
to specify... Perhaps you may wish to revisit your installation
If you have a global site-lisp directory from previous Emacs
installation, and you want Emacs to continue using it, specify it
- via the --enable-locallisppath switch to msysconfig.sh, like this:
+ via the --enable-locallisppath switch to 'configure', like this:
- ./nt/msysconfig.sh --prefix=PREFIX --enable-locallisppath="/d/usr/share/emacs/VERSION/site-lisp:/d/wherever/site-lisp"
+ ./configure --prefix=PREFIX --enable-locallisppath="/d/usr/share/emacs/VERSION/site-lisp:/d/wherever/site-lisp"
Use the normal MSYS /d/foo/bar style to specify directories by their
absolute file names.
A few frequently used options are needed when you want to produce an
unoptimized binary with runtime checks enabled:
- CPPFLAGS='-DGLYPH_DEBUG=1' CFLAGS='-O0 -g3' ./nt/msysconfig.sh --prefix=PREFIX --enable-checking
+ CPPFLAGS='-DGLYPH_DEBUG=1' CFLAGS='-O0 -g3' ./configure --prefix=PREFIX --enable-checking
Once invoked, the configure script will run for some time, and, if
successful, will eventually produce a summary of the configuration
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. The PNG libraries are also included with GTK,
- which is installed along with other Free Software that requires it.
- 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.
-
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
`dynamic-library-alist' and the value of `libpng-version', and
download compatible DLLs if needed.
+ For GIF images, we recommend to use versions 5.0.0 or later of
+ giflib, as it is much enhanced wrt previous versions. You can find
+ precompiled binaries and headers for giflib on the ezwinports site,
+ http://sourceforge.net/projects/ezwinports/files/.
+
+ Version 5.0.0 and later of giflib are binary incompatible with
+ previous versions (the signatures of several functions have
+ changed), so Emacs will only look for giflib libraries that are
+ compatible with the version it was compiled against. Similar to
+ libpng, that version is given by the value of the Lisp variable
+ `libgif-version'; e.g., 50005 means version 5.0.5. The variable
+ `dynamic-library-alist' is automatically set to name only those DLL
+ libraries that are known to be compatible with the version given by
+ `libgif-version'.
+
+ Binaries for the other image libraries can be found at the GnuWin32
+ project. 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.
+
* Optional GnuTLS support
To compile with GnuTLS, you will need pkg-config to be installed, as