Monday, January 17, 2011

Making Emacs

This is a post back from a few weeks ago when I still had Ubuntu. I didn't post it, because I've written it up offline and thus didn't put in links. I kinda forgot about it, and since recently my postrate has gone up and if I want to keep it there I have to post something, I'm putting in links and publish it.

==================

I got the Emacs package from my Ubuntu distribution; sadly after trying to start it a second time it crashed on startup with the error 'Arithmetic Error'.
I couldn't find out why it was crashing, nor fix it otherwise.

But I still wanted to look into Emacs, hearing everywhere about it. So I got the sourcecode of their Mercurial-repository and built it myself.


If you have built some libraries form source you might know the makefile stuff. Usually you just type './configure && make && sudo make install' and everything gets done.
I usually make a sub-directory called 'build', in which the configure-tool can copy all of its stuff in so I don't accidentally pollute any existing files and so I can easily clean up the build.

Then after it configured the stuff, I look at the output generated to find possible missing libraries. If there's anything critical missing the configure-tool will usually make that very clear and you don't have to search the log, but I search for optinal components that are not found and get them so I get all the features and miss none without knowing.
The output is usually like


checking whether stuff is declared... yes
checking something.h usability... yes
checking something.h presence... yes
checking for somethingelse.h... yes
checking whether gcc understands -Someflag... yes
checking how to run the C preprocessor... gcc -E
checking for sometool... yes
checking for somelib... yes


Just way more stuff. And where it says no, it didn't find stuff and works around, via patches or preprocessor magic or some other tricks.

But Emacs has an awesome summary for the optional components at the end:


Configured for `x86_64-unknown-linux-gnu'.

Where should the build process find the source code? /usr/offload/emacscode/trunk
What operating system and machine description files should Emacs use?
`s/gnu-linux.h' and `m/amdx86-64.h'
What compiler should emacs be built with? gcc -g -O2
Should Emacs use the GNU version of malloc? yes
(Using Doug Lea's new malloc from the GNU C Library.)
Should Emacs use a relocating allocator for buffers? no
Should Emacs use mmap(2) for buffer allocation? no
What window system should Emacs use? x11
What toolkit should Emacs use? GTK
Where do we find X Windows header files? Standard dirs
Where do we find X Windows libraries? Standard dirs
Does Emacs use -lXaw3d? no
Does Emacs use -lXpm? yes
Does Emacs use -ljpeg? yes
Does Emacs use -ltiff? yes
Does Emacs use a gif library? yes -lgif
Does Emacs use -lpng? yes
Does Emacs use -lrsvg-2? yes
Does Emacs use imagemagick? no
Does Emacs use -lgpm? no
Does Emacs use -ldbus? yes
Does Emacs use -lgconf? no
Does Emacs use -lselinux? yes
Does Emacs use -lgnutls? yes
Does Emacs use -lxml2? yes
Does Emacs use -lfreetype? yes
Does Emacs use -lm17n-flt? no
Does Emacs use -lotf? yes
Does Emacs use -lxft? yes
Does Emacs use toolkit scroll bars? yes


I could easily see what I can additionally install (though I didn't find Xaw3d-dev, nor did it properly configure imagemagick, but the rest is all there :)).

And my self-built Emacs works fine, also starting it up after the first time ;D
I still need to figure some stuff out, but I can see why many people like it, though at the moment I am more efficient with simple tools like gedit I will try to get better with Emacs :D

No comments: