GhcWithNativeCodeGen=NO
endif
+HaveLibDL = @HaveLibDL@
+
# Include GHCi in the compiler. Default to NO for the time being.
-# ifneq "$(findstring $(HostOS_CPP), linux solaris freebsd netbsd openbsd)" ""
-# GhcWithInterpreter=YES
-# else
+ifneq "$(findstring $(HostOS_CPP), linux solaris freebsd netbsd openbsd)" ""
+GhcWithInterpreter=YES
+ifeq "$(HaveLibDL)" "YES"
+SRC_HC_OPTS += -ldl
+endif
+else
GhcWithInterpreter=NO
-# endif
+endif
#
# Building various ways?
BuildingParallel=$(subst mp,YES,$(filter mp,$(WAYS)))
BuildingGranSim=$(subst mg,YES,$(filter mg,$(WAYS)))
-# Include compiler support for letting the compiler (optionally) report
-# your compilation to a central server for generation of fun stats.
-#
-GhcReportCompiles=NO
-
#------------------------------------------------------------------------------
# Options for GHC's Prelude
#
ReadlineIncludePath=
+# Math library
+LIBM=@LIBM@
+
# Build the Haskell OpenGL/GLUT binding?
#
GhcLibsWithHOpenGL=@GhcLibsWithHOpenGL@
################################################################################
# Directory used by GHC (and possibly other tools) for storing
-# temporary files. If your /tmp isn't big enough, either override
+# temporary files. If your TMPDIR isn't big enough, either override
# this in build.mk or set your environment variable "TMPDIR" to point
# to somewhere with more space. (TMPDIR=. is a good choice).
FPTOOLS_TOP_ABS = @hardtop@
ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
-FPTOOLS_TOP_ABS = $(patsubst /cygdrive/%/,%:/,@hardtop@)
+FPTOOLS_TOP_ABS = $(subst \,/,$(shell cygpath -w @hardtop@))
endif
ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
-FPTOOLS_TOP_ABS = $(patsubst /cygdrive/%/,%:/,@hardtop@)
+FPTOOLS_TOP_ABS = $(subst \,/,$(shell cygpath -w @hardtop@))
endif
#
#
# Options to pass to Happy when we're going to compile the output with GHC
#
-GHC_HAPPY_OPTS = $(shell if expr $(HAPPY_VERSION) \< "1.8" >/dev/null; then echo -g; else echo -agc; fi)
+GHC_HAPPY_OPTS = $(shell if ( test `echo $(HAPPY_VERSION) | sed -e "s/\(.*\)\..*/\1/g"` "-gt" "1" || test `echo $(HAPPY_VERSION) | sed -e "s/.*\.\(.*\)/\1/g"` "-ge" "9" ); then echo -agc; else echo -g; fi)
#
# Stuff from fptools/literate