emacs_tutorial/doc/compile.org
2023-04-06 13:48:23 -03:00

90 lines
2.1 KiB
Org Mode

#+date: 2022-12-14
#+options: toc:nil num:nil
* Compiling emacs in GNU linux systems
Emacs is available in all GNU-linux distributions. If you want to install emacs
directly from any free-software distribution, you may check [[https://www.gnu.org/software/emacs/download.html][this information]].
However, you may be interested in compiling emacs for your operational system.
To compile emacs it's important to install some development libraries before
downloading the emacs tarball.
Below there are options to compile emacs in debian-like free software
distributions
** Install ~build-essential~
#+begin_example sh
sudo apt install build-essential
#+end_example
#+begin_example sh
sudo apt update && sudo apt build-dep emacs
#+end_example
** Download emacs (tarball), extract and open the source directory
Visit the [[https://www.gnu.org/software/emacs/][Emacs website]]
Let's say you want to download emacs 28.2. You may use ~wget~ to download the
tarball:
#+begin_example sh
wget http://ftp.gnu.org/gnu/emacs/emacs-28.2.tar.gz
#+end_example
Then, extract the files and open a terminal within the main directory of the package.
#+begin_example sh
tar xvfz emacs-28.2.tar.gz
#+end_example
Change the directory to the extracted files:
#+begin_example sh
cd emacs-28.2
#+end_example
** Execute the following commands in a terminal to begin with the process
Run the [[https://git.savannah.gnu.org/cgit/emacs.git/tree/autogen.sh][autogen.sh]] script. The script should be inside the emacs directory.
#+begin_example sh
./autogen.sh
#+end_example
Configure
#+begin_example sh
./configure
#+end_example
Make the package and install in the system
#+begin_example sh
make
sudo make install
#+end_example
** Facing problems due to lack of XLibs in Debian system
Install the following libraries: (for PureOS or Debian Buster):
#+begin_comment
libc6-dev libjpeg62-turbo libncurses5-dev libpng-dev libtiff5-dev libgif-dev xaw3dg-dev zlib1g-dev libx11-dev
#+end_comment
To install, use:
#+begin_example sh
apt install
#+end_example
** References
* [[https://www.emacswiki.org/emacs/BuildingEmacs][Emacs wiki]]