scottp has asked for the wisdom of the Perl Monks concerning the following question:
I have a couple of deeply nested (directory wise and namespace) XS files that I want to include in an already long developed perl module. h2xs is not my friend in this case as it tends to like creating new files...
(names have been changed for simplification)
The XS file (which has all of the c code in it) has a name of lib/MyModule/Drv/MyCode.xs and contain the lines
MODULE = MyModule::Drv::MyCode PACKAGE = MyModule::Drv::MyCode PROTOTYPES: DISABLE
and the rest of the normal code.
My corosponding lib/MyModule/Drv/MyCode.pm contains
and the rest of the normal code.package MyModule::Drv::MyCode; use strict; use Carp; use vars qw($VERSION @ISA @EXPORT); require DynaLoader; @ISA = qw(DynaLoader); $VERSION = '0.1'; bootstrap MyModule::Drv::MyCode $VERSION;
My MANIFEST file in the root directory contains
amoung other lines Finally my Makefile.PL complete, looks like this:lib/Device/ParallelPort/drv/linux.pm lib/Device/ParallelPort/drv/linux.xs
I have tried varying things like addinguse ExtUtils::MakeMaker; WriteMakefile( 'NAME' => 'MyModule', 'VERSION_FROM' => 'lib/MyModule.pm', 'LIBS' => [''], 'DEFINE' => $dflags, 'INC' => '', );
The problem is that the resulting Makefile from "perl Makefile.PL" does not compile my .xs file. Sometimes (depending on the many tests I have tried) it compiles MyModule.xs - which does not exist.'XS' => { 'lib/MyModule/Drv/MyCode.xs' => 'lib/MyModule/Drv/MyCode.c', },
I can only get it to work if the .xs file is in the root directory.
Does anyone have any idea how I can fix this.
Much Appreciated in advance :-)
Scott
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Using h2xs
by scottp (Initiate) on May 01, 2002 at 00:39 UTC | |
|
Re: XS compile in Makefile.PL
by ferrency (Deacon) on Apr 30, 2002 at 20:55 UTC |