GNU Info

Info Node: (elisp)Building Emacs

(elisp)Building Emacs


Next: Pure Storage Up: GNU Emacs Internals
Enter node , (file) or (file)node

Building Emacs
==============

   This section explains the steps involved in building the Emacs
executable.  You don't have to know this material to build and install
Emacs, since the makefiles do all these things automatically.  This
information is pertinent to Emacs maintenance.

   Compilation of the C source files in the `src' directory produces an
executable file called `temacs', also called a "bare impure Emacs".  It
contains the Emacs Lisp interpreter and I/O routines, but not the
editing commands.

   The command `temacs -l loadup' uses `temacs' to create the real
runnable Emacs executable.  These arguments direct `temacs' to evaluate
the Lisp files specified in the file `loadup.el'.  These files set up
the normal Emacs editing environment, resulting in an Emacs that is
still impure but no longer bare.

   It takes a substantial time to load the standard Lisp files.
Luckily, you don't have to do this each time you run Emacs; `temacs' can
dump out an executable program called `emacs' that has these files
preloaded.  `emacs' starts more quickly because it does not need to
load the files.  This is the Emacs executable that is normally
installed.

   To create `emacs', use the command `temacs -batch -l loadup dump'.
The purpose of `-batch' here is to prevent `temacs' from trying to
initialize any of its data on the terminal; this ensures that the
tables of terminal information are empty in the dumped Emacs.  The
argument `dump' tells `loadup.el' to dump a new executable named
`emacs'.

   Some operating systems don't support dumping.  On those systems, you
must start Emacs with the `temacs -l loadup' command each time you use
it.  This takes a substantial time, but since you need to start Emacs
once a day at most--or once a week if you never log out--the extra time
is not too severe a problem.

   You can specify additional files to preload by writing a library
named `site-load.el' that loads them.  You may need to add a definition

     #define SITELOAD_PURESIZE_EXTRA N

to make N added bytes of pure space to hold the additional files.  (Try
adding increments of 20000 until it is big enough.)  However, the
advantage of preloading additional files decreases as machines get
faster.  On modern machines, it is usually not advisable.

   After `loadup.el' reads `site-load.el', it finds the documentation
strings for primitive and preloaded functions (and variables) in the
file `etc/DOC' where they are stored, by calling `Snarf-documentation'
(Note: Accessing Documentation).

   You can specify other Lisp expressions to execute just before dumping
by putting them in a library named `site-init.el'.  This file is
executed after the documentation strings are found.

   If you want to preload function or variable definitions, there are
three ways you can do this and make their documentation strings
accessible when you subsequently run Emacs:

   * Arrange to scan these files when producing the `etc/DOC' file, and
     load them with `site-load.el'.

   * Load the files with `site-init.el', then copy the files into the
     installation directory for Lisp files when you install Emacs.

   * Specify a non-`nil' value for `byte-compile-dynamic-docstrings' as
     a local variable in each of these files, and load them with either
     `site-load.el' or `site-init.el'.  (This method has the drawback
     that the documentation strings take up space in Emacs all the
     time.)

   It is not advisable to put anything in `site-load.el' or
`site-init.el' that would alter any of the features that users expect
in an ordinary unmodified Emacs.  If you feel you must override normal
features for your site, do it with `default.el', so that users can
override your changes if they wish.  Note: Startup Summary.

 - Function: dump-emacs to-file from-file
     This function dumps the current state of Emacs into an executable
     file TO-FILE.  It takes symbols from FROM-FILE (this is normally
     the executable file `temacs').

     If you want to use this function in an Emacs that was already
     dumped, you must run Emacs with `-batch'.


automatically generated by info2www version 1.2.2.9