[m-rev.] diff: fix a bug with stand-alone interfaces

Julien Fischer juliensf at csse.unimelb.edu.au
Thu Jan 24 15:05:23 AEDT 2008


Estimated hours taken: 1.5
Branches: main

Fix a bug with stand-alone interfaces.  The list of .init file search
directories was not being passed to mkinit.

compiler/compile_target_code.m:
 	Pass the .init file search directories to mkinit when generating
 	stand-alone interfaces.

 	Print out invocations of mkinit when --verbose-commands is enabled
 	rather than --verbose.  (We previously used a mixture of the two
 	with mkinit invocations.)

Julien.

Index: compiler/compile_target_code.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/compile_target_code.m,v
retrieving revision 1.125
diff -u -r1.125 compile_target_code.m
--- compiler/compile_target_code.m	23 Jan 2008 13:12:15 -0000	1.125
+++ compiler/compile_target_code.m	24 Jan 2008 04:00:24 -0000
@@ -1033,7 +1033,7 @@
              io.close_output(TmpStream, !IO),

              MkInitCmd = string.append_list([MkInit, " -k -f ", TmpFile]),
-            invoke_system_command(InitFileStream, cmd_verbose,
+            invoke_system_command(InitFileStream, cmd_verbose_commands,
                  MkInitCmd, MkInitOK0, !IO),

              io.remove_file(TmpFile, RemoveResult, !IO),
@@ -1408,7 +1408,8 @@
              " ", TargetFileNames,
              ModuleNameOption
          ]),
-    invoke_system_command(ErrorStream, cmd_verbose, MkInitCmd, MkInitOk, !IO),
+    invoke_system_command(ErrorStream, cmd_verbose_commands, MkInitCmd,
+        MkInitOk, !IO),
      maybe_report_stats(Stats, !IO),
      (
          MkInitOk = yes,
@@ -2571,6 +2572,9 @@
      globals.lookup_accumulating_option(Globals, runtime_flags,
          RuntimeFlagsList),
      join_quoted_string_list(RuntimeFlagsList, "-r ", "", " ", RuntimeFlags),
+    globals.io_lookup_accumulating_option(init_file_directories,
+        InitFileDirsList, !IO),
+    join_quoted_string_list(InitFileDirsList, "-I ", "", " ", InitFileDirs),
      globals.lookup_string_option(Globals, experimental_complexity,
          ExperimentalComplexity),
      ( ExperimentalComplexity = "" ->
@@ -2589,10 +2593,11 @@
              " ", ExperimentalComplexityOpt,
              " ", RuntimeFlags,
              " -o ", quote_arg(CFileName),
+            " ", InitFileDirs,
              " -s ", InitFilesList
          ]),
-    invoke_system_command(ErrorStream, cmd_verbose, MkInitCmd, MkInitCmdOk,
-        !IO),
+    invoke_system_command(ErrorStream, cmd_verbose_commands,
+        MkInitCmd, MkInitCmdOk, !IO),
      (
          MkInitCmdOk = yes,
          get_object_code_type(executable, PIC, !IO),



--------------------------------------------------------------------------
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