[m-rev.] for review: grade-specific init files and --search-lib-files-dir

Peter Wang wangp at students.csse.unimelb.edu.au
Wed Jan 3 13:06:01 AEDT 2007


Estimated hours taken: 1
Branches: main

compiler/handle_options.m:
        Search grade-specific .init directories when using
        `--search-library-files-directory' with `--use-grade-subdirs'.

Index: compiler/handle_options.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/handle_options.m,v
retrieving revision 1.287
diff -u -r1.287 handle_options.m
--- compiler/handle_options.m   5 Dec 2006 06:40:54 -0000       1.287
+++ compiler/handle_options.m   3 Jan 2007 00:54:28 -0000
@@ -1686,22 +1686,33 @@

         globals.lookup_accumulating_option(!.Globals,
             link_library_directories, LinkLibDirs2),
+        globals.lookup_accumulating_option(!.Globals,
+            init_file_directories, InitDirs2),
         (
             UseGradeSubdirs = yes,
             %
             % With --use-grade-subdirs we need to search in
-            % `Mercury/<grade>/<fullarch>/Mercury/lib' for libraries, for
-            % each directory listed with --search-library-files-directory.
+            % `Mercury/<grade>/<fullarch>/Mercury/lib' for libraries and
+            % `Mercury/<grade>/<fullarch>/Mercury/inits' for init files,
+            % for each directory listed with --search-library-files-directory.
             %
             ToGradeLibDir = (func(Dir) = ToGradeSubdir(Dir)/"Mercury"/"lib"),
             SearchGradeLibDirs = list.map(ToGradeLibDir, SearchLibFilesDirs),
-            LinkLibDirs = SearchGradeLibDirs ++ LinkLibDirs2
+            LinkLibDirs = SearchGradeLibDirs ++ LinkLibDirs2,
+
+            ToGradeInitDir = (func(Dir) =
+                ToGradeSubdir(Dir)/"Mercury"/"inits"),
+            SearchGradeInitDirs = list.map(ToGradeInitDir, SearchLibFilesDirs),
+            InitDirs = SearchGradeInitDirs ++ InitDirs2
         ;
             UseGradeSubdirs = no,
-            LinkLibDirs = SearchLibFilesDirs ++ LinkLibDirs2
+            LinkLibDirs = SearchLibFilesDirs ++ LinkLibDirs2,
+            InitDirs = SearchLibFilesDirs ++ InitDirs2
         ),
         globals.set_option(link_library_directories,
             accumulating(LinkLibDirs), !Globals),
+        globals.set_option(init_file_directories,
+            accumulating(InitDirs), !Globals),

         %
         % When searching for a header (.mh or .mih) file,


--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list