[commit: ghc] wip/nfs-locking: Remove argConfWith which became redundant. (86b63df)

git at git.haskell.org git at git.haskell.org
Thu Oct 26 23:02:30 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/86b63df1d036247dc78af9ec2eccb7886d0e9503/ghc

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

commit 86b63df1d036247dc78af9ec2eccb7886d0e9503
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Wed Jan 7 01:18:33 2015 +0000

    Remove argConfWith which became redundant.


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

86b63df1d036247dc78af9ec2eccb7886d0e9503
 src/Package/Base.hs |  2 +-
 src/Package/Data.hs | 18 +++++++-----------
 2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/src/Package/Base.hs b/src/Package/Base.hs
index 896bcb3..a895f5f 100644
--- a/src/Package/Base.hs
+++ b/src/Package/Base.hs
@@ -65,7 +65,7 @@ commonCcWarninigArgs :: Args
 commonCcWarninigArgs = when Validating $
        when GccIsClang                                     (arg "-Wno-unknown-pragmas")
     <> when (not GccIsClang && not GccLt46)                (arg "-Wno-error=inline")
-    <> when (    GccIsClang && not GccLt46 && windowsHost) (arg "-Werror=unused-but-set-variable" )
+    <> when (    GccIsClang && not GccLt46 && windowsHost) (arg "-Werror=unused-but-set-variable")
 
 bootPkgConstraints :: Args
 bootPkgConstraints = mempty
diff --git a/src/Package/Data.hs b/src/Package/Data.hs
index b156eaa..0fa1322 100644
--- a/src/Package/Data.hs
+++ b/src/Package/Data.hs
@@ -18,11 +18,7 @@ libraryArgs ways =
 configureArgs :: Stage -> Settings -> Args
 configureArgs stage settings = 
     let argConf :: String -> Args -> Args
-        argConf key as = joinArgs "--configure-option=" key "=" as
-
-        argConfWith key opt = do
-            opts <- showAction opt
-            when (opts /= []) $ argConf ("--with-" ++ key) $ arg opts
+        argConf key as = unless (null <$> as) $ joinArgs "--configure-option=" key "=" as
 
         cflags   = joinArgsSpaced (commonCcArgs `filterOut` ["-Werror"])
                                   (ConfCcArgs stage)
@@ -36,10 +32,10 @@ configureArgs stage settings =
         , argConf "LDFLAGS"  ldflags
         , argConf "CPPFLAGS" cppflags
         , joinArgs "--gcc-options=" cflags " " ldflags
-        , argConfWith "iconv-includes"  IconvIncludeDirs
-        , argConfWith "iconv-libraries" IconvLibDirs
-        , argConfWith "gmp-includes"    GmpIncludeDirs
-        , argConfWith "gmp-libraries"   GmpLibDirs
+        , argConf "--with-iconv-includes"  $ arg IconvIncludeDirs
+        , argConf "--with-iconv-libraries" $ arg IconvLibDirs
+        , argConf "--with-gmp-includes"    $ arg GmpIncludeDirs
+        , argConf "--with-gmp-libraries"   $ arg GmpLibDirs
         , when CrossCompiling $ argConf "--host" $ arg TargetPlatformFull -- TODO: why not host?
         , argConf "--with-cc" $ arg Gcc
         ]
@@ -66,8 +62,8 @@ buildPackageData pkg @ (Package name path _) (stage, dist, settings) =
                     [ args "configure" path dist
                     -- this is a positional argument, hence:
                     -- * if it is empty, we need to emit one empty string argument
-                    -- * if there are many, we must collapse them into one string argument
-                    , joinArgsSpaced $ customDllArgs settings
+                    -- * if there are many, we must collapse them into one space-separated string
+                    , joinArgsSpaced "" (customDllArgs settings)
                     , with $ Ghc stage -- TODO: used to be stage01 (using max Stage1 GHC)
                     , with $ GhcPkg stage
 



More information about the ghc-commits mailing list