From a0fafeff92725ef29c1e2ed5caf834cba6b59051 Mon Sep 17 00:00:00 2001 From: simonmar Date: Thu, 12 Dec 2002 15:17:53 +0000 Subject: [PATCH] [project @ 2002-12-12 15:17:52 by simonmar] Fix some issues with hschooks.c, and hopefully clear up (or at least document) the mess regarding which versions of Rts.h and RtsFlags.h are included. --- ghc/compiler/Makefile | 8 ++++++-- ghc/compiler/parser/hschooks.c | 34 +++++++++------------------------- 2 files changed, 15 insertions(+), 27 deletions(-) diff --git a/ghc/compiler/Makefile b/ghc/compiler/Makefile index f3142b2..ee0473c 100644 --- a/ghc/compiler/Makefile +++ b/ghc/compiler/Makefile @@ -294,7 +294,11 @@ HS_OBJS += $(C_OBJS) # 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 @@ -328,7 +332,7 @@ SRC_HC_OPTS += -package concurrent -package util 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 diff --git a/ghc/compiler/parser/hschooks.c b/ghc/compiler/parser/hschooks.c index d3836fe..adc985b 100644 --- a/ghc/compiler/parser/hschooks.c +++ b/ghc/compiler/parser/hschooks.c @@ -6,51 +6,37 @@ in instead of the defaults. #include -#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 #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 */ @@ -64,13 +50,11 @@ 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 -- 1.7.10.4