On Nov 16, 2005, at 2:39 AM, Tels wrote:
Jus a quick question: Have you tried Module::Build? It might magically
solve all your problems - or not but it might be worth a try and if
not,
send a bug report to the Build guys to improve it :)
I'd tried Module::Build earlier, before even breaking out the .c/.h
files, and it had failed. But it turns out, not for the reason I'd
thought.
I assembled a reduced test case and posted to the module-build-
general list. The configuration error was quickly isolated:
- xs_files => { 'TestXS.xs' => 'TestXS.xs' },
+ xs_files => { 'TestXS.xs' => 'lib/TestXS.xs' },
With that change, my test case worked properly. As an aside, you
don't need the specify the xs_files param at all if you keep the XS
file in lib/ where it is to be "installed" -- however, Module::Build
won't find a .xs file in the root directory of the distro, so you
need to do one or the other.
After making that tweak to the KinoSearch Build.PL file, two more
modifications were required. Build.PL had to be told about the src/
directory...
c_source => 'src',
... and I had to move ppport.h out of the distro's root directory and
into src/.
Now, everything works! All the individual parts get compiled, and
only when they need to be. If I regenerate the KinoSearch.xs file by
running my modified Build.PL script, Build is smart enough to figure
out that the .c/.h files haven't been modified, and it uses the
existing .o files. If a single .c file gets changed, only that one
file gets recompiled. Perfect!
Thanks to everyone for the help.
Marvin Humphrey
Rectangular Research
http://www.rectangular.com/