[project @ 1999-08-27 11:48:08 by simonpj]
authorsimonpj <unknown>
Fri, 27 Aug 1999 11:48:10 +0000 (11:48 +0000)
committersimonpj <unknown>
Fri, 27 Aug 1999 11:48:10 +0000 (11:48 +0000)
When deciding if a module is a "library" module, allow
C:/
C:\
as prefixes of the path, not just
/

We need to improve this hack, but this fix makes things
work on Windoze.

ghc/compiler/basicTypes/Module.lhs
ghc/docs/users_guide/using.vsgml

index cf86c1c..6fad2e2 100644 (file)
@@ -295,10 +295,19 @@ getAllFilesMatching dirs hims (dir_path, suffix) = ( do
        )
  where
   
-       -- Dreadfully crude.  We want a better way to distinguish
-       -- "library-ish" modules.
-   is_sys | head dir_path == '/' = LibMod
-         | otherwise            = UserMod
+   is_sys | isLibraryPath dir_path = LibMod
+         | otherwise              = UserMod
+
+       -- Dreadfully crude way to tell whether a module is a "library"
+       -- module or not.  The current story is simply that if path is
+       -- absolute we treat it as a library.  Specifically:
+       --      /usr/lib/ghc/
+       --      C:/usr/lib/ghc
+       --      C:\user\lib
+   isLibraryPath ('/' : _            ) = True
+   isLibraryPath (_   : ':' : '/'  : _) = True
+   isLibraryPath (_   : ':' : '\\' : _) = True
+   isLibraryPaty other                 = False
 
    xiffus       = reverse dotted_suffix 
    dotted_suffix = case suffix of
index 8ef6255..08e45a1 100644 (file)
@@ -632,6 +632,9 @@ multi-directory application, use <em>relative</em> path names in your
 Use absolute path names only for directories containing slowly-changing
 library modules.
 
+A path is considered ``absolute'' if it starts with ``@/@'', or
+``@A:/@'', or ``@A:\@'' (or ``@B:/@'', ``@B:\@'' etc).
+
 Patrick Sansom had a workshop paper about how all this is done (though
 the details have changed quite a bit).  Ask
 him (email: <htmlurl name="sansom@@dcs.gla.ac.uk"