Actually, I am having a similar problem that defies all logic, so I don't know that it's strictly true to say there's no magic.
Got the problem some time ago with include and modules using -I and -M. IIRC, only the first arg was used on Linux.
Solved the problem using PIKE_MODULE_PATH and PIKE_INCLUDE_PATH.