This has been tested to work with PG 9.1, 9.2, 9.3 & 9.4dev. It is also known to work on Ubuntu 10, 11, 12 & 13. I also recently got a chance to verify that it works on the ARM flavor of Ubuntu.
$ sudo apt-get install build-essential libreadline-dev zlib1g-dev flex bison libxml2-dev libxslt-dev libssl-dev
With this complete, you can then do an industrial strength build of PostgreSQL as per below:
$ tar -xvf postgresql-9.x.y.tar.bz2
$ cd postgresql-9.x.y
$ ./configure –with-libxml –with-libxslt –with-openssl