runghc -fglasgow-exts issues

I need to pass -fglasgow-exts to runghc. It appears that if the first flag to runghc is -f, it treats it as a path to GHC itself. So, I cannot do the following:
runghc -fglasgow-exts Test.hs
because runghc failes (it says it can't find glasgow-exts). However if I do this:
runghc -fc:/ghc/bin/ghc.exe -fglasgow-exts Test.hs
it works. Is this the expected behavior? I really don't want to pass full path to GHC in order to simply specify -fglasgow-exts. I could fool runghc by doing this:
runghc -v -fc:/ghc/bin/ghc.exe -fglasgow-exts Test.hs
and it'll work since the first argument isn't -f, but I really don't want to do this (if I have to, what's a good argument that does nothing?). Thanks, - Slava.

This is not the exact answer to your question, but if the first line
of your .hs file is
{-# OPTIONS_GHC -fglasgow-exts #-}
then GHC extensions will be enabled within the file, whether compiled,
loaded in GHCi, or run with runghc. Other compilers should ignore the
pragma (unlike the older {# OPTIONS #-})
/g
On 12/1/06, Vyacheslav Akhmechet
I need to pass -fglasgow-exts to runghc. It appears that if the first flag to runghc is -f, it treats it as a path to GHC itself. So, I cannot do the following:
runghc -fglasgow-exts Test.hs
because runghc failes (it says it can't find glasgow-exts). However if I do this:
runghc -fc:/ghc/bin/ghc.exe -fglasgow-exts Test.hs
it works. Is this the expected behavior? I really don't want to pass full path to GHC in order to simply specify -fglasgow-exts. I could fool runghc by doing this:
runghc -v -fc:/ghc/bin/ghc.exe -fglasgow-exts Test.hs
and it'll work since the first argument isn't -f, but I really don't want to do this (if I have to, what's a good argument that does nothing?).
Thanks, - Slava. _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
-- It is myself I have never met, whose face is pasted on the underside of my mind.
participants (2)
-
J. Garrett Morris
-
Vyacheslav Akhmechet