This commit adds a number of changes to platform-detection and compile-time directives required to support building ClickHouse on Solaris-derived systems, most notably illumos.