Commit Graph

26 Commits

Author SHA1 Message Date
Julien Fischer
dc9b9621a7 Fix compilation of dynamic linking tests.
extras/dynamic_linking/dl_test.m:
extras/dynamic_linking/dl_test2.m:
     Conform to the current interface of the dl module.
2021-01-25 03:41:42 +11:00
Mark Brown
d465fa53cb Update the COPYING.LIB file and references to it.
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.
2018-06-09 17:43:12 +10:00
Paul Bone
fc4b3ff196 Remove .cvsignore files
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.
2017-04-04 12:05:56 +10:00
Julien Fischer
e7010327d9 Delete references to picreg.
browser/interactive_query.m:
extras/dynamic_linking/Mmakefile:
extras/graphics/mercury_glut/Mmakefile:
extras/graphics/mercury_glut/Mmakefile.MacOSX:
extras/graphics/samples/calc/Makefile:
extras/graphics/samples/gears/Mmakefile:
extras/graphics/samples/maze/Mmakefile:
extras/graphics/samples/pent/Mmakefile:
extras/morphine/non-regression-tests/Mmakefile:
extras/morphine/source/collect.op:
    As above.
2016-04-26 14:03:04 +10:00
Julien Fischer
b3a819e1f5 Fix problems with the dynamic linking support in extras.
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'.
2015-08-21 21:13:26 +10:00
Zoltan Somogyi
d33273d033 Tell vim not to expand tabs in Makefiles.
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.
2015-01-08 22:07:29 +11:00
Sebastian Godelet
1d530c7d4e Add more entries to .gitignore files
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
2014-03-05 09:41:51 +11:00
Sebastian Godelet
f9899940b7 Add .gitignore files to the extras/ directory
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
2014-02-27 16:58:43 +11:00
Julien Fischer
df345f7258 Ignore generated files in the extras.
Branches: main, 11.07

extras/*/.cvsignore:
	Ignore generated files in the extras.
2011-11-18 03:03:26 +00:00
Julien Fischer
ec3b4b0c0e Fix the dynamic linking examples in extras.
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.
2007-05-07 04:18:23 +00:00
Julien Fischer
1a0007bccf Update this file as the we now use `.' as the
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 `__'.
2005-01-25 07:49:05 +00:00
Fergus Henderson
67afe2c9fc Various changes to make it easier to build the extras.
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.
2004-02-17 00:00:24 +00:00
Fergus Henderson
dced016cc1 Fix a problem where different packages in the `extras' distribution
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).
2003-01-16 10:44:26 +00:00
Fergus Henderson
700b983325 Update to include recently added generated files.
Branches: main
Estimated hours taken: 0.25

scripts/.cvsignore:
deep_profiler/.cvsignore:
extras/dynamic_linking/.cvsignore:
	Update to include recently added generated files.

compiler/.cvsignore:
	Fix a typo: s/aditi_backend/aditi_backend.m/
2002-10-02 06:59:19 +00:00
Fergus Henderson
d62c697231 Add appropriate infrastructure to support doing `mmake depend && mmake
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.
2002-03-06 10:10:31 +00:00
Fergus Henderson
8a567f3886 Add the function `add3int', which is used by the dl_test.m
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.
2001-01-12 01:31:52 +00:00
Fergus Henderson
b0c278faa3 Eliminate the code duplication problem with the source files
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.
2001-01-11 06:23:10 +00:00
Fergus Henderson
f576b8e658 Fix a bug with the building of closures for the MLDS back-end:
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.
2001-01-11 05:05:29 +00:00
Fergus Henderson
55f0d48dd1 Delete some commented-out code that I left in accidentally.
Estimated hours taken: 0.1

extras/dynamic_linking/dl_test.m:
	Delete some commented-out code that I left in accidentally.
2000-12-18 16:13:55 +00:00
Fergus Henderson
088277135d Fix some problems with dynamic linking for the MLDS back-end.
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.
2000-12-18 14:11:30 +00:00
Fergus Henderson
02fa5499a3 Add support for the MLDS->C back-end.
Estimated hours taken: 0.25

extras/dynamic_linking/name_mangle.m:
browser/name_mangle.m:
	Add support for the MLDS->C back-end.
2000-12-15 03:14:11 +00:00
Zoltan Somogyi
a1cd1a1633 Optionally test the extras directory during bootchecks.
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.
2000-11-21 23:52:54 +00:00
Zoltan Somogyi
76943f86ff New files.
Estimated hours taken: 0.1

extras/*/.nocopyright:
	New files.
2000-11-21 23:48:36 +00:00
Fergus Henderson
0bdcef9b1e Uncomment the `MLFLAGS=-ldl', which I had accidentally
Estimated hours taken: 0.1

extras/dynamic_linking/Mmakefile:
	Uncomment the `MLFLAGS=-ldl', which I had accidentally
	commented out in my last change.
2000-11-21 07:47:13 +00:00
Fergus Henderson
384aa42617 Add the appropriate flags to use shared libraries
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...)
2000-11-21 07:38:53 +00:00
Fergus Henderson
8a29f3f391 New module, containing support for dynamic linking
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).
1998-12-06 06:17:07 +00:00