#ifndef GhcVersionInUse
# define GhcVersionInUse 27
#endif

#if GhcVersionInUse >= 19
# define if19plus(x) x
#else
# define if19plus(x) /*nothing*/
#endif

#if GhcVersionInUse >= 24
# define if24plus(x) x
#else
# define if24plus(x) /*nothing*/
#endif

#if GhcVersionInUse >= 27
# define if27plus(x) x
#else
# define if27plus(x) /*nothing*/
#endif

MKDEPENDHS_OPTS= -irequired:glaExts:ghc

/* these flags worked all the way back to 0.10: */
#define _Hm(n) CAT3(-Rmax-heapsize,n,000000)
#define _Km(n) CAT3(-Rmax-stksize,n,000000)
#define _Kk(n) CAT3(-Rmax-stksize,n,000)
HC_OPTS_anna	= _Hm(16)
HC_OPTS_anna_BaseDefs = -cpp

HC_OPTS_bspt_BSPT	= if27plus(-fno-all-strict)
HC_OPTS_bspt_Euclid	= if27plus(-fno-all-strict)
HC_OPTS_bspt_EuclidGMS	= if27plus(-fno-all-strict)
HC_OPTS_bspt_GeomNum	= if27plus(-fno-all-strict) -cpp
HC_OPTS_bspt_Init	= if27plus(-fno-all-strict)
HC_OPTS_bspt_Input	= if27plus(-fno-all-strict) _Hm(24)
HC_OPTS_bspt_Interface	= if27plus(-fno-all-strict)
HC_OPTS_bspt_Interpret	= if27plus(-fno-all-strict)
HC_OPTS_bspt_Libfuns	= if27plus(-fno-all-strict)
HC_OPTS_bspt_MGRlib	= if27plus(-fno-all-strict)
HC_OPTS_bspt_Main	= if27plus(-fno-all-strict) -cpp
HC_OPTS_bspt_Merge	= if27plus(-fno-all-strict)
HC_OPTS_bspt_Params	= if27plus(-fno-all-strict)
HC_OPTS_bspt_Prog	= if27plus(-fno-all-strict) -cpp
HC_OPTS_bspt_Rationals	= if27plus(-fno-all-strict)
HC_OPTS_bspt_Render	= if27plus(-fno-all-strict)
HC_OPTS_bspt_Stdlib	= if27plus(-fno-all-strict)

HC_OPTS_compress_Encode  = -cpp _Hm(12)
HC_OPTS_compress2 = -cpp if19plus(-syslib hbc)
HC_OPTS_compress2_WriteRoutines = if24plus(-monly-4-regs)
NOFIB_RUN_compress2 = +RTS -H16m -RTS

HC_OPTS_fluid	= _Hm(12)
HC_OPTS_fluid_Main = -cpp

HC_OPTS_gg	= _Hm(12)

HC_OPTS_HMMS	= if19plus(-syslib hbc)
HC_OPTS_HMMS_MaybeStateT = -cpp
HC_OPTS_HMMS_BatchAlign = -cpp

HC_OPTS_hpg	= _Hm(8)
HC_OPTS_infer	= _Km(2)
HC_OPTS_lift	= _Hm(8) _Km(1)
HC_OPTS_mkhprog	= _Hm(12)
HC_OPTS_parser	= _Hm(30) _Km(1)
HC_OPTS_prolog	= _Hm(8)
HC_OPTS_reptile	= _Hm(10) _Km(1)
HC_OPTS_simple  = _Hm(12)

HC_OPTS_veritas	= _Hm(14) _Km(1)
HC_OPTS_veritas_Main	= -cpp
HC_OPTS_veritas_Parse	= _Hm(18)

NOFIB_RUN_symalg = +RTS -H64m -RTS
HC_OPTS_awards = if19plus(-syslib hbc)
HC_OPTS_boyer_Main = _Hm(16)
HC_OPTS_cichelli = -cpp
HC_OPTS_fibheaps = -fglasgow-exts -cpp
NOFIB_RUN_fibheaps = +RTS -K2m -RTS
HC_OPTS_knights_Sort = -cpp
HC_OPTS_knights_ChessSetList = _Hm(14)
HC_OPTS_multiplier_Main = _Hm(14)
HC_OPTS_minimax = -cpp
HC_OPTS_rewrite_Main = _Hm(14)
/* HC_OPTS_fft_Word = -fglasgow-exts */

