NAME

SPVM::Build::Util - Build Utilities

Create defaulgt build config

use SPVM::Build::Util;

my $build_config = SPVM::Build::Util::new_default_build_config();

$build_config->set_optimize('-O3');

Add Build shared library make rule in Makefile.PL

sub MY::postamble {

  my $make_rule = '';
  
  # Native compile make rule
  $make_rule .= SPVM::Build::Util::create_make_rule_native('Foo');
  
  # Precompile make rule
  $make_rule .= SPVM::Build::Util::create_make_rule_precompile('Foo');
  
  return $make_rule;
}

DESCRIPTION

SPVM::Build::Util is building utilities.

FUNCTIONS

new_default_build_config

my $build_config = SPVM::Build::Util::new_default_build_config;

Create defaulgt build config. This is SPVM::Build::Config object.

This function is used in native config file.

# Foo.native/Foo.config
use strict;
use warnings;

use SPVM::Build::Util;

my $build_config = SPVM::Build::Util::new_default_build_config();

$build_config->set_config(optimize => '-O2');

$build_config;

create_make_rule_native

Create native compile make rule.

This is used in Makefile.PL of your distributed module.

# Makefile.PL
sub MY::postamble {

  my $make_rule = '';
  
  # Native compile make rule
  $make_rule .= SPVM::Build::Util::create_make_rule_native('Foo');
  
  return $make_rule;
}

create_make_rule_precompile

Create precompile make rule.

This is used in Makefile.PL of your distributed module.

sub MY::postamble {

  my $make_rule = '';
  
  # Precompile make rule
  $make_rule .= SPVM::Build::Util::create_make_rule_precompile('Foo');
  
  return $make_rule;
}