Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

How can I have .xs files in lib? I tried adding the files myself
my %XS = do { local *ARGV; @ARGV = 'MANIFEST'; map { chomp; my $f = $_; s!\.xs$!\.c!; $f => $_; } grep /\.xs$/, <>; }; WriteMakefile( 'XS' => \%XS, ...
but didnt work

Thanks

Replies are listed 'Best First'.
Re: .xs files under lib with ExtUtils::MakeMaker?
by cdarke (Prior) on Oct 25, 2009 at 12:48 UTC
    You might find it easier to create the skeleton using h2xs -nproject then manually editing the Makefile.
      Makefile.PL is not Makefile, and it doesn't help
      $ h2xs -n CDRAKE Defaulting to backwards compatibility with perl 5.8.9 If you intend this module to be compatible with earlier perl versions, + please specify a minimum perl version with the -b option. Writing CDRAKE/ppport.h Writing CDRAKE/lib/CDRAKE.pm Writing CDRAKE/CDRAKE.xs Writing CDRAKE/fallback/const-c.inc Writing CDRAKE/fallback/const-xs.inc Writing CDRAKE/Makefile.PL Writing CDRAKE/README Writing CDRAKE/t/CDRAKE.t Writing CDRAKE/Changes Writing CDRAKE/MANIFEST
      I want
      Writing CDRAKE/lib/CDRAKE.pm Writing CDRAKE/lib/CDRAKE.xs
      the WriteMakefile XS option seems to be the way, but it isn't working