Commit 9969677b authored by simonmar's avatar simonmar
Browse files

Fixes to building, build C bits too

parent 6cfea785
......@@ -78,9 +78,9 @@ data PackageDescription
-- the following are required by the simple build infrastructure only:
buildDepends :: [ Dependency ],
allModules :: [ String ],
cSources :: [ FilePath ],
exposedModules :: [ String ],
extensions :: [ Extension ],
library :: String, -- library name
extraLibs :: [ String ],
includeDirs :: [ FilePath ],
includes :: [ FilePath ],
......@@ -97,9 +97,9 @@ emptyPackageDescription
stability = "",
buildDepends = [],
allModules = [],
cSources = [],
exposedModules = [],
extensions = [],
library = "",
extraLibs = [],
includeDirs = [],
includes = [],
......
......@@ -68,9 +68,13 @@ build pkg_descr lbi = do
let args = constructGHCCmdLine pkg_descr lbi
rawSystemExit (compilerPath (compiler lbi)) args
-- build any C sources
when (not (null (cSources pkg_descr))) $
rawSystemExit (compilerPath (compiler lbi)) (cSources pkg_descr)
-- now, build the library
let objs = map (++objsuffix) (allModules pkg_descr)
lib = mkLibName (library pkg_descr)
lib = mkLibName (showPackageId (package pkg_descr))
rawSystemPathExit "ar" (["q", lib] ++ objs)
constructGHCCmdLine :: PackageDescription -> LocalBuildInfo -> [String]
......@@ -91,6 +95,6 @@ objsuffix = ".obj"
objsuffix = ".o"
#endif
mkLibName lib = "lib" ++ lib ++ ".a"
mkLibName lib = "libHS" ++ lib ++ ".a"
-- ToDo: includes, includeDirs
......@@ -12,6 +12,7 @@
** elaborate command-line help text
** configure should check for 'ar' args + properties (see fptools/aclocal.m4)
** most commands should accept a -v flag to show command lines?
** configure should check sanity of PackageDescription, eg. library /= "" ?
* Testing
** error cases for parsing command-line args
......
Supports Markdown
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