add --enable-shared to configure, and $(BuildSharedLibs) to the build system
[ghc-hetmet.git] / mk / config.mk.in
index 3391f17..f42e5fa 100644 (file)
@@ -242,6 +242,11 @@ GhcStage3HcOpts=-O2
 GhcProfiled=NO
 GhcDebugged=NO
 
+# Build shared and/or static libs?
+BuildSharedLibs=@BuildSharedLibs@
+# ToDo later:
+# BuildStaticLibs=@BuildStaticLibs@
+
 # Build a compiler that will build *unregisterised* libraries and
 # binaries by default.  Unregisterised code is supposed to compile and
 # run without any support for architecture-specific assembly mangling,
@@ -362,6 +367,10 @@ else
 GhcLibWays=p
 endif
 
+ifeq "$(BuildSharedLibs)" "YES"
+GhcLibWays += dyn
+endif
+
 # In addition, the RTS is built in some further variations.  Ways that
 # make sense here:
 # 
@@ -381,6 +390,10 @@ ifeq "$(BootingFromHc)" "NO"
 GhcRTSWays += debug 
 endif
 
+ifeq "$(BuildSharedLibs)" "YES"
+GhcRTSWays += debug_dyn 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.
@@ -868,9 +881,9 @@ NHC         = @NHC@
 # tree).  We can refer to "this ghc" as $(GHC_INPLACE):
 
 GHC_INPLACE = $(GHC_STAGE1)
-GHC_STAGE1  = $(GHC_COMPILER_DIR_ABS)/stage1-inplace/bin/ghc
-GHC_STAGE2  = $(GHC_COMPILER_DIR_ABS)/stage2-inplace/bin/ghc
-GHC_STAGE3  = $(GHC_COMPILER_DIR_ABS)/stage3-inplace/bin/ghc
+GHC_STAGE1  = $(GHC_COMPILER_DIR_ABS)/stage1-inplace/ghc
+GHC_STAGE2  = $(GHC_COMPILER_DIR_ABS)/stage2-inplace/ghc
+GHC_STAGE3  = $(GHC_COMPILER_DIR_ABS)/stage3-inplace/ghc
 # XXX All those used to have -no-user-package-conf, but then we can't
 # pass them to Cabal