- 
    Type:Task 
- 
    Resolution: Fixed
- 
    Priority:Major - P3 
- 
    Affects Version/s: None
- 
    Component/s: None
- 
    None
- 
        None
- 
        None
- 
        None
- 
        None
- 
        None
- 
        None
In config.m4, we invoke pkg-config directly to detect libmongoc, libbson, and libmongocrypt system libraries. For consistency, we should utilize the PKG_CHECK_MODULES macro that is used for all other dependencies (e.g. TLS, compression libraries).
We can consider making pkg-config an explicit dependency in config.m4, which may help users diagnose errors when configuring the library. For example, the build process could inform users that pkg-config is required instead of a more cryptic outcome where a library isn't detected at all (see: mongodb/mongo-php-driver#1482). However, that is not done in PHP, which relies entirely on pkg-config for detecting OpenSSL since 7.4 (php/php-src@fe8fdfa).
Note: this issue has been split out from PHPC-2309, which has since been repurposed to only deal with removal of --with-openssl-dir.