When building software targeting Pi, it's common practice to use
the pkgconfig to assist building by specifying PKG_CONFIG_PATH.
Unfortunately, the presence of the legacy pkgconfig that conflict with
Mesa's libraries will cause issues for users that build against the
firmware pkgconfig, but wish to target Mesa. (Pi 4B or earlier revisions
using the f/kms overlay).
Although a possible workaround may be to omit the custom PKG_CONFIG_PATH
of the firmware pkgconfig during build, there are plausible use cases in
which to target a software build against Mesa whilst also leveraging
the non GL-specific firmware libraries (e.g. MMAL for hardware codec support
that works on the FKMS overlay, or BCM_HOST for basic board detection).
Note: this conflict is already resolved via the Raspbian packages by deliberately
omitting the conflicting .pc files during the packaging stage; see https://github.com/raspberrypi/firmware/issues/857
many packages expect packageconfig support especially for detecting EGL
libraries. This patch helps in compiling those packages on RPi
Signed-off-by: Khem Raj <raj.khem@gmail.com>