<div dir="ltr">I am currently working on an alternative implementation of the STM monad and would like to keep my work as isolated as possible.  To that end, I have tried to keep all my files separate in a confined package.  The package consists of haskell files which are exported to the programmer, a C-- file which is used by the haskell functions, and a C file, which is called from some of the C-- primitives.  Inside my C file, I need to call a couple of functions that exist in the RTS, such as "dirty_TVAR" from (rts/sm/Storage.h).  Is there a good way to include this header file in my C file?  I would like to be able to list rts/sm in my cabal file under Include-Dirs.  I'm wondering if there is something analogous to an environment variable or anchor names (from SML/NJ compilation manager) that can tell me where the GHC source directory root is.  As an example, I would like to do something to the effect of:<div><br></div><div>library</div><div>  Include-Dirs: $GHC_ROOT/rts, $GHC_ROOT/rts/sm</div><div><br></div><div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px">where $GHC_ROOT would tell cabal where to find the ghc source directory in the file system.  I tried giving a relative path (which as expected does not work), giving the following warning:</div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px"><br></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px"><p style="margin:0px;font-size:11px;font-family:Menlo">Warning: 'include-dirs: ../../rts' is a relative path outside of the source</p><p style="margin:0px;font-size:11px;font-family:Menlo">tree. This will not work when generating a tarball with 'sdist'.</p><p style="margin:0px;font-size:11px;font-family:Menlo"><br></p><p style="margin:0px;font-size:11px;font-family:Menlo"><span style="font-family:Helvetica;font-size:12px">I can give an absolute path for my machine and everything compiles just fine, but this is obviously not portable.  Any help would be much appreciated.</span><br></p><p style="margin:0px;font-size:11px;font-family:Menlo"><span style="font-family:Helvetica;font-size:12px"><br></span></p><p style="margin:0px;font-size:11px;font-family:Menlo"><span style="font-family:Helvetica;font-size:12px">-Matt</span></p></div></div></div>