PKG-CONFIG(1)              OpenBSD Reference Manual              PKG-CONFIG(1)

NAME
     pkg-config - fetch metadata about installed software packages

SYNOPSIS
     pkg-config [options] pkg-name [pkg-name ...]

DESCRIPTION
     The pkg-config utility retrieves metadata about the installation of soft-
     ware packages.  This metadata includes version, compiler and linker
     flags, and dependency information.  It is inspired by, and intended to
     operate as a drop-in replacement to, the program of the same name avail-
     able from freedesktop.org.

     Metadata is stored in files named after the package they describe; the
     Yoyodyne package would likely be described by "yoyodyne.pc".  Not all
     software packages provide pkg-config metadata.  Packages controlled by
     the ports(7) system store their metadata, if provided, in
     ${LOCALBASE}/lib/pkgconfig; the X Window System stores its metadata in
     ${X11BASE}/lib/pkgconfig.  The pkg-config utility will search these loca-
     tions by default.

     Because pkg-config attempts to output the full set of compiler or linker
     flags required to use a package, it will also output the flags required
     for any prerequisite packages.  If the "foo" package depends on the "bar"
     package, "pkg-config --cflags foo" might output something like
     "-I/usr/local/include/foo -I/usr/local/include/bar", even though the com-
     piler flags for "bar" were not explicitly requested.

     The options are as follows:

     --atleast-pkgconfig-version version
             Exit with error if the version of pkg-config is not greater than
             or equal to the specified version.

     --atleast-version version
             Exit with error if the specified package's version is not greater
             than or equal to the specified version.

     --cflags
             Return all compiler flags required to compile against the pack-
             age.

     --cflags-only-I
             Return only the include path flags required to compile against
             the package.

     --cflags-only-other
             Return all compiler flags, other than the include path flags, re-
             quired to compile against the package.

     --debug
             Enable internal development and debugging messages.

     --errors-to-stdout
             Direct error messages to stdout rather than stderr.

     --exists
             Return true if all the specified packages are installed.  This is
             the default operation.

     --help | --usage
             Print a help message and exit.

     --libs  Return all linker flags required to link against the package.

     --libs-only-L
             Return only the library path (-L/path/to/lib) flags required to
             link against the package.

     --libs-only-l
             Return only the library (-lwhatever) flags required to link
             against the package.

     --libs-only-other
             Return linker flags, other than the library and path flags, re-
             quired to compile against the package.

     --list-all
             List all installed packages and exit.

     --modversion
             Fetch package version.  If no package is given, pkg-config re-
             turns its own version.

     --print-errors
             Print error messages and exit with an error when errors occur.
             This is the default operation.

     --silence-errors
             Do not print error messages, just exit with an error.

     --static
             Return the compiler and/or linker flags required for static link-
             ing.

     --uninstalled
             Allow packages not controlled by pkg-config to be used.

     --variable name
             Fetch the value of the named variable.

     --version
             Print version of pkg-config and exit.

     The pkg-config utility exits 0 on success, and >0 if an error occurs.

ENVIRONMENT
     PKG_CONFIG_PATH  This can be used to specify a colon-separated list of
                      paths to search for package files.  If given, this list
                      of paths is prepended to the standard search path.

SEE ALSO
     pkg_info(1), ports(7)

HISTORY
     The pkg-config utility first appeared in OpenBSD 4.1.

OpenBSD 4.7                      May 31, 2007                                2
