HC = ghc -optl-s -XTemplateHaskell -threaded $(GHC7OPTS)
TIMEVERSION = $(shell $(HCPKG) latest time)
ifneq ($(findstring time-1.1.2, $(TIMEVERSION)),)
TIME_PACKAGE = -DTIME_WITHOUT_TYPEABLE
TARVERSION = $(shell $(HCPKG) latest tar)
ifneq ($(findstring 0.3, $(TARVERSION)),)
TAR_PACKAGE = -DTAR_PACKAGE
UNIXVERSION = $(shell $(HCPKG) latest unix)
ifneq ($(findstring 2., $(UNIXVERSION)),)
ifneq ($(findstring 2.4, $(UNIXVERSION)),)
GLADEVERSION = $(shell $(HCPKG) latest glade)
ifneq ($(findstring 0.1, $(GLADEVERSION)),)
GLADE_PACKAGE = -DGTKGLADE $(SUNRUNPATH)
HASKELINEVERSION = $(shell $(HCPKG) latest haskeline)
ifneq ($(findstring 0.6, $(HASKELINEVERSION)),)
HASKELINE_PACKAGE = -DHASKELINE
HEXPATVERSION = $(shell $(HCPKG) latest hexpat)
ifneq ($(findstring 0.1, $(HEXPATVERSION)),)
HEXPAT_PACKAGE = -DHEXPAT
HTTPVERSION = $(shell $(HCPKG) latest HTTP)
ifneq ($(findstring 4000., $(HTTPVERSION)),)
HTTP_PACKAGE = -DNOMATHSERVER
UNIVERSION = $(shell $(HCPKG) latest uni-uDrawGraph)
ifneq ($(findstring 2., $(UNIVERSION)),)
UNI_PACKAGE = -DUNI_PACKAGE
PROGRAMATICAVERSION = $(shell $(HCPKG) latest programatica)
ifneq ($(findstring 1.0, $(PROGRAMATICAVERSION)),)
PFE_FLAGS = -package programatica -DPROGRAMATICA
WAIEXTVERSION = $(shell $(HCPKG) latest wai-extra)
WAIVERSION = $(shell $(HCPKG) latest wai)
WARPVERSION = $(shell $(HCPKG) latest warp)
ifneq ($(findstring 0.4, $(WARPVERSION)),)
ifneq ($(findstring 0.4, $(WAIEXTVERSION)),)
ifneq ($(findstring 0.2, $(WAIEXTVERSION)),)
ifneq ($(findstring 0.2, $(WAIVERSION)),)
SERVER_FLAG = -DSERVER -DOLDSERVER
PARSEC1VERSION = $(shell $(HCPKG) latest parsec1)
ifneq ($(findstring 1.0., $(PARSEC1VERSION)),)
PARSEC_FLAG = -hide-package parsec -package parsec1
ifneq ($(strip $(UNI_PACKAGE)),)
HC_OPTS_WITHOUTGLADE = $(PARSEC_FLAG) \
$(TIME_PACKAGE) $(TAR_PACKAGE) $(HTTP_PACKAGE) $(UNIX_PACKAGE) \
$(UNI_PACKAGE) $(HASKELINE_PACKAGE) $(HEXPAT_PACKAGE)\
$(PFE_FLAGS) $(SERVER_FLAG) \
# for profiling (or a minimal hets) comment out the previous two package lines
# and the $(GLADE_PACKAGE) below
HC_OPTS = $(HC_OPTS_WITHOUTGLADE) $(GLADE_PACKAGE)