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

calling mkstrict

parent 67570657
......@@ -19,7 +19,9 @@ getOptions = do
cupath <- getEnv "CURRYPATH"
let parsed = parseOptions opts args
parsedOpts <- either usage return parsed
let newOpts = parsedOpts{userlibpath= userlibpath parsedOpts
let addFiledir = case takeDirectory (filename opts) of "" -> id; dir -> (dir:)
newOpts = parsedOpts{userlibpath= addFiledir $
userlibpath parsedOpts
++ splitSearchPath cupath}
return (newOpts,state)
......@@ -52,7 +54,7 @@ parseOptions opts ("-o":x:xs) = parseOptions (opts{target=x}) xs
parseOptions opts ("-d":xs) = parseOptions (opts{debug=True,doNotUseInterface=True}) xs
parseOptions opts ("--debug":xs) = parseOptions opts ("-d":xs)
parseOptions opts [] = Right opts
parseOptions opts [x] = Right (opts{filename=x,mainModule=x})
parseOptions opts [x] = Right (opts{filename=x,mainModule=takeBaseName x})
parseOptions _ (x:_) = Left ("unrecognized option: "++x)
usage problem = do
......@@ -108,7 +110,7 @@ cymake_call = unpath [installDir,"bin","parsecurry"]
libpath :: Options -> [String]
libpath opts@Opts{userlibpath=up,kicspath=kp,filename=fn}
= (case takeDirectory fn of "" -> id; dir -> (dir:))
= --(case takeDirectory fn of "" -> id; dir -> ((dir++[pathSeparator]):))
up ++ [unpath [kp,"src","lib",""]]
......
......@@ -69,7 +69,8 @@ addKicsSubdir s = unpath [s,currySubdir,kicsSubdir]
pathWithSubdirs :: [FilePath] -> [FilePath]
pathWithSubdirs = concatMap dirWithSubdirs
where
dirWithSubdirs dir = [dir,unpath [dir,currySubdir],addKicsSubdir dir]
dirWithSubdirs dir = [dir,unpath [dir,currySubdir,[pathSeparator]],
unpath [dir,currySubdir,kicsSubdir,[pathSeparator]]]
inKicsSubdir :: String -> String
inKicsSubdir s = inCurrySubdir s `inSubdir` kicsSubdir
......
......@@ -69,10 +69,11 @@ main = do
home <- getEnv "HOME"
(options,state) <- getOptions
mapM_ (safe . put 1 options) welcome
let files = if null (filename options)
then ["Prelude"]
else [filename options]
load files state options
let files = case filename options of
"" -> ["Prelude"]
fn -> [fn]
curDir:dirs = libpath options
load files state options{userlibpath=pathWithSubdirs [curDir]++dirs}
interactive state opts = do
mline <- readline (separate "," (loadedFiles state) ++"> ")
......@@ -124,7 +125,8 @@ setMenue [] state opts = do
putStrLn $ "run time settings: " ++ rts state
putStrLn $ "ghc compiler options: " ++ ghcOpts opts
putStrLn "paths to libraries: "
mapM_ putPath (libpath opts)
let dir:_:_:dirs = libpath opts
mapM_ putPath (dir:dirs)
interactive state opts
where
putPath p = putStr " " >> putStrLn p
......
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