Refactor, and improve error messages (cf Trac #3395)
[ghc-hetmet.git] / mk / config.mk.in
index 1e2bde0..5e8e265 100644 (file)
@@ -107,7 +107,12 @@ GhcDebugged=NO
 GhcLibProfiled=$(if $(filter p,$(GhcLibWays)),YES,NO)
 
 # Build shared and/or static libs?
-BuildSharedLibs=@BuildSharedLibs@
+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@
 
@@ -177,6 +182,16 @@ else
 GhcEnableTablesNextToCode=YES
 endif
 
+# Whether to use libffi for adjustors (foreign import "wrapper") or
+# not.  If we have built-in support (rts/Adjustor.c) then we use that,
+# otherwise we fall back on libffi, which is slightly slower.
+ArchHasAdjustorSupport=$(strip $(if $(findstring $(HostArch_CPP),i386 x86_64 alpha powerpc ia64,),YES,NO))
+ifeq "$(ArchHasAdjustorSupport)" "YES"
+UseLibFFIForAdjustors=NO
+else
+UseLibFFIForAdjustors=YES
+endif
+
 # On Windows we normally want to make a relocatable bindist, to we
 # ignore flags like libdir
 ifeq "$(Windows)" "YES"
@@ -195,25 +210,6 @@ BeConservative = NO
 BuildingParallel=$(subst mp,YES,$(filter mp,$(WAYS)))
 BuildingGranSim=$(subst mg,YES,$(filter mg,$(WAYS)))
 
-# Interface file version (hi-boot files only)
-#
-# A GHC built with HscIfaceFileVersion=n will look for 
-#      M.hi-boot-n, and only then for 
-#      M.hi-boot.
-# (It'll be happy with the latter if the former doesn't exist.)
-#
-#
-# This variable is used ONLY for hi-boot files.  Its only purpose is
-# to allow you to have a single directory with multiple .hi-boot files
-# for the same module, each corresponding to a different version of
-# GHC.
-#
-# HscIfaceFileVersion is propagated to hsc via
-# compiler/main/Config.hs, which is automatically generated by
-# compiler/Makefile.
-
-HscIfaceFileVersion=6
-
 #------------------------------------------------------------------------------
 # Options for Libraries
 
@@ -380,6 +376,9 @@ BIN_DIST_PREP_DIR=$(TOP)/bindist-prep
 BIN_DIST_PREP=$(BIN_DIST_PREP_DIR)/$(BIN_DIST_NAME)
 BIN_DIST_LIST=$(TOP)/bindist-list
 
+WINDOWS_INSTALLER_BASE = ghc-$(ProjectVersion)-i386-windows
+WINDOWS_INSTALLER = $(WINDOWS_INSTALLER_BASE)$(exeext)
+
 # Definition of installation directories, we don't use half of these, but since
 # the configure script has them on offer while passing through, we might as well
 # set them. Note that we have to be careful, because the GNU coding standards
@@ -500,13 +499,16 @@ INSTALL_GROUP =
 # Invocations of `install' for the four different classes
 # of targets:
 #
+CREATE_SCRIPT   = create () { touch $$1 && chmod 755 $$1 ; } && create
+CREATE_DATA     = create () { touch $$1 && chmod 644 $$1 ; } && create
 INSTALL_PROGRAM = $(INSTALL) -m 755
 INSTALL_SCRIPT  = $(INSTALL) -m 755
 INSTALL_SHLIB   = $(INSTALL) -m 755
 INSTALL_DATA    = $(INSTALL) -m 644
 INSTALL_HEADER  = $(INSTALL) -m 644
 INSTALL_MAN     = $(INSTALL) -m 644
-INSTALL_DIR     = $(MKDIRHIER)
+INSTALL_DOC     = $(INSTALL) -m 644
+INSTALL_DIR     = $(INSTALL) -m 755 -d
 
 #
 # runhaskell and hsc2hs are special, in that other compilers besides
@@ -698,20 +700,6 @@ SRC_HSC2HS_OPTS += $(addprefix --cflag=,$(filter-out -O,$(SRC_CC_OPTS)))
 SRC_HSC2HS_OPTS += $(foreach d,$(GMP_INCLUDE_DIRS),-I$(d))
 
 #-----------------------------------------------------------------------------
-# GMP Library (version 2.0.x or above)
-#
-HaveLibGmp     = @HaveLibGmp@
-LibGmp         = @LibGmp@
-
-GMP_INCLUDE_DIRS=@GMP_INCLUDE_DIRS@
-GMP_LIB_DIRS=@GMP_LIB_DIRS@
-
-#-----------------------------------------------------------------------------
-# GMP framework (Mac OS X)
-#
-HaveFrameworkGMP = @HaveFrameworkGMP@
-
-#-----------------------------------------------------------------------------
 # Mingwex Library
 #
 HaveLibMingwEx = @HaveLibMingwEx@
@@ -929,7 +917,7 @@ endif
 #
 # The ways currently defined.
 #
-ALL_WAYS=v p t l s mp mg debug dyn thr thr_l debug_dyn thr_dyn thr_debug_dyn thr_p thr_debug thr_debug_l
+ALL_WAYS=v p t l s mp mg debug dyn thr thr_l debug_dyn thr_dyn thr_debug_dyn thr_p thr_debug thr_debug_l debug_p thr_debug_p
 USER_WAYS=a b c d e f g h j k l m n o A B
 
 #