Variable.pm (automake-1.16.2.tar.xz) | : | Variable.pm (automake-1.16.3.tar.xz) | ||
---|---|---|---|---|
skipping to change at line 20 | skipping to change at line 20 | |||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
# GNU General Public License for more details. | # GNU General Public License for more details. | |||
# You should have received a copy of the GNU General Public License | # You should have received a copy of the GNU General Public License | |||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | # along with this program. If not, see <https://www.gnu.org/licenses/>. | |||
package Automake::Variable; | package Automake::Variable; | |||
use 5.006; | use 5.006; | |||
use strict; | use strict; | |||
use warnings FATAL => 'all'; | ||||
use Carp; | use Carp; | |||
use Exporter; | ||||
use Automake::Channels; | use Automake::Channels; | |||
use Automake::ChannelDefs; | use Automake::ChannelDefs; | |||
use Automake::Configure_ac; | use Automake::Configure_ac; | |||
use Automake::Item; | use Automake::Item; | |||
use Automake::VarDef; | use Automake::VarDef; | |||
use Automake::Condition qw (TRUE FALSE); | use Automake::Condition qw (TRUE FALSE); | |||
use Automake::DisjConditions; | use Automake::DisjConditions; | |||
use Automake::General 'uniq'; | use Automake::General 'uniq'; | |||
use Automake::Wrap 'makefile_wrap'; | use Automake::Wrap 'makefile_wrap'; | |||
require Exporter; | our @ISA = qw (Automake::Item Exporter); | |||
use vars '@ISA', '@EXPORT', '@EXPORT_OK'; | our @EXPORT = qw (err_var msg_var msg_cond_var reject_var | |||
@ISA = qw/Automake::Item Exporter/; | var rvar vardef rvardef | |||
@EXPORT = qw (err_var msg_var msg_cond_var reject_var | variables | |||
var rvar vardef rvardef | scan_variable_expansions check_variable_expansions | |||
variables | variable_delete | |||
scan_variable_expansions check_variable_expansions | variables_dump | |||
variable_delete | set_seen | |||
variables_dump | require_variables | |||
set_seen | variable_value | |||
require_variables | output_variables | |||
variable_value | transform_variable_recursively); | |||
output_variables | ||||
transform_variable_recursively); | ||||
=head1 NAME | =head1 NAME | |||
Automake::Variable - support for variable definitions | Automake::Variable - support for variable definitions | |||
=head1 SYNOPSIS | =head1 SYNOPSIS | |||
use Automake::Variable; | use Automake::Variable; | |||
use Automake::VarDef; | use Automake::VarDef; | |||
skipping to change at line 200 | skipping to change at line 201 | |||
UPC => 'AM_PROG_UPC', | UPC => 'AM_PROG_UPC', | |||
UPCFLAGS => 'AM_PROG_UPC', | UPCFLAGS => 'AM_PROG_UPC', | |||
YACC => 'AC_PROG_YACC', | YACC => 'AC_PROG_YACC', | |||
); | ); | |||
# The name of the configure.ac file. | # The name of the configure.ac file. | |||
my $configure_ac; | my $configure_ac; | |||
# Variables that can be overridden without complaint from -Woverride | # Variables that can be overridden without complaint from -Woverride | |||
my %_silent_variable_override = | my %_silent_variable_override = | |||
(AM_MAKEINFOHTMLFLAGS => 1, | (AM_DISTCHECK_DVI_TARGET => 1, | |||
AM_MAKEINFOHTMLFLAGS => 1, | ||||
AR => 1, | AR => 1, | |||
ARFLAGS => 1, | ARFLAGS => 1, | |||
DEJATOOL => 1, | DEJATOOL => 1, | |||
JAVAC => 1, | JAVAC => 1, | |||
JAVAROOT => 1); | JAVAROOT => 1); | |||
# Count of helper variables used to implement conditional '+='. | # Count of helper variables used to implement conditional '+='. | |||
my $_appendvar; | my $_appendvar; | |||
# Each call to C<Automake::Variable::traverse_recursively> gets an | # Each call to C<Automake::Variable::traverse_recursively> gets an | |||
skipping to change at line 299 | skipping to change at line 301 | |||
Declare a function to be called whenever a variable | Declare a function to be called whenever a variable | |||
named C<$varname> is defined or redefined. | named C<$varname> is defined or redefined. | |||
C<$fun> should take two arguments: C<$type> and C<$value>. | C<$fun> should take two arguments: C<$type> and C<$value>. | |||
When type is C<''> or <':'>, C<$value> is the value being | When type is C<''> or <':'>, C<$value> is the value being | |||
assigned to C<$varname>. When C<$type> is C<'+'>, C<$value> | assigned to C<$varname>. When C<$type> is C<'+'>, C<$value> | |||
is the value being appended to C<$varname>. | is the value being appended to C<$varname>. | |||
=cut | =cut | |||
use vars '%_hooks'; | our %_hooks; | |||
sub hook ($$) | sub hook ($$) | |||
{ | { | |||
my ($var, $fun) = @_; | my ($var, $fun) = @_; | |||
$_hooks{$var} = $fun; | $_hooks{$var} = $fun; | |||
} | } | |||
=item C<variables ([$suffix])> | =item C<variables ([$suffix])> | |||
Returns the list of all L<Automake::Variable> instances. (I.e., all | Returns the list of all L<Automake::Variable> instances. (I.e., all | |||
variables defined so far.) If C<$suffix> is supplied, return only | variables defined so far.) If C<$suffix> is supplied, return only | |||
the L<Automake::Variable> instances that ends with C<_$suffix>. | the L<Automake::Variable> instances that ends with C<_$suffix>. | |||
=cut | =cut | |||
use vars '%_variable_dict', '%_primary_dict'; | our (%_variable_dict, %_primary_dict); | |||
sub variables (;$) | sub variables (;$) | |||
{ | { | |||
my ($suffix) = @_; | my ($suffix) = @_; | |||
my @vars = (); | my @vars = (); | |||
if ($suffix) | if ($suffix) | |||
{ | { | |||
if (exists $_primary_dict{$suffix}) | if (exists $_primary_dict{$suffix}) | |||
{ | { | |||
@vars = values %{$_primary_dict{$suffix}}; | @vars = values %{$_primary_dict{$suffix}}; | |||
} | } | |||
End of changes. 6 change blocks. | ||||
17 lines changed or deleted | 19 lines changed or added |