build: Fix clock_gettime check with XCode 8
authorNirbheek Chauhan <nirbheek@centricular.com>
Mon, 3 Oct 2016 14:52:53 +0000 (20:22 +0530)
committerNirbheek Chauhan <nirbheek@centricular.com>
Wed, 12 Oct 2016 22:10:04 +0000 (03:40 +0530)
commit6c1bc80d2791af9a5b07d59ce8e6f7039577eece
tree11676a9b5fb069d2b296a36614030de5c78cb5ab
parent0ab950f501ef1cb6ee1a786aaf473261ae3fed58
build: Fix clock_gettime check with XCode 8

With XCode 8, clock_gettime will be incorrectly detected as being
available regardless of what OS X version we're targetting because the
symbol is available in the .tbd library as a weak symbol.
See: https://github.com/Homebrew/homebrew-core/issues/3727#issue-170086273

It's only starting from macOS 10.12 that clock_gettime is actually
available, so we can unconditionally disable it when targetting older
versions. We cannot simply do AC_CHECK_FUNCS with -Wl,-no_weak_imports
because the autoconf check does its own prototype declaration that
doesn't trigger that compiler flag.

https://bugzilla.gnome.org/show_bug.cgi?id=772451
configure.ac
m4/check-checks.m4
meson.build