finding C compiler and preprocessor?

Simon Peyton-Jones simonpj at
Thu Mar 18 14:08:42 EST 2004

ghc -v Foo.hs
will show you what C compiler GHC invokes


| -----Original Message-----
| From: glasgow-haskell-users-bounces at
| bounces at] On Behalf Of David Roundy
| Sent: 18 March 2004 14:05
| To: glasgow-haskell-users at
| Subject: finding C compiler and preprocessor?
| Hello,
| Is there any way to find out what C compiler and preprocessor are used
| ghc?
| I've run into problems with a windows user, since the ghc distribution
| apparently uses a different compiler than the one that my configure
| finds, and so the configure script indicates that a certain header
file is
| found, but then the program fails to compile, since ghc doesn't find
| :( The only other option that comes to mind would be to write autoconf
| macros to check for header files and/or libraries using ghc, but that
| sounds to me like a real pain.
| Alternatively, if I could tell ghc which compiler to use, that would
| as well, since autoconf is perfectly capable of identifying a working
| compiler.
| I've tried telling autoconf that ghc is my C compiler, but that fails
| the user provides a CFLAGS that isn't supported by ghc.  One could get
| around this by prepending -optc to all the CFLAGS (but I haven't
| out how to do this in shell), but then there is still the trouble of
| to convince ghc to preprocess a C file with the C preprocessor.  :(
| Any suggestions would be welcome!
| --
| David Roundy
| _______________________________________________
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users at

More information about the Glasgow-haskell-users mailing list