# Big Fudge to get around inherent problem that Makefile setup
# has got with 'mkdependC'.
#
-SRC_MKDEPENDC_OPTS += -D__GLASGOW_HASKELL__=$(ProjectVersionInt) -I$(GHC_INCLUDE_DIR)
+SRC_MKDEPENDC_OPTS += -D__GLASGOW_HASKELL__=$(ProjectVersionInt)
+
+# XXX not really correct, hschooks.c actually gets include files like
+# RtsFlags.c from the installed GHC, but we can't tell mkdependC about that.
+SRC_MKDEPENDC_OPTS += -I$(GHC_INCLUDE_DIR)
# -----------------------------------------------------------------------------
# Haskell compilations
endif
endif
-SRC_CC_OPTS += -Iparser -I. -I$(GHC_INCLUDE_DIR) -O
+SRC_CC_OPTS += -Iparser -I. -O
SRC_HC_OPTS += -recomp $(GhcHcOpts) $(GhcStage$(stage)HcOpts)
SRC_HC_OPTS += -H16M
#include <string.h>
-#if __GLASGOW_HASKELL__ >= 400
-#include "../rts/Rts.h"
-#else
-#include "rtsdefs.h"
-#endif
-
-#if __GLASGOW_HASKELL__ >= 505
-#include "../rts/Rts.h"
+/* For GHC 4.08, we are relying on the fact that RtsFlags has
+ * compatibile layout with the current version, because we're
+ * #including the current version of RtsFlags.h below. 4.08 didn't
+ * ship with its own RtsFlags.h, unfortunately. For later GHC
+ * versions, we #include the correct RtsFlags.h.
+ */
+#if __GLASGOW_HASKELL__ < 502
+#include "../includes/Rts.h"
#include "../includes/RtsFlags.h"
#else
#include "Rts.h"
#include "RtsFlags.h"
#endif
-#if __GLASGOW_HASKELL__ >= 502
-#include "RtsFlags.h"
-#endif
-
-#if __GLASGOW_HASKELL__ >= 408
#include "HsFFI.h"
-#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#if __GLASGOW_HASKELL__ >= 504
-
-char *ghc_rts_opts = "-H8m -K8m";
-
-#else
-
void
defaultsHook (void)
{
-#if __GLASGOW_HASKELL__ >= 408
RtsFlags.GcFlags.heapSizeSuggestion = 6*1024*1024 / BLOCK_SIZE;
RtsFlags.GcFlags.maxStkSize = 8*1024*1024 / sizeof(W_);
-#endif
#if __GLASGOW_HASKELL__ >= 411
+ /* GHC < 4.11 didn't have these */
RtsFlags.GcFlags.giveStats = COLLECT_GC_STATS;
RtsFlags.GcFlags.statsFile = stderr;
#endif
}
-#endif
void
enableTimingStats( void ) /* called from the driver */
void
setHeapSize( HsInt size )
{
-#if __GLASGOW_HASKELL__ >= 408
RtsFlags.GcFlags.heapSizeSuggestion = size / BLOCK_SIZE;
if (RtsFlags.GcFlags.maxHeapSize != 0 &&
RtsFlags.GcFlags.heapSizeSuggestion > RtsFlags.GcFlags.maxHeapSize) {
RtsFlags.GcFlags.maxHeapSize = RtsFlags.GcFlags.heapSizeSuggestion;
}
-#endif
}
void