[m-rev.] for review: enable library grade detection
Julien Fischer
jfischer at opturion.com
Sat Sep 7 03:12:08 AEST 2013
Enable library grade detection by default.
Use -R instead of -r with cp by default.
Fix some documentation errors.
compiler/options.m:
Enable library grade detection by default.
Document the --no-detect-libgrades option.
Make the default install command dir option, -R,
rather than -r. The former is more portable.
scripts/Mercury.config.in:
Do not hardcode the set of library grades at configuration time.
compiler/mercury_compile.m:
Do not clear the library grade set before adding any detected
grades since doing so also prevents additional grades being
specified via the LIBGRADES variable.
doc/user_guide.texi:
Document --no-detect-libgrades.
Replace some uses of `:' as a module qualifier.
Fix a typo: s/outut/output/.
Julien.
diff --git a/compiler/mercury_compile.m b/compiler/mercury_compile.m
index aded039..b694ecc 100644
--- a/compiler/mercury_compile.m
+++ b/compiler/mercury_compile.m
@@ -2092,15 +2092,7 @@ do_detect_libgrades(VeryVerbose, StdLibDir, GradeOpts, !IO) :-
dir.foldl2(do_detect_libgrade(VeryVerbose), ModulesDir,
[], MaybeGradeOpts, !IO),
(
- MaybeGradeOpts = ok(GradeOpts0),
- (
- GradeOpts0 = [],
- GradeOpts = GradeOpts0
- ;
- GradeOpts0 = [_ | _],
- % Override any --libgrades settings from Mercury.config.
- GradeOpts = ["--no-libgrade" | GradeOpts0]
- )
+ MaybeGradeOpts = ok(GradeOpts)
;
MaybeGradeOpts = error(_, _),
GradeOpts = []
diff --git a/compiler/options.m b/compiler/options.m
index 45048bb..4a07250 100644
--- a/compiler/options.m
+++ b/compiler/options.m
@@ -1893,8 +1893,8 @@ option_defaults_2(build_system_option, [
mercury_configuration_directory_special - string_special,
mercury_configuration_directory - maybe_string(no),
install_command - string("cp"),
- install_command_dir_option - string("-r"),
- detect_libgrades - bool(no),
+ install_command_dir_option - string("-R"),
+ detect_libgrades - bool(yes),
libgrades - accumulating([]),
libgrades_include_components - accumulating([]),
libgrades_exclude_components - accumulating([]),
@@ -5788,12 +5788,10 @@ options_help_build_system -->
"\tSpecify the flag to pass to the install command to install",
"\ta directory. The given command will be invoked as",
"\t`<command> <option> <source> <target>'",
- "\tto install each directory. The default option is `-r'.",
-
- % `--detect-libgrades' is a developer-only that controls
- % whether the compiler should scan the installation directory
- % to determine which standard library grades are available.
-
+ "\tto install each directory. The default option is `-R'.",
+ "--no-detect-libgrades",
+ "\tDo not scan the installation directory to determine which",
+ "\tstandard library grades are available.",
"--libgrade <grade>",
"\tAdd <grade> to the list of compilation grades in",
"\twhich a library to be installed should be built.",
diff --git a/doc/user_guide.texi b/doc/user_guide.texi
index eccc6d9..29992bd 100644
--- a/doc/user_guide.texi
+++ b/doc/user_guide.texi
@@ -968,8 +968,8 @@ It may be as simple as this @file{mypackage.m} file:
@noindent
This defines a module @samp{mypackage} containing
-sub-modules @samp{mypackage:foo}, @samp{mypackage:bar},
-and @samp{mypackage:baz}.
+sub-modules @samp{mypackage.foo}, @samp{mypackage.bar},
+and @samp{mypackage.baz}.
It is also possible to build libraries of unrelated
modules, so long as the top-level module imports all
@@ -7081,7 +7081,7 @@ library as well as any other libraries specified via the
@findex --output-grade-defines
Print the flags that are passed to the C compiler to define the macros used to
specify the compilation grade.
-The flags are printed to the standard outut.
+The flags are printed to the standard output.
@sp 1
@item --output-c-include-dir-flags
@@ -9371,7 +9371,13 @@ The default command is @samp{cp}.
Specify the flag to pass to the install command to install
a directory. The given command will be invoked as
@code{@var{command} @var{option} @var{source} @var{target}}
-to install each directory. The default option is @samp{-r}.
+to install each directory. The default option is @samp{-R}.
+
+ at sp 1
+ at item --no-detect-libgrades
+ at findex --no-detect-libgrades
+Do not scan the installation direcotry to determine which
+standard library grades are available.
@sp 1
@item --libgrade @var{grade}
@@ -10849,7 +10855,7 @@ against, e.g. the @samp{--ml} and @samp{--mld} options.
(@pxref{Libraries}).
The Mercury standard library is always included in this set.
-In C grades the @samp{--generate-standalone-interface} option causes
+In C grades, the @samp{--generate-standalone-interface} option causes
the compiler to generate an object file that should be linked into
the executable.
This object file contains two functions:
diff --git a/scripts/Mercury.config.in b/scripts/Mercury.config.in
index 3d06b09..d487803 100644
--- a/scripts/Mercury.config.in
+++ b/scripts/Mercury.config.in
@@ -130,6 +130,4 @@ DEFAULT_MCFLAGS=\
@HAVE_BOXED_FLOATS@ \
@MCFLAGS_FOR_CC@ \
$(MERCURY_DEFAULT_OPT_LEVEL) \
- @MMC_USE_SYMLINKS_OPT@ \
- @LIBGRADE_OPTS@
-
+ @MMC_USE_SYMLINKS_OPT@
More information about the reviews
mailing list