Module::Install::Compiler - Commands for interacting with the C compiler


Module-Install documentation Contained in the Module-Install distribution.

Index


Code Index:

NAME

Top

Module::Install::Compiler - Commands for interacting with the C compiler

SYNOPSIS

Top

  To be completed

DESCRIPTION

Top

Many Perl modules that contains C and XS code have fiendishly complex Makefile.PL files, because ExtUtils::MakeMaker doesn't itself provide a huge amount of assistance and automation in this area.

Module::Install::Compiler provides a number of commands that take care of common utility tasks, and try to take some of intricacy out of creating C and XS modules.

COMMANDS

Top

To be completed

TO DO

Top

The current implementation is relatively fragile and minimalistic.

It only handles some very basic wrapper around ExtUtils::MakeMaker.

It is currently undergoing extensive refactoring to provide a more generic compiler flag generation capability. This may take some time, and if anyone who maintains a Perl module that makes use of the compiler would like to help out, your assistance would be greatly appreciated.

SEE ALSO

Top

Module::Install, ExtUtils::MakeMaker

AUTHORS

Top

Refactored by Adam Kennedy <adamk@cpan.org>

Mostly by Audrey Tang <autrijus@autrijus.org>

Based on original works by Brian Ingerson <ingy@cpan.org>

COPYRIGHT

Top


Module-Install documentation Contained in the Module-Install distribution.

package Module::Install::Compiler;

use strict;
use File::Basename        ();
use Module::Install::Base ();

use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
	$VERSION = '1.01';
	@ISA     = 'Module::Install::Base';
	$ISCORE  = 1;
}

sub ppport {
	my $self = shift;
	if ( $self->is_admin ) {
		return $self->admin->ppport(@_);
	} else {
		# Fallback to just a check
		my $file = shift || 'ppport.h';
		unless ( -f $file ) {
			die "Packaging error, $file is missing";
		}
	}
}

sub cc_files {
	require Config;
	my $self = shift;
	$self->makemaker_args(
		OBJECT => join ' ', map { substr($_, 0, -2) . $Config::Config{_o} } @_
	);
}

sub cc_inc_paths {
	my $self = shift;
	$self->makemaker_args(
		INC => join ' ', map { "-I$_" } @_
	);
}

sub cc_lib_paths {
	my $self = shift;
	$self->makemaker_args(
		LIBS => join ' ', map { "-L$_" } @_
	);
}

sub cc_lib_links {
	my $self = shift;
	$self->makemaker_args(
		LIBS => join ' ', $self->makemaker_args->{LIBS}, map { "-l$_" } @_
	);
}

sub cc_optimize_flags {
	my $self = shift;
	$self->makemaker_args(
		OPTIMIZE => join ' ', @_
	);
}

1;

__END__