make the smp way RTS-only, normal libraries now work with -smp
[ghc-hetmet.git] / mk / config.mk.in
index af7dbe9..931c4f5 100644 (file)
 # a section corresponding to each of the main .mk files 
 # included by boilerplate.mk (see boilerplate.mk for a list).
 
+ifneq "$(findstring 3.7, $(MAKE_VERSION))" ""
+ifeq "$(findstring 3.79.1, $(MAKE_VERSION))" ""
+$(error GNU make version 3.79.1 or later is required.)
+endif
+endif
 
 ################################################################################
 #
@@ -187,7 +192,7 @@ IncludeExampleDirsInBuild=NO
 
 #
 # Which ways should DocBook XML documents be built?
-# options are: dvi ps pdf html
+# options are: dvi ps pdf html chm HxS
 #
 XMLDocWays=
 
@@ -255,7 +260,11 @@ GhcUnregisterised=NO
 # Target platforms supported:
 #   i386, powerpc
 #   sparc has bitrotted
-ifneq "$(findstring $(HostArch_CPP), i386 powerpc)" ""
+#   AIX is not supported 
+ArchSupportsNCG=$(strip $(patsubst $(HostArch_CPP), YES, $(findstring $(HostArch_CPP), i386 x86_64 powerpc)))
+OsSupportsNCG=$(strip $(patsubst $(HostOS_CPP), YES, $(patsubst aix,,$(HostOS_CPP))))
+
+ifeq "$(OsSupportsNCG)$(ArchSupportsNCG)" "YESYES"
 GhcWithNativeCodeGen=YES
 else
 GhcWithNativeCodeGen=NO
@@ -265,12 +274,14 @@ endif
 GhcWithJavaGen=NO
 
 HaveLibDL = @HaveLibDL@
-HaveRtldNext = @HaveRtldNext@
-HaveRtldLocal = @HaveRtldLocal@
 
-# Include GHCi in the compiler.  Default to NO for the time being.
+# Whether to include GHCi in the compiler.  Depends on whether the RTS linker
+# has support for this OS/ARCH combination.
 
-ifneq "$(findstring $(HostOS_CPP), mingw32 cygwin32 linux solaris2 freebsd netbsd openbsd darwin)" ""
+OsSupportsGHCi=$(strip $(patsubst $(HostOS_CPP), YES, $(findstring $(HostOS_CPP), mingw32 cygwin32 linux solaris2 freebsd netbsd openbsd darwin)))
+ArchSupportsGHCi=$(strip $(patsubst $(HostArch_CPP), YES, $(findstring $(HostArch_CPP), i386 x86_64 powerpc powerpc64 sparc sparc64)))
+
+ifeq "$(OsSupportsGHCi)$(ArchSupportsGHCi)" "YESYES"
 GhcWithInterpreter=YES
 else 
 GhcWithInterpreter=NO
@@ -300,8 +311,10 @@ endif
 # 
 #   thr         : threaded
 #   thr_p       : threaded profiled
+#   s          : smp
 #   debug       : debugging (compile with -g for the C compiler, and -DDEBUG)
 #   debug_p     : debugging profiled
+#   debug_s     : debugging smp
 #   debug_u     : debugging unregisterised
 #   thr_debug   : debugging threaded
 #   thr_debug_p : debugging threaded profiled
@@ -309,7 +322,7 @@ endif
 ifeq "$(BootingFromHc)" "YES"
 GhcRTSWays=
 else
-GhcRTSWays=thr thr_p debug
+GhcRTSWays=thr thr_p s debug debug_s thr_debug
 endif
 
 # Option flags to pass to GHC when it's compiling modules in
@@ -344,11 +357,14 @@ StripLibraries=NO
 #      Don't use -split-objs in in GhcLibHcOpts, because the build
 #              system needs to do other special magic if you are
 #              doing object-file splitting
+ifneq "$(findstring $(HostArch_CPP), i386 x86_64 powerpc sparc)" ""
+SplitObjs=YES
+else
+SplitObjs=NO
+endif
 
 # Don't split object files for libs if we're building DLLs, or booting from
 # .hc files.
