Thursday, April 16, 2009

Building a lean'n'mean emacs for HP-UX

The port of emacs available in the Porting and Archiving Center for HP-UX is a helluva big build, with all options. It requires a total of 22 libraries, that's nonsense if you're only interested in running the textmode version of emacs. Here's how to build one for HP-UX.

You need the following to build it:

  • The aCC compiler - I have not been able to compile it with gcc (both using the stock source or the one modified by the Porting Center). If you don't have it, there is an evaluation versionavailable on the HP Software Depot. Sorry, normally I prefer using gcc, too.
  • GNU Make
  • Libncurses (also required on the servers where you intend to run emacs. I haven't taken my chances with the stock curses library).

Here is the procedure to follow:

The porting center already did the grunt work of modifying the code to have it compile nicely under HP-UX -- thanks Richard. That is impossible if you take the stock emacs source. Grab that ported source directly from the porting center:

# wget http://hpux.connect.org.uk/ftp/hpux/Editors/emacs-22.3/emacs-22.3-hppa-11.11.depot.gz

Sidenote: if you don't have wget, now would be a good time to install it, it's very useful for doing this kind of stuff if your servers have an outbound connection to the internet.

Extract the tar file and run configure like this:
# ./configure --prefix=/opt/emacs --without-x

N.B. You don't need to add --prefix if you prefer having it under /usr/local. The report at the end of configure should look like this:


Should Emacs use the GNU version of malloc? yes
Should Emacs use a relocating allocator for buffers? yes
Should Emacs use mmap(2) for buffer allocation? no
What window system should Emacs use? none
What toolkit should Emacs use? none
Where do we find X Windows header files? NONE
Where do we find X Windows libraries? NONE
Does Emacs use -lXaw3d? no
Does Emacs use -lXpm? no
Does Emacs use -ljpeg? no
Does Emacs use -ltiff? no
Does Emacs use -lungif? no
Does Emacs use -lpng? no
Does Emacs use X toolkit scroll bars? no


Then run gmake to build emacs:

# gmake

Finally, install emacs:

# gmake install

And you're done.

No comments: