Both `_spin_lock_try` and `_spin_unlock` are private and deprecated
APIs, which are not exported by any headers in the SDK. The build fails
because the configure script does not define the functions before
calling them, which is treated as error by clang 16.
This patch replaces use of those APIs with `os_unfair_lock`, which is
the recommended replacement per the deprecation messages.
The configure scripts frequently use `main` returning an implicit `int`,
which causes spurious failures when CC is clang 16+. This is fixed by
patching the provided macros and regenerating the scripts with
autoreconfHook, though it requires some manual processing (see below).
The upstream `configure.ac` is written in such a way that it requires
fixups and post-processing.
* Fixups are required because the original build process just cats the
macros together into one file. When `aclocal` is run, it does not pick
up all of them. This is worked around by catting the missing macros to
a file that is picked up by autoreconfHook.
* Post-processing is required to populate the version information. This
is done in a subshell to avoid polluting the environment with the
contents of `RELEASE`. Otherwise, the build will fail because the
version C macros it expects will not be defined.