This accomplishes two things for the fallback path without pkg-config.
1. If --disable-foo is passed to configure it will explicitly skip
check_val. This has the benefit of reducing checks in
qb/config.libs.sh which are easy to break due to human error.
2. When a fallback path exists and --enable-foo is passed to configure,
but fails due to the missing -lfoo check_val will now bail and print
a configure error. However --enable-foo will still be ignored if
there is no fallback path and pkg-config is not installed.
One issue with this is that if pkg-config is installed and the package
foo is not, it will still check if -lfoo works. As not all pkg-config
implemenations can be trusted to work even if they exist this seems
unavoidable.
This resolves an issue where the default freebsd compiler does not
include /usr/local/include which contains important headers such as
GL/gl.h and results in the check_header function failing to find them.
Unfortunately pkg-config/pkgconf will not work here for two reasons.
1. It does not seem able to actually check for gl.h which RetroArch
explicitly needs.
2. Not all systems have a pkg-config implementation so we will still
have to fall back to checking for gl.h...
Fixes https://github.com/libretro/RetroArch/issues/5958
RetroArch no longer uses submodules for various good reasons and now uses git subtrees instead.
As a result these files will always exist and these tests will always be true.
Recent Raspberry Pi firmware images have renamed the vendor graphics
libraries (brcmEGL, brcmGLESv2, brcmOpenVG) to distinguish from the
standard VC4 Mesa driver.
* When videocore is selected, first try to use pkgconfig for the
new library names (brcmEGL, brcmGLESv2, brcmOpenVG).
* Ensure that non-pkgconfig fallback detection also checks the new
library names.
This should resolve compile issues in stretch whilst maintaining
compatibility with jessie firmwares later than 1.20160921-1 (the
first package that includes the renamed libraries).
The PKG_CONFIG_PATH must be set in your build environment in order
for the pkgconfig to be utilized, which will be included in
the next firmware (1.20170811-2 or later).