ghci 7.4.1 no longer loading .o files?

Evan Laforge qdunkan at gmail.com
Sat Mar 3 00:12:03 CET 2012


> There is a way around it: create a .h file containing "#define MY_SETTING",
> and have the Haskell code #include the .h file.  The recompilation checker
> does track .h files:
>
> http://hackage.haskell.org/trac/ghc/ticket/3589
>
> When you want to change the setting, just modify the .h file.  Make sure you
> don't #include the file in source code that doesn't depend on it.

Ahh, I do believe that would work.  Actually, I'm not using --make but
the build system I am using (shake) can easily track those
dependencies.  It would fix the inconsistent-flags problem because now
I'm not passing any -D flags at all.

It's more awkward though, I'm using make flags or env vars to control
the defines, I would have to either change to editing a config.h file,
or have the build system go rewrite config.h on each run, making sure
to preserve the timestamp if it hasn't changed.  But that's not really
all that bad, and you could argue config.h is more common practice
than passing -D, probably because it already cooperates with
file-based make systems.

I'll give it a try, thanks!



More information about the Glasgow-haskell-users mailing list