-SplitObjs=YES
-
 ifeq "$(DLLized)" "YES"
 SplitObjs=NO
 endif
@@ -358,7 +374,7 @@ endif
 ifeq "$(GhcUnregisterised)" "YES"
 SplitObjs=NO
 endif
-ifeq "$(TARGETPLATFORM)" "ia64-unknown-linux"
+ifeq "$(TargetArch_CPP)" "ia64"
 SplitObjs=NO
 endif
 
@@ -366,8 +382,8 @@ endif
 # Options for GHC's RTS
 
 # For an optimised RTS (you probably don't want to change these; we build
-# a debugging RTS by default now.  Use -package rts_debug to get it).
-GhcRtsHcOpts=-O2
+# a debugging RTS by default now.  Use -debug to get it).
+GhcRtsHcOpts=-optc-O2
 GhcRtsCcOpts=-fomit-frame-pointer
 
 # Include the front panel code?  Needs GTK+.
@@ -467,6 +483,9 @@ NoFibWays = $(GhcLibWays)
 # Haskell compiler options for nofib
 NoFibHcOpts = -O
 
+# Number of times to run each program
+NoFibRuns = 5
+
 # ==============================================================================
 #
 #                      END OF PROJECT-SPECIFIC STUFF
@@ -759,14 +778,14 @@ HaveLibGmp        = @HaveLibGmp@
 LibGmp         = @LibGmp@
 
 #-----------------------------------------------------------------------------
-# Mingwex Library
+# GMP framework (Mac OS X)
 #
-HaveLibMingwEx = @HaveLibMingwEx@
+HaveFrameworkGMP = @HaveFrameworkGMP@
 
 #-----------------------------------------------------------------------------
-# HaskellSupport framework (Mac OS X)
+# Mingwex Library
 #
-HaveFrameworkHaskellSupport = @HaveFrameworkHaskellSupport@
+HaveLibMingwEx = @HaveLibMingwEx@
 
 #-----------------------------------------------------------------------------
 # Flex (currently unused, could be moved to glafp-utils)
@@ -794,6 +813,7 @@ CTAGS                       = $(ETAGS)
 #
 RAWCPP_FLAGS            = -undef -traditional
 FIND                   = @FindCmd@
+SORT                   = @SortCmd@
 INSTALL                        = @INSTALL@
 #
 # Sigh - the autoconf macro for INSTALL will subst a relative path to the fallback
@@ -1030,10 +1050,6 @@ WAY_t_HC_OPTS= -ticky
 WAY_u_NAME=unregisterized (using portable C only)
 WAY_u_HC_OPTS=-unreg
 
-# Way `s':
-WAY_s_NAME=threads (for SMP)
-WAY_s_HC_OPTS=-smp
-
 # Way `mp': 
 WAY_mp_NAME=parallel
 WAY_mp_HC_OPTS=-parallel
@@ -1054,6 +1070,10 @@ WAY_thr_HC_OPTS=-optc-DTHREADED_RTS
 WAY_thr_p_NAME=threaded profiled
 WAY_thr_p_HC_OPTS=-optc-DTHREADED_RTS -prof
 
+# Way `s':
+WAY_s_NAME=threads (for SMP)
+WAY_s_HC_OPTS=-optc-DSMP -optc-DTHREADED_RTS
+
 # Way 'debug':
 WAY_debug_NAME=debug
 WAY_debug_HC_OPTS=-optc-DDEBUG
@@ -1066,6 +1086,10 @@ WAY_debug_p_HC_OPTS=-optc-DDEBUG -prof
 WAY_debug_u_NAME=debug unregisterised
 WAY_debug_u_HC_OPTS=-optc-DDEBUG -unreg
 
+# Way 'debug_s':
+WAY_debug_s_NAME=debug SMP
+WAY_debug_s_HC_OPTS=-optc-DDEBUG -optc-DTHREADED_RTS -optc-DSMP
+
 # Way 'thr_debug':
 WAY_thr_debug_NAME=threaded
 WAY_thr_debug_HC_OPTS=-optc-DTHREADED_RTS -optc-DDEBUG