Commit 4a287659 authored by Moritz Angermann's avatar Moritz Angermann

Adds sSources and cmmSources.

# Conflicts:
#	Cabal/Distribution/PackageDescription/Check.hs
#	Cabal/Distribution/PackageDescription/Parsec/FieldDescr.hs
#	Cabal/Distribution/Parsec/Types/FieldDescr.hs
#	Cabal/doc/developing-packages.rst
parent 52a7d51e
......@@ -1031,6 +1031,8 @@ checkPaths pkg =
++ concat
[ [ (path, "c-sources") | path <- cSources bi ]
++ [ (path, "cxx-sources") | path <- cxxSources bi ]
++ [ (path, "s-sources") | path <- sSources bi ]
++ [ (path, "cmm-sources") | path <- cmmSources bi ]
++ [ (path, "js-sources") | path <- jsSources bi ]
++ [ (path, "install-includes") | path <- installIncludes bi ]
++ [ (path, "hs-source-dirs") | path <- hsSourceDirs bi ]
......
......@@ -456,6 +456,12 @@ binfoFieldDescrs =
, listField "extra-framework-dirs"
showToken parseFilePathQ
extraFrameworkDirs (\val binfo -> binfo{extraFrameworkDirs=val})
, listFieldWithSep vcat "s-sources"
showFilePath parseFilePathQ
sSources (\paths binfo -> binfo{sSources=paths})
, listFieldWithSep vcat "cmm-sources"
showFilePath parseFilePathQ
cmmSources (\paths binfo -> binfo{cmmSources=paths})
, listFieldWithSep vcat "c-sources"
showFilePath parseFilePathQ
cSources (\paths binfo -> binfo{cSources=paths})
......
......@@ -285,6 +285,8 @@ ppField name fielddoc
, "extra-source-files"
, "extra-tmp-files"
, "exposed-modules"
, "s-sources"
, "cmm-sources"
, "c-sources"
, "js-sources"
, "extra-libraries"
......
......@@ -450,6 +450,8 @@ data ComponentInfo = ComponentInfo {
cinfoSrcDirs :: [FilePath],
cinfoModules :: [ModuleName],
cinfoHsFiles :: [FilePath], -- other hs files (like main.hs)
cinfoSFiles :: [FilePath],
cinfoCmmFiles:: [FilePath],
cinfoCFiles :: [FilePath],
cinfoJsFiles :: [FilePath]
}
......@@ -464,6 +466,8 @@ pkgComponentInfo pkg =
cinfoSrcDirs = hsSourceDirs bi,
cinfoModules = componentModules c,
cinfoHsFiles = componentHsFiles c,
cinfoSFiles = sSources bi,
cinfoCmmFiles= cmmSources bi,
cinfoCFiles = cSources bi,
cinfoJsFiles = jsSources bi
}
......
......@@ -462,6 +462,8 @@ 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 (cmmSources bi))
|| (not (null (jsSources bi)) &&
compilerFlavor comp == GHCJS))
&& not (componentIsIndefinite clbi)
......
......@@ -57,6 +57,8 @@ data BuildInfo = BuildInfo {
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.
cSources :: [FilePath],
cxxSources :: [FilePath],
jsSources :: [FilePath],
......@@ -102,6 +104,8 @@ instance Monoid BuildInfo where
pkgconfigDepends = [],
frameworks = [],
extraFrameworkDirs = [],
sSources = [],
cmmSources = [],
cSources = [],
cxxSources = [],
jsSources = [],
......@@ -141,6 +145,8 @@ instance Semigroup BuildInfo where
pkgconfigDepends = combine pkgconfigDepends,
frameworks = combineNub frameworks,
extraFrameworkDirs = combineNub extraFrameworkDirs,
sSources = combineNub sSources,
cmmSources = combineNub cmmSources,
cSources = combineNub cSources,
cxxSources = combineNub cxxSources,
jsSources = combineNub jsSources,
......
......@@ -2040,6 +2040,16 @@ 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
A list of assembly source files to be compiled and linked with the
Haskell files.
.. pkg-field:: cmm-sources: filename list
A list of C-- source files to be compiled and linked with the Haskell
files.
.. pkg-field:: js-sources: filename list
A list of JavaScript source files to be linked with the Haskell
......
......@@ -1707,8 +1707,8 @@ 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``, ``js-sources``, ``data-files``, ``extra-source-files``
and ``extra-doc-files`` fields.
``c-sources``, ``s-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