:set -icompiler/backpack
:set -icompiler/basicTypes
:set -icompiler/cmm
:set -icompiler/codeGen
:set -icompiler/coreSyn
:set -icompiler/deSugar
:set -icompiler/ghci
:set -icompiler/hiefile
:set -icompiler/hsSyn
:set -icompiler/iface
:set -icompiler/llvmGen
:set -icompiler/main
:set -icompiler/nativeGen
:set -icompiler/parser
:set -icompiler/prelude
:set -icompiler/profiling
:set -icompiler/rename
:set -icompiler/simplCore
:set -icompiler/simplStg
:set -icompiler/specialise
:set -icompiler/stgSyn
:set -icompiler/stranal
:set -icompiler/typecheck
:set -icompiler/types
:set -icompiler/utils
:set -icompiler/vectorise
:set -ighc
:set -Icompiler
:set -Iincludes
:set -Iincludes/dist-derivedconstants/header
:set -package=ghc-boot-th
:set -DSTAGE=2
:set -DGHCI
:set -DGHC_LOADED_INTO_GHCI
:set -XNoImplicitPrelude

-- make it work for Make stage2
:set -Icompiler/stage2
:set -Icompiler/stage2/build
:set -icompiler/stage2/build

-- make it work for Make stage1
:set -Icompiler/stage1
:set -Icompiler/stage1/build
:set -icompiler/stage1/build

-- make it work for Hadrian stage2
:set -I_build/generated
:set -I_build/stage2/compiler/build
:set -i_build/stage2/compiler/build

-- make it work for Hadrian stage1
:set -I_build/stage1/compiler/build
:set -i_build/stage1/compiler/build

-- -fobject-code is required because bytecode doesn't support unboxed tuples
-- https://ghc.haskell.org/trac/ghc/ticket/1257
:set -odir ./.ghci-objects
:set -hidir ./.ghci-objects
:set -fobject-code

-- Setup args so that running "main" will run ghci and set the prompt to
-- indicate that it is an inner ghci.
:set args --interactive -ghci-script utils/ghc-in-ghci/inner.ghci