HC_OPTS_comp_lab_zift	= -cpp if19plus(-syslib hbc)
HC_OPTS_event		= -cpp if19plus(-syslib hbc)
HC_OPTS_fft		= -cpp if19plus(-syslib hbc) if24plus(-monly-4-regs)
HC_OPTS_genfft		= -cpp if19plus(-syslib hbc) if24plus(-monly-4-regs)
HC_OPTS_ida		= -cpp if19plus(-syslib hbc)
HC_OPTS_listcompr	= -cpp if19plus(-syslib hbc)
HC_OPTS_listcopy	= -cpp if19plus(-syslib hbc)
HC_OPTS_parstof		= -cpp if19plus(-syslib hbc) _Hm(30) _Km(1) if24plus(-monly-4-regs)
HC_OPTS_sched		= -cpp if19plus(-syslib hbc)
HC_OPTS_solid		= -cpp if19plus(-syslib hbc) _Hm(30) _Km(3)
HC_OPTS_transform	= -cpp if19plus(-syslib hbc) _Hm(12)
HC_OPTS_typecheck	= -cpp if19plus(-syslib hbc)
HC_OPTS_wang		= -cpp if19plus(-syslib hbc)
HC_OPTS_wave4main	= -cpp if19plus(-syslib hbc) _Hm(12) if24plus(-monly-4-regs)

HC_OPTS_nucleic2	= -cpp /*-DUSE_UNBOXED_FLOATS -DUSE_GLASGOW_HACKS*/ /*nope:-DUSE_HARTEL_LAZINESS*/ -fglasgow-exts

HC_OPTS_editor3 = if19plus(-syslib posix)

HC_OPTS_haskelldraw = -fglasgow-exts -L/usr/openwin/lib -L/usr/X11/lib -lXol -lXt -lXpm -lX11

HC_OPTS_happy = -cpp -fglasgow-exts

HC_OPTS_lolita = -cpp if19plus(-syslib hbc) if19plus(-syslib ghc) -fglasgow-exts -iutils:StaticNet:controls:tomita
HC_OPTS_lolita_FeatureType = -Onot _Km(4) /* sigh */
HC_OPTS_lolita_Roles = _Km(4)
HC_OPTS_lolita_IMain = _Km(4)
HC_OPTS_lolita_Dial_EmCausePB = -fno-update-analysis /* sigh */
HC_OPTS_lolita_Dial_EmShowPB = -fno-update-analysis /* sigh */
HC_OPTS_lolita_Dial_EmReact = -fno-update-analysis /* sigh */
HC_OPTS_lolita_ExtractRootItal = -fno-update-analysis /* sigh */

HC_OPTS_nhccomp = -cpp if19plus(-syslib hbc)
HC_OPTS_linsolv = -fglasgow-exts -cpp -UNO_FILTER -DASYM_CRA -DGUM -DPAR_DET_SZ=4 -DINPUT_SIZE=4
HC_OPTS_dcbm    = -fglasgow-exts -cpp -DPAR 

NOFIB_RUN_exp3_8 = +RTS -K1m -RTS
NOFIB_RUN_fulsom  = +RTS -H12m -RTS

NOFIB_RUN_gamteb  = +RTS -K1500k -RTS	/* SIGH */

NOFIB_RUN_hidden  = +RTS -K1m -RTS	/* fairly random number; SIGH */

/*??? NOFIB_RUN_HMMS	  = +RTS -H54M -K1M -RTS*/
NOFIB_RUN_reptile = +RTS -H6m -RTS

NOFIB_RUN_life	   = +RTS -H32m -RTS

NOFIB_RUN_maillist = +RTS -K100k -RTS

NOFIB_RUN_cichelli = +RTS -H6m -RTS

NOFIB_RUN_comp_lab_zift	= +RTS -H20m -K10m -RTS
NOFIB_RUN_event		= +RTS -H24m -K4500k -RTS
NOFIB_RUN_fft		= +RTS -H24m -K1m -RTS
NOFIB_RUN_genfft	= +RTS -H20m -K10m -RTS
NOFIB_RUN_ida		= +RTS -H24m -K1m -RTS
NOFIB_RUN_listcompr	= +RTS -H24m -K1m -RTS
NOFIB_RUN_listcopy	= +RTS -H24m -K1m -RTS
NOFIB_RUN_parstof	= +RTS -H24m -K1m -RTS
NOFIB_RUN_sched		= +RTS -H24m -K1m -RTS
NOFIB_RUN_solid		= +RTS -H24m -K1m -RTS
NOFIB_RUN_transform	= +RTS -H24m -K1m -RTS
NOFIB_RUN_typecheck	= +RTS -H24m -K6m -RTS
NOFIB_RUN_wang		= +RTS -H24m -K6m -RTS
NOFIB_RUN_wave4main	= +RTS -H24m -K1m -RTS

NOFIB_RUN_clausify  = +RTS -K200k -RTS

NOFIB_RUN_simple    = +RTS -H16m -K1m -RTS

NOFIB_RUN_treejoin  = +RTS -H32m -K2m

NOFIB_RUN_exp3_8    = +RTS -K300k -RTS
NOFIB_RUN_primes    = +RTS -H16m -RTS

/* **********  END OF all that follows ... ************* */
#if IncludeGHC_ONLYNoFibTests == YES

