SPVM::Builder::Config - build config
SPVM::Builder::Config is configuration of c/c++ compile and link.
my $bconf = SPVM::Builder::Config->new;
Create SPVM::Builder::Config object.
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.
set_std
$bconf->set_std('c99');
my $bconf = SPVM::Builder::Config->new_c99;
Create default build config with C99 settings. This is SPVM::Builder::Config object.
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');
my $bconf = SPVM::Builder::Config->new_cpp11;
Create default build config with C++11 settings. This is SPVM::Builder::Config object.
my $config = {cc => 'g++', ld => 'g++'}; $bconf->replace_all_config($config);
Replace all config.
All of old configs is removed and added new config.
my $config = $bconf->to_hash;
Convert configs to hash reference.
my $cc = $bconf->get_config('cc');
Get a config value.
$bconf->set_config(cc => $cc);
Set a config value.
$bconf->set_std('gnu99');
Set std.
std
Internally, remove -std=old if exists and add -std=new after ccflags.
-std=old
-std=new
ccflags
$bconf->delete_std;
Delete std.
Internally, remove -std=old if exists from ccflags.
$bconf->set_cc($cc);
Set cc.
cc
my $cc = $bconf->get_cc;
Get cc.
my $ccflags = $bconf->get_ccflags;
Get ccflags option using get_config method.
get_config
ccflags option is passed to config option of ExtUtils::CBuilder new method.
config
new
Default is copied from $Config{ccflags}.
$bconf->set_ccflags($ccflags);
Set ccflags using set_config method.
set_config
See get_ccflags method about ccflags option.
get_ccflags
$bconf->append_ccflags($ccflags);
Add new ccflags after current ccflags using get_config and set_config method.
$bconf->prepend_ccflags($ccflags);
Add new ccflags before current ccflags using get_config and set_config method.
my $cccdlflags = $bconf->get_cccdlflags;
Get cccdlflags option using get_config method.
cccdlflags
cccdlflags option is passed to config option of ExtUtils::CBuilder new method.
Default is copied from $Config{cccdlflags}.
$bconf->set_cccdlflags($cccdlflags);
Set cccdlflags using set_config method.
See get_cccdlflags method about cccdlflags option.
get_cccdlflags
$bconf->append_cccdlflags($cccdlflags);
Add new cccdlflags after current cccdlflags using get_config and set_config method.
$bconf->prepend_cccdlflags($cccdlflags);
Add new cccdlflags before current cccdlflags using get_config and set_config method.
my $archlibexp = $bconf->get_archlibexp;
Get archlibexp option using get_config method.
archlibexp
archlibexp option is passed to config option of ExtUtils::CBuilder new method.
Default is copied from $Config{archlibexp}.
$bconf->set_archlibexp($archlibexp);
Set archlibexp using set_config method.
See get_archlibexp method about archlibexp option.
get_archlibexp
my $optimize = $bconf->get_optimize;
Get optimize option using get_config method.
optimize
optimize option is passed to config option of ExtUtils::CBuilder new method
Default is copied from $Config{optimize}.
$bconf->set_optimize($optimize);
Set optimize using set_config method.
See get_optimize method about optimize option.
get_optimize
$bconf->set_ld($ld);
Set ld.
ld
my $ld = $bconf->get_ld;
Get ld.
my $lddlflags = $bconf->get_lddlflags;
Get lddlflags option using get_config method.
lddlflags
lddlflags option is passed to config option of ExtUtils::CBuilder new method.
Default is copied from $Config{lddlflags}.
$bconf->set_lddlflags($lddlflags);
Set lddlflags using set_config method.
See get_lddlflags method about lddlflags option.
get_lddlflags
$bconf->append_lddlflags($lddlflags);
Add new lddlflags after current lddlflags using get_config and set_config method.
$bconf->prepend_lddlflags($lddlflags);
Add new lddlflags before current lddlflags using get_config and set_config method.
my $shrpenv = $bconf->get_shrpenv;
Get shrpenv option using get_config method.
shrpenv
shrpenv option is passed to config option of ExtUtils::CBuilder new method.
Default is copied from $Config{shrpenv}.
$bconf->set_shrpenv($shrpenv);
Set shrpenv using set_config method.
See get_shrpenv method about shrpenv option.
get_shrpenv
my $include_dirs = $bconf->get_include_dirs;
Get include_dirs option. This option is array refernce.
include_dirs
include_dirs option is used by compile method of SPVM::Builder::CC to set -inculde_dir.
compile
Default is "SPVM/Builder/include" of one up of directory SPVM::Buidler::Config.pm loaded and the values of -include_dir in $Config{ccflags}.
$bconf->set_include_dirs($include_dirs);
Set include_dirs option. This option is array refernce.
See get_include_dirs method about include_dirs option.
get_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.
get_lib_dirs
lib_dirs
$bconf->push_include_dirs($include_dir1, $include_dir2, ...);
Add a element after the last element of include_dirs option.
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}.
$bconf->set_lib_dirs($lib_dirs);
Set lib_dirs option. This option is array refernce.
$bconf->unshift_lib_dirs($lib_dir1, $lib_dir2, ...);
Add a element before the first element of lib_dirs option.
$bconf->push_lib_dirs($lib_dir1, $lib_dir2, ...);
Add a element after the last element of lib_dirs option.
my $libs = $bconf->get_libs;
Get libs option. This option is array refernce.
libs
libs option is used by link method of SPVM::Builder::CC to set -l<lib>.
link
Don't prefix '-l' or 'lib' for library name. 'gsl' is ok. 'libgsl', '-lgsl' is not ok.
$bconf->set_libs($libs);
Set libs option. This option is array refernce.
See get_libs method about libs option.
get_libs
$bconf->unshift_libs($lib1, $lib2, ...);
Add a library before the first element of libs option.
$bconf->push_libs($lib1, $lib2, ...);
Add a library after the last element of libs option.
my $force_compile = $bconf->get_force_compile;
Get force_compile option.
force_compile
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.
$bconf->set_force_compile($force_compile);
Set force_compile option.
See get_force_compile method about force_compile option.
get_force_compile
my $quiet = $bconf->get_quiet;
Get quiet option.
quiet
quiet option is used by compile method of SPVM::Builder::CC to determine whether the method output compiler messages , default to 1.
1
$bconf->set_quiet($quiet);
Set quiet option.
See get_quiet method about quiet option.
get_quiet
To install SPVM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SPVM
CPAN shell
perl -MCPAN -e shell install SPVM
For more information on module installation, please visit the detailed CPAN module installation guide.