{
    "mode": "man",
    "parameter": "PC",
    "section": "5",
    "url": "https://www.chedong.com/phpMan.php/man/PC/5/json",
    "generated": "2026-10-05T01:14:34Z",
    "sections": {
        "NAME": {
            "content": "file.pc — pkg-config file format\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "pkg-config  files  provide a useful mechanism for storing various information about libraries\nand packages on a given system.  Information stored by .pc files include compiler and  linker\nflags necessary to use a given library, as well as any other relevant metadata.\n\nThese  .pc  files are processed by a utility called pkg-config, of which pkgconf is an imple‐\nmentation.\n\nFILE SYNTAX\nThe .pc file follows a format inspired by RFC822.  Comments are prefixed  by  a  pound  sign,\nhash  sign  or octothorpe (#), and variable assignment is similar to POSIX shell.  Properties\nare defined using RFC822-style stanzas.\n\nVARIABLES\nVariable definitions start with an alphanumeric string, followed by an equal sign,  and  then\nthe value the variable should contain.\n\nVariable  references  are  always written as \"${variable}\".  It is possible to escape literal\n\"${\" as \"$${\".\n\nPROPERTIES\nProperties are set using RFC822-style stanzas which consist of a keyword, followed by a colon\n(:) and then the value the property should be set to.  Variable substitution is  always  per‐\nformed regardless of property type.\n\nThere are three types of property:\n\nLiteral\nThe property will be set to the text of the value.\n\nDependency List\nThe  property will be set to a list of dependencies parsed from the text.  Dependency\nlists are defined by this ABNF syntax:\n\npackage-list = *WSP *( package-spec *( package-sep ) )\npackage-sep  = WSP / \",\"\npackage-spec = package-key [ ver-op package-version ]\nver-op       = \"<\" / \"<=\" / \"=\" / \"!=\" / \">=\" / \">\"\n\nFragment List\nThe property will be set to a list of fragments parsed from the text.  The input text\nmust be in a format that is suitable for passing to a POSIX shell without  any  shell\nexpansions after variable substitution has been done.\n\nPROPERTY KEYWORDS\nName    The displayed name of the package.  (mandatory; literal)\n\nVersion\nThe version of the package.  (mandatory; literal)\n\nDescription\nA description of the package.  (mandatory; literal)\n\nURL     A  URL  to a webpage for the package.  This is used to recommend where newer versions\nof the package can be acquired.  (mandatory; literal)\n\nCflags  Required compiler flags.  These flags are always used, regardless of  whether  static\ncompilation is requested.  (optional; fragment list)\n\nCflags.private\nRequired  compiler  flags  for static compilation.  (optional; fragment list; pkgconf\nextension)\n\nLibs    Required linking flags for this package.  Libraries this package depends on for link‐\ning against it, which are not described as dependencies  should  be  specified  here.\n(optional; fragment list)\n\nLibs.private\nRequired  linking  flags  for this package that are only required when linking stati‐\ncally.  Libraries this package depends on for linking against  it  statically,  which\nare  not  described  as  dependencies  should be specified here.  (optional; fragment\nlist)\n\nRequires\nRequired dependencies that must be met for the package to be usable.   All  dependen‐\ncies  must  be  satisfied  or the pkg-config implementation must not use the package.\n(optional; dependency list)\n\nRequires.private\nRequired dependencies that must be met for the package to be usable for static  link‐\ning.   All  dependencies  must be satisfied or the pkg-config implementation must not\nuse the package for static linking.  (optional; dependency list)\n\nConflicts\nDependencies that must not be met for the package to be usable.  If  any  package  in\nthe  proposed  dependency  solution  match  any dependency in the Conflicts list, the\npackage being considered is not usable.  (optional; dependency list)\n\nProvides\nDependencies that may be provided by an alternate package.  If a  package  cannot  be\nfound, the entire package collection is scanned for providers which can match the re‐\nquested dependency.  (optional; dependency list; pkgconf extension)\n\nEXTENSIONS\nFeatures  that  have  been marked as a pkgconf extension are only guaranteed to work with the\npkgconf implementation of pkg-config.  Other implementations may or may not support  the  ex‐\ntensions.\n\nAccordingly,  it  is suggested that .pc files which absolutely depend on these extensions de‐\nclare a requirement on the pkgconf virtual.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "An example .pc file:\n\n# This is a comment\nprefix=/home/kaniini/pkg   # this defines a variable\nexecprefix=${prefix}      # defining another variable with a substitution\nlibdir=${execprefix}/lib\nincludedir=${prefix}/include\n\nName: libfoo                                  # human-readable name\nDescription: an example library called libfoo # human-readable description\nVersion: 1.0\nURL: http://www.pkgconf.org\nRequires: libbar > 2.0.0\nConflicts: libbaz <= 3.0.0\nLibs: -L${libdir} -lfoo\nLibs.private: -lm\nCflags: -I${includedir}/libfoo\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "pkgconf(1), pkg.m4(7)\n\nDebian                                    December 15, 2017                                    PC(5)",
            "subsections": []
        }
    },
    "summary": "file.pc — pkg-config file format",
    "flags": [],
    "examples": [
        "An example .pc file:",
        "# This is a comment",
        "prefix=/home/kaniini/pkg   # this defines a variable",
        "execprefix=${prefix}      # defining another variable with a substitution",
        "libdir=${execprefix}/lib",
        "includedir=${prefix}/include",
        "Name: libfoo                                  # human-readable name",
        "Description: an example library called libfoo # human-readable description",
        "Version: 1.0",
        "URL: http://www.pkgconf.org",
        "Requires: libbar > 2.0.0",
        "Conflicts: libbaz <= 3.0.0",
        "Libs: -L${libdir} -lfoo",
        "Libs.private: -lm",
        "Cflags: -I${includedir}/libfoo"
    ],
    "see_also": [
        {
            "name": "pkgconf",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pkgconf/1/json"
        },
        {
            "name": "pkg.m4",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/pkg.m4/7/json"
        }
    ]
}