HC_OPTS_cg012 = -fglasgow-exts
HC_OPTS_cg015 = -fglasgow-exts
HC_OPTS_cg018 = -fglasgow-exts
HC_OPTS_cg025 = if19plus(-syslib hbc)
HC_OPTS_cg026 = -fglasgow-exts
HC_OPTS_cg029 = -fglasgow-exts
HC_OPTS_cg030 = -fglasgow-exts
HC_OPTS_cg031 = -fglasgow-exts
HC_OPTS_cg032 = -fglasgow-exts
HC_OPTS_cg033 = -fglasgow-exts
HC_OPTS_cg035 = -fglasgow-exts -fvia-C /*'-#include"math.h"'*/
HC_OPTS_cg036 = -fglasgow-exts

HC_OPTS_ghclib001 = if19plus(-syslib ghc)
NOFIB_RUN_ghclib001 = +RTS -H16m -K8m -RTS

NOFIB_RUN_cg021 = +RTS -H15000k -K4500k -RTS

NOFIB_RUN_cg022 = +RTS -H10m -RTS

HC_OPTS_cg023 = _Hm(14)
NOFIB_RUN_cg023 = +RTS -H32k -RTS
	/* the whole point of cg023 is that it runs in small space */

HC_OPTS_arith005 = -cpp -fno-update-analysis/*sigh*/

HC_OPTS_io009 = if19plus(-syslib hbc)
HC_OPTS_io012 = if19plus(-syslib ghc)
HC_OPTS_io018 = if19plus(-syslib ghc)
HC_OPTS_io019 = if19plus(-syslib ghc -syslib posix)
HC_OPTS_io020 = if19plus(-syslib ghc -syslib posix)

HC_OPTS_po001 = if19plus(-syslib posix -syslib ghc)
HC_OPTS_po002 = if19plus(-syslib posix)
HC_OPTS_po003 = if19plus(-syslib posix)
HC_OPTS_po004 = if19plus(-syslib posix) -fvia-C
HC_OPTS_po005 = if19plus(-syslib posix)
HC_OPTS_po006 = if19plus(-syslib posix)
HC_OPTS_po007 = if19plus(-syslib posix) -fvia-C
HC_OPTS_po008 = if19plus(-syslib posix) -fvia-C
HC_OPTS_po009 = if19plus(-syslib posix) -fvia-C
HC_OPTS_po010 = if19plus(-syslib posix)
HC_OPTS_po011 = if19plus(-syslib posix)
HC_OPTS_po012 = if19plus(-syslib posix) -fvia-C /*??? '-#include"libposix.h"' */

HC_OPTS_net001 = if19plus(-syslib ghc)
HC_OPTS_net002 = if19plus(-syslib ghc)
HC_OPTS_net003 = if19plus(-syslib ghc)
HC_OPTS_net004 = if19plus(-syslib ghc)
HC_OPTS_net005 = if19plus(-syslib ghc)
HC_OPTS_net006 = if19plus(-syslib ghc)
HC_OPTS_net007 = if19plus(-syslib ghc) if19plus(-syslib posix)
HC_OPTS_net008 = if19plus(-syslib ghc) if19plus(-syslib posix)

HC_OPTS_stable001 = -fvia-C -fglasgow-exts
NOFIB_RUN_stable001 = +RTS -H10k -RTS

/* specialisation tests, esp for unboxed specialisation */
HC_OPTS_spec001	    = -fglasgow-exts
HC_OPTS_spec003	    = -fglasgow-exts
HC_OPTS_clausify001 = -fglasgow-exts
HC_OPTS_clausify002 = -fglasgow-exts
HC_OPTS_clausify003 = -fglasgow-exts

/* keep the heap down on 10queens in the hope it will not "loop" */
NOFIB_RUN_10queens = +RTS -H1m -RTS

HC_OPTS_fast2haskell = _Hm(20)
HC_OPTS_fast2haskell_Word2 = -fglasgow-exts

HC_OPTS_cvh_unboxing = -fglasgow-exts

HC_OPTS_areid_pass = -fglasgow-exts

NOFIB_RUN_jules_xref = +RTS -K1m -H20m -RTS

NOFIB_RUN_life_space_leak = +RTS -H32m -RTS

HC_OPTS_north_lias = _Hm(32)

HC_OPTS_zhang_ccall = -fglasgow-exts

HC_OPTS_dmgob_native1 = if19plus(-syslib hbc)
HC_OPTS_dmgob_native1_MaybeStateT = -cpp

HC_OPTS_dmgob_native2 = if19plus(-syslib hbc) -cpp

HC_OPTS_andy_cherry = -cpp
HC_OPTS_ipoole_spec_class = -cpp
HC_OPTS_waugh_neural = if19plus(-syslib hbc)

#endif /* IncludeGHC_ONLYNoFibTests */
