Fix build with GHC <= 6.10.1
[ghc-hetmet.git] / mk / config.mk.in
index e1d79cf..6516238 100644 (file)
@@ -35,12 +35,9 @@ include $(TOP)/mk/install.mk
 ################################################################################
 
 # BootingFromHc - build GHC and the libraries from .hc files?
+# (unregisterised only)
 BootingFromHc = @BootingFromHc@
 
-# BootingFromUnregisterisedHc - treat .hc files as containing unregisterised
-# rather than registerised code, i.e., disable the mangler?
-BootingFromUnregisterisedHc = @BootingFromUnregisterisedHc@
-
 NO_INCLUDE_DEPS = NO
 NO_INCLUDE_PKGDATA = NO
 
@@ -105,13 +102,9 @@ GhcProfiled=NO
 GhcDebugged=NO
 GhcLibProfiled=$(if $(filter p,$(GhcLibWays)),YES,NO)
 
-# Build shared and/or static libs?
+# Do we support shared libs?
 PlatformSupportsSharedLibs = $(if $(filter $(TARGETPLATFORM),i386-unknown-linux x86_64-unknown-linux),YES,NO)
-ifeq "$(PlatformSupportsSharedLibs)" "YES"
-BuildSharedLibs = YES
-else
-BuildSharedLibs = NO
-endif
+
 # ToDo later:
 # BuildStaticLibs=@BuildStaticLibs@
 
@@ -224,10 +217,13 @@ ifneq "$(BootingFromHc)" "YES"
 GhcLibWays += p
 endif
 
-ifeq "$(BuildSharedLibs)" "YES"
+ifeq "$(PlatformSupportsSharedLibs)" "YES"
 GhcLibWays += dyn
 endif
 
+# Handy way to test whether we're building shared libs or not.
+BuildSharedLibs=$(strip $(if $(findstring dyn,$(GhcLibWays)),YES,NO))
+
 # In addition, the RTS is built in some further variations.  Ways that
 # make sense here:
 # 
@@ -249,15 +245,12 @@ ifeq "$(BootingFromHc)" "NO"
 GhcRTSWays += debug 
 endif
 
-ifeq "$(BuildSharedLibs)" "YES"
-GhcRTSWays += dyn debug_dyn $(if $(findstring NO, $(GhcUnregisterised)),thr_dyn thr_debug_dyn)
-endif
-
 # Want the threaded versions unless we're unregisterised
 # Defer the check until later by using $(if..), because GhcUnregisterised might
 # be set in build.mk, which hasn't been read yet.
 GhcRTSWays += $(if $(findstring NO, $(GhcUnregisterised)),thr thr_debug thr_l,)
 GhcRTSWays += $(if $(findstring p, $(GhcLibWays)),$(if $(findstring NO, $(GhcUnregisterised)),thr_p,),)
+GhcRTSWays += $(if $(findstring dyn, $(GhcLibWays)), dyn debug_dyn $(if $(findstring NO, $(GhcUnregisterised)),thr_dyn thr_debug_dyn),)
 
 # We can only build GHCi threaded if we have a threaded RTS:
 GhcThreaded = $(if $(findstring thr,$(GhcRTSWays)),YES,NO)
@@ -507,7 +500,7 @@ INSTALL_GHC_STAGE=2
 
 BOOTSTRAPPING_CONF = libraries/bootstrapping.conf
 
-INPLACE_PACKAGE_CONF = $(INPLACE_LIB)/package.conf
+INPLACE_PACKAGE_CONF = $(INPLACE_LIB)/package.conf.d
 
 GhcVersion     = @GhcVersion@
 GhcPatchLevel  = @GhcPatchLevel@
@@ -515,6 +508,7 @@ GhcMajVersion       = @GhcMajVersion@
 GhcMinVersion  = @GhcMinVersion@
 
 ghc_ge_609 = @ghc_ge_609@
+ghc_ge_6102 = @ghc_ge_6102@
 
 # Canonicalised ghc version number, used for easy (integer) version
 # comparisons.  We must expand $(GhcMinVersion) to two digits by
@@ -545,12 +539,13 @@ else
 endif
 endif
 
-# default C compiler and linker flags
-SRC_CC_OPTS = @SRC_CC_OPTS@
-SRC_LD_OPTS = @SRC_LD_OPTS@
+# C compiler and linker flags from configure (e.g. -m<blah> to select
+# correct C compiler backend).
+CONF_CC_OPTS = @CONF_CC_OPTS@
+CONF_LD_OPTS = @CONF_LD_OPTS@
 
 ifeq "$(TARGETPLATFORM)" "ia64-unknown-linux"
-SRC_CC_OPTS += -G0
+CONF_CC_OPTS += -G0
 endif
 
 SRC_HSC2HS_OPTS += $(addprefix --cflag=,$(filter-out -O,$(SRC_CC_OPTS)))