From 7f2147adc622d0d3ac62a619c85384f71c19f01c Mon Sep 17 00:00:00 2001 From: simonpj <unknown> Date: Fri, 27 Aug 1999 11:48:10 +0000 Subject: [PATCH] [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. --- ghc/compiler/basicTypes/Module.lhs | 17 +++++++++++++---- ghc/docs/users_guide/using.vsgml | 3 +++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ghc/compiler/basicTypes/Module.lhs b/ghc/compiler/basicTypes/Module.lhs index cf86c1ce8998..6fad2e296892 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 8ef625551443..08e45a1c753f 100644 --- a/ghc/docs/users_guide/using.vsgml +++ b/ghc/docs/users_guide/using.vsgml @@ -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" -- GitLab