This change is not strictly necessary, but what it does do is allow you to add .m files (Objective-C source files) to your .cabal project. --- ghc-6.10.2.orig/compiler/main/DriverPhases.hs 2009-03-31 06:13:15.000000000 +1300 +++ ghc-6.10.2/compiler/main/DriverPhases.hs 2009-06-18 15:54:37.000000000 +1200 @@ -156,6 +156,7 @@ startPhase "C" = Cc startPhase "cc" = Ccpp startPhase "cxx" = Ccpp +startPhase "m" = Cc -- Objective-C startPhase "raw_s" = Mangle startPhase "split_s" = SplitMangle startPhase "s" = As @@ -195,7 +196,7 @@ haskellish_src_suffixes = haskellish_user_src_suffixes ++ [ "hspp", "hscpp", "hcr", "cmm" ] haskellish_suffixes = haskellish_src_suffixes ++ ["hc", "raw_s"] -cish_suffixes = [ "c", "cpp", "C", "cc", "cxx", "s", "S" ] +cish_suffixes = [ "c", "cpp", "C", "cc", "cxx", "s", "S", "m" ] extcoreish_suffixes = [ "hcr" ] -- Will not be deleted as temp files: haskellish_user_src_suffixes = [ "hs", "lhs", "hs-boot", "lhs-boot" ] --- ghc-6.10.2.orig/compiler/main/DriverPipeline.hs 2009-03-31 06:13:16.000000000 +1300 +++ ghc-6.10.2/compiler/main/DriverPipeline.hs 2009-06-18 15:54:37.000000000 +1200 @@ -970,8 +970,10 @@ -- compiling .hc files, by adding the -x c option. -- Also useful for plain .c files, just in case GHC saw a -- -x c option. - [ SysTools.Option "-x", if cc_phase `eqPhase` Ccpp - then SysTools.Option "c++" else SysTools.Option "c"] ++ + (if ".m" `isSuffixOf` input_fn -- "-x c" breaks Objective-C + then [] + else [ SysTools.Option "-x", if cc_phase `eqPhase` Ccpp + then SysTools.Option "c++" else SysTools.Option "c"]) ++ [ SysTools.FileOption "" input_fn , SysTools.Option "-o" , SysTools.FileOption "" output_fn