NAME

SPVM::Builder::Config - build config

DESCRIPTION

SPVM::Builder::Config is configuration of c/c++ compile and link.

Methods

new

my $bconf = SPVM::Builder::Config->new;

Create SPVM::Builder::Config object.

new_c

my $bconf = SPVM::Builder::Config->new_c;

Create default build config with C settings. This is SPVM::Builder::Config object.

If you want to use the specific C version, use set_std method.

$bconf->set_std('c99');

new_c99

my $bconf = SPVM::Builder::Config->new_c99;

Create default build config with C99 settings. This is SPVM::Builder::Config object.

new_cpp

my $bconf = SPVM::Builder::Config->new_cpp;

Create default build config with C++ settings. This is SPVM::Builder::Config object.

If you want to use the specific C++ version, use set_std method.

$bconf->set_std('c++11');

new_cpp11

my $bconf = SPVM::Builder::Config->new_cpp11;

Create default build config with C++11 settings. This is SPVM::Builder::Config object.

replace_all_config

my $config = {cc => 'g++', ld => 'g++'};
$bconf->replace_all_config($config);

Replace all config.

All of old configs is removed and added new config.

to_hash

my $config = $bconf->to_hash;

Convert configs to hash reference.

get_config

my $cc = $bconf->get_config('cc');

Get a config value.

set_config

$bconf->set_config(cc => $cc);

Set a config value.

set_std

$bconf->set_std('gnu99');

Set std.

Internally, remove -std=old if exists and add -std=new after extra_compiler_flags.

delete_std

$bconf->delete_std;

Delete std.

Internally, remove -std=old if exists from extra_compiler_flags.

set_cc

$bconf->set_cc($cc);

Set cc.

get_cc

my $cc = $bconf->get_cc;

Get cc.

set_cc

$bconf->set_cc($cc);

Set cc.

get_cc

my $cc = $bconf->get_cc;

Get cc.

get_ccflags

my $ccflags = $bconf->get_ccflags;

Get ccflags option using get_config method.

ccflags option is passed to config option of ExtUtils::CBuilder new method.

Default is copied from $Config{ccflags}.

set_ccflags

$bconf->set_ccflags($ccflags);

Set ccflags using set_config method.

See get_ccflags method about ccflags option.

append_ccflags

$bconf->append_ccflags($ccflags);

Add new ccflags after current ccflags using get_config and set_config method.

See get_ccflags method about ccflags option.

prepend_ccflags

$bconf->prepend_ccflags($ccflags);

Add new ccflags before current ccflags using get_config and set_config method.

See get_ccflags method about ccflags option.

get_cccdlflags

my $cccdlflags = $bconf->get_cccdlflags;

Get cccdlflags option using get_config method.

cccdlflags option is passed to config option of ExtUtils::CBuilder new method.

Default is copied from $Config{cccdlflags}.

set_cccdlflags

$bconf->set_cccdlflags($cccdlflags);

Set cccdlflags using set_config method.

See get_cccdlflags method about cccdlflags option.

append_cccdlflags

$bconf->append_cccdlflags($cccdlflags);

Add new cccdlflags after current cccdlflags using get_config and set_config method.

See get_cccdlflags method about cccdlflags option.

prepend_cccdlflags

$bconf->prepend_cccdlflags($cccdlflags);

Add new cccdlflags before current cccdlflags using get_config and set_config method.

See get_cccdlflags method about cccdlflags option.

get_archlibexp

my $archlibexp = $bconf->get_archlibexp;

Get archlibexp option using get_config method.

archlibexp option is passed to config option of ExtUtils::CBuilder new method.

Default is copied from $Config{archlibexp}.

set_archlibexp

$bconf->set_archlibexp($archlibexp);

Set archlibexp using set_config method.

See get_archlibexp method about archlibexp option.

get_optimize

my $optimize = $bconf->get_optimize;

Get optimize option using get_config method.

optimize option is passed to config option of ExtUtils::CBuilder new method

Default is copied from $Config{optimize}.

set_optimize

$bconf->set_optimize($optimize);

Set optimize using set_config method.

See get_optimize method about optimize option.

get_extra_compiler_flags

my $extra_compiler_flags = $bconf->get_extra_compiler_flags;

Get extra_compiler_flags.

extra_compiler_flags is passed to extra_compiler_flags option of ExtUtils::CBuilder compile method.

Default is empty string.

set_extra_compiler_flags

$bconf->set_extra_compiler_flags($extra_compiler_flags);

Set extra_compiler_flags.

See get_extra_compiler_flags method about extra_compiler_flags option.

append_extra_compiler_flags

$bconf->append_extra_compiler_flags($extra_compiler_flags);

Add new extra_compiler_flags after current extra_compiler_flags.

See get_extra_compiler_flags method about extra_compiler_flags option.

prepend_extra_compiler_flags

$bconf->prepend_extra_compiler_flags($extra_compiler_flags);

Add new extra_compiler_flags before current extra_compiler_flags.

See get_extra_compiler_flags method about extra_compiler_flags option.

set_ld

$bconf->set_ld($ld);

Set ld.

get_ld

my $ld = $bconf->get_ld;

