{
    "mode": "man",
    "parameter": "dpkg-buildflags",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/dpkg-buildflags/1/json",
    "generated": "2026-05-30T05:15:22Z",
    "synopsis": "dpkg-buildflags [option...] [command]",
    "sections": {
        "NAME": {
            "content": "dpkg-buildflags - returns build flags to use during package build\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "dpkg-buildflags [option...] [command]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "dpkg-buildflags is a tool to retrieve compilation flags to use during build of Debian\npackages.\n\nThe default flags are defined by the vendor but they can be extended/overridden in several\nways:\n\n1.  system-wide with /etc/dpkg/buildflags.conf;\n\n2.  for the current user with $XDGCONFIGHOME/dpkg/buildflags.conf where $XDGCONFIGHOME\ndefaults to $HOME/.config;\n\n3.  temporarily by the user with environment variables (see section ENVIRONMENT);\n\n4.  dynamically by the package maintainer with environment variables set via debian/rules\n(see section ENVIRONMENT).\n\nThe configuration files can contain four types of directives:\n\nSET flag value\nOverride the flag named flag to have the value value.\n\nSTRIP flag value\nStrip from the flag named flag all the build flags listed in value.\n\nAPPEND flag value\nExtend the flag named flag by appending the options given in value.  A space is prepended\nto the appended value if the flag's current value is non-empty.\n\nPREPEND flag value\nExtend the flag named flag by prepending the options given in value.  A space is appended\nto the prepended value if the flag's current value is non-empty.\n\nThe configuration files can contain comments on lines starting with a hash (#). Empty lines\nare also ignored.\n",
            "subsections": []
        },
        "COMMANDS": {
            "content": "",
            "subsections": [
                {
                    "name": "--dump",
                    "content": "Print to standard output all compilation flags and their values. It prints one flag per\nline separated from its value by an equal sign (“flag=value”). This is the default\naction.\n",
                    "long": "--dump"
                },
                {
                    "name": "--list",
                    "content": "Print the list of flags supported by the current vendor (one per line). See the SUPPORTED\nFLAGS section for more information about them.\n",
                    "long": "--list"
                },
                {
                    "name": "--status",
                    "content": "Display any information that can be useful to explain the behaviour of dpkg-buildflags\n(since dpkg 1.16.5): relevant environment variables, current vendor, state of all feature\nflags.  Also print the resulting compiler flags with their origin.\n\nThis is intended to be run from debian/rules, so that the build log keeps a clear trace\nof the build flags used. This can be useful to diagnose problems related to them.\n\n--export=format\nPrint to standard output commands that can be used to export all the compilation flags\nfor some particular tool. If the format value is not given, sh is assumed. Only\ncompilation flags starting with an upper case character are included, others are assumed\nto not be suitable for the environment. Supported formats:\n\nsh  Shell commands to set and export all the compilation flags in the environment. The\nflag values are quoted so the output is ready for evaluation by a shell.\n\ncmdline\nArguments to pass to a build program's command line to use all the compilation flags\n(since dpkg 1.17.0). The flag values are quoted in shell syntax.\n\nconfigure\nThis is a legacy alias for cmdline.\n\nmake\nMake directives to set and export all the compilation flags in the environment.\nOutput can be written to a Makefile fragment and evaluated using an include\ndirective.\n\n--get flag\nPrint the value of the flag on standard output. Exits with 0 if the flag is known\notherwise exits with 1.\n\n--origin flag\nPrint the origin of the value that is returned by --get. Exits with 0 if the flag is\nknown otherwise exits with 1. The origin can be one of the following values:\n\nvendor\nthe original flag set by the vendor is returned;\n\nsystem\nthe flag is set/modified by a system-wide configuration;\n\nuser\nthe flag is set/modified by a user-specific configuration;\n\nenv the flag is set/modified by an environment-specific configuration.\n",
                    "long": "--status"
                },
                {
                    "name": "--query",
                    "content": "Print any information that can be useful to explain the behaviour of the program: current\nvendor, relevant environment variables, feature areas, state of all feature flags, and\nthe compiler flags with their origin (since dpkg 1.19.0).\n\nFor example:\n\nVendor: Debian\nEnvironment:\nDEBCFLAGSSET=-O0 -Wall\n\nArea: qa\nFeatures:\nbug=no\ncanary=no\n\nArea: reproducible\nFeatures:\ntimeless=no\n\nFlag: CFLAGS\nValue: -O0 -Wall\nOrigin: env\n\nFlag: CPPFLAGS\nValue: -DFORTIFYSOURCE=2\nOrigin: vendor\n\n--query-features area\nPrint the features enabled for a given area (since dpkg 1.16.2).  The only currently\nrecognized areas on Debian and derivatives are future, qa, reproducible, sanitize and\nhardening, see the FEATURE AREAS section for more details.  Exits with 0 if the area is\nknown otherwise exits with 1.\n\nThe output is in RFC822 format, with one section per feature.  For example:\n\nFeature: pie\nEnabled: yes\n\nFeature: stackprotector\nEnabled: yes\n",
                    "long": "--query"
                },
                {
                    "name": "--help",
                    "content": "Show the usage message and exit.\n",
                    "long": "--help"
                },
                {
                    "name": "--version",
                    "content": "Show the version and exit.\n",
                    "long": "--version"
                }
            ]
        },
        "SUPPORTED FLAGS": {
            "content": "ASFLAGS\nOptions for the assembler. Default value: empty. Since dpkg 1.21.0.\n\nCFLAGS\nOptions for the C compiler. The default value set by the vendor includes -g and the\ndefault optimization level (-O2 usually, or -O0 if the DEBBUILDOPTIONS environment\nvariable defines noopt).\n\nCPPFLAGS\nOptions for the C preprocessor. Default value: empty.\n\nCXXFLAGS\nOptions for the C++ compiler. Same as CFLAGS.\n\nOBJCFLAGS\nOptions for the Objective C compiler. Same as CFLAGS.\n\nOBJCXXFLAGS\nOptions for the Objective C++ compiler. Same as CXXFLAGS.\n\nGCJFLAGS\nOptions for the GNU Java compiler (gcj). A subset of CFLAGS.\n\nDFLAGS\nOptions for the D compiler (ldc or gdc). Since dpkg 1.20.6.\n\nFFLAGS\nOptions for the Fortran 77 compiler. A subset of CFLAGS.\n\nFCFLAGS\nOptions for the Fortran 9x compiler. Same as FFLAGS.\n\nLDFLAGS\nOptions passed to the compiler when linking executables or shared objects (if the linker\nis called directly, then -Wl and , have to be stripped from these options). Default\nvalue: empty.\n\nNew flags might be added in the future if the need arises (for example to support other\nlanguages).\n",
            "subsections": []
        },
        "FEATURE AREAS": {
            "content": "Each area feature can be enabled and disabled in the DEBBUILDOPTIONS and\nDEBBUILDMAINTOPTIONS environment variable's area value with the ‘+’ and ‘-’ modifier.  For\nexample, to enable the hardening “pie” feature and disable the “fortify” feature you can do\nthis in debian/rules:\n\nexport DEBBUILDMAINTOPTIONS=hardening=+pie,-fortify\n\nThe special feature all (valid in any area) can be used to enable or disable all area\nfeatures at the same time.  Thus disabling everything in the hardening area and enabling only\n“format” and “fortify” can be achieved with:\n\nexport DEBBUILDMAINTOPTIONS=hardening=-all,+format,+fortify\n",
            "subsections": [
                {
                    "name": "future",
                    "content": "Several compile-time options (detailed below) can be used to enable features that should be\nenabled by default, but cannot due to backwards compatibility reasons.\n\nlfs This setting (disabled by default) enables Large File Support on 32-bit architectures\nwhere their ABI does not include LFS by default, by adding -DLARGEFILESOURCE\n-DFILEOFFSETBITS=64 to CPPFLAGS.\n\nqa\nSeveral compile-time options (detailed below) can be used to help detect problems in the\nsource code or build system.\n\nbug This setting (disabled by default) adds any warning option that reliably detects\nproblematic source code. The warnings are fatal.  The only currently supported flags are\nCFLAGS and CXXFLAGS with flags set to -Werror=array-bounds, -Werror=clobbered,\n-Werror=implicit-function-declaration and -Werror=volatile-register-var.\n"
                },
                {
                    "name": "canary",
                    "content": "This setting (disabled by default) adds dummy canary options to the build flags, so that\nthe build logs can be checked for how the build flags propagate and to allow finding any\nomission of normal build flag settings.  The only currently supported flags are CPPFLAGS,\nCFLAGS, OBJCFLAGS, CXXFLAGS and OBJCXXFLAGS with flags set to -DDEBCANARYflagrandom-\nid, and LDFLAGS set to -Wl,-z,deb-canary-random-id.\n"
                },
                {
                    "name": "optimize",
                    "content": "Several compile-time options (detailed below) can be used to help optimize a resulting binary\n(since dpkg 1.21.0).  Note: enabling all these options can result in unreproducible binary\nartifacts.\n\nlto This setting (since dpkg 1.21.0; disabled by default) enables Link Time Optimization by\nadding -flto=auto -ffat-lto-objects to CFLAGS, CXXFLAGS, OBJCFLAGS, OBJCXXFLAGS,\nGCJFLAGS, FFLAGS, FCFLAGS and LDFLAGS.\n"
                },
                {
                    "name": "optimize",
                    "content": "Several compile-time options (detailed below) can be used to help optimize a resulting binary\n(since dpkg 1.21.0).  Note: enabling all these options can result in unreproducible binary\nartifacts.\n\nlto This setting (since dpkg 1.21.0; disabled by default) enables Link Time Optimization by\nadding -flto=auto -ffat-lto-objects to CFLAGS, CXXFLAGS, OBJCFLAGS, OBJCXXFLAGS,\nGCJFLAGS, FFLAGS and FCFLAGS.\n"
                },
                {
                    "name": "sanitize",
                    "content": "Several compile-time options (detailed below) can be used to help sanitize a resulting binary\nagainst memory corruptions, memory leaks, use after free, threading data races and undefined\nbehavior bugs.  Note: these options should not be used for production builds as they can\nreduce reliability for conformant code, reduce security or even functionality.\n"
                },
                {
                    "name": "address",
                    "content": "This setting (disabled by default) adds -fsanitize=address to LDFLAGS and\n-fsanitize=address -fno-omit-frame-pointer to CFLAGS and CXXFLAGS.\n"
                },
                {
                    "name": "thread",
                    "content": "This setting (disabled by default) adds -fsanitize=thread to CFLAGS, CXXFLAGS and\nLDFLAGS.\n"
                },
                {
                    "name": "leak",
                    "content": "This setting (disabled by default) adds -fsanitize=leak to LDFLAGS. It gets automatically\ndisabled if either the address or the thread features are enabled, as they imply it.\n"
                },
                {
                    "name": "undefined",
                    "content": "This setting (disabled by default) adds -fsanitize=undefined to CFLAGS, CXXFLAGS and\nLDFLAGS.\n"
                },
                {
                    "name": "hardening",
                    "content": "Several compile-time options (detailed below) can be used to help harden a resulting binary\nagainst memory corruption attacks, or provide additional warning messages during compilation.\nExcept as noted below, these are enabled by default for architectures that support them.\n"
                },
                {
                    "name": "format",
                    "content": "This setting (enabled by default) adds -Wformat -Werror=format-security to CFLAGS,\nCXXFLAGS, OBJCFLAGS and OBJCXXFLAGS.  This will warn about improper format string uses,\nand will fail when format functions are used in a way that represent possible security\nproblems. At present, this warns about calls to printf and scanf functions where the\nformat string is not a string literal and there are no format arguments, as in\nprintf(foo); instead of printf(\"%s\", foo); This may be a security hole if the format\nstring came from untrusted input and contains ‘%n’.\n"
                },
                {
                    "name": "fortify",
                    "content": "This setting (enabled by default) adds -DFORTIFYSOURCE=2 to CPPFLAGS. During code\ngeneration the compiler knows a great deal of information about buffer sizes (where\npossible), and attempts to replace insecure unlimited length buffer function calls with\nlength-limited ones. This is especially useful for old, crufty code.  Additionally,\nformat strings in writable memory that contain ‘%n’ are blocked. If an application\ndepends on such a format string, it will need to be worked around.\n\nNote that for this option to have any effect, the source must also be compiled with -O1\nor higher. If the environment variable DEBBUILDOPTIONS contains noopt, then fortify\nsupport will be disabled, due to new warnings being issued by glibc 2.16 and later.\n"
                },
                {
                    "name": "stackprotector",
                    "content": "This setting (enabled by default if stackprotectorstrong is not in use) adds\n-fstack-protector --param=ssp-buffer-size=4 to CFLAGS, CXXFLAGS, OBJCFLAGS, OBJCXXFLAGS,\nGCJFLAGS, FFLAGS and FCFLAGS.  This adds safety checks against stack overwrites. This\nrenders many potential code injection attacks into aborting situations. In the best case\nthis turns code injection vulnerabilities into denial of service or into non-issues\n(depending on the application).\n\nThis feature requires linking against glibc (or another provider of stackchkfail), so\nneeds to be disabled when building with -nostdlib or -ffreestanding or similar.\n"
                },
                {
                    "name": "stackprotectorstrong",
                    "content": "This setting (enabled by default) adds -fstack-protector-strong to CFLAGS, CXXFLAGS,\nOBJCFLAGS, OBJCXXFLAGS, GCJFLAGS, FFLAGS and FCFLAGS.  This is a stronger variant of\nstackprotector, but without significant performance penalties.\n\nDisabling stackprotector will also disable this setting.\n\nThis feature has the same requirements as stackprotector, and in addition also requires\ngcc 4.9 and later.\n"
                },
                {
                    "name": "relro",
                    "content": "This setting (enabled by default) adds -Wl,-z,relro to LDFLAGS.  During program load,\nseveral ELF memory sections need to be written to by the linker. This flags the loader to\nturn these sections read-only before turning over control to the program. Most notably\nthis prevents GOT overwrite attacks. If this option is disabled, bindnow will become\ndisabled as well.\n"
                },
                {
                    "name": "bindnow",
                    "content": "This setting (disabled by default) adds -Wl,-z,now to LDFLAGS. During program load, all\ndynamic symbols are resolved, allowing for the entire PLT to be marked read-only (due to\nrelro above). The option cannot become enabled if relro is not enabled.\n\npie This setting (with no global default since dpkg 1.18.23, as it is enabled by default now\nby gcc on the amd64, arm64, armel, armhf, hurd-i386, i386, kfreebsd-amd64, kfreebsd-i386,\nmips, mipsel, mips64el, powerpc, ppc64, ppc64el, riscv64, s390x, sparc and sparc64 Debian\narchitectures) adds the required options to enable or disable PIE via gcc specs files, if\nneeded, depending on whether gcc injects on that architecture the flags by itself or not.\nWhen the setting is enabled and gcc injects the flags, it adds nothing.  When the setting\nis enabled and gcc does not inject the flags, it adds -fPIE (via\n/usr/share/dpkg/pie-compiler.specs) to CFLAGS, CXXFLAGS, OBJCFLAGS, OBJCXXFLAGS,\nGCJFLAGS, FFLAGS and FCFLAGS, and -fPIE -pie (via /usr/share/dpkg/pie-link.specs) to\nLDFLAGS.  When the setting is disabled and gcc injects the flags, it adds -fno-PIE (via\n/usr/share/dpkg/no-pie-compile.specs) to CFLAGS, CXXFLAGS, OBJCFLAGS, OBJCXXFLAGS,\nGCJFLAGS, FFLAGS and FCFLAGS, and -fno-PIE -no-pie (via\n/usr/share/dpkg/no-pie-link.specs) to LDFLAGS.\n\nPosition Independent Executable are needed to take advantage of Address Space Layout\nRandomization, supported by some kernel versions. While ASLR can already be enforced for\ndata areas in the stack and heap (brk and mmap), the code areas must be compiled as\nposition-independent. Shared libraries already do this (-fPIC), so they gain ASLR\nautomatically, but binary .text regions need to be build PIE to gain ASLR. When this\nhappens, ROP (Return Oriented Programming) attacks are much harder since there are no\nstatic locations to bounce off of during a memory corruption attack.\n\nPIE is not compatible with -fPIC, so in general care must be taken when building shared\nobjects. But because the PIE flags emitted get injected via gcc specs files, it should\nalways be safe to unconditionally set them regardless of the object type being compiled\nor linked.\n\nStatic libraries can be used by programs or other shared libraries.  Depending on the\nflags used to compile all the objects within a static library, these libraries will be\nusable by different sets of objects:\n\nnone\nCannot be linked into a PIE program, nor a shared library.\n\n-fPIE\nCan be linked into any program, but not a shared library (recommended).\n\n-fPIC\nCan be linked into any program and shared library.\n\nIf there is a need to set these flags manually, bypassing the gcc specs injection, there\nare several things to take into account. Unconditionally and explicitly passing -fPIE,\n-fpie or -pie to a build-system using libtool is safe as these flags will get stripped\nwhen building shared libraries.  Otherwise on projects that build both programs and\nshared libraries you might need to make sure that when building the shared libraries\n-fPIC is always passed last (so that it overrides any previous -PIE) to compilation flags\nsuch as CFLAGS, and -shared is passed last (so that it overrides any previous -pie) to\nlinking flags such as LDFLAGS. Note: This should not be needed with the default gcc specs\nmachinery.\n\nAdditionally, since PIE is implemented via a general register, some register starved\narchitectures (but not including i386 anymore since optimizations implemented in gcc >=\n5) can see performance losses of up to 15% in very text-segment-heavy application\nworkloads; most workloads see less than 1%. Architectures with more general registers\n(e.g. amd64) do not see as high a worst-case penalty.\n"
                },
                {
                    "name": "reproducible",
                    "content": "The compile-time options detailed below can be used to help improve build reproducibility or\nprovide additional warning messages during compilation. Except as noted below, these are\nenabled by default for architectures that support them.\n"
                },
                {
                    "name": "timeless",
                    "content": "This setting (enabled by default) adds -Wdate-time to CPPFLAGS.  This will cause warnings\nwhen the TIME, DATE and TIMESTAMP macros are used.\n"
                },
                {
                    "name": "fixfilepath",
                    "content": "This setting (enabled by default) adds -ffile-prefix-map=BUILDPATH=.  to CFLAGS,\nCXXFLAGS, OBJCFLAGS, OBJCXXFLAGS, GCJFLAGS, FFLAGS and FCFLAGS where BUILDPATH is set to\nthe top-level directory of the package being built.  This has the effect of removing the\nbuild path from any generated file.\n\nIf both fixdebugpath and fixfilepath are set, this option takes precedence, because it is\na superset of the former.\n"
                },
                {
                    "name": "fixdebugpath",
                    "content": "This setting (enabled by default) adds -fdebug-prefix-map=BUILDPATH=.  to CFLAGS,\nCXXFLAGS, OBJCFLAGS, OBJCXXFLAGS, GCJFLAGS, FFLAGS and FCFLAGS where BUILDPATH is set to\nthe top-level directory of the package being built.  This has the effect of removing the\nbuild path from any generated debug symbols.\n"
                }
            ]
        },
        "ENVIRONMENT": {
            "content": "There are 2 sets of environment variables doing the same operations, the first one\n(DEBflagop) should never be used within debian/rules. It's meant for any user that wants to\nrebuild the source package with different build flags. The second set (DEBflagMAINTop)\nshould only be used in debian/rules by package maintainers to change the resulting build\nflags.\n\nDEBflagSET\nDEBflagMAINTSET\nThis variable can be used to force the value returned for the given flag.\n\nDEBflagSTRIP\nDEBflagMAINTSTRIP\nThis variable can be used to provide a space separated list of options that will be\nstripped from the set of flags returned for the given flag.\n\nDEBflagAPPEND\nDEBflagMAINTAPPEND\nThis variable can be used to append supplementary options to the value returned for the\ngiven flag.\n\nDEBflagPREPEND\nDEBflagMAINTPREPEND\nThis variable can be used to prepend supplementary options to the value returned for the\ngiven flag.\n\nDEBBUILDOPTIONS\nDEBBUILDMAINTOPTIONS\nThese variables can be used by a user or maintainer to disable/enable various area\nfeatures that affect build flags.  The DEBBUILDMAINTOPTIONS variable overrides any\nsetting in the DEBBUILDOPTIONS feature areas.  See the FEATURE AREAS section for\ndetails.\n\nDEBVENDOR\nThis setting defines the current vendor.  If not set, it will discover the current vendor\nby reading /etc/dpkg/origins/default.\n\nDEBBUILDPATH\nThis variable sets the build path (since dpkg 1.18.8) to use in features such as\nfixdebugpath so that they can be controlled by the caller.  This variable is currently\nDebian and derivatives-specific.\n\nDPKGCOLORS\nSets the color mode (since dpkg 1.18.5).  The currently accepted values are: auto\n(default), always and never.\n\nDPKGNLS\nIf set, it will be used to decide whether to activate Native Language Support, also known\nas internationalization (or i18n) support (since dpkg 1.19.0).  The accepted values are:\n0 and 1 (default).\n",
            "subsections": []
        },
        "FILES": {
            "content": "",
            "subsections": [
                {
                    "name": "Configuration files",
                    "content": ""
                },
                {
                    "name": "/etc/dpkg/buildflags.conf",
                    "content": "System wide configuration file.\n\n$XDGCONFIGHOME/dpkg/buildflags.conf or"
                },
                {
                    "name": "$HOME/.config/dpkg/buildflags.conf",
                    "content": "User configuration file.\n"
                },
                {
                    "name": "Packaging support",
                    "content": ""
                },
                {
                    "name": "/usr/share/dpkg/buildflags.mk",
                    "content": "Makefile snippet that will load (and optionally export) all flags supported by dpkg-\nbuildflags into variables (since dpkg 1.16.1).\n"
                }
            ]
        },
        "EXAMPLES": {
            "content": "To pass build flags to a build command in a Makefile:\n\n$(MAKE) $(shell dpkg-buildflags --export=cmdline)\n\n./configure $(shell dpkg-buildflags --export=cmdline)\n\nTo set build flags in a shell script or shell fragment, eval can be used to interpret the\noutput and to export the flags in the environment:\n\neval \"$(dpkg-buildflags --export=sh)\" && make\n\nor to set the positional parameters to pass to a command:\n\neval \"set -- $(dpkg-buildflags --export=cmdline)\"\nfor dir in a b c; do (cd $dir && ./configure \"$@\" && make); done\n",
            "subsections": [
                {
                    "name": "Usage in debian/rules",
                    "content": "You should call dpkg-buildflags or include buildflags.mk from the debian/rules file to obtain\nthe needed build flags to pass to the build system.  Note that older versions of dpkg-\nbuildpackage (before dpkg 1.16.1) exported these flags automatically. However, you should not\nrely on this, since this breaks manual invocation of debian/rules.\n\nFor packages with autoconf-like build systems, you can pass the relevant options to configure\nor make(1) directly, as shown above.\n\nFor other build systems, or when you need more fine-grained control about which flags are\npassed where, you can use --get. Or you can include buildflags.mk instead, which takes care\nof calling dpkg-buildflags and storing the build flags in make variables.\n\nIf you want to export all buildflags into the environment (where they can be picked up by\nyour build system):\n\nDPKGEXPORTBUILDFLAGS = 1\ninclude /usr/share/dpkg/buildflags.mk\n\nFor some extra control over what is exported, you can manually export the variables (as none\nare exported by default):\n\ninclude /usr/share/dpkg/buildflags.mk\nexport CPPFLAGS CFLAGS LDFLAGS\n\nAnd you can of course pass the flags to commands manually:\n\ninclude /usr/share/dpkg/buildflags.mk\nbuild-arch:\n$(CC) -o hello hello.c $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)\n\n\n\n1.21.1                                       2025-09-09                           dpkg-buildflags(1)"
                }
            ]
        }
    },
    "summary": "dpkg-buildflags - returns build flags to use during package build",
    "flags": [],
    "examples": [
        "To pass build flags to a build command in a Makefile:",
        "$(MAKE) $(shell dpkg-buildflags --export=cmdline)",
        "./configure $(shell dpkg-buildflags --export=cmdline)",
        "To set build flags in a shell script or shell fragment, eval can be used to interpret the",
        "output and to export the flags in the environment:",
        "eval \"$(dpkg-buildflags --export=sh)\" && make",
        "or to set the positional parameters to pass to a command:",
        "eval \"set -- $(dpkg-buildflags --export=cmdline)\"",
        "for dir in a b c; do (cd $dir && ./configure \"$@\" && make); done",
        "You should call dpkg-buildflags or include buildflags.mk from the debian/rules file to obtain",
        "the needed build flags to pass to the build system.  Note that older versions of dpkg-",
        "buildpackage (before dpkg 1.16.1) exported these flags automatically. However, you should not",
        "rely on this, since this breaks manual invocation of debian/rules.",
        "For packages with autoconf-like build systems, you can pass the relevant options to configure",
        "or make(1) directly, as shown above.",
        "For other build systems, or when you need more fine-grained control about which flags are",
        "passed where, you can use --get. Or you can include buildflags.mk instead, which takes care",
        "of calling dpkg-buildflags and storing the build flags in make variables.",
        "If you want to export all buildflags into the environment (where they can be picked up by",
        "your build system):",
        "DPKGEXPORTBUILDFLAGS = 1",
        "include /usr/share/dpkg/buildflags.mk",
        "For some extra control over what is exported, you can manually export the variables (as none",
        "are exported by default):",
        "include /usr/share/dpkg/buildflags.mk",
        "export CPPFLAGS CFLAGS LDFLAGS",
        "And you can of course pass the flags to commands manually:",
        "include /usr/share/dpkg/buildflags.mk",
        "build-arch:",
        "$(CC) -o hello hello.c $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)",
        "1.21.1                                       2025-09-09                           dpkg-buildflags(1)"
    ],
    "see_also": []
}