Draft: use meson's built-in has_function() for feature detection
the current meson.build script checks the existence of some functions by compiling a code snippet, this patch replaces this custom feature detection logic by meson's built-in Compiler.has_function() mechanism.