Perhaps you didn't understand the question. I know of many ways to generate things during module-building. What I don't know about is if there is an existing package which already handles .ph file dependencies. If not, what I don't know about is how to generate this sanely myself. I have a guess but I quickly run directly into shell quoting issues and guessing about what compiler options mean. It gets ugly rather quickly. Or... well... maybe it's possible to write a Module::Build plugin which could handle getting the compiler to find the syscall.h file.
Makefile.PL
WriteMakefile(
...
CC => "$^X bin/fake-cc", # shell quoting matters here!
);
bin/fake-cc
#!perl
for ( map extract_paths( $_ ), @ARGV ) {
# stash this somewhere, I guess.
}
# etc.