[m-rev.] diff: add `--output-cc' option

Julien Fischer juliensf at csse.unimelb.edu.au
Fri Jun 22 16:39:06 AEST 2007


Estimated hours taken: 0.5
Branches: main

Add a new option that makes Mercury print out the name of the C compiler
that it currently configured to use.

compiler/options.m:
 	Add a new option `--output-cc' that prints the name of the C
 	compiler that Mercury is configured to use.

compiler/mercury_compile.m:
 	Implement the new option.

doc/user_guide.texi:
 	Document the new option.

Julien.

Index: compiler/mercury_compile.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mercury_compile.m,v
retrieving revision 1.442
diff -u -r1.442 mercury_compile.m
--- compiler/mercury_compile.m	19 Jun 2007 01:10:53 -0000	1.442
+++ compiler/mercury_compile.m	22 Jun 2007 06:30:35 -0000
@@ -386,6 +386,7 @@
          FileNamesFromStdin),
      globals.lookup_bool_option(Globals, output_libgrades,
          OutputLibGrades),
+    globals.lookup_bool_option(Globals, output_cc, OutputCC),
      globals.lookup_bool_option(Globals, make, Make),
      globals.lookup_maybe_string_option(Globals, generate_standalone_interface,
          GenerateStandaloneInt),
@@ -423,6 +424,10 @@
          globals.lookup_accumulating_option(Globals, libgrades, LibGrades),
          io.stdout_stream(Stdout, !IO),
          io.write_list(Stdout, LibGrades, "\n", io.write_string, !IO)
+    ; OutputCC = yes ->
+        globals.lookup_string_option(Globals, cc, CC),
+        io.stdout_stream(StdOut, !IO),
+        io.write_string(StdOut, CC ++ "\n", !IO)
      ; GenerateMapping = yes ->
          source_file_map.write_source_file_map(Args, !IO)
      ; GenerateStandaloneInt = yes(StandaloneIntBasename) ->
Index: compiler/options.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/options.m,v
retrieving revision 1.567
diff -u -r1.567 options.m
--- compiler/options.m	19 Jun 2007 04:20:45 -0000	1.567
+++ compiler/options.m	22 Jun 2007 06:30:35 -0000
@@ -179,6 +179,7 @@
      ;       output_link_command
      ;       output_shared_lib_link_command
      ;       output_libgrades
+    ;       output_cc

      % Auxiliary output options
      ;       smart_recompilation
@@ -980,7 +981,8 @@
      output_grade_string                 -   bool(no),
      output_link_command                 -   bool(no),
      output_shared_lib_link_command      -   bool(no),
-    output_libgrades                    -   bool(no)
+    output_libgrades                    -   bool(no),
+    output_cc                           -   bool(no)

  ]).
  option_defaults_2(aux_output_option, [
@@ -1743,6 +1745,7 @@
  long_option("output-link-command",  output_link_command).
  long_option("output-shared-lib-link-command", output_shared_lib_link_command).
  long_option("output-libgrades", output_libgrades).
+long_option("output-cc",        output_cc).

  % aux output options
  long_option("smart-recompilation",  smart_recompilation).
@@ -3211,7 +3214,9 @@
          "\tstandard output.",
          "--output-libgrades",
          "\tPrint the list of compilation grades in which a library",
-        "\tto be installed should be built to the standard output."
+        "\tto be installed should be built to the standard output.",
+        "--output-cc",
+        "\tPrint the name of the C compiler to the standard output."
      ]).

  :- pred options_help_aux_output(io::di, io::uo) is det.
Index: doc/user_guide.texi
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/doc/user_guide.texi,v
retrieving revision 1.529
diff -u -r1.529 user_guide.texi
--- doc/user_guide.texi	19 Jun 2007 04:20:47 -0000	1.529
+++ doc/user_guide.texi	22 Jun 2007 06:30:36 -0000
@@ -6594,6 +6594,11 @@
  Print the list of compilation grades in which a library to
  be installed should be built to the standard output.

+ at sp 1
+ at item --output-cc
+ at findex --output-cc
+Print the name of the C compiler to the standard output.
+
  @end table

  @node Auxiliary output options

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