hmake: Getting compiler info at runtime and not relying on name for compiler type

Hi, Attached is a patch which does two things: * Gets compiler type from the result of running a compiler if the first 3 letters aren't ghc|nhc|hbc|gcc. I wanted this for /usr/bin/haskell-compiler. * If "hmake-config add-dyn" is used instead of "hmake add" then the compiler information is not stored, but worked out dynamically when used. This means /usr/bin/haskell-compiler can be the default hmake compiler on a Debian installation and it doesn't matter if it is really nhc98, ghc6 or ghc5, and there is no need to require specific versions of the compilers. It could be a bit nicer, e.g. I didn't notice runAndReadStdout until I was half way through, but it seems to work for me. Thanks Ian

Ian Lynagh
Attached is a patch which does two things:
* Gets compiler type from the result of running a compiler if the first 3 letters aren't ghc|nhc|hbc|gcc. I wanted this for /usr/bin/haskell-compiler. * If "hmake-config add-dyn" is used instead of "hmake add" then the compiler information is not stored, but worked out dynamically when used. This means /usr/bin/haskell-compiler can be the default hmake compiler on a Debian installation and it doesn't matter if it is really nhc98, ghc6 or ghc5, and there is no need to require specific versions of the compilers.
Thanks for the contribution. I am reviewing your code and will incorporate it into hmake with perhaps a couple of tidy-ups. Regards, Malcolm
participants (2)
-
Ian Lynagh
-
Malcolm Wallace