suaveant,
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.
tinypig