Improve portability in HHVM's CMake build files (#9085)
Summary:
This PR is a redo of previously reverted https://github.com/facebook/hhvm/issues/9080.
This PR includes improvement of portability in HHVM's CMake build files. They are necessary to let HHVM build with Nix, but these changes are not specifically to Nix, because other untested OS might also have similar behavior like Nix:
- `CMAKE_INSTALL_PREFIX` is replaced by `CMAKE_INSTALL_FULL_*`, because the manual concatenation of `${CMAKE_INSTALL_PREFIX}/${xxx}` would point to a wrong path if `xxx` is an absolute path. Note that https://github.com/facebook/hhvm/issues/9080 incorrectly changes the behavior of the CMake `install` command, because the CMake `install` command only automatically prepends the prefix to directories specified in `DESTINATION`, not in `CODE`. `CMAKE_INSTALL_FULL_*` used by this PR should be fine.
- `PAM_LIB` is added to fix https://github.com/facebook/hhvm/issues/257
- Passing `HAVE_SYSTEM_TZDATA_PREFIX` to `timelib` to customize the `zoneinfo` path instead of hard-coded `/usr/share/zoneinfo`, which does not exist on Nix.
- Passing `CMAKE_OSX_DEPLOYMENT_TARGET` to `thrift` explicitly, otherwise it would be inferred as 10.12 implicitly on Nix, and thrift does not compile when targeting macOS 10.12.
- Skip `zstd` detection by manually setting `CAN_USE_SYSTEM_ZSTD` because the original `zstd` detection script does not work for Nix
Pull Request resolved: https://github.com/facebook/hhvm/pull/9085
Test Plan: Tested along with the next diff
D36068249 on Github Action
Reviewed By: alexeyt
Differential Revision:
D36203896
Pulled By: Atry
fbshipit-source-id:
59fcbe0c008b35c8f20966a2c87f895c608ccce9