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.
Remove old .cvsignore files, moving their contents to .gitignore files.
There are now no .cvsignore files in the repository.
I've also sorted some .gitignore files and avoided repeating a pattern in a
subdirectory's .gitignore file when it is already mentioned in the parent
.gitignore file.
Fix a mismatch in the mangling of symbol names between the name mangling
module in the browser / dynamic linking library and the MLDS->C code generator.
The former includes the function return argument in the arity, while the latter
does not.
Make the dynamic linking examples work in low-level C grades on OS X and mostly
work in high-level C grades. (I say "mostly", since the integer function test
returns an incorrect result on my machine.)
browser/name_mangle.m:
The arity for symbols corresponding to Mercury functions should not
include the return argument.
Add a comment mentioning that this module needs to be kept in sync
with the name mangling scheme used in compiler/mlds_to_c.m.
s/XXX/NOTE/ in a spot.
compiler/mlds_to_c.m:
Add a comment mentioning that the name mangling code here needs to be
kept in sync with the mlds version of the name mangling code
in browser/name_mangle.m.
extras/dynamic_linking/Mmakefile:
Use the variable EXT_FOR_SHARED_LIBS rather than assuming that the
shared library extension is .so.
extras/dynamic_linking/dl_test.m:
extras/dynamic_linking/dl_test2.m:
Open 'libhello.dylib' on OS X systems rather than 'libhello.so'.
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.
This is a consecutive patch to my previous patch, it extends the .gitignore
files to work more thoroughly on Windows.
browser/.gitignore:
ignore .net .dll assemblies
compiler/.gitignore:
ignore *.obj
extras/.gitignore:
Ignore the tags directory
Ignore: *.bat, *.lib,
Ignore *.dll rather than lib*.dll because the .net assemblies are not
prefixed.
extras/dynamic_linking/.gitignore:
Ignore *.out (test output files)
extras/error/.gitignore:
Ignoring unix binary for the error utility
extras/lex/tests/.gitignore:
Ignore the test_regex binary
extras/moose/tests/.gitignore:
Ignore array_based.m because it is generated from array_based.moo
extras/.gitignore:
Mercury ignores the --use-{grade}-subdir dir
Mercury/** for git 1.8+ this recursively ignores all build files
ignoring *.mh and *.init files
*.err output files
lib*.{dll|so|a|dylib} ignores target compiler library output
*.jar ignores the Java grade output
*.exe for Windows executables
extras/dynamic_linking/.gitignore:
ignoring the copy of dl.m, name_mangle.m
ignoring hello lib and dl_test* executables
extras/moose/samples/.gitignore:
ignoring cgram.m small.m alpha.m expr.m which are
generated from the .moo grammar files
extras/graphics/mercury_cairo/samples/.gitignore:
ignoring *.png output and all executables
extras/**/.gitignore:
In each sample/test/example folder the linux executable/test
output is ignored
Estimated hours taken: 0.5
Branches: main
Fix the dynamic linking examples in extras.
extras/dynamic_linking/dl_test.m:
extras/dynamic_linking/dl_test2.m:
extras/dynamic_linking/hello.m:
Conform to name changes in the dl module.
Clean up the code so that it conforms to our current coding standard.
Estimated hours taken: 0.1
Branches: main
extras/dynamic_linking/Mmakefile:
Update this file as the we now use `.' as the
module qualifier in the debugger rather than `__'.
Estimated hours taken: 0.5
Branches: main, release
Various changes to make it easier to build the extras.
extras/dynamic_linking/Mmakefile:
Don't require the existence of "../../../mercury/browser".
extras/posix/README:
Mention that it may be necessary to set MLLIBS.
extras/references/Mmakefile:
Don't include the "asm_fast.tr" grade in LIBGRADES, since by
default the Mercury standard library doesn't get installed in
that grade.
Estimated hours taken: 3
Branches: main, release
Fix a problem where different packages in the `extras' distribution
were being installed in different directories when you specified
INSTALL_PREFIX in the Mmake.params file. Some honoured the INSTALL_PREFIX
setting, some appended "/extras", and some ignored it completely.
Also, add `clean' and `realclean' targets for the extras directory hierarchy,
and fix a few other minor bugs.
extras/lazy_evaluation/Mmakefile:
Include Mmake.params, which previously wasn't included at all
in this file.
extras/logged_output/Mmakefile:
extras/odbc/Mmakefile:
extras/quickcheck/Mmakefile:
Append "/extras" to INSTALL_PREFIX, which previously wasn't done
at all in these directories.
extras/cgi/Mmakefile:
extras/complex_numbers/Mmakefile:
extras/concurrency/Mmakefile:
extras/curs/Mmakefile:
extras/curses/Mmakefile:
extras/dynamic_linking/Mmakefile:
extras/moose/Mmakefile:
extras/posix/Mmakefile:
Move the line `INSTALL_PREFIX := $(INSTALL_PREFIX/extras)'
to before the include of Mmake.params, so as not to override
the user's setting (only override the default setting).
extras/Mmakefile:
extras/concurrency/Mmakefile:
Add `clean' and `realclean' targets.
extras/posix/Mmakefile:
Add MGNUCFLAGS = --no-ansi, since this is needed on some systems.
extras/quickcheck/Mmakefile:
Add "depend", "all", and "install" targets.
Ensure that the "check" target runs the test program.
extras/quickcheck/qcheck.m:
Set the exit status to non-zero if a test fails.
extras/references/Mmakefile:
Adjust the setting of LIBGRADES to account for the fact that
$(GRADE) is no longer implicitly included in $(LIBGRADES).
Estimated hours taken: 2
Branches: main
Add appropriate infrastructure to support doing `mmake depend && mmake
&& mmake install' in the `extras' directory, and having it automatically
install and build as much as possible.
extras/Mmakefile:
New file.
extras/cgi/Mmakefile:
Delete bogus reference to `ALL_LIBGRADES' and `mercury-config'.
extras/complex_numbers/Mmakefile:
extras/concurrency/Mmakefile:
extras/concurrency/concurrency.m:
extras/curses/Mmakefile:
extras/dynamic_linking/Mmakefile:
extras/lazy_evaluation/Mmakefile:
extras/lex/Mmakefile:
extras/moose/Mmakefile:
extras/xml/Mmakefile:
Add rules for `mmake install'.
extras/references/scoped_update.m:
Add macro guard around typedef in `c_header_code'.
extras/curs/Mmakefile:
extras/curses/Mmakefile:
Define MERCURY_BOOTSTRAP_H, to avoid name clash on `bool'
that is caused by our bootstrap code in runtime/Merucry.h.
extras/curs/curs.m:
Add `promise_pure' declarations for all pure procedures.
XXX Should this be needed? These predicates all take
io__state arguments.
Estimated hours taken: 0.1
extras/dynamic_linking/hello.m:
Add the function `add3int', which is used by the dl_test.m
test case. I forgot to commit this with my previous change.
Estimated hours taken: 1
Eliminate the code duplication problem with the source files
in the extras/dynamic_linking and browser directories.
extras/dynamic_linking/dl.m:
extras/dynamic_linking/name_mangle.m:
Remove these from the cvs repository.
extras/dynamic_linking/Mmakefile:
Add rules to build dl.m and name_mangle.m from
the copies in the browser directory.
Mmakefile:
Make sure to build the .m files in the extras/dynamic_linking
directory before creating the extras distribution.
Estimated hours taken: 3
extras/dynamic_linking/dl.m:
Fix a bug with the building of closures for the MLDS back-end:
the wrapper procedure in the closure gets passed the closure
as an extra argument, so we can't just use the address return
from dlsym() in the closure. Instead, we need to put the
address of a wrapper procedure in the closure, and have the
wrapper procedure call the real procedure, passing it all
the arguments passed to the wrapper *except* for the closure
argument.
extras/dynamic_linking/Mmakefile:
extras/dynamic_linking/dl_test.m:
extras/dynamic_linking/dl_test2.m:
extras/dynamic_linking/dl_test.exp:
extras/dynamic_linking/dl_test2.exp:
Move the test case that the MLDS grades don't handle into a
separate file. Add a new test for passing integer arguments.
Estimated hours taken: 2
Fix some problems with dynamic linking for the MLDS back-end.
extras/dynamic_linking/name_mangle.m:
browser/name_mangle.m:
Fix a bug with the name mangling of the arity for functions;
the mangling algorithm here didn't match what the compiler
actually outputs.
Clarify the documentation about the meaning of the `arity'
field.
extras/dynamic_linking/dl.m:
Fix a bug with the arity checks for functions;
they were always failing.
For the MLDS back-end, check that the argument type
isn't `char' or `float'; those are not supported.
Document that restriction.
extras/dynamic_linking/dl_test.m:
extras/dynamic_linking/dl_test.exp:
extras/dynamic_linking/hello.m:
Add a test of dynamically linking functions and
passing and returning floating-point arguments.
NEWS:
Document the restriction that dl__mercury_sym doesn't support
argument types `float' or `char' for the MLDS back-end.
Estimated hours taken: 4
Optionally test the extras directory during bootchecks.
tools/bootcheck
Add an option, -e, for testing the extras directory. Rename the
-T/--test-only option as -n/--no-bootcheck, since it does not prevent
the testing of the extras.
Bootcheck only test the subdirectories in extras which have an
Mmakefile and which can be tested in all grades and in all setups.
extras/*/Mmakefile:
Updates to include extras/Mmake.params if it exists (to get the
parameters, including grades, of the bootcheck) and to add a check
target, which in most cases does not do anything yet (which means
that the only testing we do is checking that the program compiles
all right). Making "mmake check" do something meaningful will be
up to the authors of the various subdirectories involved.
In many cases, add .PHONY annotations on the relevant targets,
and copyright notices.
extras/aditi/NOBOOTTEST:
Prevent the automatic testing of the aditi subdirectory from
bootcheck, since this can be done only on a machine with Aditi
installed.
extras/aditi/NOBOOTTEST:
Prevent the automatic testing of the aditi subdirectory from
bootcheck, since this can be done only on a machine with Aditi
installed.
extras/aditi/NOBOOTTEST:
Prevent the automatic testing of this subdirectory from bootcheck,
since this can be done only on a machine with Aditi installed.
extras/dynamic_linking/NOBOOTTEST:
Prevent the automatic testing of this subdirectory from bootcheck,
since this can be done only on a machine with the dl library already
installed.
extras/logged_out/NOBOOTTEST:
Prevent the automatic testing of this subdirectory from bootcheck,
since this can be done only in grades with the right kind of stream
support.
extras/odbc/NOBOOTTEST:
Prevent the automatic testing of this subdirectory from bootcheck,
since this can be done only on a machine with ODBC installed.
extras/references/NOBOOTTEST:
extras/trailed_update/NOBOOTTEST:
Prevent the automatic testing of this subdirectory from bootcheck,
since this can be done only in trailing grades.
extras/*/.nocopyright:
Mention the NOBOOTTEST files in the relevant .nocopyright files.
Estimated hours taken: 0.25
extras/dynamic_linking/Mmakefile:
Add the appropriate flags to use shared libraries
(since on Linux this is not the default).
Link in `-ldl'.
extras/dynamic_linking/dl.m:
Apply some bug fixes that were previously applied to browser/mdb.m.
(XXX we really ought to fix this code duplication problem...)
Estimated hours taken: 5
extras/dynamic_linking/dl.m:
New module, containing support for dynamic linking
(i.e. a binding to dlopen(), dlsym(), and dlclose()).
extras/dynamic_linking/name_mangle.m:
New module, containing a representation for Mercury procedure
specifiers and a function for mangling them into symbol names.
extras/dynamic_linking/dl_test.m:
extras/dynamic_linking/dl_test.exp:
extras/dynamic_linking/hello.m:
A test case (and sample program) for the use of dynamic linking.
extras/dynamic_linking/README:
A brief README file describing the files in this directory.
extras/dynamic_linking/Mmakefile:
A simple Mmakefile to build it all and test it.
NEWS:
Mention the new dynamic linking support.
compiler/llds_out.m:
Add some comments warning about code duplication
between the code here and that in extras/dynamic_linking/name_mangle.m
(and also profiler/demangle.m and util/mdemangle.c).