Alien-Bit

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

NAME
    Alien::Bit - Find or install the Bit library

VERSION
    version 0.09

SYNOPSIS
     use Alien::Bit;
     use Alien qw( Alien::Bit );

     # Get compiler flags for XS/C compilation
     my $cflags = Alien::Bit->cflags;
     # Returns: path to include directory

     # Get linker flags 
     my $libs = Alien::Bit->libs;
     # Returns: the linker flags to link to the Bit library statically

     # For FFI::Platypus usage
     use FFI::Platypus;
     my $ffi = FFI::Platypus->new( api => 2 );
     $ffi->lib(Alien::Bit->dynamic_libs);

    Installs the Bit library, used to manipulate bitsets and their packed
    containers

DESCRIPTION

alienfile  view on Meta::CPAN


    # Set runtime properties for client code
    gather sub {
        my ($build) = @_;
        my $prefix = $build->runtime_prop->{prefix};

        # Set include and library paths
        my $include_dir = path( $prefix, 'include' )->stringify;
        my $lib_dir     = path( $prefix, 'lib' )->stringify;

        # Set compiler flags
        $build->runtime_prop->{cflags} = "-I$include_dir";

        # Set linker flags with appropriate library name
        $build->runtime_prop->{libs} = "-L$lib_dir -lbit";

        # Store raw paths for Platypus FFI
        $build->runtime_prop->{ffi_name}    = "bit";
        $build->runtime_prop->{include_dir} = $include_dir;
        $build->runtime_prop->{lib_dir}     = $lib_dir;

        # Print confirmation
        print "Alien::Bit configured with:\n";
        print "  cflags: ",      $build->runtime_prop->{cflags},      "\n";
        print "  libs: ",        $build->runtime_prop->{libs},        "\n";
        print "  ffi_name: ",    $build->runtime_prop->{ffi_name},    "\n";
        print "  include_dir: ", $build->runtime_prop->{include_dir}, "\n";
        print "  lib_dir: ",     $build->runtime_prop->{lib_dir},     "\n";
    };

    # Run tests after installation
    test sub {
        my ($build) = @_;
        my $lib_dir = path( $build->install_prop->{stage}, 'lib' );

alienfile  view on Meta::CPAN

        fcopy( $source_header, $dest_header );

    };

    gather sub {
        my ($build) = @_;
        my $prefix = $build->runtime_prop->{prefix};
        my $incdir = catfile( $prefix, 'include' );
        my $libdir = catfile( $prefix, 'lib' );

        # Set the compiler flags
        $build->runtime_prop->{cflags} = "-I$incdir";

        # Set the linker flags
        $build->runtime_prop->{libs}     = "-L$libdir -lbit";
        $build->runtime_prop->{ffi_name} = "bit";

        # store the actual paths if you ever have to debug
        $build->runtime_prop->{include_dir} = $incdir;
        $build->runtime_prop->{lib_dir}     = $libdir;

    };

    test sub {

lib/Alien/Bit.pm  view on Meta::CPAN


=head1 VERSION

version 0.09

=head1 SYNOPSIS

 use Alien::Bit;
 use Alien qw( Alien::Bit );

 # Get compiler flags for XS/C compilation
 my $cflags = Alien::Bit->cflags;
 # Returns: path to include directory

 # Get linker flags 
 my $libs = Alien::Bit->libs;
 # Returns: the linker flags to link to the Bit library statically

 # For FFI::Platypus usage
 use FFI::Platypus;
 my $ffi = FFI::Platypus->new( api => 2 );
 $ffi->lib(Alien::Bit->dynamic_libs);


Installs the Bit library, used to manipulate bitsets and their packed containers

=head1 DESCRIPTION



( run in 1.203 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )