NAME

ExtUtils::Builder::BuildTools::Base - A base class for BuildTools implementations.

VERSION

version 0.035

DESCRIPTION

This is a base-class for providers of compiler configuration. It defines the following delegates:

compile($source, $target, %options)

This compiles $source to $target. It takes the following optional arguments:

type

The type of the final product. This must be one of:

  • executable

    An executable to be run. This is the default.

  • static-library

    A static library to link against.

  • shared-library

    A dynamic library to link against.

  • loadable-object

    A loadable extension. On most platforms this is the same as a dynamic library, but some (Mac) make a distinction between these two.

Note that if you first compile for a static library that will later be linked into a shared library, you need to pick 'shared-library' here.

profiles

A list of profile that can be used when compiling and linking. One profile comes with this distribution: '@Perl', which sets up the appropriate things to compile/link with libperl.

include_dirs

A list of directories to add to the include path, e.g. ['include', '.'].

define

A hash of preprocessor defines, e.g. {DEBUG => 1, HAVE_FEATURE => 0 }

language

The language to use for compilation. Valid values are "C" or "C++".

standard

The language standard to use, e.g. "c99", "c11".

extra_args

A list of additional arguments to the compiler.

link(\@sources, $target, %options)

type

This works the same as with compile.

profile

This works the same as with compile.

language

This works the same as with compile.

libraries

A list of libraries to link to. E.g. ['z'].

library_dirs

A list of directories to find libraries in. E.g. ['/opt/my-app/lib/'].

extra_args

A list of additional arguments to the linker.

object_file($basename, $dir = undef)

Given a basename this will return the matching object file name.

library_file($basename, $dir = undef)

Given a basename this will return the matching shared library file name.

static_library_file($basename, $dir = undef)

Given a basename this will return the matching static library file name.

loadable_file($basename, $dir = undef)

Given a basename this will return the matching loadable library file name.

executable_file($basename, $dir = undef)

Given a basename this will return the matching executable file name.

AUTHOR

Leon Timmermans <fawaka@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by Leon Timmermans.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.