darcs patch: more portabilization

Isaac Dupree isaacdupree at charter.net
Fri Jan 18 07:08:50 EST 2008


Simon Marlow wrote:
> Isaac Dupree wrote:
>> /* This makes it easier to test building without GHC extensions,
>>  * used in import statements such as "import GHC_EXTS.IOBase", to
>>  * provide distinguishment from the GHC API's module GHC */
>> #ifdef __GLASGOW_HASKELL__
>> #define GHC_EXTS GHC
>> #else
>> /* let it be an error */
>> #endif
> 
> I don't really see what this buys us - the only GHC.* modules are in 
> package base anyway.

it's so that I can test still using "ghc" as the compiler, because 
nothing else implements quite the same set of extensions yet (and 
build-flags!).  I'm doing some testing with things in compiler/Makefile like

ifeq "$(PRETEND_NOT_TO_BE_GLASGOW_HASKELL)" "YES"
else
SRC_MKDEPENDC_OPTS += -D__GLASGOW_HASKELL__=$(ProjectVersionInt)
endif

ifeq "$(PRETEND_NOT_TO_BE_GLASGOW_HASKELL)" "YES"
SRC_HC_OPTS += -optP-U__GLASGOW_HASKELL__
...


which actually seem to work pretty well (along with varying the -X flags 
when "$(ghc_ge_607)" or -fglasgow-exts etc. otherwise)

now, if you think that's too much of a hack to put in the official repo, 
just say so :-)

~Isaac



More information about the Cvs-ghc mailing list