+
+ -- this is the filename we're going to use when
+ -- #including the stub_h file from the .hc file.
+ -- Without -stubdir, we just #include the basename
+ -- (eg. for a module A.B, we #include "B_stub.h"),
+ -- relying on the fact that we add an implicit -I flag
+ -- for the directory in which the source file resides
+ -- (see DriverPipeline.hs). With -stubdir, we
+ -- #include "A/B.h", assuming that the user has added
+ -- -I<dir> along with -stubdir <dir>.
+ include_basename
+ | Just _ <- stubdir = mod_basename
+ | otherwise = filenameOf src_basename