configure: Add and use AX_CHECK_COMPILE_FLAG

This makes it a lot clearer what's happening (at least I think so), and
will make future additions much simpler.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2 files changed