If you have a module.pmod.in and some C code, both the generated module.pmod and the .so file should be installed in the MODDIR subdirectory of the module directory. Maybe they aren't (the Parser module doesn't seem to use a module.pmod.in), but then that would be the bug to fix rather than add a new construct that does the same thing.