From: simonpj Date: Fri, 27 Aug 1999 11:48:10 +0000 (+0000) Subject: [project @ 1999-08-27 11:48:08 by simonpj] X-Git-Tag: Approximately_9120_patches~5862 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=7f2147adc622d0d3ac62a619c85384f71c19f01c;p=ghc-hetmet.git [project @ 1999-08-27 11:48:08 by simonpj] 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. --- diff --git a/ghc/compiler/basicTypes/Module.lhs b/ghc/compiler/basicTypes/Module.lhs index cf86c1c..6fad2e2 100644 --- a/ghc/compiler/basicTypes/Module.lhs +++ b/ghc/compiler/basicTypes/Module.lhs @@ -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 diff --git a/ghc/docs/users_guide/using.vsgml b/ghc/docs/users_guide/using.vsgml index 8ef6255..08e45a1 100644 --- a/ghc/docs/users_guide/using.vsgml +++ b/ghc/docs/users_guide/using.vsgml @@ -632,6 +632,9 @@ multi-directory application, use relative 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: