I am working on a module that I would like to have two backends, a Module(::PerlArray)
and Module::PDL
(which can will depend on Module
). Both need access to a functions.c/.h
file for building. This file has the rather complicated logic needed for the module. Rather than distribute it separately with each module, is there some way to keep it with the Module::PP
on the system and then add it to the appropriate build flags in EU::MM
or M::B
(given the complexity here probably the latter)?
To put it more visually
--Module--
Module.pm
Module/PerlArray.pm
Module/PerlArray.xs (#include functions.h
#include perlarray_backend.h)
Module/src/functions.c
Module/src/perlarray_backend.c
Module/inc/functions.h
Module/inc/perlarray_backend.h
--Module::PDL--
Module/PDL.pm
Module/PDL.xs (#include functions.h /*from Module*/
#include pdl_backend.h)
Module/src/pdl_backend.c
Module/inc/pdl_backend.h
and the compilation makes functions.o and links. I'm sure I can figure out how to set the flags appropriately but how can I make Module keep the functions.c
file while installing, and how can I then find it when installing Module::PDL
? Is there some location I can place the functions.c/.h
?