Discussion of these changes can be found on the Mercury developers
mailing list archives from June 2018.
COPYING.LIB:
Add a special linking exception to the LGPL.
*:
Update references to COPYING.LIB.
Clean up some minor errors that have accumulated in copyright
messages.
This file-specific setting will override a default setting of expandtabs
in $HOME/.vimrc.
*/Makefile:
*/Mmakefile:
As above.
tests/hard_coded/.gitignore:
Don't ignore the purity subdir. This ignore must have been left over
from when purity.m was a test in hard_coded, not hard_coded/purity,
and it ignored an executable, not a directory.
Branches: main, 11.07
Make compilation of extras/references more reliable.
extras/references/Makefile:
extras/references/Mmakefile:
extras/references/Mercury.options:
Use mmc --make to build and install this library (as we do with
some of the other extras packages) instead of mmake. This allows
us to sue the grade filtering mechanism in mmc --make to ensure
that we only install the library in grades that support trailing.
Fix a number of problems that prevent this library installing cleanly:
+ don't require the presence of asm_fast grades; build the library in
the default grade with the trail segment component added.
+ use trail segment grades instead of fixed sized trail grades (the latter
are not installed anymore unless specifically requested by the user).
+ install the C header file that is part of this library.
+ delete ancient workarounds for supporting shared libraries on Linux.
extras/references/tests/Mmakefile:
extras/references/samples/Mmakefile:
Conform to the above changes.
Don't assume that the extension for static libraries is .a; it's
not on some systems.
extras/references/global.m:
Add a feature set pragma specifying that trailing is required.
extras/references/nb_reference.m:
s/__/./
extras/lex/lex.m:
Unrelated change: avoid using an obsolete function.
Branches: main
Remove uses of the old C interface from the extras distribution.
extras/lazy_evaluation/lazy_list.m:
extras/quickcheck/qcheck.m:
extras/references/samples/max_of.m:
Use the new foreign language interface instead of the old C
interface.
extras/curses/basics.m:
As above, and conform to our current coding standards.
Estimated hours taken: 30
Added built-in mmake support for installing user libraries.
Mmake.common.in:
Moved the definitions of many of the generic install directories
(plus FULLARCH and LIBGRADES) to scripts/Mmake.vars.in, so they
can be used for things other than just the Mercury compiler.
compiler/modules.m:
Added code to generate appropriate lib<module>.install* targets.
Improved the dependency list generated for the lib<module> target to
include intermodule optimisation files if and only if the
appropriate flags have been set (previously it always depended on
the `.opt' files, but never on the `.trans_opt' files).
scripts/Mmake.rules:
Added some rules for use when installing libraries.
scripts/Mmake.vars.in:
Added the definitions of many of the generic install directories
(plus FULLARCH and LIBGRADES) from Mmake.common.in.
Added support for overriding and/or adding to the definition of
LIBGRADES on a per-library basis.
scripts/mercury_cleanup_install:
New script, for cleaning up after failed installs.
scripts/Mmakefile:
Added `mercury_cleanup_install' to the list of scripts to be
installed.
bindist/Mmakefile:
bindist/bindist.Makefile.in:
Added `mercury_cleanup_install' and `vpath_find' to the list of
utilities included in and installed by a binary distribution. These
are used by some of the install targets.
doc/user_guide.texi:
Documented the new features.
extras/references/Mmakefile:
extras/references/samples/Mmakefile:
Changed to exploit/test new features.
Estimated hours taken: 0.75
Mmakefile:
*/Mmakefile:
*/*/Mmakefile:
*/*/*/Mmakefile:
Use `clean_local' instead of `clean' and `realclean_local' instead
of `realclean' where appropriate. This is necessary now that
`realclean' does not depend on `clean'.
Estimated hours taken: 15
Split the automatically generated `.dep' file into two files. The new `.dv'
file contains all the variable definitions which used to be in the `.dep'
file, which now contains just the rules. With mmake including the `.dv'
files before the user's Mmakefile and the `.dep' files after, this allows
user-defined Mmakefiles to refer to the automatically-generated variables
and automatically-generated rules to refer to variables defined in the
user's Mmakefile. This was possible before to a limited extent, but in
particular dependency lists for automatically-generated rules could not
refer to user-defined variables.
Also introduced `C2INITARGS' as part of an illustration of how this change
is useful (though probably this should be a separate change). `C2INITARGS'
should be used to specify extra files to be passed to `c2init', rather than
the currently-used `C2INITFLAGS' (which should only be used for option
flags). The `_init.c' target should depend on these extra arguments, but it
was not possible to do this automatically prior to this change (at least,
not if one wanted to support per-program specification of `C2INITARGS').
compiler/modules.m:
Generate the new `.dv' files and revised `.dep' files.
Update the `change_clean' and `real_clean' targets to delete the
`.dv' files.
Update the `_init.c' rule to refer to `$(ALL_C2INITARGS)' as well as
`$(ALL_C2INITFLAGS)', and add a dependency on `$(ALL_C2INITARGS)'.
scripts/Mmake.rules:
Add appropriate rules and dependencies for `.dv' files.
scripts/Mmake.vars.in:
Add definitions for implementing `C2INITARGS'.
scripts/mmake.in:
Add code for using `.dv' files (while maintaining backward
compatibility for when they don't exist).
doc/user_guide.texi:
Document the new `.dv' files.
Document the new `C2INITARGS' variables and the dependencies they
imply.
../clpr/Mmakefile:
../clpr/samples/Mmakefile:
extras/complex_numbers/samples/Mmakefile:
extras/complex_numbers/tests/Mmakefile:
extras/graphics/mercury_opengl/Mmakefile:
extras/references/samples/Mmakefile:
extras/references/tests/Mmakefile:
extras/trailed_update/samples/Mmakefile:
extras/trailed_update/tests/Mmakefile:
Update to use `C2INITARGS' instead of `C2INITFLAGS', where
appropriate, and remove any now-obsolete `%_init.c' dependencies
(which wouldn't have worked anyway since GNU Make ignores pattern
dependencies with no commands).
Estimated hours taken: 70 (plus whatever pets spent when he wrote the
original version of this)
This change adds a new extras directory, "references". This directory
contains two impure reference type modules and a module that allows scoped
non-backtrackable update, along with examples of using them and tests.
These modules are intended to be useful when HAL is retargetted to Mercury,
for implementing global variables (backtracking and non-backtracking), and
may also be useful for the debugger.
In order to implement these features, a new memory zone "global heap" was
added to the runtime system, for a heap which is not reclaimed on failure,
along with a pair of functions for copying terms to this heap.
runtime/mercury_deep_copy.c:
runtime/mercury_deep_copy.h:
Added two functions, MR_make_permanent() and
MR_make_partially_permanent(), which essentially do a deep copy of a
term to the global heap.
(In conservative GC grades, these functions actually do nothing).
runtime/mercury_engine.c:
runtime/mercury_engine.h:
Added fields global_heap_zone and e_global_hp (for the global heap
and its heap pointer) to the MR_mercury_engine_struct, along with
appropriate initialisation, etc.
Defined MR_heap_zone, MR_solutions_heap_zone, and
MR_global_heap_zone for convenient access to the corresponding field
of the relevant Mercury engine.
runtime/mercury_memory.c:
Added code for handling the size and zone size of the global heap.
runtime/mercury_regorder.h:
runtime/mercury_regs.h:
Defined MR_global_hp (the global heap pointer for general use),
along with corresponding other changes.
runtime/mercury_wrapper.c:
runtime/mercury_wrapper.h:
Added declarations and initialisation of the size and zone_size of
the global_heap.
Added an entry for MR_GLOBAL_HP_RN to print_register_usage_counts()
(plus missing entries for MR_SOL_HP_RN, MR_MIN_HP_REC and
MR_MIN_SOL_HP_REC).
New files:
extras/references/Mmakefile:
Mmakefile for building and testing these modules.
extras/references/README:
Description of contents of this directory.
extras/references/global.m:
A wrapper module for building a library containing the nb_reference,
reference and scoped_update modules.
extras/references/nb_reference.m:
Implements references which are not backtracked on failure.
extras/references/reference.m:
Implements references which *are* backtracked on failure.
extras/references/scoped_update.m:
Allows nested scoping of non-backtracking references.
extras/references/samples/Mmakefile:
extras/references/samples/max_of.m:
extras/references/samples/max_test.exp:
extras/references/samples/max_test.m:
An example of using a non-backtracking reference (to find the
maximum of the solutions generated by a predicate), with tests.
extras/references/tests/Mmakefile:
extras/references/tests/ref_test.exp:
extras/references/tests/ref_test.m:
Some tests of references (backtracking and non-backtracking) and
scoping.