MariaDB on OS X

With these patches I can build and run MariaDB on OS X.  Most are copied from the mysql5.5 build, but I did have to remove some asm code, otherwise I get the error

```
[ 15%] Building C object mysys/CMakeFiles/mysys.dir/my_context.c.o
.../nix-build-mariadb-10.0.10.drv-1/mariadb-10.0.10/mysys/my_context.c:207:Unknown pseudo-op: .cfi_escape
.../nix-build-mariadb-10.0.10.drv-1/mariadb-10.0.10/mysys/my_context.c:207:Rest of line ignored. 1st junk character valued 48 (0).
make[2]: *** [mysys/CMakeFiles/mysys.dir/my_context.c.o] Error 1
```

I did not investigate fully. Perhaps on OS X a different assembler is used?