pkgconf
$ pkgconf Community Low Riskpkgconf resolves .pc metadata files to emit C/C++ compiler include flags (--cflags), linker libraries (--libs), and dependency graphs (--simulate). It is a fast, strictly read-only C binary that replaces legacy pkg-config with predictable exit codes and plain-text output.
brew install pkgconf pkgconf inspects local system .pc metadata files and returns exact compiler/linker flags for local toolchains; MCP is inapplicable.
Agent-Readiness Checklist
Local Probe EvidenceCaptured --help excerpt
usage: pkgconf [OPTIONS] [LIBRARIES]
basic options:
--help this message
--about print pkgconf version and license to stdout
--version print supported pkg-config version to stdout
--verbose print additional information
--atleast-pkgconfig-version check whether or not pkgconf is compatible
with a specified pkg-config version
--errors-to-stdout print all errors on stdout instead of stderr
--print-errors ensure all errors are printed
--short-errors be less verbose about some errors
--silence-errors explicitly be silent about errors
--list-all list all known packages
--list-package-names list all known package names
--simulate simulate walking the calculated dependency graph
--no-cache do not cache already seen packages when
walking the dependency graph
--log-file=filename write an audit log to a specified file
--with-path=path adds a directory to the search path
--define-prefix override the prefix variable with one that is guessed based on
the location of the .pc file
--dont-define-prefix do not override the prefix variable under any circumstances
--prefix-variable=varname sets the name of the variable that pkgconf considers
to be the package prefix
--dont-relocate-paths disables path relocation support
cross-compilation personality support:
--personality=triplet|filename sets the personality to 'triplet' or a file named 'filename'
--dump-personality dumps details concerning selected personality
checking specific pkg-config database entries:
--atleast-version require a specific version of a module
--exact-version require an exact version of a module
--max-version require a maximum version of a module
--exists check whether or not a module exists
--uninstalled check whether or not an uninstalled module will be used
--no-uninstalled never use uninstalled modules when satisfying dependencies
--n FCRS-1.0 6-Dimension Breakdown
Fast, deterministic, non-interactive read-only queries (--cflags, --libs, --modversion, --exists), though emits compiler-flag strings without --json.
--exists --print-errorsgives unambiguous exit codes and diagnostics- No
--jsonoutput mode
Strictly read-only metadata query tool with zero filesystem mutations, network calls, or credential handling.
- Pure read-only
.pcfile evaluator
Lightweight native C binary available via Homebrew, Linux package managers, and MSYS2/Windows.
- Zero-dependency native C binary across macOS, Linux, and Windows
Solves library discovery and version checks (--atleast-version) in sub-millisecond invocations.
- Replaces slower GLib-based
pkg-configwith a fast C library/CLI
Actively maintained community project (pkgconf/pkgconf) under ISC license, standard across Homebrew, Alpine, Fedora, and FreeBSD.
- Default
pkg-configimplementation on major distros and Homebrew
Clear --help output and pkgconf(1) man page, though web docs are minimal.
- Comprehensive
--helpand man page flags
Security, Auth & Guardrails
No authentication or user state required; reads .pc metadata from PKG_CONFIG_PATH and system directories.
ISC open-source CLI; free to use.
# pkgconf Agent Rules - Use `pkgconf --exists --print-errors <pkg>` before guessing header or library paths. - Pass `PKG_CONFIG_PATH` explicitly when querying keg-only Homebrew or custom prefix `.pc` files.
Agent-Ready Command Recipes
Safe Read-Only Queries
pkgconf --list-all
Enumerates all .pc packages visible on PKG_CONFIG_PATH with short descriptions.
pkgconf --cflags --libs openssl
Outputs exact -I, -L, and -l flags needed to compile and link against openssl.
Strengths for Agents
- + 100% read-only, sub-millisecond
.pcmetadata resolution with clear exit codes. - +
--simulate,--print-errors, and--errors-to-stdoutmake debugging missing native deps easy. - + Drop-in
pkg-configcompatibility without GLib runtime bloat.
Caveats & Pitfalls
- ! Outputs raw compiler/linker strings rather than
--json. - ! Requires
PKG_CONFIG_PATHwhen querying Homebrew keg-only or non-standard library prefixes.