More un-hardcoding
[bpt/mlt.git] / src / config.sml
index 691f714..ad3946f 100644 (file)
@@ -1,6 +1,6 @@
 (*
  * Dynamic web page generation with Standard ML
- * Copyright (C) 2003  Adam Chlipala
+ * Copyright (C) 2003-2004  Adam Chlipala
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -21,7 +21,7 @@
 
 structure Config :> CONFIG =
 struct
-    val defaultFile = "/etc/mlt.conf"
+    open Settings
 
     datatype config =
             CONFIG of {inPath : string, (* Directory for input sources *)
@@ -62,8 +62,8 @@ struct
 
            fun read (fields as {inPath, outPath, pubPath, lib, compiler, cm, sml, printFn, beforeT, afterT, exnT}) =
                (case TextIO.inputLine inf of
-                    "" => CONFIG fields
-                  | line =>
+                    NONE => CONFIG fields
+                  | SOME line =>
                     (case String.tokens Char.isSpace line of
                          [] => read fields
                        | ["in", inPath] => read {inPath = expandPath inPath, outPath = outPath, pubPath = pubPath,
@@ -137,9 +137,9 @@ struct
        let
            val cwd = OS.FileSys.getDir ()
        
-           val base = CONFIG {lib = "/usr/local/share/mlt/src/lib/sources.cm",
-                              compiler = "/usr/local/share/mlt/src/sources.cm",
-                              sml = "/usr/local/sml/bin",
+           val base = CONFIG {lib = mltdir ^ "/src/lib/sources.cm",
+                              compiler = mltdir ^ "/src/sources.cm",
+                              sml = smlbin,
                               inPath = cwd,
                               outPath = cwd,
                               pubPath = cwd,