Distributing C code

2008-03-17 Thread Alberto Simões

Hi

I have a C package that has a Perl Module associated. At the moment it 
follows the following file system structure:


  [/]
   |
   |- configure.ac
   |- Makefile.am
   |- *.c
   |- perl
  |- file.pm
  |- Makefile.PL
  |- MANIFEST
  | ...

At the moment the approach is to run the configure script that is hacked 
to produce a Makefile.AM from the output of Makefile.PL. Also, the dist 
rule is hacked to follow the MANIFEST files.


What I would like was to rewrite this configure system and base it in 
Perl. I want to make all the package installable from CPAN as all users 
of the C package uses the Perl module interface.


My question is: what is the best and easier approach?
  Any module I might give a peek to steal some ideas?

TIA
ambs
--
Alberto Simões - Departamento de Informática - Universidade do Minho
 Campus de Gualtar - 4710-057 Braga - Portugal


Re: Distributing C code

2008-03-17 Thread Guy Hulbert
On Mon, 2008-17-03 at 17:23 +, Alberto Simões wrote:
 What I would like was to rewrite this configure system and base it in 
 Perl. I want to make all the package installable from CPAN as all users 
 of the C package uses the Perl module interface.
 
 My question is: what is the best and easier approach?

The standard way is to use h2xs but there is also swig and I seem to
recall reading recently that Incline::C may be easier but I don't know
how much it is used.

h2xs:
http://search.cpan.org/~rgarcia/perl-5.10.0/utils/h2xs.PL

Swig:
http://www.swig.org/exec.html

Inline:
http://search.cpan.org/src/INGY/Inline-0.44/README

-- 
--gh




Re: Distributing C code

2008-03-17 Thread Eric Wilhelm
# from Alberto Simões
# on Monday 17 March 2008 10:23:

What I would like was to rewrite this configure system and base it in
Perl. I want to make all the package installable from CPAN as all
 users of the C package uses the Perl module interface.

Is there anything in the 'configure' that can't be done with 
Module::Build?

What object files result from the C compilation?  Where do they get 
installed?

--Eric
-- 
Don't worry about what anybody else is going to do. The best way to
predict the future is to invent it.
--Alan Kay
---
http://scratchcomputing.com
---


Re: Distributing C code

2008-03-17 Thread David Nicol
On Mon, Mar 17, 2008 at 12:45 PM, Guy Hulbert [EMAIL PROTECTED] wrote:
 Inline::C may be easier but I don't know how much it is used.

It's used less than it used to, thanks to this guy:

InlineX::CPP2XS
Convert from Inline C++ code to XS.
InlineX-CPP2XS-0.12 - 19 Sep 2007 - Sisyphus

InlineX::C2XS
Convert from Inline C code to XS.
InlineX-C2XS-0.12 - 19 Sep 2007 - Sisyphus