{
    "mode": "perldoc",
    "parameter": "Dpkg::BuildFlags",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Dpkg%3A%3ABuildFlags/json",
    "generated": "2026-10-08T13:49:39Z",
    "sections": {
        "NAME": {
            "content": "Dpkg::BuildFlags - query build flags\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This class is used by dpkg-buildflags and can be used to query the same information.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "$bf = Dpkg::BuildFlags->new()\nCreate a new Dpkg::BuildFlags object. It will be initialized based on the value of several\nconfiguration files and environment variables.\n\nIf the option vendordefaults is set to false, then no vendor defaults are initialized (it\ndefaults to true).\n\n$bf->loadvendordefaults()\nReset the flags stored to the default set provided by the vendor.\n\n$bf->loadsystemconfig()\nUpdate flags from the system configuration.\n\n$bf->loaduserconfig()\nUpdate flags from the user configuration.\n\n$bf->loadenvironmentconfig()\nUpdate flags based on user directives stored in the environment. See dpkg-buildflags(1) for\ndetails.\n\n$bf->loadmaintainerconfig()\nUpdate flags based on maintainer directives stored in the environment. See\ndpkg-buildflags(1) for details.\n\n$bf->loadconfig()\nCall successively loadsystemconfig(), loaduserconfig(), loadenvironmentconfig() and\nloadmaintainerconfig() to update the default build flags defined by the vendor.\n\n$bf->unset($flag)\nUnset the build flag $flag, so that it will not be known anymore.\n\n$bf->set($flag, $value, $source, $maint)\nUpdate the build flag $flag with value $value and record its origin as $source (if defined).\nRecord it as maintainer modified if $maint is defined and true.\n\n$bf->setfeature($area, $feature, $enabled)\nUpdate the boolean state of whether a specific feature within a known feature area has been\nenabled. The only currently known feature areas are \"future\", \"qa\", \"sanitize\", \"optimize\",\n\"hardening\" and \"reproducible\".\n\n$bf->getfeature($area, $feature)\nReturns the value for the given feature within a known feature area. This is relevant for\nbuiltin features where the feature has a ternary state of true, false and undef, and where\nthe latter cannot be retrieved with usefeature().\n\n$bf->usefeature($area, $feature)\nReturns true if the given feature within a known feature areas has been enabled, and false\notherwise. The only currently recognized feature areas are \"future\", \"qa\", \"sanitize\",\n\"optimize\", \"hardening\" and \"reproducible\".\n\n$bf->setbuiltin($area, $feature, $enabled)\nUpdate the boolean state of whether a specific feature within a known feature area is\nhandled (even if only in some architectures) as a builtin default by the compiler.\n\n$bf->getbuiltins($area)\nReturn, for the given area, a hash with keys as feature names, and values as booleans\nindicating whether the feature is handled as a builtin default by the compiler or not. Only\nfeatures that might be handled as builtins on some architectures are returned as part of the\nhash. Missing features mean they are currently never handled as builtins by the compiler.\n\n$bf->setoptionvalue($option, $value)\nPrivate method to set the value of a build option. Do not use outside of the dpkg project.\n\n$bf->getoptionvalue($option)\nPrivate method to get the value of a build option. Do not use outside of the dpkg project.\n\n$bf->strip($flag, $value, $source, $maint)\nUpdate the build flag $flag by stripping the flags listed in $value and record its origin as\n$source (if defined). Record it as maintainer modified if $maint is defined and true.\n\n$bf->append($flag, $value, $source, $maint)\nAppend the options listed in $value to the current value of the flag $flag. Record its\norigin as $source (if defined). Record it as maintainer modified if $maint is defined and\ntrue.\n\n$bf->prepend($flag, $value, $source, $maint)\nPrepend the options listed in $value to the current value of the flag $flag. Record its\norigin as $source (if defined). Record it as maintainer modified if $maint is defined and\ntrue.\n\n$bf->updatefromconffile($file, $source)\nUpdate the current build flags based on the configuration directives contained in $file. See\ndpkg-buildflags(1) for the format of the directives.\n\n$source is the origin recorded for any build flag set or modified.\n\n$bf->get($flag)\nReturn the value associated to the flag. It might be undef if the flag doesn't exist.\n\n$bf->getfeatureareas()\nReturn the feature areas (i.e. the area values hasfeatures will return true for).\n\n$bf->getfeatures($area)\nReturn, for the given area, a hash with keys as feature names, and values as booleans\nindicating whether the feature is enabled or not.\n\n$bf->getorigin($flag)\nReturn the origin associated to the flag. It might be undef if the flag doesn't exist.\n\n$bf->ismaintainermodified($flag)\nReturn true if the flag is modified by the maintainer.\n\n$bf->hasfeatures($area)\nReturns true if the given area of features is known, and false otherwise. The only currently\nrecognized feature areas are \"future\", \"qa\", \"sanitize\", \"optimize\", \"hardening\" and\n\"reproducible\".\n\n$bf->has($option)\nReturns a boolean indicating whether the flags exists in the object.\n\n@flags = $bf->list()\nReturns the list of flags stored in the object.\n",
            "subsections": []
        },
        "CHANGES": {
            "content": "Version 1.06 (dpkg 1.21.15)\nNew method: $bf->getfeature().\n\nVersion 1.05 (dpkg 1.21.14)\nNew option: 'vendordefaults' in new().\n\nNew methods: $bf->loadvendordefaults(), $bf->usefeature(), $bf->setbuiltin(),\n$bf->getbuiltins().\n\nVersion 1.04 (dpkg 1.20.0)\nNew method: $bf->unset().\n\nVersion 1.03 (dpkg 1.16.5)\nNew method: $bf->getfeatureareas() to list possible values for $bf->getfeatures.\n\nNew method $bf->ismaintainermodified() and new optional parameter to $bf->set(),\n$bf->append(), $bf->prepend(), $bf->strip().\n\nVersion 1.02 (dpkg 1.16.2)\nNew methods: $bf->getfeatures(), $bf->hasfeatures(), $bf->setfeature().\n\nVersion 1.01 (dpkg 1.16.1)\nNew method: $bf->prepend() very similar to append(). Implement support of the prepend operation\neverywhere.\n\nNew method: $bf->loadmaintainerconfig() that update the build flags based on the package\nmaintainer directives.\n\nVersion 1.00 (dpkg 1.15.7)\nMark the module as public.\n",
            "subsections": []
        }
    },
    "summary": "Dpkg::BuildFlags - query build flags",
    "flags": [],
    "examples": [],
    "see_also": []
}