Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Getting a C library to compile into a Perl module...

by tinypig (Beadle)
on May 12, 2003 at 19:52 UTC ( #257547=note: print w/replies, xml ) Need Help??

in reply to Getting a C library to compile into a Perl module...


Why don't you start here: perlxstut, and bring your C code into this framework.

Added:Also, h2xs accepts a parameter for specifying extra libraries.

h2xs [-ACOPXacdfhkmx] [-F addflags] [-M fmask] [-n module_name] [-o tm +ask] [-p prefix] [-s subs] [-v version] [headerfile [extra_libraries] +] version: 1.21 -A Omit all autoloading facilities (implies -c). -C Omit creating the Changes file, add HISTORY heading to stub P +OD. -F Additional flags for C preprocessor (used with -x). -M Mask to select C functions/macros (default is select all). -O Allow overwriting of a pre-existing extension directory. -P Omit the stub POD section. -X Omit the XS portion (implies both -c and -f). -a Generate get/set accessors for struct and union members (used + with -x). -c Omit the constant() function and specialised AUTOLOAD from th +e XS file. -d Turn on debugging messages. -f Force creation of the extension even if the C header does not + exist. -h Display this help message -k Omit 'const' attribute on function arguments (used with -x). -m Generate tied variables for access to declared variables. -n Specify a name to use for the extension (recommended). -o Regular expression for "opaque" types. -p Specify a prefix which should be removed from the Perl functi +on names. -s Create subroutines for specified macros. -v Specify a version number for this extension. -x Autogenerate XSUBs using C::Scan. -b Specify a perl version to be backwards compatibile with extra_libraries are any libraries that might be needed for loading the extension, e.g. -lm would try to link in the math library.

Replies are listed 'Best First'.
Re: Re: Getting a C library to compile into a Perl module...
by suaveant (Parson) on May 12, 2003 at 20:52 UTC
    I am reading perlxstut, but I am not sure that is going to help... h2xs fails miserably with this library on its own. And I am using that framework, with the Makefile.PL. But if I am not mistaken, unless you know how to compile a test program or something in gcc, you can't really set up the Makefile info properly. I can't get a test file to compile, so I'm not even sure what linker options gcc needs...

                    - Ant
                    - Some of my best work - (1 2 3)

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://257547]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2023-03-24 10:01 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (61 votes). Check out past polls.