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

Adds options; renames sSoruces to asmSources

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