<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package ExtUtils::Config::MakeMaker;
$ExtUtils::Config::MakeMaker::VERSION = '0.010';
use strict;
use warnings;

use ExtUtils::MakeMaker::Config;

sub new {
    my ($class, $maker) = @_;
    return bless { maker =&gt; $maker }, $class;
}

sub get {
    my ($self, $key) = @_;
    return exists $self-&gt;{maker}{uc $key} ? $self-&gt;{maker}{uc $key} : $Config{$key};
}

sub exists {
    my ($self, $key) = @_;
	return exists $Config{$key};
}

sub all_config {
	my $self = shift;
	my %result;
	for my $key (keys %Config) {
		$result{$key} = $self-&gt;get($key);
	}
	return \%result;
}

sub values_set {
	my $self = shift;
	my %result;
	for my $key (keys %Config) {
		next if not exists $self-&gt;{maker}{uc $key};
		next if $self-&gt;{maker}{uc $key} eq $Config{$key};
		$result{$key} = $self-&gt;{maker}{uc $key};
	}
	return \%result;
}

sub serialize {
	my $self = shift;
	require Data::Dumper;
	return $self-&gt;{serialized} ||= Data::Dumper-&gt;new($self-&gt;values_set)-&gt;Terse(1)-&gt;Sortkeys(1)-&gt;Dump;
}

sub materialize {
	my $self = shift;
	require ExtUtils::Config;
	return ExtUtils::Config-&gt;new($self-&gt;values_set);
}

sub but {
	my ($self, %args) = @_;
	return $self-&gt;materialize-&gt;but(%args);
}

1;

#ABSTRACT: A ExtUtils::Config compatible wrapper for ExtUtils::MakeMaker's configuration.

__END__

=pod

=encoding UTF-8

=head1 NAME

ExtUtils::Config::MakeMaker - A ExtUtils::Config compatible wrapper for ExtUtils::MakeMaker's configuration.

=head1 VERSION

version 0.010

=head1 SYNOPSIS

 my $config = ExtUtils::Config::MakeMaker-&gt;new($makemaker);

=head1 DESCRIPTION

This object wraps L&lt;ExtUtils::MakeMaker|ExtUtils::MakeMaker&gt;'s idea of configuration in an L&lt;ExtUtils::Config|ExtUtils::Config&gt; compatible interface. That means that if you pass a configuration argument to or in Makefile.PL (e.g. C&lt;OPTIMIZE=-O3&gt;) it will show up in the config object (e.g. C&lt;$config-&gt;get('optimize')&gt;.

=head1 METHODS

=head2 new($makemaker)

This creates a new C&lt;ExtUtils::Config::MakeMaker&gt; object from a MakeMaker object.

=head2 get($key)

Get the value of C&lt;$key&gt;. If not overridden it will return the value in %Config.

=head2 exists($key)

Tests for the existence of $key.

=head2 values_set()

Get a hashref of all overridden values.

=head2 all_config()

Get a hashref of the complete configuration, including overrides.

=head2 serialize()

This method serializes the object to some kind of string. This can be useful for various caching purposes.

=head2 materialize()

This turns this object into an actual C&lt;ExtUtils::Config&gt; object.

=head2 but(%config)

This returns a C&lt;ExtUtils::Config&gt; object based on the current one but with the given entries overriden. If any value is C&lt;undef&gt; it will revert to the official C&lt;%Config&gt; value instead.

=head1 AUTHORS

=over 4

=item *

Ken Williams &lt;kwilliams@cpan.org&gt;

=item *

Leon Timmermans &lt;leont@cpan.org&gt;

=back

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2006 by Ken Williams, Leon Timmermans.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut
</pre></body></html>