Get ld.

get_lddlflags

my $lddlflags = $bconf->get_lddlflags;

Get lddlflags option using get_config method.

lddlflags option is passed to config option of ExtUtils::CBuilder new method.

Default is copied from $Config{lddlflags}.

set_lddlflags

$bconf->set_lddlflags($lddlflags);

Set lddlflags using set_config method.

See get_lddlflags method about lddlflags option.

append_lddlflags

$bconf->append_lddlflags($lddlflags);

Add new lddlflags after current lddlflags using get_config and set_config method.

See get_lddlflags method about lddlflags option.

prepend_lddlflags

$bconf->prepend_lddlflags($lddlflags);

Add new lddlflags before current lddlflags using get_config and set_config method.

See get_lddlflags method about lddlflags option.

get_shrpenv

my $shrpenv = $bconf->get_shrpenv;

Get shrpenv option using get_config method.

shrpenv option is passed to config option of ExtUtils::CBuilder new method.

Default is copied from $Config{shrpenv}.

set_shrpenv

$bconf->set_shrpenv($shrpenv);

Set shrpenv using set_config method.

See get_shrpenv method about shrpenv option.

get_extra_linker_flags

my $extra_linker_flags = $bconf->get_extra_linker_flags;

Get extra_linker_flags option.

extra_linker_flags option is passed to extra_compiler_flags option of ExtUtils::CBuilder link method.

Default is emtpy string.

set_extra_linker_flags

$bconf->set_extra_linker_flags($extra_linker_flags);

Set extra_linker_flags option.

See get_extra_linker_flags method about extra_linker_flags option.

append_extra_linker_flags

$bconf->append_extra_linker_flags($extra_linker_flags);

Add new extra_linker_flags option after current extra_linker_flags option.

See get_extra_linker_flags method about extra_linker_flags option.

prepend_extra_linker_flags

$bconf->prepend_extra_linker_flags($extra_linker_flags);

Add new extra_linker_flags option before current extra_linker_flags option.

See get_extra_linker_flags method about extra_linker_flags option.

get_include_dirs

my $include_dirs = $bconf->get_include_dirs;

Get include_dirs option. This option is array refernce.

include_dirs option is used by compile method of SPVM::Builder::CC to set -inculde_dir.

Default is "SPVM/Builder/include" of one up of directory SPVM::Buidler::Config.pm loaded and the values of -include_dir in $Config{ccflags}.

set_include_dirs

$bconf->set_include_dirs($include_dirs);

Set include_dirs option. This option is array refernce.

See get_include_dirs method about include_dirs option.

unshift_include_dirs

$bconf->unshift_include_dirs($include_dir1, $include_dir2, ...);

Add a element before the first element of include_dirs option.

See get_lib_dirs method about lib_dirs option.

push_include_dirs

$bconf->push_include_dirs($include_dir1, $include_dir2, ...);

Add a element after the last element of include_dirs option.

See get_lib_dirs method about lib_dirs option.

get_lib_dirs

my $lib_dirs = $bconf->get_lib_dirs;

Get lib_dirs option. This option is array refernce.

lib_dirs option is used by compile method of SPVM::Builder::CC to set -lib_dir.

Default is the values of -lib_dir in $Config{lddlflags}.

set_lib_dirs

$bconf->set_lib_dirs($lib_dirs);

Set lib_dirs option. This option is array refernce.

See get_lib_dirs method about lib_dirs option.

unshift_lib_dirs

$bconf->unshift_lib_dirs($lib_dir1, $lib_dir2, ...);

Add a element before the first element of lib_dirs option.

See get_lib_dirs method about lib_dirs option.

push_lib_dirs

$bconf->push_lib_dirs($lib_dir1, $lib_dir2, ...);

Add a element after the last element of lib_dirs option.

See get_lib_dirs method about lib_dirs option.

get_libs

my $libs = $bconf->get_libs;

Get libs option. This option is array refernce.

libs option is used by link method of SPVM::Builder::CC to set -l<lib>.

Don't prefix '-l' or 'lib' for library name. 'gsl' is ok. 'libgsl', '-lgsl' is not ok.

set_libs

$bconf->set_libs($libs);

Set libs option. This option is array refernce.

See get_libs method about libs option.

unshift_libs

$bconf->unshift_libs($lib1, $lib2, ...);

Add a library before the first element of libs option.

See get_libs method about libs option.

push_libs

$bconf->push_libs($lib1, $lib2, ...);

Add a library after the last element of libs option.

See get_libs method about libs option.

get_force_compile

my $force_compile = $bconf->get_force_compile;

Get force_compile option.

force_compile option is used by compile method of SPVM::Builder::CC to determine whether the method should force compilation of source codes without cache.

set_force_compile

$bconf->set_force_compile($force_compile);

Set force_compile option.

See get_force_compile method about force_compile option.

get_quiet

my $quiet = $bconf->get_quiet;

Get quiet option.

quiet option is used by compile method of SPVM::Builder::CC to determine whether the method output compiler messages , default to 1.

set_quiet

$bconf->set_quiet($quiet);

Set quiet option.

See get_quiet method about quiet option.