ExtUtils-CBuilder
view release on metacpan or search on metacpan
lib/ExtUtils/CBuilder/Base.pm view on Meta::CPAN
my $class = shift;
my $self = bless {@_}, $class;
$self->{properties}{perl} = $class->find_perl_interpreter
or warn "Warning: Can't locate your perl binary";
while (my ($k,$v) = each %Config) {
$self->{config}{$k} = $v unless exists $self->{config}{$k};
}
$self->{config}{cc} = $ENV{CC} if defined $ENV{CC};
$self->{config}{ccflags} = join(" ", $self->{config}{ccflags}, $ENV{CFLAGS})
if defined $ENV{CFLAGS};
$self->{config}{cxx} = $ENV{CXX} if defined $ENV{CXX};
$self->{config}{cxxflags} = $ENV{CXXFLAGS} if defined $ENV{CXXFLAGS};
$self->{config}{ld} = $ENV{LD} if defined $ENV{LD};
$self->{config}{ldflags} = join(" ", $self->{config}{ldflags}, $ENV{LDFLAGS})
if defined $ENV{LDFLAGS};
unless ( exists $self->{config}{cxx} ) {
my ($ccbase, $ccpath, $ccsfx ) = fileparse($self->{config}{cc}, qr/\.[^.]*/);
## If the path is just "cc", fileparse returns $ccpath as "./"
$ccpath = "" if $self->{config}{cc} =~ /^\Q$ccbase$ccsfx\E$/;
foreach my $cxx (@{$cc2cxx{$ccbase}}) {
my $cxx1 = File::Spec->catfile( $ccpath, $cxx . $ccsfx);
lib/ExtUtils/CBuilder/Platform/VMS.pm view on Meta::CPAN
# We override the compile method because we consume the includes and defines
# parts of ccflags in the process of compiling but don't save those parts
# anywhere, so $self->{config}{ccflags} needs to be reset for each compile
# operation.
sub compile {
my ($self, %args) = @_;
$self->{config}{ccflags} = $Config{ccflags};
$self->{config}{ccflags} = $ENV{CFLAGS} if defined $ENV{CFLAGS};
return $self->SUPER::compile(%args);
}
sub _do_link {
my ($self, $type, %args) = @_;
my $objects = delete $args{objects};
$objects = [$objects] unless ref $objects;
( run in 0.667 second using v1.01-cache-2.11-cpan-8d75d55dd25 )