I'm working on a CPAN distro with dozens of modules, several of which are outfitted with XS code. What's the best directory structure for this kind of thing?
Traditionally, .xs files and their associated Makefile.PL files get put in either the root directory of the distro, or one level above in a folder named for the last part of the package (e.g. Bar.xs from Foo::Bar gets put in MyDist-0.01/Bar/, along with Bar.pm). That doesn't scale well, unfortunately -- the distro's root directory gets real cluttered.
For now, what I'm doing is putting all the .pm files in MyDist-0.01/lib/ and giving each XS module a folder in MyDist-0.01/XS/. The upside of this strategy is that you can grok the distro's structure by looking only at Mydist-0.01/lib/, as if it were a pure Perl distro.
There are two downsides. First, the xs dirs are not organized hierarchically, but collected in a flat dir which doesn't mirror the distro's structure. Second, MakeMaker chdir's into the dir with the Makefile.PL before running it, so building the the path to the associated .pm file at MyDist-0.01/lib/Foo/Bar.pm gets messy. Right now, the code looks like...
my $path_to_pm_file = catfile(updir, updir, 'lib', 'Foo', 'Bar.pm');
... and I'm not even sure that's portable.
Suggestions?
In reply to Distro with multiple XS modules by creamygoodness
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |