.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Dpkg::BuildFlags 3perl" .TH Dpkg::BuildFlags 3perl 2024-01-19 1.22.3 libdpkg-perl .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Dpkg::BuildFlags \- query build flags .SH DESCRIPTION .IX Header "DESCRIPTION" This class is used by dpkg-buildflags and can be used to query the same information. .SH METHODS .IX Header "METHODS" .ie n .IP "$bf = Dpkg::BuildFlags\->\fBnew()\fR" 4 .el .IP "\f(CW$bf\fR = Dpkg::BuildFlags\->\fBnew()\fR" 4 .IX Item "$bf = Dpkg::BuildFlags->new()" Create a new Dpkg::BuildFlags object. It will be initialized based on the value of several configuration files and environment variables. .Sp If the option \fBvendor_defaults\fR is set to false, then no vendor defaults are initialized (it defaults to true). .ie n .IP $bf\->\fBload_vendor_defaults()\fR 4 .el .IP \f(CW$bf\fR\->\fBload_vendor_defaults()\fR 4 .IX Item "$bf->load_vendor_defaults()" Reset the flags stored to the default set provided by the vendor. .ie n .IP $bf\->\fBload_system_config()\fR 4 .el .IP \f(CW$bf\fR\->\fBload_system_config()\fR 4 .IX Item "$bf->load_system_config()" Update flags from the system configuration. .ie n .IP $bf\->\fBload_user_config()\fR 4 .el .IP \f(CW$bf\fR\->\fBload_user_config()\fR 4 .IX Item "$bf->load_user_config()" Update flags from the user configuration. .ie n .IP $bf\->\fBload_environment_config()\fR 4 .el .IP \f(CW$bf\fR\->\fBload_environment_config()\fR 4 .IX Item "$bf->load_environment_config()" Update flags based on user directives stored in the environment. See \&\fBdpkg\-buildflags\fR\|(1) for details. .ie n .IP $bf\->\fBload_maintainer_config()\fR 4 .el .IP \f(CW$bf\fR\->\fBload_maintainer_config()\fR 4 .IX Item "$bf->load_maintainer_config()" Update flags based on maintainer directives stored in the environment. See \&\fBdpkg\-buildflags\fR\|(1) for details. .ie n .IP $bf\->\fBload_config()\fR 4 .el .IP \f(CW$bf\fR\->\fBload_config()\fR 4 .IX Item "$bf->load_config()" Call successively \fBload_system_config()\fR, \fBload_user_config()\fR, \&\fBload_environment_config()\fR and \fBload_maintainer_config()\fR to update the default build flags defined by the vendor. .ie n .IP $bf\->unset($flag) 4 .el .IP \f(CW$bf\fR\->unset($flag) 4 .IX Item "$bf->unset($flag)" Unset the build flag \f(CW$flag\fR, so that it will not be known anymore. .ie n .IP "$bf\->set($flag, $value, $source, $maint)" 4 .el .IP "\f(CW$bf\fR\->set($flag, \f(CW$value\fR, \f(CW$source\fR, \f(CW$maint\fR)" 4 .IX Item "$bf->set($flag, $value, $source, $maint)" Update the build flag \f(CW$flag\fR with value \f(CW$value\fR and record its origin as \&\f(CW$source\fR (if defined). Record it as maintainer modified if \f(CW$maint\fR is defined and true. .ie n .IP "$bf\->set_feature($area, $feature, $enabled)" 4 .el .IP "\f(CW$bf\fR\->set_feature($area, \f(CW$feature\fR, \f(CW$enabled\fR)" 4 .IX Item "$bf->set_feature($area, $feature, $enabled)" Update the boolean state of whether a specific feature within a known feature area has been enabled. The only currently known feature areas are "future", "qa", "sanitize", "optimize", "hardening" and "reproducible". .ie n .IP "$bf\->get_feature($area, $feature)" 4 .el .IP "\f(CW$bf\fR\->get_feature($area, \f(CW$feature\fR)" 4 .IX Item "$bf->get_feature($area, $feature)" Returns the value for the given feature within a known feature area. This is relevant for builtin features where the feature has a ternary state of true, false and undef, and where the latter cannot be retrieved with \fBuse_feature()\fR. .ie n .IP "$bf\->use_feature($area, $feature)" 4 .el .IP "\f(CW$bf\fR\->use_feature($area, \f(CW$feature\fR)" 4 .IX Item "$bf->use_feature($area, $feature)" Returns true if the given feature within a known feature areas has been enabled, and false otherwise. The only currently recognized feature areas are "future", "qa", "sanitize", "optimize", "hardening" and "reproducible". .ie n .IP "$bf\->set_builtin($area, $feature, $enabled)" 4 .el .IP "\f(CW$bf\fR\->set_builtin($area, \f(CW$feature\fR, \f(CW$enabled\fR)" 4 .IX Item "$bf->set_builtin($area, $feature, $enabled)" Update the boolean state of whether a specific feature within a known feature area is handled (even if only in some architectures) as a builtin default by the compiler. .ie n .IP $bf\->get_builtins($area) 4 .el .IP \f(CW$bf\fR\->get_builtins($area) 4 .IX Item "$bf->get_builtins($area)" Return, for the given area, a hash with keys as feature names, and values as booleans indicating whether the feature is handled as a builtin default by the compiler or not. Only features that might be handled as builtins on some architectures are returned as part of the hash. Missing features mean they are currently never handled as builtins by the compiler. .ie n .IP "$bf\->set_option_value($option, $value)" 4 .el .IP "\f(CW$bf\fR\->set_option_value($option, \f(CW$value\fR)" 4 .IX Item "$bf->set_option_value($option, $value)" \&\fBPrivate\fR method to set the value of a build option. Do not use outside of the dpkg project. .ie n .IP $bf\->get_option_value($option) 4 .el .IP \f(CW$bf\fR\->get_option_value($option) 4 .IX Item "$bf->get_option_value($option)" \&\fBPrivate\fR method to get the value of a build option. Do not use outside of the dpkg project. .ie n .IP "$bf\->strip($flag, $value, $source, $maint)" 4 .el .IP "\f(CW$bf\fR\->strip($flag, \f(CW$value\fR, \f(CW$source\fR, \f(CW$maint\fR)" 4 .IX Item "$bf->strip($flag, $value, $source, $maint)" Update the build flag \f(CW$flag\fR by stripping the flags listed in \f(CW$value\fR and record its origin as \f(CW$source\fR (if defined). Record it as maintainer modified if \f(CW$maint\fR is defined and true. .ie n .IP "$bf\->append($flag, $value, $source, $maint)" 4 .el .IP "\f(CW$bf\fR\->append($flag, \f(CW$value\fR, \f(CW$source\fR, \f(CW$maint\fR)" 4 .IX Item "$bf->append($flag, $value, $source, $maint)" Append the options listed in \f(CW$value\fR to the current value of the flag \f(CW$flag\fR. Record its origin as \f(CW$source\fR (if defined). Record it as maintainer modified if \f(CW$maint\fR is defined and true. .ie n .IP "$bf\->prepend($flag, $value, $source, $maint)" 4 .el .IP "\f(CW$bf\fR\->prepend($flag, \f(CW$value\fR, \f(CW$source\fR, \f(CW$maint\fR)" 4 .IX Item "$bf->prepend($flag, $value, $source, $maint)" Prepend the options listed in \f(CW$value\fR to the current value of the flag \f(CW$flag\fR. Record its origin as \f(CW$source\fR (if defined). Record it as maintainer modified if \f(CW$maint\fR is defined and true. .ie n .IP "$bf\->update_from_conffile($file, $source)" 4 .el .IP "\f(CW$bf\fR\->update_from_conffile($file, \f(CW$source\fR)" 4 .IX Item "$bf->update_from_conffile($file, $source)" Update the current build flags based on the configuration directives contained in \f(CW$file\fR. See \fBdpkg\-buildflags\fR\|(1) for the format of the directives. .Sp \&\f(CW$source\fR is the origin recorded for any build flag set or modified. .ie n .IP $bf\->get($flag) 4 .el .IP \f(CW$bf\fR\->get($flag) 4 .IX Item "$bf->get($flag)" Return the value associated to the flag. It might be undef if the flag doesn't exist. .ie n .IP $bf\->\fBget_feature_areas()\fR 4 .el .IP \f(CW$bf\fR\->\fBget_feature_areas()\fR 4 .IX Item "$bf->get_feature_areas()" Return the feature areas (i.e. the area values has_features will return true for). .ie n .IP $bf\->get_features($area) 4 .el .IP \f(CW$bf\fR\->get_features($area) 4 .IX Item "$bf->get_features($area)" Return, for the given area, a hash with keys as feature names, and values as booleans indicating whether the feature is enabled or not. .ie n .IP $bf\->get_origin($flag) 4 .el .IP \f(CW$bf\fR\->get_origin($flag) 4 .IX Item "$bf->get_origin($flag)" Return the origin associated to the flag. It might be undef if the flag doesn't exist. .ie n .IP $bf\->is_maintainer_modified($flag) 4 .el .IP \f(CW$bf\fR\->is_maintainer_modified($flag) 4 .IX Item "$bf->is_maintainer_modified($flag)" Return true if the flag is modified by the maintainer. .ie n .IP $bf\->has_features($area) 4 .el .IP \f(CW$bf\fR\->has_features($area) 4 .IX Item "$bf->has_features($area)" Returns true if the given area of features is known, and false otherwise. The only currently recognized feature areas are "future", "qa", "sanitize", "optimize", "hardening" and "reproducible". .ie n .IP $bf\->has($option) 4 .el .IP \f(CW$bf\fR\->has($option) 4 .IX Item "$bf->has($option)" Returns a boolean indicating whether the flags exists in the object. .ie n .IP "@flags = $bf\->\fBlist()\fR" 4 .el .IP "\f(CW@flags\fR = \f(CW$bf\fR\->\fBlist()\fR" 4 .IX Item "@flags = $bf->list()" Returns the list of flags stored in the object. .SH CHANGES .IX Header "CHANGES" .SS "Version 1.06 (dpkg 1.21.15)" .IX Subsection "Version 1.06 (dpkg 1.21.15)" New method: \f(CW$bf\fR\->\fBget_feature()\fR. .SS "Version 1.05 (dpkg 1.21.14)" .IX Subsection "Version 1.05 (dpkg 1.21.14)" New option: 'vendor_defaults' in \fBnew()\fR. .PP New methods: \f(CW$bf\fR\->\fBload_vendor_defaults()\fR, \f(CW$bf\fR\->\fBuse_feature()\fR, \&\f(CW$bf\fR\->\fBset_builtin()\fR, \f(CW$bf\fR\->\fBget_builtins()\fR. .SS "Version 1.04 (dpkg 1.20.0)" .IX Subsection "Version 1.04 (dpkg 1.20.0)" New method: \f(CW$bf\fR\->\fBunset()\fR. .SS "Version 1.03 (dpkg 1.16.5)" .IX Subsection "Version 1.03 (dpkg 1.16.5)" New method: \f(CW$bf\fR\->\fBget_feature_areas()\fR to list possible values for \&\f(CW$bf\fR\->get_features. .PP New method \f(CW$bf\fR\->\fBis_maintainer_modified()\fR and new optional parameter to \&\f(CW$bf\fR\->\fBset()\fR, \f(CW$bf\fR\->\fBappend()\fR, \f(CW$bf\fR\->\fBprepend()\fR, \f(CW$bf\fR\->\fBstrip()\fR. .SS "Version 1.02 (dpkg 1.16.2)" .IX Subsection "Version 1.02 (dpkg 1.16.2)" New methods: \f(CW$bf\fR\->\fBget_features()\fR, \f(CW$bf\fR\->\fBhas_features()\fR, \f(CW$bf\fR\->\fBset_feature()\fR. .SS "Version 1.01 (dpkg 1.16.1)" .IX Subsection "Version 1.01 (dpkg 1.16.1)" New method: \f(CW$bf\fR\->\fBprepend()\fR very similar to \fBappend()\fR. Implement support of the prepend operation everywhere. .PP New method: \f(CW$bf\fR\->\fBload_maintainer_config()\fR that update the build flags based on the package maintainer directives. .SS "Version 1.00 (dpkg 1.15.7)" .IX Subsection "Version 1.00 (dpkg 1.15.7)" Mark the module as public.