Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Docs, and Build.PL cleanups

  • Loading branch information...
commit 9add5825a77ea9fa8b2a0fd80b4cb6ef4d0b897f 1 parent d69d648
@run4flat authored
Showing with 114 additions and 1 deletion.
  1. +15 −0 Build.PL
  2. +9 −1 README
  3. +90 −0 lib/Alien/FFCall.pm
View
15 Build.PL
@@ -4,6 +4,10 @@ use warnings;
use Alien::Base::ModuleBuild;
my $builder = Alien::Base::ModuleBuild->new(
+ 'meta-spec' => {
+ version => '2',
+ url => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec',
+ },
module_name => 'Alien::FFCall',
dist_abstract => 'Build and install libffcall',
license => 'perl',
@@ -26,5 +30,16 @@ my $builder = Alien::Base::ModuleBuild->new(
'make install'
],
alien_provides_libs => '-lavcall -lcallback',
+ resources => {
+ bugtracker => {
+ web => 'http://github.com/run4flat/Alien-FFCall/issues',
+ mailto => 'dcmertens.perl@gmail.com',
+ },
+ repository => {
+ url => 'git://github.com/run4flat/Alien-FFCall.git',
+ web => 'http://github.com/run4flat/Alien-FFCall',
+ type => 'git',
+ },
+ },
);
$builder->create_build_script;
View
10 README
@@ -1,11 +1,18 @@
+NAME
+
Alien::FFCall - an Alien package for the FFCall library (predecessor to libffi)
+DESCRIPTION
+
This Alien package, built on Alien::Base, provides the FFCall library. FFCall
has been surpassed by libffi and is rather hard to obtain these days, but Perl's
FFI module is built upon FFCall, so I decided to make it easy to distribute
FFCall on CPAN. :-)
-This module still needs docs and tests. :-(
+There is a project that provides an interface to libffi known as Ctypes, which
+should be coming out Real Soon Now. As far as I can tell, libffi is more robust
+than FFCall, and I would recommend using that when it becomes available. In the
+meantime, you should can use FFCall-based FFI.
INSTALLATION
@@ -13,6 +20,7 @@ To install this module, run the following commands:
perl Build.PL
./Build
+ ./Build test
./Build install
SUPPORT AND DOCUMENTATION
View
90 lib/Alien/FFCall.pm
@@ -9,3 +9,93 @@ $VERSION = eval $VERSION;
use parent 'Alien::Base';
1;
+
+__END__
+
+=head1 NAME
+
+Alien::FFCall - Alien library for FFCall
+
+=head1 SYNOPSIS
+
+I would encourage you to look at FFI.pm if you want a Perl-level wrapper to
+FFCall. However, if you want to write your own XS-based interface to FFCall,
+your Build.PL file should say:
+
+ use strict;
+ use warnings;
+ use Module::Build;
+ use Alien::FFCall;
+
+ # Retrieve the Alien::FFCall configuration:
+ my $alien = Alien::FFCall->new;
+
+ # Create the build script:
+ my $builder = Module::Build->new(
+ module_name => 'FFI',
+ extra_compiler_flags => $alien->cflags(),
+ extra_linker_flags => $alien->libs(),
+ configure_requires => {
+ 'Alien::FFCall' => 0,
+ },
+ );
+ $builder->create_build_script;
+
+Your module (.pm) file should look like this:
+
+ package My::FFCall::Wrapper;
+
+ use strict;
+ use warnings;
+
+ use Alien::FFCall;
+
+ our $VERSION = '0.01';
+
+ require XSLoader;
+ XSLoader::load('My::FFCall::Wrapper');
+
+ ... perl-level code goes here ...
+
+Your XS file should look like this:
+
+ #include "EXTERN.h"
+ #include "perl.h"
+ #include "XSUB.h"
+
+ #include <avcall.h>
+ #include <callback.h>
+
+ ... normal XS stuff goes here, making use of the FFCall API ...
+
+=head1 DESCRIPTION
+
+Alien::FFCall provides a CPAN distribution for the FFCall library. In other
+words, it installs FFCall's library in a non-system folder and provides you with
+the details necessary to include in and link to your C/XS code.
+
+=head1 AUTHOR
+
+David Mertens, C<< <dcmertens.perl at gmail.com> >>
+
+=head1 BUGS
+
+The best place to report bugs or get help for this module is to file Issues on
+github:
+
+ https://github.com/run4flat/Alien-FFI/issues
+
+Note that I do not maintain FFCall itself, only the Alien module for it. As I
+understand it, FFCall is no longer maintained. :-(
+
+=head1 LICENSE AND COPYRIGHT
+
+Copyright 2012 Northwestern University
+
+This program is free software; you can redistribute it and/or modify it
+under the terms of either: the GNU General Public License as published
+by the Free Software Foundation; or the Artistic License.
+
+See http://dev.perl.org/licenses/ for more information.
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.