Tsukasa Hamano

NAME

C::TCC - An interface to the TCC(Tiny C Compiler)

SYNOPSIS

  use C::TCC;
  my $tcc = C::TCC->new();
  $tcc->compile_string('int main(){printf("Hello World.\n"); return 0;}');
  $tcc->run();

DESCRIPTION

The perl module TCC provides an interface to the TCC(Tiny C Compiler) See http://fabrice.bellard.free.fr/tcc/ for more information on TCC.

METHODS

new Create a new TCC compilation context.

add_include_path Add include path

add_sysinclude_path Add in system include path

define_symbol Define preprocessor symbol 'sym'. Can put optional value

undefine_symbol Undefine preprocess symbol 'sym'

add_file Add a file (either a C file, dll, an object, a library or an ld script). Return -1 if error.

compile_string Compile a string containing a C source. Return non zero if error.

set_output_type set output type. MUST BE CALLED before any compilation

TCC_OUTPUT_MEMORY

TCC_OUTPUT_EXE

TCC_OUTPUT_DLL

TCC_OUTPUT_OBJ

TCC_OUTPUT_PREPROCESS

output_file output an executable, library or object file. DO NOT call relocate() method before.

SEE ALSO

TCC(Tiny C Compiler) is created by Fabrice Bellard.

http://fabrice.bellard.free.fr/tcc/

AUTHOR

Tsukasa Hamano <hamano@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2008 Tsukasa Hamano <hamano@cpan.org>

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA