Simple CMake build scripts and Linux fixes

These commits add the standard header needed for va_list and uses Linux's endian.h to define OS X-like endianess defines.

The CMake build is tested on Linux, and should thus probably work on most OSes of that kind.