[modify initial library path, clean up some code, print search path when --list-libraries is used.
John Meacham <john@repetae.net>**20060307232349] hunk ./Main.hs 94
-      BuildHl hl    -> createLibrary hl buildLibrary
-      ListLibraries -> sequence_ [ putStrLn name | (name,_) <- libraryList ]
-      SelfTest      -> do putStrLn "Starting self testing..."
-                          SelfTest.selfTest (optArgs o)
-      ShowHo ho     -> dumpHoFile ho
-      Version       -> putStrLn versionString
-      VersionCtx    -> putStrLn versionContext
-      _             -> processFiles  (optArgs o)
+        BuildHl hl    -> createLibrary hl buildLibrary
+        ListLibraries -> do
+            putStrLn "Search path:"
+            mapM_ putStrLn (optHlPath options)
+            putStrLn "Libraries found:"
+            sequence_ [ putStrLn name | (name,_) <- libraryList ]
+        SelfTest      -> do
+            putStrLn "Starting self testing..."
+            SelfTest.selfTest (optArgs o)
+        ShowHo ho     -> dumpHoFile ho
+        Version       -> putStrLn versionString
+        VersionCtx    -> putStrLn versionContext
+        _             -> processFiles  (optArgs o)
hunk ./Options.hs 84
-    optHlPath      = initialIncludes ++ libraryPath,
+    optHlPath      = initialLibIncludes,
hunk ./Options.hs 225
+-- | Include directories taken from JHCPATH enviroment variable.
+initialLibIncludes :: [String]
+initialLibIncludes = unsafePerformIO $ do
+    p <- lookupEnv "JHCLIBPATH"
+    h <- lookupEnv "HOME"
+    let x = maybe "" id p
+        mh = fmap (++ "/lib/jhc") h
+    return (mh ++ (tokens (== ':') x) ++ libraryPath)
+
hunk ./docs/using.txt 63
-up future compilation. feel free to delete these but having a set for the
-standard Haskell libraries pre-built will greatly speed up future builds.
+up future compilation. feel free to delete these if you want to. There are
+various options for controlling the writing and reading of these ho files.
+
+=== Environment Variables ===
+
+jhc understands the following environment variables
+
+ JHCPATH - path to search for haskell source files, seperated by colons.
+
+ JHCLIBPATH - path to search for jhc library files