Commit 57d7f28e authored by Moritz Angermann's avatar Moritz Angermann

Adds options; renames sSoruces to asmSources

parent f6b2394c
...@@ -1029,10 +1029,10 @@ checkPaths pkg = ...@@ -1029,10 +1029,10 @@ checkPaths pkg =
++ [ (path, "data-dir") | path <- [dataDir pkg]] ++ [ (path, "data-dir") | path <- [dataDir pkg]]
++ [ (path, "license-file") | path <- licenseFiles pkg ] ++ [ (path, "license-file") | path <- licenseFiles pkg ]
++ concat ++ concat
[ [ (path, "c-sources") | path <- cSources bi ] [ [ (path, "asm-sources") | path <- asmSources bi ]
++ [ (path, "cxx-sources") | path <- cxxSources bi ]
++ [ (path, "s-sources") | path <- sSources bi ]
++ [ (path, "cmm-sources") | path <- cmmSources bi ] ++ [ (path, "cmm-sources") | path <- cmmSources bi ]
++ [ (path, "c-sources") | path <- cSources bi ]
++ [ (path, "cxx-sources") | path <- cxxSources bi ]
++ [ (path, "js-sources") | path <- jsSources bi ] ++ [ (path, "js-sources") | path <- jsSources bi ]
++ [ (path, "install-includes") | path <- installIncludes bi ] ++ [ (path, "install-includes") | path <- installIncludes bi ]
++ [ (path, "hs-source-dirs") | path <- hsSourceDirs bi ] ++ [ (path, "hs-source-dirs") | path <- hsSourceDirs bi ]
......
...@@ -360,12 +360,16 @@ buildInfoFieldGrammar = BuildInfo ...@@ -360,12 +360,16 @@ buildInfoFieldGrammar = BuildInfo
<*> monoidalFieldAla "build-tool-depends" (alaList CommaFSep) L.buildToolDepends <*> monoidalFieldAla "build-tool-depends" (alaList CommaFSep) L.buildToolDepends
^^^ availableSince [2,0] ^^^ availableSince [2,0]
<*> monoidalFieldAla "cpp-options" (alaList' NoCommaFSep Token') L.cppOptions <*> monoidalFieldAla "cpp-options" (alaList' NoCommaFSep Token') L.cppOptions
<*> monoidalFieldAla "asm-options" (alaList' NoCommaFSep Token') L.asmOptions
<*> monoidalFieldAla "cmm-options" (alaList' NoCommaFSep Token') L.cmmOptions
<*> monoidalFieldAla "cc-options" (alaList' NoCommaFSep Token') L.ccOptions <*> monoidalFieldAla "cc-options" (alaList' NoCommaFSep Token') L.ccOptions
<*> monoidalFieldAla "cxx-options" (alaList' NoCommaFSep Token') L.cxxOptions <*> monoidalFieldAla "cxx-options" (alaList' NoCommaFSep Token') L.cxxOptions
<*> monoidalFieldAla "ld-options" (alaList' NoCommaFSep Token') L.ldOptions <*> monoidalFieldAla "ld-options" (alaList' NoCommaFSep Token') L.ldOptions
<*> monoidalFieldAla "pkgconfig-depends" (alaList CommaFSep) L.pkgconfigDepends <*> monoidalFieldAla "pkgconfig-depends" (alaList CommaFSep) L.pkgconfigDepends
<*> monoidalFieldAla "frameworks" (alaList' FSep Token) L.frameworks <*> monoidalFieldAla "frameworks" (alaList' FSep Token) L.frameworks
<*> monoidalFieldAla "extra-framework-dirs" (alaList' FSep FilePathNT) L.extraFrameworkDirs <*> monoidalFieldAla "extra-framework-dirs" (alaList' FSep FilePathNT) L.extraFrameworkDirs
<*> monoidalFieldAla "asm-sources" (alaList' VCat FilePathNT) L.asmSources
<*> monoidalFieldAla "cmm-sources" (alaList' VCat FilePathNT) L.cmmSources
<*> monoidalFieldAla "c-sources" (alaList' VCat FilePathNT) L.cSources <*> monoidalFieldAla "c-sources" (alaList' VCat FilePathNT) L.cSources
<*> monoidalFieldAla "cxx-sources" (alaList' VCat FilePathNT) L.cxxSources <*> monoidalFieldAla "cxx-sources" (alaList' VCat FilePathNT) L.cxxSources
<*> monoidalFieldAla "js-sources" (alaList' VCat FilePathNT) L.jsSources <*> monoidalFieldAla "js-sources" (alaList' VCat FilePathNT) L.jsSources
...@@ -380,6 +384,7 @@ buildInfoFieldGrammar = BuildInfo ...@@ -380,6 +384,7 @@ buildInfoFieldGrammar = BuildInfo
^^^ deprecatedSince [1,12] "Please use 'default-extensions' or 'other-extensions' fields." ^^^ deprecatedSince [1,12] "Please use 'default-extensions' or 'other-extensions' fields."
<*> monoidalFieldAla "extra-libraries" (alaList' VCat Token) L.extraLibs <*> monoidalFieldAla "extra-libraries" (alaList' VCat Token) L.extraLibs
<*> monoidalFieldAla "extra-ghci-libraries" (alaList' VCat Token) L.extraGHCiLibs <*> monoidalFieldAla "extra-ghci-libraries" (alaList' VCat Token) L.extraGHCiLibs
<*> monoidalFieldAla "extra-bundled-libraries" (alaList' VCat Token) L.extraBundledLibs
<*> monoidalFieldAla "extra-lib-dirs" (alaList' FSep FilePathNT) L.extraLibDirs <*> monoidalFieldAla "extra-lib-dirs" (alaList' FSep FilePathNT) L.extraLibDirs
<*> monoidalFieldAla "include-dirs" (alaList' FSep FilePathNT) L.includeDirs <*> monoidalFieldAla "include-dirs" (alaList' FSep FilePathNT) L.includeDirs
<*> monoidalFieldAla "includes" (alaList' FSep FilePathNT) L.includes <*> monoidalFieldAla "includes" (alaList' FSep FilePathNT) L.includes
......
...@@ -438,6 +438,12 @@ binfoFieldDescrs = ...@@ -438,6 +438,12 @@ binfoFieldDescrs =
, spaceListField "cpp-options" , spaceListField "cpp-options"
showToken parseTokenQ' showToken parseTokenQ'
cppOptions (\val binfo -> binfo{cppOptions=val}) cppOptions (\val binfo -> binfo{cppOptions=val})
, spaceListField "asm-options"
showToken parseTokenQ'
asmOptions (\val binfo -> binfo{asmOptions=val})
, spaceListField "cmm-options"
showToken parseTokenQ'
cmmOptions (\val binfo -> binfo{cmmOptions=val})
, spaceListField "cc-options" , spaceListField "cc-options"
showToken parseTokenQ' showToken parseTokenQ'
ccOptions (\val binfo -> binfo{ccOptions=val}) ccOptions (\val binfo -> binfo{ccOptions=val})
...@@ -456,9 +462,9 @@ binfoFieldDescrs = ...@@ -456,9 +462,9 @@ binfoFieldDescrs =
, listField "extra-framework-dirs" , listField "extra-framework-dirs"
showToken parseFilePathQ showToken parseFilePathQ
extraFrameworkDirs (\val binfo -> binfo{extraFrameworkDirs=val}) extraFrameworkDirs (\val binfo -> binfo{extraFrameworkDirs=val})
, listFieldWithSep vcat "s-sources" , listFieldWithSep vcat "asm-sources"
showFilePath parseFilePathQ showFilePath parseFilePathQ
sSources (\paths binfo -> binfo{sSources=paths}) asmSources (\paths binfo -> binfo{asmSources=paths})
, listFieldWithSep vcat "cmm-sources" , listFieldWithSep vcat "cmm-sources"
showFilePath parseFilePathQ showFilePath parseFilePathQ
cmmSources (\paths binfo -> binfo{cmmSources=paths}) cmmSources (\paths binfo -> binfo{cmmSources=paths})
......
...@@ -285,7 +285,7 @@ ppField name fielddoc ...@@ -285,7 +285,7 @@ ppField name fielddoc
, "extra-source-files" , "extra-source-files"
, "extra-tmp-files" , "extra-tmp-files"
, "exposed-modules" , "exposed-modules"
, "s-sources" , "asm-sources"
, "cmm-sources" , "cmm-sources"
, "c-sources" , "c-sources"
, "js-sources" , "js-sources"
......
...@@ -450,7 +450,7 @@ data ComponentInfo = ComponentInfo { ...@@ -450,7 +450,7 @@ data ComponentInfo = ComponentInfo {
cinfoSrcDirs :: [FilePath], cinfoSrcDirs :: [FilePath],
cinfoModules :: [ModuleName], cinfoModules :: [ModuleName],
cinfoHsFiles :: [FilePath], -- other hs files (like main.hs) cinfoHsFiles :: [FilePath], -- other hs files (like main.hs)
cinfoSFiles :: [FilePath], cinfoAsmFiles:: [FilePath],
cinfoCmmFiles:: [FilePath], cinfoCmmFiles:: [FilePath],
cinfoCFiles :: [FilePath], cinfoCFiles :: [FilePath],
cinfoJsFiles :: [FilePath] cinfoJsFiles :: [FilePath]
...@@ -466,7 +466,7 @@ pkgComponentInfo pkg = ...@@ -466,7 +466,7 @@ pkgComponentInfo pkg =
cinfoSrcDirs = hsSourceDirs bi, cinfoSrcDirs = hsSourceDirs bi,
cinfoModules = componentModules c, cinfoModules = componentModules c,
cinfoHsFiles = componentHsFiles c, cinfoHsFiles = componentHsFiles c,
cinfoSFiles = sSources bi, cinfoAsmFiles= asmSources bi,
cinfoCmmFiles= cmmSources bi, cinfoCmmFiles= cmmSources bi,
cinfoCFiles = cSources bi, cinfoCFiles = cSources bi,
cinfoJsFiles = jsSources bi cinfoJsFiles = jsSources bi
......
...@@ -463,8 +463,9 @@ generalInstalledPackageInfo adjustRelIncDirs pkg abi_hash lib lbi clbi installDi ...@@ -463,8 +463,9 @@ generalInstalledPackageInfo adjustRelIncDirs pkg abi_hash lib lbi clbi installDi
hasModules = not $ null (allLibModules lib clbi) hasModules = not $ null (allLibModules lib clbi)
comp = compiler lbi comp = compiler lbi
hasLibrary = (hasModules || not (null (cSources bi)) hasLibrary = (hasModules || not (null (cSources bi))
|| not (null (sSources bi)) || not (null (asmSources bi))
|| not (null (cmmSources bi)) || not (null (cmmSources bi))
|| not (null (cxxSources bi))
|| (not (null (jsSources bi)) && || (not (null (jsSources bi)) &&
compilerFlavor comp == GHCJS)) compilerFlavor comp == GHCJS))
&& not (componentIsIndefinite clbi) && not (componentIsIndefinite clbi)
......
...@@ -51,14 +51,16 @@ data BuildInfo = BuildInfo { ...@@ -51,14 +51,16 @@ data BuildInfo = BuildInfo {
-- field directly. -- field directly.
buildToolDepends :: [ExeDependency], buildToolDepends :: [ExeDependency],
cppOptions :: [String], -- ^ options for pre-processing Haskell code cppOptions :: [String], -- ^ options for pre-processing Haskell code
asmOptions :: [String], -- ^ options for assmebler
cmmOptions :: [String], -- ^ options for C-- compiler
ccOptions :: [String], -- ^ options for C compiler ccOptions :: [String], -- ^ options for C compiler
cxxOptions :: [String], -- ^ options for C++ compiler cxxOptions :: [String], -- ^ options for C++ compiler
ldOptions :: [String], -- ^ options for linker ldOptions :: [String], -- ^ options for linker
pkgconfigDepends :: [PkgconfigDependency], -- ^ pkg-config packages that are used pkgconfigDepends :: [PkgconfigDependency], -- ^ pkg-config packages that are used
frameworks :: [String], -- ^support frameworks for Mac OS X frameworks :: [String], -- ^support frameworks for Mac OS X
extraFrameworkDirs:: [String], -- ^ extra locations to find frameworks. extraFrameworkDirs:: [String], -- ^ extra locations to find frameworks.
sSources :: [FilePath], -- ^ Assembly files. asmSources :: [FilePath], -- ^ Assembly files.
cmmSources :: [FilePath], -- ^ CMM files. cmmSources :: [FilePath], -- ^ C-- files.
cSources :: [FilePath], cSources :: [FilePath],
cxxSources :: [FilePath], cxxSources :: [FilePath],
jsSources :: [FilePath], jsSources :: [FilePath],
...@@ -105,13 +107,15 @@ instance Monoid BuildInfo where ...@@ -105,13 +107,15 @@ instance Monoid BuildInfo where
buildTools = [], buildTools = [],
buildToolDepends = [], buildToolDepends = [],
cppOptions = [], cppOptions = [],
asmOptions = [],
cmmOptions = [],
ccOptions = [], ccOptions = [],
cxxOptions = [], cxxOptions = [],
ldOptions = [], ldOptions = [],
pkgconfigDepends = [], pkgconfigDepends = [],
frameworks = [], frameworks = [],
extraFrameworkDirs = [], extraFrameworkDirs = [],
sSources = [], asmSources = [],
cmmSources = [], cmmSources = [],
cSources = [], cSources = [],
cxxSources = [], cxxSources = [],
...@@ -147,13 +151,15 @@ instance Semigroup BuildInfo where ...@@ -147,13 +151,15 @@ instance Semigroup BuildInfo where
buildTools = combine buildTools, buildTools = combine buildTools,
buildToolDepends = combine buildToolDepends, buildToolDepends = combine buildToolDepends,
cppOptions = combine cppOptions, cppOptions = combine cppOptions,
asmOptions = combine asmOptions,
cmmOptions = combine cmmOptions,
ccOptions = combine ccOptions, ccOptions = combine ccOptions,
cxxOptions = combine cxxOptions, cxxOptions = combine cxxOptions,
ldOptions = combine ldOptions, ldOptions = combine ldOptions,
pkgconfigDepends = combine pkgconfigDepends, pkgconfigDepends = combine pkgconfigDepends,
frameworks = combineNub frameworks, frameworks = combineNub frameworks,
extraFrameworkDirs = combineNub extraFrameworkDirs, extraFrameworkDirs = combineNub extraFrameworkDirs,
sSources = combineNub sSources, asmSources = combineNub asmSources,
cmmSources = combineNub cmmSources, cmmSources = combineNub cmmSources,
cSources = combineNub cSources, cSources = combineNub cSources,
cxxSources = combineNub cxxSources, cxxSources = combineNub cxxSources,
......
...@@ -39,6 +39,14 @@ class HasBuildInfo a where ...@@ -39,6 +39,14 @@ class HasBuildInfo a where
cppOptions = buildInfo . cppOptions cppOptions = buildInfo . cppOptions
{-# INLINE cppOptions #-} {-# INLINE cppOptions #-}
asmOptions :: Lens' a [String]
asmOptions = buildInfo . asmOptions
{-# INLINE asmOptions #-}
cmmOptions :: Lens' a [String]
cmmOptions = buildInfo . cmmOptions
{-# INLINE cmmOptions #-}
ccOptions :: Lens' a [String] ccOptions :: Lens' a [String]
ccOptions = buildInfo . ccOptions ccOptions = buildInfo . ccOptions
{-# INLINE ccOptions #-} {-# INLINE ccOptions #-}
...@@ -63,6 +71,14 @@ class HasBuildInfo a where ...@@ -63,6 +71,14 @@ class HasBuildInfo a where
extraFrameworkDirs = buildInfo . extraFrameworkDirs extraFrameworkDirs = buildInfo . extraFrameworkDirs
{-# INLINE extraFrameworkDirs #-} {-# INLINE extraFrameworkDirs #-}
asmSources :: Lens' a [FilePath]
asmSources = buildInfo . asmSources
{-# INLINE asmSources #-}
cmmSources :: Lens' a [FilePath]
cmmSources = buildInfo . cmmSources
{-# INLINE cmmSources #-}
cSources :: Lens' a [FilePath] cSources :: Lens' a [FilePath]
cSources = buildInfo . cSources cSources = buildInfo . cSources
{-# INLINE cSources #-} {-# INLINE cSources #-}
...@@ -115,6 +131,10 @@ class HasBuildInfo a where ...@@ -115,6 +131,10 @@ class HasBuildInfo a where
extraGHCiLibs = buildInfo . extraGHCiLibs extraGHCiLibs = buildInfo . extraGHCiLibs
{-# INLINE extraGHCiLibs #-} {-# INLINE extraGHCiLibs #-}
extraBundledLibs :: Lens' a [String]
extraBundledLibs = buildInfo . extraBundledLibs
{-# INLINE extraBundledLibs #-}
extraLibDirs :: Lens' a [String] extraLibDirs :: Lens' a [String]
extraLibDirs = buildInfo . extraLibDirs extraLibDirs = buildInfo . extraLibDirs
{-# INLINE extraLibDirs #-} {-# INLINE extraLibDirs #-}
...@@ -176,6 +196,12 @@ instance HasBuildInfo BuildInfo where ...@@ -176,6 +196,12 @@ instance HasBuildInfo BuildInfo where
cppOptions f s = fmap (\x -> s { T.cppOptions = x }) (f (T.cppOptions s)) cppOptions f s = fmap (\x -> s { T.cppOptions = x }) (f (T.cppOptions s))
{-# INLINE cppOptions #-} {-# INLINE cppOptions #-}
asmOptions f s = fmap (\x -> s { T.asmOptions = x }) (f (T.asmOptions s))
{-# INLINE asmOptions #-}
cmmOptions f s = fmap (\x -> s { T.cmmOptions = x }) (f (T.cmmOptions s))
{-# INLINE cmmOptions #-}
ccOptions f s = fmap (\x -> s { T.ccOptions = x }) (f (T.ccOptions s)) ccOptions f s = fmap (\x -> s { T.ccOptions = x }) (f (T.ccOptions s))
{-# INLINE ccOptions #-} {-# INLINE ccOptions #-}
...@@ -194,6 +220,12 @@ instance HasBuildInfo BuildInfo where ...@@ -194,6 +220,12 @@ instance HasBuildInfo BuildInfo where
extraFrameworkDirs f s = fmap (\x -> s { T.extraFrameworkDirs = x }) (f (T.extraFrameworkDirs s)) extraFrameworkDirs f s = fmap (\x -> s { T.extraFrameworkDirs = x }) (f (T.extraFrameworkDirs s))
{-# INLINE extraFrameworkDirs #-} {-# INLINE extraFrameworkDirs #-}
asmSources f s = fmap (\x -> s { T.asmSources = x }) (f (T.asmSources s))
{-# INLINE asmSources #-}
cmmSources f s = fmap (\x -> s { T.cmmSources = x }) (f (T.cmmSources s))
{-# INLINE cmmSources #-}
cSources f s = fmap (\x -> s { T.cSources = x }) (f (T.cSources s)) cSources f s = fmap (\x -> s { T.cSources = x }) (f (T.cSources s))
{-# INLINE cSources #-} {-# INLINE cSources #-}
...@@ -233,6 +265,9 @@ instance HasBuildInfo BuildInfo where ...@@ -233,6 +265,9 @@ instance HasBuildInfo BuildInfo where
extraGHCiLibs f s = fmap (\x -> s { T.extraGHCiLibs = x }) (f (T.extraGHCiLibs s)) extraGHCiLibs f s = fmap (\x -> s { T.extraGHCiLibs = x }) (f (T.extraGHCiLibs s))
{-# INLINE extraGHCiLibs #-} {-# INLINE extraGHCiLibs #-}
extraBundledLibs f s = fmap (\x -> s { T.extraBundledLibs = x }) (f (T.extraBundledLibs s))
{-# INLINE extraBundledLibs #-}
extraLibDirs f s = fmap (\x -> s { T.extraLibDirs = x }) (f (T.extraLibDirs s)) extraLibDirs f s = fmap (\x -> s { T.extraLibDirs = x }) (f (T.extraLibDirs s))
{-# INLINE extraLibDirs #-} {-# INLINE extraLibDirs #-}
......
...@@ -2040,7 +2040,7 @@ system-dependent values for these fields. ...@@ -2040,7 +2040,7 @@ system-dependent values for these fields.
:pkg-field:`c-sources` field and vice-versa. The object files will be linked :pkg-field:`c-sources` field and vice-versa. The object files will be linked
appropriately. appropriately.
.. pkg-field:: s-sources: filename list .. pkg-field:: asm-sources: filename list
A list of assembly source files to be compiled and linked with the A list of assembly source files to be compiled and linked with the
Haskell files. Haskell files.
......
...@@ -1707,7 +1707,7 @@ this section will be available. ...@@ -1707,7 +1707,7 @@ this section will be available.
The files placed in this distribution are the package description file, The files placed in this distribution are the package description file,
the setup script, the sources of the modules named in the package the setup script, the sources of the modules named in the package
description file, and files named in the ``license-file``, ``main-is``, description file, and files named in the ``license-file``, ``main-is``,
``c-sources``, ``s-sources``, ``cmm-sources``, ``js-sources``, ``c-sources``, ``asm-sources``, ``cmm-sources``, ``js-sources``,
``data-files``, ``extra-source-files`` and ``extra-doc-files`` fields. ``data-files``, ``extra-source-files`` and ``extra-doc-files`` fields.
This command takes the following option: This command takes the following option:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment