diff options
| author | Paul Eggert | 2020-01-24 16:41:38 -0800 |
|---|---|---|
| committer | Paul Eggert | 2020-01-24 16:46:42 -0800 |
| commit | f42d57c7dbd571b449270c8899a67e537561c2b2 (patch) | |
| tree | 3750aa093fb8ac135c20a247e8d82c49b55bd8a4 /INSTALL | |
| parent | 0c6c8aa002d321db61afdd14c70744f7bc27f268 (diff) | |
| download | emacs-f42d57c7dbd571b449270c8899a67e537561c2b2.tar.gz emacs-f42d57c7dbd571b449270c8899a67e537561c2b2.zip | |
Install C source code for C-h f etc.
Without this change, on typical GNU/Linux distributions
like Debian, the first button of ‘C-h f car RET’ does not work
because the source code for ‘car’ is not installed (Bug#37527).
Fix this by installing the (compressed) C source code alongside
the (compressed) Lisp source code that is already installed.
This adds about 3 MB (about 2%) to the size of the installed files
on my platform.
* Makefile.in (emacs_srcdir): New macro.
(epaths-force): Substitute PATH_EMACS_SOURCE.
(install-c-src): New rule, that installs a copy of the C source
code if emacs_srcdir says to.
(install-arch-indep): Depend on it.
* configure.ac (emacs_srcdir): New var.
Add support for --disable-install-srcdir.
* lisp/emacs-lisp/find-func.el (find-function-C-source-directory):
Look in emacs-source-directory first.
(find-function-C-source): Also look for gzipped source files.
* lisp/startup.el (normal-top-level):
Also recode emacs-source-directory.
* src/epaths.in (PATH_EMACS_SOURCE): New macro.
* src/lread.c: Include dosname.h, for IS_ABSOLUTE_FILE_NAME.
(syms_of_lread): New var emacs-source-directory.
Diffstat (limited to 'INSTALL')
| -rw-r--r-- | INSTALL | 65 |
1 files changed, 33 insertions, 32 deletions
| @@ -214,41 +214,42 @@ like 'apt-get build-dep emacs' (on older systems, replace 'emacs' with | |||
| 214 | eg 'emacs25'). On Red Hat-based systems, the corresponding command is | 214 | eg 'emacs25'). On Red Hat-based systems, the corresponding command is |
| 215 | 'dnf builddep emacs' (on older systems, use 'yum-builddep' instead). | 215 | 'dnf builddep emacs' (on older systems, use 'yum-builddep' instead). |
| 216 | 216 | ||
| 217 | |||
| 218 | DEBUGGING AN INSTALLED EMACS | ||
| 219 | |||
| 220 | * Installed Emacs source code | ||
| 221 | |||
| 222 | Emacs installs a compressed copy of much of its source code, to make | ||
| 223 | it easy for users to read the source code of Emacs via commands like | ||
| 224 | M-x describe-function (C-h f) to display the definition of a function. | ||
| 225 | This compressed copy ordinarily includes both the Elisp source code | ||
| 226 | that Emacs is mostly written in, as well as the C source code for the | ||
| 227 | core Emacs executable. | ||
| 228 | |||
| 217 | * GNU/Linux source and debug packages | 229 | * GNU/Linux source and debug packages |
| 218 | 230 | ||
| 219 | Many GNU/Linux systems provide separate packages containing the | 231 | Many GNU/Linux systems provide separate packages containing the |
| 220 | sources and debug symbols of Emacs. They are useful if you want to | 232 | sources and debug symbols of Emacs. They can help you debug the |
| 221 | check the source code of Emacs primitive functions or debug Emacs on | 233 | installed Emacs on the C level. The procedures for installing these |
| 222 | the C level. | 234 | packages depend on the GNU/Linux system that you use. |
| 223 | 235 | ||
| 224 | The names of the packages that you need vary according to the | 236 | Emacs debugging symbols are distributed by a debug package if one |
| 225 | GNU/Linux distribution that you use. On Debian-based systems, you can | 237 | exists for your system. On Debian-based systems, you can |
| 226 | install a source package of Emacs with a command like 'apt-get source | 238 | install a debug package of Emacs with a command like 'apt-get install |
| 227 | emacs' (on older systems, replace 'emacs' with eg 'emacs25'). The | 239 | emacs-dbg' (on older systems, replace 'emacs' with e.g. 'emacs25'). |
| 228 | target directory for unpacking the source tree is the current | 240 | On Red Hat-based systems, the corresponding command is 'dnf |
| 229 | directory. On Red Hat-based systems, the corresponding command is | 241 | debuginfo-install emacs'; this may require adding the *-debuginfo |
| 230 | 'dnf install emacs-debugsource', with target directory /usr/src/debug | 242 | repositories first, via 'dnf config-manager --set-enabled |
| 231 | (this requires to add the *-debuginfo repositories first, via 'dnf | 243 | fedora-debuginfo updates-debuginfo'. |
| 232 | config-manager --set-enabled fedora-debuginfo updates-debuginfo'). | 244 | |
| 233 | 245 | Some systems also have an Emacs source package that is also helpful | |
| 234 | Once you have installed the source package, for example at | 246 | when debugging the installed Emacs. To unpack an Emacs source package |
| 235 | /path/to/emacs-26.1, add the following line to your startup file: | 247 | into the current directory on Debian-based systems, you can use a |
| 236 | 248 | command like 'apt-get source emacs' (on older systems, replace 'emacs' | |
| 237 | (setq find-function-C-source-directory | 249 | with e.g. 'emacs25'); you may first need to add the appropriate |
| 238 | "/path/to/emacs-26.1/src") | 250 | 'source' URIs to your sources.list. On Red Hat-based systems, |
| 239 | 251 | installing the debugging symbols automatically installs the | |
| 240 | The installation directory of the Emacs source package will contain | 252 | corresponding source package in the appropriate location. |
| 241 | the exact package name and version number Emacs is installed on your | ||
| 242 | system. If a new Emacs package is installed, the source package must | ||
| 243 | be reinstalled as well, and the setting in your startup file must be | ||
| 244 | updated. | ||
| 245 | |||
| 246 | Emacs debugging symbols are distributed by a debug package. It does | ||
| 247 | not exist for every released Emacs package, this depends on the | ||
| 248 | distribution. On Debian-based systems, you can install a debug | ||
| 249 | package of Emacs with a command like 'apt-get install emacs-dbg' (on | ||
| 250 | older systems, replace 'emacs' with eg 'emacs25'). On Red Hat-based | ||
| 251 | systems, the corresponding command is 'dnf debuginfo-install emacs'. | ||
| 252 | 253 | ||
| 253 | 254 | ||
| 254 | DETAILED BUILDING AND INSTALLATION: | 255 | DETAILED BUILDING AND INSTALLATION: |