@@ -142,6 +142,8 @@ ghcLibParserHsSrcDirs forDepends ghcFlavor lib =
142142 GHC_8_8 -> [" compiler/codeGen" , " compiler/hieFile" , " compile/llvmGen" , " compiler/stranal" , " compiler/rename" , " compiler/stgSyn" , " compiler/llvmGen" ]
143143 GHC_8_10 -> [" compiler/nativeGen" , " compiler/deSugar" , " compiler/hieFile" , " compiler/llvmGen" , " compiler/stranal" , " compiler/rename" , " compiler/stgSyn" ]
144144 GHC_9_10 -> [" libraries/ghc-internal/src" ]
145+ GHC_9_12 -> [" utils/ghc-toolchain/src" | ghcFlavor >= Ghc9123 ]
146+ GHC_9_14 -> [" utils/ghc-toolchain/src" ]
145147 _ -> []
146148 in sortDiffListByLength all $ Set. fromList [dir | not forDepends, dir <- exclusions]
147149
@@ -159,9 +161,9 @@ ghcLibHsSrcDirs forDepends ghcFlavor lib =
159161 GHC_9_6 -> [" libraries/template-haskell" , " libraries/ghc-boot-th" , " libraries/ghc-boot" , " libraries/ghc-heap" , " libraries/ghci" ]
160162 GHC_9_8 -> [" libraries/template-haskell" , " libraries/ghc-boot-th" , " libraries/ghc-boot" , " libraries/ghc-heap" , " libraries/ghc-platform/src" , " libraries/ghc-platform" ]
161163 GHC_9_10 -> [" libraries/template-haskell" , " libraries/ghc-boot-th" , " libraries/ghc-boot" , " libraries/ghc-heap" , " libraries/ghc-platform/src" , " libraries/ghc-platform" , " libraries/ghci" , " libraries/ghc-internal/src" ]
162- GHC_9_12 -> [" libraries/template-haskell" , " libraries/ghc-boot-th" , " libraries/ghc-boot" , " libraries/ghc-heap" , " libraries/ghc-platform/src" , " libraries/ghc-platform" , " libraries/ghci" ]
163- GHC_9_14 -> [" libraries/template-haskell" , " libraries/ghc-boot-th" , " libraries/ghc-boot" , " " , " libraries/ghc-heap" , " libraries/ghc-platform/src" , " libraries/ghc-platform" , " libraries/ghci" ]
164- GHC_9_16 -> [" libraries/template-haskell" , " libraries/ghc-boot-th" , " libraries/ghc-boot" , " " , " libraries/ghc-heap" , " libraries/ghc-platform/src" , " libraries/ghc-platform" , " libraries/ghci" , " libraries/ghc-internal" ]
164+ GHC_9_12 -> [" libraries/template-haskell" , " libraries/ghc-boot-th" , " libraries/ghc-boot" , " libraries/ghc-heap" , " libraries/ghc-platform/src" , " libraries/ghc-platform" , " libraries/ghci" ] ++ [x | x <- [ " libraries/ghc-internal/src " , " utils/ghc-toolchain/src " ], ghcFlavor >= Ghc9123 ]
165+ GHC_9_14 -> [" libraries/template-haskell" , " libraries/ghc-boot-th" , " libraries/ghc-boot" , " " , " libraries/ghc-heap" , " libraries/ghc-platform/src" , " libraries/ghc-platform" , " libraries/ghci" , " libraries/ghc-internal/src " , " utils/ghc-toolchain/src " ]
166+ GHC_9_16 -> [" libraries/template-haskell" , " libraries/ghc-boot-th" , " libraries/ghc-boot" , " " , " libraries/ghc-heap" , " libraries/ghc-platform/src" , " libraries/ghc-platform" , " libraries/ghci" , " libraries/ghc-internal" , " libraries/ghc-internal/src " , " utils/ghc-toolchain/src " ]
165167 in sortDiffListByLength all $ Set. fromList [dir | not forDepends, dir <- exclusions]
166168
167169-- File path constants.
@@ -354,6 +356,7 @@ calcModuleDeps includeDirs _hsSrcDirs hsSrcIncludes ghcFlavor cabalPackageDb ghc
354356#endif
355357 [" -fno-safe-haskell" | series >= GHC_9_0 ], -- avoid warning: [GHC-98887] -XGeneralizedNewtypeDeriving is not allowed in Safe Haskell; ignoring -XGeneralizedNewtypeDeriving
356358 [" -DBIGNUM_NATIVE" | series > GHC_9_12 ],
359+ [" -XGHC2024" | series > GHC_9_14 ],
357360 includeDirs,
358361 hsSrcIncludes,
359362 [placeholderModulesDir </> " Main.hs" ]
@@ -1376,6 +1379,7 @@ baseBounds = \case
13761379 -- base-4.21.0.0
13771380 Ghc9121 -> " base >= 4.19 && < 4.22" -- [ghc-9.8.1, ghc-9.14.1)
13781381 Ghc9122 -> " base >= 4.19 && < 4.22" -- [ghc-9.8.1, ghc-9.14.1)
1382+ Ghc9123 -> " base >= 4.19 && < 4.22" -- [ghc-9.8.1, ghc-9.14.1)
13791383 -- base-4.21.0.0
13801384 Ghc9141 -> " base >= 4.20 && < 4.23" -- [ghc-9.10.1, ghc-9.16.1)
13811385 GhcMaster ->
@@ -1586,8 +1590,9 @@ generateGhcLibCabal ghcFlavor customCppOpts = do
15861590 " description: Pass -DTHREADED_RTS to the C toolchain"
15871591 ],
15881592 [" library" ],
1589- [" default-language: Haskell2010" | ghcFlavor < Ghc9101 ],
1590- [" default-language: GHC2021" | ghcFlavor >= Ghc9101 ],
1593+ [" default-language: Haskell2010" | ghcSeries ghcFlavor < GHC_9_10 ],
1594+ [" default-language: GHC2021" | ghcSeries ghcFlavor >= GHC_9_10 && ghcSeries ghcFlavor < GHC_9_16 ],
1595+ [" default-language: GHC2024" | ghcSeries ghcFlavor >= GHC_9_16 ],
15911596 [ " exposed: False" ,
15921597 " include-dirs:"
15931598 ],
@@ -1596,14 +1601,14 @@ generateGhcLibCabal ghcFlavor customCppOpts = do
15961601 " ghc-options: -fno-safe-haskell"
15971602 ],
15981603 [ " if flag(threaded-rts)" ,
1599- " if impl(ghc < 9.14.0 )" ,
1604+ " if impl(ghc < 9.12.3 )" ,
16001605 " ghc-options: -fobject-code -package=ghc-boot-th -optc-DTHREADED_RTS" ,
16011606 " else" ,
16021607 " ghc-options: -fobject-code -optc-DTHREADED_RTS" ,
16031608 " cc-options: -DTHREADED_RTS" ,
16041609 " cpp-options: -DTHREADED_RTS " ++ generateCppOpts ghcFlavor customCppOpts,
16051610 " else" ,
1606- " if impl(ghc < 9.14.0 )" ,
1611+ " if impl(ghc < 9.12.3 )" ,
16071612 " ghc-options: -fobject-code -package=ghc-boot-th" ,
16081613 " else" ,
16091614 " ghc-options: -fobject-code" ,
@@ -1703,8 +1708,9 @@ generateGhcLibParserCabal ghcFlavor customCppOpts = do
17031708 " description: Pass -DTHREADED_RTS to the C toolchain"
17041709 ],
17051710 [" library" ],
1706- [" default-language: Haskell2010" | ghcFlavor < Ghc9101 ],
1707- [" default-language: GHC2021" | ghcFlavor >= Ghc9101 ],
1711+ [" default-language: Haskell2010" | ghcSeries ghcFlavor < GHC_9_10 ],
1712+ [" default-language: GHC2021" | ghcSeries ghcFlavor >= GHC_9_10 && ghcSeries ghcFlavor < GHC_9_16 ],
1713+ [" default-language: GHC2024" | ghcSeries ghcFlavor >= GHC_9_16 ],
17081714 [ " exposed: False" ,
17091715 " include-dirs:"
17101716 ],
@@ -1713,11 +1719,17 @@ generateGhcLibParserCabal ghcFlavor customCppOpts = do
17131719 " ghc-options: -fno-safe-haskell"
17141720 ],
17151721 [ " if flag(threaded-rts)" ,
1716- " ghc-options: -fobject-code -package=ghc-boot-th -optc-DTHREADED_RTS" ,
1722+ " if impl(ghc < 9.12.3)" ,
1723+ " ghc-options: -fobject-code -package=ghc-boot-th -optc-DTHREADED_RTS" ,
1724+ " else" ,
1725+ " ghc-options: -fobject-code -optc-DTHREADED_RTS" ,
17171726 " cc-options: -DTHREADED_RTS" ,
17181727 " cpp-options: -DTHREADED_RTS " ++ generateCppOpts ghcFlavor customCppOpts,
17191728 " else" ,
1720- " ghc-options: -fobject-code -package=ghc-boot-th" ,
1729+ " if impl(ghc < 9.12.3)" ,
1730+ " ghc-options: -fobject-code -package=ghc-boot-th" ,
1731+ " else" ,
1732+ " ghc-options: -fobject-code" ,
17211733 " cpp-options: " ++ generateCppOpts ghcFlavor customCppOpts
17221734 ],
17231735 [ " if !os(windows)" ,
0 commit comments