Last Updated: February 25, 2016
·
6.744K
· jimeh

Compile Emacs 24.2 on Raspberry Pi (Rasbian)

Create working directory, download and extract Emacs 24.2:

mkdir ~/src
cd ~/src
wget http://ftp.gnu.org/pub/gnu/emacs/emacs-24.2.tar.bz2
tar -xjvf emacs-24.2.tar.bz2
cd emacs-24.2

Install dependencies:

sudo apt-get install texinfo libncurses5-dev

(Optional) Install X related dependencies:

sudo apt-get install xorg-dev libpng12-dev libjpeg8-dev \
libgif-dev libtiff5 libtiff5-dev

Create /usr/local/bin/gcc-4.2 symlink:

sudo ln -s /usr/bin/gcc /usr/local/bin/gcc-4.2

Emacs' configure script seems to specifically look for /usr/local/bin/gcc-4.2 which doesn't by default exist on Rasbian.

Run configure script:

./configure --prefix /opt/emacs

Add --without-x to the end of the configure command if you don't need X support.

Run make:

make

Check emacs binary was built and works:

./src/emacs

If Emacs loaded up alright, quit it and run make install:

make install

Emacs binaries will now be available under /opt/emacs/bin/. Run the following to to ensure it works:

/opt/emacs/bin/emacs

3 Responses
Add your response

Thanks for this!
I can recommend the emacs-live configuration from here, which requires emacs24: http://github.com/overtone/emacs-live

over 1 year ago ·

Thanks to share this tip !

over 1 year ago ·

Thank you the tip. Raspbian these days includes gcc-4.6 and it had both /usr/bin/gcc and /usr/bin/gcc-4.6 accessible.

over 1 year ago ·