Commit a3b621cb authored by Bernd Brassel's avatar Bernd Brassel
Browse files

still trying to find interface files

parent e7436048
......@@ -27,6 +27,8 @@ Executable kics
old-time,
directory,
containers,
ghc-paths,
process,
curry-base >= 0.2.5,
curry-frontend >= 0.2.6
......
......@@ -3,11 +3,14 @@ module Curry.Compiler.Config (
module Curry.Compiler.KicsSubdir) where
import System.FilePath
import System.Process
import System.Time (ClockTime)
import Char
import System.Environment (getEnvironment,getArgs)
import System.Directory hiding (executable)
import System.Time
import GHC.Paths
import Data.List
import Curry.Compiler.SafeCalls
import Curry.FlatCurry.Type (readFlat)
......@@ -15,6 +18,10 @@ import Curry.Compiler.Names
import Curry.Compiler.KicsSubdir
import Curry.Files.CymakePath
isModuleInstalled :: String -> IO Bool
isModuleInstalled m = do
cont <- readProcess ghc_pkg ["find-module",m] ""
return (isInfixOf "KiCS" cont)
getOptions :: IO (Options,State)
getOptions = do
......@@ -36,11 +43,9 @@ parseOptions opts ("-or":xs) = parseOptions (opts{cm=OrBased}) xs
parseOptions opts ("-ctc":xs) = parseOptions (opts{cm=CTC}) xs
parseOptions opts ("-main":x:xs) = parseOptions (opts{mainFunc=x}) xs
parseOptions opts ("-frontend":x:xs) = parseOptions (opts{frontend=x}) xs
--parseOptions opts ("-kicspath":x:xs) = parseOptions (opts{kicspath=x}) xs
parseOptions opts ("-userlibpath":x:xs) =
parseOptions (opts{userlibpath=userlibpath opts ++ splitSearchPath x}) xs
parseOptions opts ("-nouserlibpath":xs) = parseOptions (opts{userlibpath=[]}) xs
--parseOptions opts ("-ghc":x:xs) = parseOptions (opts{ghc=x}) xs
parseOptions opts ("-make":xs) = parseOptions (opts{make=True}) xs
parseOptions opts ("-nomake":xs) = parseOptions (opts{make=False}) xs
parseOptions opts ("-executable":xs) = parseOptions (opts{executable=True}) xs
......@@ -70,10 +75,8 @@ usage problem = do
putStrLn "-ctc | switch to call time choice"
putStrLn "-main | name of main function "
putStrLn "-frontend | frontend binary"
putStrLn "-kicspath | path to kics compiler"
putStrLn "-userlibpath | path to curry libraries"
putStrLn "-nouserlibpath | only standard curry libraries"
putStrLn "-ghc | path to ghc"
putStrLn "-make | chase imported modules"
putStrLn "-nomake | do not chase imported modules"
putStrLn "-executable | create executable"
......@@ -96,7 +99,6 @@ usage problem = do
data Options = Opts{ cm :: ChoiceMode,
filename, mainFunc, mainModule,
frontend, ghcOpts
--, ghc, kicspath
:: String,
target :: Maybe String,
userlibpath, done :: [String],
......@@ -140,9 +142,7 @@ hasExtFuncs opts = not (null (extFuncs opts))
defaultOpts curDir = Opts {cm=CTC,filename="", mainFunc= "main", mainModule="Main",
target = Just "request",
frontend="cymake",
--kicspath=installDir,
userlibpath=[],
--ghc="ghc",
ghcOpts=" -fglasgow-exts -fcontext-stack=50 ",
done=[],
make=True,
......@@ -204,7 +204,7 @@ readPMode s = readPM (words (map toLower s))
ghcCall :: Options -> String
ghcCall opts@Opts{filename=fn} =
callnorm ("ghc "
callnorm (ghc
++makeGhc (make opts)
++" -i"++show (toPathList
(pathWithSubdirs $ libpath opts))++" "
......
module Curry.Files.StdLibPath (stdLibVersion,getStdLibPath) where
import Data.Version
import Paths_KiCS_standard_libraries
stdLibVersion = showVersion version
getStdLibPath = getDataDir
......@@ -27,6 +27,7 @@ extra-source-files:
Curry/Module/Time.hs.include
Curry/Module/ReadShowTerm.hs.include
Curry/Module/Meta.hs.include
Curry/Module/Unsafe.hs.include
Data-Dir: Curry/Module/.curry
Data-Files: *.fcy
*.fint
......@@ -47,6 +48,8 @@ Library
random,
KiCS >= 0.8.8
Exposed-Modules:
Curry.Files.StdLibPath
Curry.Module.Prelude
Curry.Module.Interactive
Curry.Module.Char
......
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