configure: improve pkg-config support
This adds helper functions for checking packages with pkg-config
and managing the associated flags.
Note that pkg-config use is still discouraged due to widespread
poor practices resulting in broken flags in many situations. A
few badly designed packages require flags only obtainable using
pkg-config, and these functions are intended for those cases.
Signed-off-by: Mans Rullgard <email@example.com>
(cherry picked from commit 3f8040db3e13c3dbdf07c74d92ca34817a69f733)
Signed-off-by: Michael Niedermayer <firstname.lastname@example.org>