The --with-msvcrt option was intended for selecting between the older Microsoft
C runtime (crtdll.dll) and the Microsoft Visual C runtime (msvcrt.dll). This is
all now ancient history, since the MSVCRT itself has been superseded by the
Universal C runtime since Windows 10. Delete the --with-msvcrt option and all
uses of it.
configure.ac:
Delete the --with-msvcrt option.
scripts/mgnuc.in
scripts/ml.in:
Delete uses of the above configuration value.
Documentation/README.MS-VisualC.md:
Delete references to --with-msvcrt.
In Unix expansion of wildcard arguments is done by the shell. On Windows,
this is not the case and programs are responsible for expanding wildcard
argument themselves. When using source file mapping, we typically used
wildcards to specify the source files to map. When native Windows Mercury
compilers are used in the Windows command prompt or PowerShell, this does
not work, which is inconvenient to say the least. (In environments like
Cygwin or MSYS2, the shell does do wildcard expansion.)
Microsoft's C runtime has an optional component that programs can
link against which will do wildcard expansion on the argument vector
before main is called. Set up builds with MSVC to link against this
component when building the Mercury compiler.
scripts/parse_ml_options.sh-subr.in:
scripts/ml.in:
Add a new option --use-msvc-setargv-extension, which causes the the
wsetargv.obj file that enables the extension to be passed the linker.
(MSVC seems rather picky about where this is positioned. A a result
we do it within the ml script where have we more control over the matter.)
compiler/Mmakefile:
Pass --use-msvc-setargv-extension to the ml script if we are using MSVC.
Unrelated: Fix the identity of a compiler in a comment.
Unrelated: Add an XXX about something that looks suspicious.
util/mkinit.c:
Add a pointer to scripts/ml.in, saying that if the Windows entry
point (currently wmain) is updated, then the script may need to
be updated.
The Windows console (on Windows 10 at least) does not support ANSI escape
sequences by default, so turn off colored diagnostics by default when
the compiler is invoked via the mercury.bat batch file.
scripts/mercury.bat.in:
As above.
Let the host and target env types be overridden in the environment.
If not set in the environment, then they default to the values
determined by the configure script.
Use this capability to let Mercury compilers built in one of the MSYS2
environments be usable from both the MSYS2 shell (via the mmc script) and
also from cmd.exe (via the mercury.bat batch file), _without_ requiring any
modifications to Mercury.config.
scripts/Mercury.config.in:
Add two new variables that hold the host and target env type.
scripts/mercury.bat.in:
Set the host and target env types to "windows" when we are
invoked via this batch file.
Mmake.common.in:
RELEASE_NOTES:
configure.ac:
scripts/mgnuc.in:
tools/bootcheck:
tools/configure_cross:
tools/copy_mercury_binaries:
Conform to the recent change that moved most of the README files into the
Documentation directory.
util/mkinit.c:
Put the central list of the places that create .init files here.
compiler/compile_target_code.m:
scripts/c2init.in:
Point to util/mkinit.c as the repository of that central list.
Make some predicate names more descriptive.
util/mkinit_common.h:
Replace /* */ comments with // comments.
doc/mercury_user_guide.texi:
Fit the compilation section into its new position.
Fix the description of C# compilation.
scripts/mgnuc.in:
Change the help message NOT to assume that the C compiler is gcc,
since we have supported other C compilers as well for a long time.
Move a comment to the code it applies to.
compiler/mercury_compile_augment.m:
Add a comment.
compiler/export.m:
Replace /* */ C commments with // commments.
scripts/mtags.in:
If we are considering generating a duplicate tag, do not generate it
if the new location and the old are within five lines of each other.
To make this change possible, simplify the logic that deals with
duplicate tags.
Before this diff,
- the .d filed generated by "mmc --generate-dependencies mer_std.m", and
- the .d files generated by compiling all the modules in the library
had *two*-way differences: the first set of .d files contained dependencies
that the second did not, and *vice versa*. The latter differences were bugs.
Now, as far as I can tell from the deluge of data,
"mmc --generate-dependencies" generates a superset of the dependencies
generated by code generating compiler invocations, which is a safe
overapproximation of the actual dependencies.
compiler/generate_mmakefile_fragments.m:
Flatten the d_file_deps structure by effectively inlining the std_deps
structure inside it, and putting the resulting fields into a meaningful
order. Document the resulting structure as well as I can.
Use notag types to record the intended semantics of some fields
into their values, with the intention of making them harder to misuse.
They were misused before this diff; in particular, a missing module
name in one of these fields would reliably lead to the failure
of the hard_coded/foreign_import_module test case in hlc grades,
though only with a sequential invocation of mmake. (The bug was
that after "mmc --generate-dependencies foreign_import_module.m",
foreign_import_module.d was missing the dependency of
foreign_import_module.o on foreign_import_module_helper_1.mh,
and therefore the compilation foreign_import_module.c got a gcc abort
complaining about this .mh file being missing. The reason for
the bug being intermittent was that the mmc invocation that created
foreign_import_module.c would add the missing dependency, so *later*
mmake invocations, though not existing ones, would know
to build that .mh file.)
Generate rules for object files depending on .mh files that
account for both foreign_import_module declarations, and for
foreign type definitions. Add an XXX about the absence of the
information we need to properly handle the latter in the presence
of intermodule optimization.
Generate just one rule for object files depending on .mh files,
instead of generating two (one for the dependencies that exist
without intermodule optimization, and for one those that exist only
with intermodule optimization.)
Flatten the intermod_deps structure as well. It used to have two
components that encoded the outcomes of two *almost* identical tests,
but a change to d_file_deps.m below makes them actually identical,
so they do not need to be recorded twice.
Inline the old (and misnamed) gather_foreign_import_deps predicate
at its only call site, for greater clarity.
Simplify the code constructing some actions.
Use more specifically descriptive predicate and variable names.
compiler/d_file_deps.m:
Stop requiring the caller of construct_d_file_deps_gendep to pass
an aug_compilation_unit; get it to pass instead two of its components,
the only ones that are meaningful and also the only ones we actually need:
the parse_tree of the module in question and its baggage.
Eliminate some unnecessary differences between compute_d_file_deps_gendep
and compute_d_file_deps_hlds by replacing some existing tests for just
--intermod-opt with tests for *either* --intermod-opt *or* --use-opt-files,
which is the test used elsewhere for the same purpose in the rest of this
module. The two tests are equivalent for now, because handle_options.m
force-sets --no-use-opt-files. And even when we undo that force-set,
the new test will actually be what we want.
Completely redo the code that computes the dependencies that
generate_mmakefile_fragments.m converts into the dependencies
of object files on .mh files.
Give some predicates more meaningful names.
compiler/mmakefiles.m:
Add a mechanism to allow the simplification of some codes
creating actions.
compiler/module_deps_graph.m:
Give a type a more descriptive name.
Document a predicate.
Add an XXX.
compiler/make.program_target.m:
compiler/write_deps_file.m:
Conform to the changes above.
compiler/intermod.m:
Fix comment rot.
compiler/parse_tree_out_item.m:
Generate more readable output for foreign_enum pragmas.
library/digraph.m:
Put the predicates/functions of this file into meaningful groups.
We have several operations that have two names, one old and short,
and one newer, longer and more descriptive. Implement the short named
versions in terms of the longer named versions, not vice versa.
Give some internal predicates more meaningful names.
There are no algorithmic changes in this module.
browser/Mmakefile:
Update a comment.
scripts/mmake.in:
Allow $MMAKE_DEBUG to specify what debug flags to invoke gmake with.
runtime/mercury_grade.h:
Rename the grade modifier, and the C macro that represents it.
compiler/options.m:
Rename the --c-debug-grade option to --target-debug-grade.
compiler/compute_grade.m:
Rename the grade modifier, and the option that represents it.
Restrict the .target_debut grade modifier to MLDS grades.
compiler/handle_options.m:
Implement --target-debug-grade by having it imply --target-debug.
compiler/compile_target_code.m:
compiler/link_target_code.m:
Pay attention to either --target-debug-grade (for purposes related
to the grade itself) and to --target-debug (for all other purposes).
scripts/canonical_grade.in:
scripts/canonical_grade.sh-subr:
scripts/final_grade_options.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
Parse target_debug grade modifiers and --target-debug-grade options
instead of c_debug grade modifiers and --c-debug-grade options.
Add (normally commented-out) infrastructure to make it easier
to debug changes.
Restrict the .target_debut grade modifier to MLDS grades.
scripts/mgnuc.in:
scripts/mgnuc_file_opts.sh-subr:
Rename some variables to clarify the distinction between the
--target-debug option (which, like -g, enabled debugging of only one file)
and the --target-debug-grade option (which enables it for the whole
program).
configure.ac:
Make it easier to debug grade-related changes by recording
both autoconfigured and user-supplied grades that the rejected by
the canonical_grade script.
Conform to the changes above.
README.sanitizers:
doc/user_guide.texi:
grade_lib/grade_spec.m:
grade_lib/grade_string.m:
scripts/ml.in:
tests/warnings/help_text.err_exp:
tools/lmc.in:
tools/test_mercury:
Conform to the changes above.
scripts/Mmake.vars.in:
Add some XXXs about style.
Until now, it kept debugging symbols in .o files, but not in executables.
scripts/ml.in:
Ask the linker (via the C compiler) to preserve debugging symbols
if the grade includes the c_debug component.
scripts/Mercury.config.bootstrap.in:
Delete this file.
configure.ac:
scripts/Mmakefile:
Copy scripts/Mercury.config to scripts/Mercury.config.bootstrap.
Add a note about filtering out options that the installed compiler
does not yet understand.
scripts/Mercury.config.in:
Document the new dual role of this file.
scripts/Mercury.config.in:
scripts/Mercury.config.bootstrap.in:
Use spaces for indentation instead of tabs.
List all the environment variables in lexicographic order.
Sort the big groups.
Put the options in the definitions of DEFAULT_MCFLAGS into
logical groups, indicated by indentation.
Eliminate the differences between the values of DEFAULT_MCFLAGS
in the two config files. Make all the changes required for this
to the bootstrap version. The need for these changes seem to be
caused by updates to Mercury.config.in that *should* have updated
the bootstrap version as well, but did not. (The difference in
the lists of copyright years is stark.)
The extra targets that this diff puts into .dep files are not yet used,
though they can be (and have been) tested manually.
compiler/generate_mmakefile_fragments.m:
Generate three new mmake rules to do library installs:
- one to install non-grade-specific files
- one to install grade-specific files, and
- one to
- invoke the ngs target once for the current grade, and
- invoke the gs target for each to-be-installed grade.
The code in this last rule that saves and restores the working files
of the current directory is an adapted version of the lib%.install_grades
target in scripts/Mmake.rules.
Add some code to prepare for storing .int and .int2 files in separate
directories.
scripts/Mmake.rules:
scripts/Mmake.vars.in:
Delete code whose job was to install .s and .pic_s files.
Such files were never meant to be installed; their only purpose
was debugging.
Add a conditional definition to shut up a useless warning by gmake.
scripts/mmake_grade_test:
This new script tests whether a given grade targets C, Java or C#,
and if it targets C, whether it is an MLDS or LLDS grade.
It is intended for use by the new make actions generated
by generate_mmakefile_fragments.m.
scripts/mmake_grade_test_test:
This new script tests the operation of mmake_grade_test.
scripts/Mmakefile:
Install mmake_grade_test (but not mmake_grade_test_test) along with
the other scripts.
scripts/ml.in:
Fix the vim modeline.
scripts/mmake.in:
Fix indentation.
Put .mh files into a Mercury/mhs subdirectory when --use-subdirs
or --use-grade-subdirs is used.
compiler/file_names.m:
Replace ext_cur_mh with ext_cur_ngs_max_cur_mh, in the new category
ext_cur_ngs_max_cur. The new category is similar to that for .mih
files, except that .mh files are never placed in grade-specific
subdirectories.
compiler/handle_options.m:
Add Mercury/mhs subdirs to list of C include directories
when --use-subdirs or --use-grade-subdirs is in effect.
compiler/write_deps_file.m:
Add $(mhs_subdir) prefix before %.mh patterns.
Create a Mercury/mhs -> .. symlink when installing.
This is required by mmc --make and mmake --use-subdirs.
Conform to the changes above.
compiler/export.m:
compiler/make.file_names.m:
compiler/make.program_target.m:
compiler/mercury_compile_llds_back_end.m:
compiler/mlds_to_c_file.m:
Conform to the changes above.
scripts/Mmake.vars.in:
Define the variable mhs_subdir.
scripts/Mmake.rules:
Add -I option to find .mh files when --use-subdirs is used.
browser/.mgnuc_copts:
browser/MDB_FLAGS.in:
compiler/.mgnuc_copts:
compiler/COMP_FLAGS.in:
deep_profiler/.mgnuc_copts:
deep_profiler/DEEP_FLAGS.in:
extras/EXTRAS_FLAGS.in:
grade_lib/.mgnuc_copts:
grade_lib/GRADE_LIB_FLAGS.in:
library/.mgnuc_copts:
mdbcomp/.mgnuc_copts:
mdbcomp/MDBCOMP_FLAGS.in:
mfilterjavac/.mgnuc_copts:
mfilterjavac/MFILTERJAVAC_FLAGS.in:
profiler/.mgnuc_copts:
profiler/PROF_FLAGS.in:
slice/.mgnuc_copts:
slice/SLICE_FLAGS.in:
ssdb/.mgnuc_copts:
ssdb/SSDB_FLAGS.in:
tests/.mgnuc_copts.ws:
tests/WS_FLAGS.ws:
trace/.mgnuc_copts:
tools/lmc.in:
Add -I options to find .mh files when the workspace is built
with mmake --use-subdirs.
samples/c_interface/standalone_c/Makefile:
Add option to let the C compiler find the .mh file.
NEWS.md:
Announce change.
Delete trailing whitespace.
Function trailing with tagged trail entries does not work unless the functions
are aligned on word boundaries. In trailing grades with GCC, we have long
passed an option (-falign-functions) to force this to happen. Do the same for
clang, which supports the same option. This fixes the failure of function
trailing tests on Apple Silicon based machines.
(This does not appear an issue on Intel-based Macs, although passing
-falign-functions option there is harmless.)
scripts/mgnuc.in:
compiler/compile_target_code.m:
Tell clang to align functions on word boundaries in trailing grades.
Add a new configuration option, --with-cp, that controls whether file copying
by the Mercury compiler is done by invoking the "cp" command or by using the
file copying predicates in the new copy_util module.
When using MSVC or when using MinGW, make the new file copying predicates the
default. (These configurations are the most likely to be the ones where the
Mercury compiler is used from the Windows command prompt, where cp is not
available.)
configure.ac:
Add the new option, --with-cp.
Require the bootstrap compiler to support the --install-method configuration
option that was added last November.
scripts/Mercury.config.in:
Set the install method configuration option.
More generally, clean-up the various batch files we have.
scripts/mdb.bat.in:
Ensure that the value of MERCURY_DEBUGGER_INIT environment variable does
*not* include double quotes, otherwise the path to the mdbrc file will
be incorrect.
scripts/*.bat.in:
Require command extensions to be enabled. This is the default on
all Windows systems we support; explicitly enabling them is just in case
the user turns them off for some reason.
Don't disable echoing twice.
Quote the entire argument to the set command; this should avoid double
quotes ending up where we don't want them.
Update copyright notices.
configure.ac:
Mmake.common.in:
Add a configuration parameter that says if the batch files in
the scripts directory should be installed or not.
scripts/Mmakefile:
Make the set of scripts to be installed dependent on the value of
the new configuration parameter.
scripts/ml.in:
Assign SHARED_LIBS only when it will actually be used,
as the default value of SHARED_LIBS set by configure
may invoke "gcc -print-libgcc-file-name" in a command substitution.
Fix an issue exposed by commit 7d001786a0.
VPATH indirectly refers to GRADESTRING_NO_TARGET.
When the VPATH is being calculated after the makefile is read,
the reference to GRADESTRING_NO_TARGET causes make to try to run the
Mercury compiler to output a grade string, but we may not yet have a
working Mercury compiler.
scripts/Mmake.vars.in:
Set EXTRA_INIT_DIRS_NO_TARGET to a non-empty string
(that references GRADESTRING_NO_TARGET in a pattern substitution)
only if EXTRA_LIB_DIRS is actually non-empty.
GNU Make 4.4 reports undefined variable warnings about MERC_INT_DIR.
The problem is related to MERC_INT_DIR being referenced in a
$(shell ...) command, but being defined later.
scripts/Mmake.vars.in:
Move the definition of MERC_INT_DIR to Mmake.vars,
before its reference in MERC_INT_DIR_FOR_VPATH.
scripts/Mmake.rules:
Delete definition of MERC_INT_DIR from Mmake.rules.
This prevents warnings about undefined variables $@ and $*
when running mmake with GNU Make 4.4.0.90 or above (Mantis bug 566).
scripts/Mmake.vars.in:
Define "_NO_TARGET" variants of ALL_GRADEFLAGS, ALL_MCFLAGS and
GRADESTRING variables that make no reference to target-specific
variables such as GRADEFLAGS-prog.
Add EXTRA_INIT_DIRS_NO_TARGET.
Delete MERCURY_EXTRA_INT_DIRS and MERCURY_EXTRA_INIT_DIRS,
instead referring to EXTRA_INT_DIRS and EXTRA_INIT_DIRS_NO_TARGET
directly. The variables with the "MERCURY_" prefix don't appear to
serve any purpose.
Rename UNIX_MERCURY_{EXTRA_INT_DIRS,MERC_INT_DIR,_EXTRA_INT_DIRS}
to {EXTRA_INT_DIRS,MERC_INT_DIR,EXTRA_INT_DIRS}_FOR_VPATH
so they aren't used for some other purpose.
Make EXTRA_INIT_DIRS_FOR_VPATH refer to EXTRA_INIT_DIRS_NO_TARGET
instead of EXTRA_INIT_DIRS.
Update MMAKE_VPATH to refer to the _FOR_VPATH variables,
which do not refer to any target-specific variables.
Fix some whitespace.
scripts/Mmake.rules:
Add a rule for the pattern target %.depend_ints which invokes mmc
with --generate-dependencies-ints, just as %.depend invokes mmc
with --generate-dependencies.
Document the reason why this addition requires yet more code duplication.
scripts/Mmake.vars.in:
Add the make variable definitions needed by the new code in Mmake.rules.
compiler/mercury_compile_main.m:
Make it practical to use --generate-dependencies-ints in a multi-directory
project like the Mercury implementation, in which some directories
may use --generate-dependencies-ints as the target of "mmake depend",
while other directories, which come earlier in the build process,
still do "mmake depend" using just --generate-dependencies.
In such cases, mmc --generate-dependencies-ints in the later directory
may fail to generate .int0, .int or .int2 files simply because
the .int3 file of a module they import (from an earlier directory
in which "mmake depend" uses just --generate-dependencies) hasn't been
made yet. (This is what would happen if someone executed "mmake depend"
at the top level in a freshly checked out workspace.)
The practical fix is to simply report this fix using an error message
that still allows the compiler to exit with an exit status that
indicates success.
Most of the rest of this diff is there to make this possible.
compiler/error_spec.m:
Add a new phase, phase_find_files, that specifically indicates
that we couldn't read a file because we couldn't find it.
Give it a string argument naming the file, to allow mercury_compile_main.m
to replace several error_specs that each report not being able to find
one file with a single error_spec that reports not being able to find
many files.
Add a utility function for use by mercury_compile_main.m to construct
that error message.
Add another new phase, phase_make_int, that indicates a problem
we discovered in the code of a Mercury source file while trying
to decide what should got into one of the that module's interface files.
compiler/parse_error.m:
Here also use separate function symbols in the fatal_module_read_error
type for the situations "couldn't find a file" and "couldn't read a file".
Update the predicates constructing error_specs to handle this distinction
(which the callers make using the new function symbol in the above type).
compiler/compile_target_code.m:
compiler/error_util.m:
compiler/grab_modules.m:
compiler/options_file.m:
compiler/parse_module.m:
compiler/read_modules.m:
compiler/recompilation.check.m:
compiler/write_module_interface_files.m:
Conform to the changes above.
compiler/options.m:
Add a way to detect the presence of this diff in an installed compiler.
compiler/generate_dep_d_files.m:
Document the reason for the split between .dep and .dv files.
Fix typo.
scripts/mmake.in:
Delete code that was only needed for bootstrapping that split
(in 1999!).
Document an incorrect comment.
... instead of building a bunch of .c files.
Our tradition of adding an "s" at the end of a suffix to mean "all of the
files with the original suffix" had a problem when we added C# as a target
language. Until then, just as "os" stood for ".o files" when it occurred
as either a mmake target, mmc --make target, or mmake variable name component.
"cs" likewise stood for ".c files", but was now also needed to mean ".cs file".
We coped by keeping "cs" meaning ".c files", and adding "csharp" as a target
name synonym to mean ".cs file".
This diff keeps that synonym, but it changes
- the name needed to refer to ".c files" from "cs" to "all_cs"
- the name needed to refer to ".o files" from "os" to "all_os"
- the name needed to refer to ".pic_o files" from "pic_os" to "all_pic_os"
- the name needed to refer to ".cs files" from "css" to "all_css"
- the name needed to refer to ".java files" from "javas" to "all_javas"
- the name needed to refer to ".opt files" from "opts" to "all_opts"
- the name needed to refer to ".trans_opt files"
from "trans_opts" to "all_trans_opts"
It would be nice if we could apply this same change to all other similar
target names and mmake variable name suffixes, such as "ints" and "int3s",
but some of those names are already in use to mean semantically different
things. All of the names above that used to have the form "<ext>s" and
now have the form "all_<ext>s" stood for all the files with extension
".<ext>" that are prerequisites for building a linked target, i.e.
an executable or a library. But the mmake variable name suffixes
".all_mihs", ".all_mhs" and ".all_int0s" each stand for something subtly
different: the names of files that *may or may not exist", but which,
if they do exist, should be deleted by a clean or realclean target.
To make this breaking change easier to handle by users, this diff does
not simply redefine the meaning of ".all_int0s". (It does change the meaning
of the "cs" target, but the fact this will happen at some time has been
announced ages ago.) Instead, it defines three new mmake var suffixes,
".mihs_to_clean", ".mhs_to_clean" and ".int0s_to_clean", which are
synonyms for ".all_mihs", ".all_mhs" and ".all_int0s" respectively,
and announces that ".all_mihs", ".all_mhs" and ".all_int0s" are being
deprecated, and will have the above change of semantics applied to them
in the future.
NEWS.md:
Announce the breaking change.
compiler/make.top_level.m:
Stop treating the target "cs" as meaning "build all the .c files
for this program".
The code of classify_target_2 has long been semidet, but only in a way
that was not apparent to the compiler. Change the code to allow the
compiler to see its semidet nature while keeping the algorithm the same,
except for the change in the paragraph above.
This includes keeping e.g. "ints" as meaning "build all the .int/.int2
files needed by this program".
compiler/write_deps_file.m:
Stop generating mmake variables with suffixes ".cs", ".os", ".pic_os",
".javas" and ".css". The mmake variables with suffixes ".all_cs",
".all_os", ".all_pic_os", ".all_javas" and ".all_css" already existed.
All had the same value as the mmake variable without the "all",
with one exception: ".cs". However, in this case, the old (and still
current) value of ".all_cs" is what the value of ".cs" *should* have been.
Simplify some code.
The following changes in compiler/*.m are only cosmetic, but they helped me
rule out possible sources of problems with incomplete versions of this diff.
compiler/file_names.m:
Add a version of a fact_table_file_name_return_dirs which does not
return directories, since most of its callers don't need that info.
compiler/make.program_target.m:
Clarify code by making variable names more descriptive,
compiler/make.file_names.m:
compiler/make.module_target.m:
Conform to the changes above,
browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
grade_lib/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
mfilterjavac/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
ssdb/Mmakefile:
Rename os to all_os, cs to all_cs, css to all_css, javas to all_javas,
and opts to all_opts. (There were no occurrences of trans_opts to rename.)
Replace [s as sh command names in actions.
scripts/Mmake.vars.in:
Specify the names of mmake variables holding the names of sets of files
with a given extension directly, since for some of them, adding an "s"
at the end of the name of the extension does not generate the name
of the corresponding mmake variable anymore.
scripts/Mmake.rules:
Use the directly specified mmake variable names from Mmake.vars.in
in the rule for installing lbraries. Temporarily add some debugging
output to make suree that the updated nested mmake variable references
work as intended.
tools/bootcheck:
Specify the names of mmake targets for making all the files in a program
with a given extension directly, since adding an "s" at the end of the
name of the extension does not generate the name of the corresponding
mmake target anymore.
Print timestamps around the action of checking namespace cleanliness,
to allow the time taken by that action to be measured. (I kept track
of bootchecks as they happened while working on this diff, and found
this time to be nontrivial.)
scripts/c2init.in:
scripts/mercury.in:
scripts/mmake.in:
scripts/mmc.in:
scripts/prepare_install_dir.in:
Indent by four spaces, not by tabs, or by three spaces.
Use ${varname}, not just $varname.
Put successive commands on separate lines.
Indent case statements in a consistent manner: put case patterns
on their own lines; put ;;s on their own lines.
Put quotes around strings that should be considered one word
even if they are empty or contain spaces.
scripts/init_grade_options.sh-subr:
scripts/mdb.in:
scripts/mercury_config.in:
scripts/mercury_update_interface.in:
scripts/mgnuc.in:
scripts/ml.in:
scripts/parse_ml_options.sh-subr.in:
Indent by four spaces, not by tabs, or by three spaces.
Use ${varname}, not just $varname.
Put successive commands on separate lines.
Indent case statements in a consistent manner: put case patterns
on their own lines; put ;;s on their own lines.
Replace the [ command with test.
Put quotes around strings that should be considered one word
even if they are empty or contain spaces.
Fix English in messages and comments.
The internal option --fullarch has been deprecated in favour of --target-arch
since 2014. Delete it and replace any uses with --target-arch.
compiler/options.m:
As above.
scripts/Mercury.config.in:
scripts/Mercury.config.boostrap.in:
extras/windows_installer_generator/sample/Mercury.config:
Conform to the above change.
scripts/Mmake.vars.in:
The above commit breaks the installed version of mmake on Linux.
Revert it until we find a solution that works on both Windows
and Linux.
These were failing because debugger expects Windows-style paths in the
test_mdbrc file, but it was being generated with Unix-style paths. A
similar problem was recently fixed for MSVC, this change extends that
fix to also work for MSYS2/MinGW64.
configure.ac:
Define a new configuration variable, FIX_PATH_FOR_WINDOWS, that expands
to the command used to do path conversion in Unix-like environments on
Windows. (The previous fix for MSVC used FIX_PATH_FOR_CC to do this,
but the MinGW64 port of GCC does use Unix-style paths so that cannot
be used here.)
scripts/Mmake.vars.in:
Add a new mmake variable, FIX_PATH_FOR_WINDOWS.
scripts/Mmakefile:
Use FIX_PATH_FOR_WINDOWS when creating the test_mdbrc file.
scripts/Mmake.vars.in:
The variable FIX_PATH_FOR_CSC has not been used since the old
.NET backend was deleted. (The current C# backend does not use
mmake.)
The MERCURY_OPTIONS environment variable supported these options
-a benchmark_all_solns
-r repeats
-t use_own_timer
to perform microbenchmarks very early on in the Mercury project,
but the time for that is past.
runtime/mercury_wrapper.c:
Delete code supporting -a, -r and -t options.
scripts/mprof_merge_runs:
Delete mention of -r option.
tests/benchmarks/Mmakefile:
Delete/comment out rules that makes use of the -r option.
--no-ansi (mgnuc) and --no-ansi-c (mmc) have not actually done anything for
many years now. Deprecate these options and remove their "use" throughout most
of the Mercury system. (The remaining uses are in the Makefiles for the Boehm
GC, which need to be updated separately.)
Also deprecate the internal compiler option --cflags-for-ansi.
compiler/options.m:
Document that --no-ansi-c is now deprecated.
Document that the internal option --cflags-for-ansi is now
deprecated.
compiler/compile_target_code.m:
Do not pass the ANSI options to the C compiler.
scripts/mgnuc.in:
scripts/mgnuc_file_opts.sh-subr:
Deprecate the --no-ansi option; delete code that no longer does
anything useful.
configure.ac:
Delete the configuration variable CFLAGS_FOR_ANSI; it is only ever
set to be empty. (The comment talks about --no-ansi doing other things
in the mgnuc script. It used to also cause some preprocessor macros
to be defined for compatibility with the system headers on some
platforms -- that has not been the case since 2013.)
doc/user_guide.texi:
Document that --no-ansi-c is deprecated.
bytecode/Mmakefile:
compiler/Mercury.options:
library/Mercury.options:
extras/odbc/odbc.m:
runtime/Mmakefile:
scripts/Mercury.config.bootstrap.in:
scripts/Mercury.config.in:
tests/hard_coded/Mercury.options:
tests/valid/Mercury.options:
trace/Mmakefile:
util/Mmakefile:
Conform to the above change.
NEWS.md:
Announce the above.