[commit: testsuite] master: Add a -static way, enabled only if dynlibs are used by default (64529d6)

Ian Lynagh <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/64529d67006023c8bfe587083688221c99a9a4f6

>---------------------------------------------------------------

commit 64529d67006023c8bfe587083688221c99a9a4f6
Author: Ian Lynagh <[email protected]>
Date:   Wed Oct 3 17:58:50 2012 +0100

    Add a -static way, enabled only if dynlibs are used by default

>---------------------------------------------------------------

 config/ghc       |    5 +++++
 mk/ghc-config.hs |    1 +
 mk/test.mk       |    6 ++++++
 3 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/config/ghc b/config/ghc
index 8c8c329..c2f80f8 100644
--- a/config/ghc
+++ b/config/ghc
@@ -56,6 +56,9 @@ if (ghc_with_dynamic_rts == 1):
     config.have_shared_libs = True
     config.run_ways.append('dyn')
 
+if (ghc_dynamic_by_default == 1):
+    config.run_ways.append('static')
+
 if (ghc_with_profiling == 1 and ghc_with_threaded_rts == 1):
     config.run_ways.append('profthreaded')
 
@@ -90,6 +93,7 @@ config.way_flags = {
     'prof_hy'      : ['-O', '-prof', '-auto-all'],
     'prof_hr'      : ['-O', '-prof', '-auto-all'],
     'dyn'          : ['-O', '-dynamic'],
+    'static'       : ['-O', '-static'],
     # llvm variants...
     'profllvm'         : ['-prof', '-auto-all', '-fllvm'],
     'profoptllvm'      : ['-O', '-prof', '-auto-all', '-fllvm'],
@@ -123,6 +127,7 @@ config.way_rts_flags = {
     'prof_hy'      : ['-hy'],
     'prof_hr'      : ['-hr'],
     'dyn'          : [],
+    'static'       : [],
     # llvm variants...
     'profllvm'         : ['-p'],
     'profoptllvm'      : ['-hc', '-p'],
diff --git a/mk/ghc-config.hs b/mk/ghc-config.hs
index 5ab49eb..77efbcd 100644
--- a/mk/ghc-config.hs
+++ b/mk/ghc-config.hs
@@ -22,6 +22,7 @@ main = do
   getGhcField fields "GhcUnregisterised" "Unregisterised"
   getGhcField fields "GhcWithSMP" "Support SMP"
   getGhcField fields "GhcRTSWays" "RTS ways"
+  getGhcField fields "GhcDynamicByDefault" "Dynamic by default"
   getGhcFieldProgWithDefault fields "AR" "ar command" "ar"
 
   let pkgdb_flag = case lookup "Project version" fields of
diff --git a/mk/test.mk b/mk/test.mk
index 6fc9afa..882ae60 100644
--- a/mk/test.mk
+++ b/mk/test.mk
@@ -80,6 +80,12 @@ else
 RUNTEST_OPTS += -e ghc_unregisterised=0
 endif
 
+ifeq "$(GhcDynamicByDefault)" "YES"
+RUNTEST_OPTS += -e ghc_dynamic_by_default=1
+else
+RUNTEST_OPTS += -e ghc_dynamic_by_default=0
+endif
+
 ifeq "$(GhcWithSMP)" "YES"
 RUNTEST_OPTS += -e ghc_with_smp=1
 else
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.