fix "dirs" to "dir" for gmp and iconv libraries
authorKarel Gardas <karel.gardas@centrum.cz>
Tue, 19 Jan 2016 06:38:52 +0000 (07:38 +0100)
committerKarel Gardas <karel.gardas@centrum.cz>
Tue, 19 Jan 2016 06:38:52 +0000 (07:38 +0100)
cfg/system.config.in
src/Oracles/Config/Setting.hs
src/Rules/Gmp.hs
src/Settings/Builders/GhcCabal.hs
src/Settings/Builders/Hsc2Hs.hs

index 126387f..0eb775a 100644 (file)
@@ -100,11 +100,11 @@ conf-ld-linker-args-stage2  = @CONF_LD_LINKER_OPTS_STAGE2@
 # Include and library directories:\r
 #=================================\r
 \r
-iconv-include-dirs = @ICONV_INCLUDE_DIRS@\r
-iconv-lib-dirs     = @ICONV_LIB_DIRS@\r
+iconv-include-dir = @ICONV_INCLUDE_DIRS@\r
+iconv-lib-dir     = @ICONV_LIB_DIRS@\r
 \r
-gmp-include-dirs   = @GMP_INCLUDE_DIRS@\r
-gmp-lib-dirs       = @GMP_LIB_DIRS@\r
+gmp-include-dir   = @GMP_INCLUDE_DIRS@\r
+gmp-lib-dir       = @GMP_LIB_DIRS@\r
 \r
 use-system-ffi     = @UseSystemLibFFI@\r
 ffi-include-dir   = @FFIIncludeDir@\r
index f4540cc..3502929 100644 (file)
@@ -49,16 +49,16 @@ data Setting = BuildArch
              | TargetVendor
              | FfiIncludeDir
              | FfiLibDir
+             | GmpIncludeDir
+             | GmpLibDir
+             | IconvIncludeDir
+             | IconvLibDir
 
 data SettingList = ConfCcArgs Stage
                  | ConfCppArgs Stage
                  | ConfGccLinkerArgs Stage
                  | ConfLdLinkerArgs Stage
-                 | GmpIncludeDirs
-                 | GmpLibDirs
                  | HsCppArgs
-                 | IconvIncludeDirs
-                 | IconvLibDirs
 
 setting :: Setting -> Action String
 setting key = askConfig $ case key of
@@ -92,6 +92,10 @@ setting key = askConfig $ case key of
     TargetVendor       -> "target-vendor"
     FfiIncludeDir      -> "ffi-include-dir"
     FfiLibDir          -> "ffi-lib-dir"
+    GmpIncludeDir      -> "gmp-include-dir"
+    GmpLibDir          -> "gmp-lib-dir"
+    IconvIncludeDir    -> "iconv-include-dir"
+    IconvLibDir        -> "iconv-lib-dir"
 
 settingList :: SettingList -> Action [String]
 settingList key = fmap words $ askConfig $ case key of
@@ -99,11 +103,7 @@ settingList key = fmap words $ askConfig $ case key of
     ConfCppArgs       stage -> "conf-cpp-args-"        ++ stageString stage
     ConfGccLinkerArgs stage -> "conf-gcc-linker-args-" ++ stageString stage
     ConfLdLinkerArgs  stage -> "conf-ld-linker-args-"  ++ stageString stage
-    GmpIncludeDirs          -> "gmp-include-dirs"
-    GmpLibDirs              -> "gmp-lib-dirs"
     HsCppArgs               -> "hs-cpp-args"
-    IconvIncludeDirs        -> "iconv-include-dirs"
-    IconvLibDirs            -> "iconv-lib-dirs"
 
 getSetting :: Setting -> ReaderT a Action String
 getSetting = lift . setting
index ec14b36..702e645 100644 (file)
@@ -62,10 +62,10 @@ configureArguments = do
 
 configureIntGmpArguments :: Action [String]
 configureIntGmpArguments = do
-    includes      <- settingList GmpIncludeDirs
-    libs          <- settingList GmpLibDirs
-    return $ map ("--with-gmp-includes=" ++) includes
-          ++ map ("--with-gmp-libraries=" ++) libs
+    includes      <- setting GmpIncludeDir
+    libs          <- setting GmpLibDir
+    return $ map ("--with-gmp-includes=" ++) [includes]
+          ++ map ("--with-gmp-libraries=" ++) [libs]
 
 -- TODO: we rebuild gmp every time.
 gmpRules :: Rules ()
index 06787c5..51d0e6b 100644 (file)
@@ -79,10 +79,10 @@ configureArgs = do
         , conf "LDFLAGS"  ldFlags
         , conf "CPPFLAGS" cppFlags
         , appendSubD "--gcc-options" $ cFlags <> ldFlags
-        , conf "--with-iconv-includes"    $ argSettingList IconvIncludeDirs
-        , conf "--with-iconv-libraries"   $ argSettingList IconvLibDirs
-        , conf "--with-gmp-includes"      $ argSettingList GmpIncludeDirs
-        , conf "--with-gmp-libraries"     $ argSettingList GmpLibDirs
+        , conf "--with-iconv-includes"    $ argSetting IconvIncludeDir
+        , conf "--with-iconv-libraries"   $ argSetting IconvLibDir
+        , conf "--with-gmp-includes"      $ argSetting GmpIncludeDir
+        , conf "--with-gmp-libraries"     $ argSetting GmpLibDir
         , crossCompiling ? (conf "--host" $ argSetting TargetPlatformFull)
         , conf "--with-cc" $ argStagedBuilderPath Gcc ]
 
index c4e518b..4529af8 100644 (file)
@@ -17,7 +17,7 @@ hsc2hsBuilderArgs :: Args
 hsc2hsBuilderArgs = builder Hsc2Hs ? do
     stage   <- getStage
     ccPath  <- lift . builderPath $ Gcc stage
-    gmpDirs <- getSettingList GmpIncludeDirs
+    gmpDir  <- getSetting GmpIncludeDir
     cFlags  <- getCFlags
     lFlags  <- getLFlags
     top     <- getTopDirectory
@@ -32,7 +32,7 @@ hsc2hsBuilderArgs = builder Hsc2Hs ? do
     mconcat [ arg $ "--cc=" ++ ccPath
             , arg $ "--ld=" ++ ccPath
             , notM windowsHost ? arg "--cross-safe"
-            , append $ map ("-I"       ++) gmpDirs
+            , append $ map ("-I"       ++) [gmpDir]
             , append $ map ("--cflag=" ++) cFlags
             , append $ map ("--lflag=" ++) lFlags
             , notStage0 ? crossCompiling ? arg "--cross-compile"