On Jan 5, 2007, at 3:01 PM, Marvin Humphrey wrote:
I have an XS distro that has maybe 50 or 60 packages in it. My
strategy has been to put everything in one big XS file, so that
only one shared library gets compiled. However, the XS file is now
over 4000 lines, and the compilation time for 10000-line monolithic
C file it generates is becoming an issue.
Is there a way to split up that C file so that fragments can be
conditionally compiled, yet still end up with only one shared library?
Gtk2 uses over 150 XS files, all of which get compiled into a single
Gtk2.so. On the other hand, it also uses ExtUtils::MakeMaker rather
than Module::Build. The only trick was supplying more than one XS
filename to WriteMakefile().
If you have no problem getting Module::Build to build you a whole
bunch of C files into O files, then you can probably pre-parse the XS
into C with xsubpp --- but i have to imagine that there's a way to
get Module::Build to use multiple XS files.