{
    "mode": "man",
    "parameter": "pkg.m4",
    "section": "7",
    "url": "https://www.chedong.com/phpMan.php/man/pkg.m4/7/json",
    "generated": "2026-10-05T16:54:45Z",
    "synopsis": "PKGPREREQ\nPKGPROGPKGCONFIG\nPKGCHECKMODULES\nPKGCHECKMODULESSTATIC\nPKGINSTALLDIR\nPKGNOARCHINSTALLDIR\nPKGCHECKVAR\nPKGWITHMODULES\nPKGHAVEWITHMODULES\nPKGHAVEDEFINEWITHMODULES",
    "sections": {
        "NAME": {
            "content": "pkg.m4 — autoconf macros for using pkgconf\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "PKGPREREQ\nPKGPROGPKGCONFIG\nPKGCHECKMODULES\nPKGCHECKMODULESSTATIC\nPKGINSTALLDIR\nPKGNOARCHINSTALLDIR\nPKGCHECKVAR\nPKGWITHMODULES\nPKGHAVEWITHMODULES\nPKGHAVEDEFINEWITHMODULES\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "pkg.m4  is  a collection of autoconf macros which help to configure compiler and linker flags\nfor development libraries.  This allows build systems to detect other  dependencies  and  use\nthem with the system toolchain.\n",
            "subsections": []
        },
        "AUTOCONF MACROS": {
            "content": "",
            "subsections": [
                {
                    "name": "PKG_PREREQ(MIN-VERSION)",
                    "content": "Checks  that  the version of the pkg.m4 autoconf macros in use is at least MIN-VERSION.  This\ncan be used to ensure a particular pkg.m4 macro will be available.\n"
                },
                {
                    "name": "PKG_PROG_PKG_CONFIG([MIN-VERSION])",
                    "content": "Checks for an implementation of pkg-config which is at least MIN-VERSION or newer.\n"
                },
                {
                    "name": "PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]])",
                    "content": ""
                },
                {
                    "name": "PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]])",
                    "content": "Checks whether a given module set exists, and if so, defines CFLAGS and LIBS  variables  pre‐\nfixed by VARIABLE-PREFIX with the output from --cflags and --libs respectively.\n\nThe  optional  ACTION-IF-FOUND  and  ACTION-IF-NOT-FOUND  arguments  are shell fragments that\nshould be executed if the module set is found or not found.\n\nIf $PKGCONFIG is not defined, the PKGPROGPKGCONFIG macro will be  executed  to  locate  a\npkg-config implementation.\n\nThe PKGCHECKMODULESSTATIC macro provides the same behaviour as PKGCHECKMODULES with sta‐\ntic linking enabled via the --static flag.\n"
                },
                {
                    "name": "PKG_INSTALLDIR(DIRECTORY)",
                    "content": "Defines  the variable $pkgconfigdir as the location where a package should install pkg-config\n.pc files.\n\nBy default the directory is $libdir/pkgconfig, but the default can be changed by passing  the\nDIRECTORY parameter.\n\nThis value can be overridden with the --with-pkgconfigdir configure parameter.\n"
                },
                {
                    "name": "PKG_NOARCH_INSTALLDIR(DIRECTORY)",
                    "content": "Defines the variable $noarchpkgconfigdir as the location where a package should install pkg-\nconfig .pc files.\n\nBy default the directory is $datadir/pkgconfig, but the default can be changed by passing the\nDIRECTORY parameter.\n\nThis value can be overridden with the --with-noarch-pkgconfigdir configure parameter.\n"
                },
                {
                    "name": "PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])",
                    "content": "Retrieves  the  value of the pkg-config variable CONFIG-VARIABLE from MODULE and stores it in\nthe VARIABLE variable.\n\nNote that repeated usage of VARIABLE is not recommended as the check will be skipped  if  the\nvariable is already set.\n"
                },
                {
                    "name": "PKG_WITH_MODULES(VARIABLE-PREFIX,        MODULES,        [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],",
                    "content": ""
                },
                {
                    "name": "[DESCRIPTION], [DEFAULT])",
                    "content": "Prepares a \"--with-\" configure option using the lowercase VARIABLE-PREFIX name,  merging  the\nbehaviour of ACARGWITH and PKGCHECKMODULES in a single macro.\n"
                },
                {
                    "name": "PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, [DESCRIPTION], [DEFAULT])",
                    "content": "Convenience  macro  to trigger AMCONDITIONAL after a PKGWITHMODULES check. VARIABLE-PREFIX\nis exported as a make variable.\n"
                },
                {
                    "name": "PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, [DESCRIPTION], [DEFAULT])",
                    "content": "Convenience macro to trigger AMCONDITIONAL and ACDEFINE  after  a  PKGWITHMODULES  check.\nVARIABLE-PREFIX is exported as a make variable.\n\nDebian                                    December 5, 2017                                 PKG.M4(7)"
                }
            ]
        }
    },
    "summary": "pkg.m4 — autoconf macros for using pkgconf",
    "flags": [],
    "examples": [],
    "see_also": []
}