Mercurium ported to Solaris 10 and better

While Mercurium whas not originally meant to be run in platforms other than Linux, from time to time we do some efforts for portability. This time has been the turn of Solaris 10 and OpenSolaris.

This port has not been particulary hard, Solaris is a UNIX incarnation. Porting among unices means fighting agains those minor 10% differences among them that cause the 90% of compilation fails or errors. Another annoying fact is the lack of a useful userland in Solaris. While this is not so serious in OpenSolaris, as lots of GNU tools are made the default or are already bundled, it is very annoying in Solaris 10.

Solaris 10, like Linux or FreeBSD (to name a couple), have community maintained repositories of software, so adding software is not hard, but the number of tools that must be installed can be large, at least from a developer point of view. The particular issue of Solaris 10 is that the usual repository supports several versions of Solaris (and maybe this is due to my lack of expertise or because this is on purpose) but I've felt a bit strange installing software compiled for Solaris 8 in a Solaris 10. On the good side, the tool pkg-get makes the installation a piece of cake. I've run into some issues with the packaged GCC 4.3.3 version (it installs some fixing includes that are worse than the originals they intend to fix!).

The port itself has involved polishing some bits related to the bizarre SunOS sed, which behaves in a way that turns the whole tool into something almost useless for 21th century regular expressions. Some makefiles have been changed to make them compatible with Sun ld (fortunately GNU ld features some degree of compatiblity with Sun's). Functions that in Linux are already available in the libc but in Solaris are in a separate library (mallinfo requires -lmalloc in Solaris). And functions that are too new to be in an OS of 2005, like mkdtemp (which was standardized in POSIX.1-2008, although it is been available for long in other BSDs).

Windows is another platform where we port the compiler. Windows is not a UNIX platform, so its porting is much more complex and breaks easily. We do non-releasing nightly builds for Windows which have been broken for long. When we find some spare time we'll address the Windows build.