Alien-TinyCC
view release on metacpan or search on metacpan
inc/My/Build/Linux.pm view on Meta::CPAN
chdir 'src';
system($make, 'clean');
chdir '..';
}
use File::Path;
sub ACTION_install {
my $self = shift;
# For unixish systems, we must re-build with the new prefix so that all of
# the baked-in paths are correct. I just wanna say this:
#my $prefix = File::ShareDir::dist_dir('Alien-TinyCC');
# Unfortunately, this won't work because File::ShareDir expects the
# folder to already exist.
# Instead, I copy code from Alien::Base::ModuleBuild to calculate the
# sharedir location by-hand:
my $prefix = File::Spec->catdir($self->install_destination('lib'),
qw(auto share dist Alien-TinyCC));
lib/Alien/TinyCC.pm view on Meta::CPAN
# Find the path to the tcc executable
sub path_to_tcc {
return $dist_dir if $^O =~ /MSWin/;
return File::Spec->catdir($dist_dir, 'bin');
}
# Modify the PATH environment variable to include tcc's directory
unshift @PATH, path_to_tcc();
# Find the path to the compiled libraries. Note that this is only applicable
# on Unixish systems; Windows simply uses the %PATH%, which was already
# appropriately set.
sub libtcc_library_path {
return $dist_dir if $^O =~ /MSWin/;
return File::Spec->catdir($dist_dir, 'lib');
}
# Add library path on Unixish:
if ($ENV{LD_LIBRARY_PATH}) {
$ENV{LD_LIBRARY_PATH} = libtcc_library_path() . ':' . $ENV{LD_LIBRARY_PATH};
}
elsif ($^O !~ /MSWin/) {
$ENV{LD_LIBRARY_PATH} = libtcc_library_path();
}
# Determine path for libtcc.h
sub libtcc_include_path {
return File::Spec->catdir($dist_dir, 'libtcc') if $^O =~ /MSWin/;
lib/Alien/TinyCC.pm view on Meta::CPAN
#include "ppport.h"
/* This is the important one */
#include "libtcc.h"
=head1 DESCRIPTION
This module ensures that you have a copy of the Tiny C Compiler accessible
to your Perl code, ensures that F<tcc> is in your path after saying
C<use Alien::TinyCC>, ensures that F<libtcc> is in your C<LD_LIBRARY_PATH>
for Unixen and C<PATH> for Windows, and provides some functions for
identifying those paths and building against them.
This module is blissfully unaware of any other F<tcc> installations on your
system and it does not install F<tcc> into a generically usable location.
Rather, it installs it into a Perl-specific location. The basic idea is that
this Perl module should not interfere with your non-Perl stuff.
The provided path functions include:
=over
src/Changelog view on Meta::CPAN
- added verbosity levels -v, -vv, -vvv
- Accept standard input as an inputstream (Hanzac Chen)
- Support c89 compilers other than gcc (Hanzac Chen)
- -soname linker option (Marc Andre Tanner)
- Just warn about unknown directives, ignore quotes in #error/#warning
- Define __STDC_VERSION__=199901L (477)
- Switch to newer tccpe.c (includes support for resources)
- Handle backslashes within #include/#error/#warning
- Import changesets (part 4) 428,457,460,467: defines for openbsd etc.
- Use _WIN32 for a windows hosted tcc and define it for the PE target,
otherwise define __unix / __linux (Detlef Riekenberg)
- Import changesets (part 3) 409,410: ARM EABI by Daniel Glöckner
- Some in-between fixes:
TCC -E no longer hangs with macro calls involving newlines.
(next_nomacro1 now advances the read-pointer with TOK_LINEFEED)
Global cast (int g_i = 1LL;) no longer crashes tcc.
(nocode_wanted is initially 1, and only 0 for gen_function)
On win32 now tcc.exe finds 'include' & 'lib' even if itself is in 'bin'.
(new function w32_tcc_lib_path removes 'bin' if detected)
Added quick build batch file for mingw (win32/build-tcc.bat)
Last added case label optimization (455) produced wrong code. Reverted.
src/libtcc.c view on Meta::CPAN
tcc_define_symbol(s, "__ARM_PCS_VFP", NULL);
#endif
#endif
#ifdef TCC_TARGET_PE
tcc_define_symbol(s, "_WIN32", NULL);
# ifdef TCC_TARGET_X86_64
tcc_define_symbol(s, "_WIN64", NULL);
# endif
#else
tcc_define_symbol(s, "__unix__", NULL);
tcc_define_symbol(s, "__unix", NULL);
tcc_define_symbol(s, "unix", NULL);
# if defined(__linux)
tcc_define_symbol(s, "__linux__", NULL);
tcc_define_symbol(s, "__linux", NULL);
# endif
# if defined(__FreeBSD__)
# define str(s) #s
tcc_define_symbol(s, "__FreeBSD__", str( __FreeBSD__));
# undef str
# endif
# if defined(__FreeBSD_kernel__)
( run in 1.056 second using v1.01-cache-2.11-cpan-39bf76dae61 )