Commit Graph

419 Commits

Author SHA1 Message Date
Zoltan Somogyi
22840901fd Fix potential problems with the way we were handling grade components: the
Estimated hours taken: 5

Fix potential problems with the way we were handling grade components: the
places that know about grade components were not being kept totally in sync.
This change fixes previous damage and aims to prevent future damage.

The file runtime/mercury_grade.h contains a list of all the files in the
compiler that know about grade components. All these files now process the
grade components in the same order, so that they can be checked for consistency
more easily.

runtime/mercury_grade.h:
	Add the list.

runtime/mercury_conf_param.h:
	Remove a comment about an obsolete grade component.

scripts/init_grade_options.sh-subr:
	Remove initializations of variables that do not correspond to grade
	components, add missing initializations of shell variables that do
	correspond to grade components, and concentrate the grade options
	component of usage messages here, to prevent double maintenance.

	Update list of user scripts.

scripts/final_grade_options.sh-subr:
	Add missing initializations in processing the --grade superoption.

	Standardize the order of processing options, and the indentation.

	Update list of user scripts.

scripts/c2init.in:
	Take the usage message for grade component options from
	init_grade_options.sh-subr.

scripts/mgnuc.in:
	Take the usage message for grade component options from
	init_grade_options.sh-subr.

	Standardize the order of processing grade options, and separate the
	processing of grade options and non-grade options.

scripts/ml.in:
	Take the usage message for grade component options from
	init_grade_options.sh-subr.

	Standardize the order of processing grade options. Process some missing
	ones.

compiler/handle_options.m:
	Standardize the order of processing grade options.

	Remove code to handle an obsolete grade component.
1999-11-09 01:45:43 +00:00
Fergus Henderson
1876077d12 Check for -lnsl, since on i386-pc-solaris2.7 that is needed
Estimated hours taken: 0.75

configure.in:
	Check for -lnsl, since on i386-pc-solaris2.7 that is needed
	for the socket stuff.

scripts/ml.in:
	Link with -lnsl if necessary.
1999-11-04 20:12:53 +00:00
Fergus Henderson
1897bd8591 Pass the new `--explain-link-errors' option to mdemangle.
Estimated hours taken: 0.25

scripts/ml.in:
        Pass the new `--explain-link-errors' option to mdemangle.

	This may cause bootstrapping problems if you try to compile
	with a version of `mdemangle' that doesn't support that option.
	So I've tagged the old version of scripts/ml.in with the tag
	`bootstrap_19991029_mdemangle' to make bootstrapping easier.
1999-10-29 05:09:38 +00:00
Fergus Henderson
7654602989 Minor efficiency improvment in the rules for *.install and
Estimated hours taken: 0.1

scripts/Mmake.rules:
	Minor efficiency improvment in the rules for *.install and
	*.install_grades: use `{ ...; }' rather than `( ... )', to
	avoid creating unnecessary processes.
1999-10-25 14:26:56 +00:00
Warwick Harvey
be51ca48b6 Added built-in mmake support for installing user libraries.
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.
1999-10-21 14:36:39 +00:00
Fergus Henderson
98e67d2201 Fix a problem where the test cases were sometimes failing
Estimated hours taken: 0.5

Fix a problem where the test cases were sometimes failing
if old /tmp/mmake* directories were left lying around.

scripts/ml.in:
scripts/mmake.in:
	When creating the temporary directory, if mkdir fails (e.g.
	because that directory already exists), then try again with a
	different directory name.  Only report an error if it fails 20
	times in a row.
1999-10-11 05:47:12 +00:00
Fergus Henderson
88eca71d1a Fix a bug: take care to avoid infinite loops when processing
Estimated hours taken: 0.5

scripts/mtags:
	Fix a bug: take care to avoid infinite loops when processing
	typeclass and instance declarations.
1999-10-07 11:54:04 +00:00
Fergus Henderson
a69a85395d Undo a previous change: don't pass --explain-link-errors to
Estimated hours taken: 0.25

scripts/ml.in:
	Undo a previous change: don't pass --explain-link-errors to
	$MDEMANGLE yet, since it causes bootstrapping problems.
1999-10-01 19:12:06 +00:00
Fergus Henderson
17dc28cf0c Improve the error messages for linking objects compiled in different grades.
Estimated hours taken: 1

Improve the error messages for linking objects compiled in different grades.

util/mdemangle.c:
	Check for `MR_grade_*' and `MR_runtime_grade', and if they are
	found, print out a message explaining the cause of the problem.
	But only do that if a new option `--explain-link-errors' is set,
	so that this message will only come out when you get a message
	from the linker, not when you invoke mdemangle manually e.g.
	via `nm *.o | mdemangle'.

scripts/ml.in:
	Pass the new `--explain-link-errors' option to mdemangle.
1999-09-30 21:33:14 +00:00
Mark Brown
99b8372463 Added `test_mdbrc'.
Estimated hours taken: 0

Added `test_mdbrc'.
1999-09-17 06:15:17 +00:00
Fergus Henderson
98b0afa001 Use clean_local' instead of clean' and `realclean_local' instead
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'.
1999-09-16 04:46:31 +00:00
Fergus Henderson
6267f5bff8 Add `dl.c' to the list of files which need to be compiled with
Estimated hours taken: 0.5

scripts/mgnuc.in:
	Add `dl.c' to the list of files which need to be compiled with
	`-O1' rather than `-O2' to avoid gcc internal errors on sparc.
1999-09-14 20:55:47 +00:00
Thomas Conway
541ab2829f Add a new option for deep profiling to the compiler and the scripts.
Estimated hours taken: 0.5

Add a new option for deep profiling to the compiler and the scripts.

compiler/options.m:
	Add the new profiling options `profile-deep' and `deep-profiling'.
compiler/handle_options.m:
	Add code to handle the above options.

scripts/init_grade_options.sh-subr:
	Initialize the profile_deep option to false.
scripts/parse_grade_options.sh-subr:
	Add code handle the deep-profiling options.
1999-09-13 04:51:20 +00:00
Fergus Henderson
8b043a1791 Honour the TMPDIR environment, if it is set,
Estimated hours taken: 0.25

scripts/ml.in:
scripts/mmake.in:
	Honour the TMPDIR environment, if it is set,
	rather than always using /tmp.
1999-09-10 08:50:04 +00:00
Thomas Conway
d659c2b6c3 Under Linux, don't use -ansi in thread safe grades, because if
Estimated hours taken: 0.2


scripts/mgnuc.in:
	Under Linux, don't use -ansi in thread safe grades, because if
	you do, you'll get parse errors in pthread.h where it uses
	sigset_t.
1999-08-27 04:46:55 +00:00
Warwick Harvey
a11d224374 Reconciled the implementation and the documentation of the automatically
Estimated hours taken: 3

Reconciled the implementation and the documentation of the automatically
generated clean targets.  Also removed the `change_clean' targets to
simplify things, since they're not particularly useful.

`clean' now no longer deletes transitive optimization files, and should be
suitable for use when changing compilation models.  When changing the level
of intermodule optimization, a `depend' is required, but a `clean' is also
recommended.

compiler/modules.m:
	Removed the generation and recognition of the `.change_clean'
	target.
	Moved the deletion of the `.trans_opt' and `.trans_opt_date' files
	from the `.clean' target to the `.realclean' target.

doc/user_guide.texi:
	Removed the documentation for the `.change_clean' target, but
	documented how to achieve each of its two intended purposes by using
	other targets.
	Updated the documentation of the clean targets to more accurately
	and completely reflect what they do.

scripts/Mmake.rules:
	Removed a reference to `change_clean'.
1999-08-18 06:26:09 +00:00
Tyson Dowd
57da6befbd Improve the install and bindist creation on win32.
Estimated hours taken: 1

Improve the install and bindist creation on win32.

bindist/Mmakefile:
	Use EXT_FOR_EXE when installing executables.

bindist/README.MS-Windows:
	Remove unnecessary file, we now handle these instructions
	automatically.

scripts/Mmakefile:
	Move and replace mmake instead of deleting it while running.
1999-07-29 04:27:20 +00:00
Warwick Harvey
a7b1401531 Allow the user to conveniently use Mercury libraries installed in
Estimated hours taken: 70

Allow the user to conveniently use Mercury libraries installed in
non-standard places, by specifying the variables `EXTRA_LIBRARIES' and
`EXTRA_LIB_DIRS' in their Mmakefile.

doc/user_guide.texi:
	Documented the new `EXTRA_LIBRARIES' and `EXTRA_LIB_DIRS' Mmake
	variables.

scripts/Mmake.vars.in:
	Added/changed definitions appropriately to support the new
	variables.
	This included adding a `GRADESTRING' variable which holds the
	canonical name of the grade being used, taking into account all the
	grade flags.

scripts/c2init.in:
	Added a new option to `c2init':
	-I/--init-file-directory <directory> adds the directory to the list
		of directories to search for `.init' files.

util/mkinit.c:
	Added a new option `-I' to add a directory to the list of
	directories to search for `.init' files.
1999-07-26 02:52:46 +00:00
Warwick Harvey
293b4a1d59 Make some improvements in automatically generated dependencies.
Estimated hours taken: 2.5

Make some improvements in automatically generated dependencies.

compiler/modules.m:
	Change the generation of `.dep' files so that dependencies on
	library files are specified.
	Also change the dependencies on `$(MLOBJS)' and `$(MLPICOBJS)' to be
	explicit rather than using the `MLOBJS_DEPS' / `MLPICOBJS_DEPS'
	hacks, since the hacks aren't necessary any more.

scripts/Mmake.vars.in:
	Introduce the variable `ALL_MLLIBS_DEP' which provides a list of
	dependencies based on the contents of the `ALL_MLLIBS' variable.
	XXX At the moment it isn't clear how to know whether the files
	appearing in `ALL_MLLIBS_DEP' should be `.a' or `.so' libraries,
	so for now it is defined to be empty (though the user can specify
	it if desired).
1999-07-24 08:40:56 +00:00
Warwick Harvey
174ea0ff5b Split the automatically generated .dep' file into two files. The new .dv'
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).
1999-07-20 03:39:24 +00:00
Warwick Harvey
d2b98d996c Fixed a typo in the rule to generate .pic_o' files from .m' files
Estimated hours taken: 0.25

scripts/Mmake.rules:
	Fixed a typo in the rule to generate `.pic_o' files from `.m' files
	when `RM_C' is not set to `:'.
1999-07-14 07:17:51 +00:00
Mark Brown
bf66b3545c Add two new mmake targets, clean_local and realclean_local, which
Estimated hours taken: 1

Add two new mmake targets, clean_local and realclean_local, which
are the same as clean and realclean except that the former retain their
original meanings if rules are added to the latter.  This is useful
if users want to add rules for a recursive mmake clean.

compiler/modules.m:
	Output `clean_local: module.clean' to generated .dep files
	instead of `clean: module.clean'.  Same for `realclean'.

scripts/Mmake.rules:
	Add dependencies to implement the original targets in terms of
	the new targets.
1999-07-09 04:53:13 +00:00
Warwick Harvey
58d6d8b9c5 Specifying GRADEFLAGS and C2INITFLAGS on a per-program basis didn't work
Estimated hours taken: 3.5

Specifying GRADEFLAGS and C2INITFLAGS on a per-program basis didn't work
properly for `_init.*' files.  Rather than just specifying `-foo' versions,
one had to specify `-foo_init.c' or `-foo_init' versions instead or as well.
This change corrects this.

scripts/Mmake.vars.in:
	Strip any `_init' suffix from the `$*' automatic variable and any
	`_init.c' suffix from the `$@' automatic variable used in the
	per-target definitions of GRADEFLAGS and C2INITFLAGS.
1999-07-01 11:01:15 +00:00
Warwick Harvey
67a204a188 If a shared library directory given to `ml' is relative, turn it
Estimated hours taken: 1.5

scripts/ml.in:
	If a shared library directory given to `ml' is relative, turn it
	into an absolute path by prepending the current directory.  Also
	add options `--[no-]leave-shared-lib-dirs-relative' to `ml' to
	turn off/on this behaviour.
1999-07-01 02:58:50 +00:00
Fergus Henderson
27eb98582a Make static linking the default on FreeBSD,
Estimated hours taken: 1

scripts/ml.in:
	Make static linking the default on FreeBSD,
	since shared linking doesn't work.

README.FreeBSD:
	Document that shared libraries are not supported on FreeBSD.
	Add some hints about what would need to be done to make them work.
1999-06-21 07:45:52 +00:00
Zoltan Somogyi
c6812299c2 Remove support for --args simple. We don't use it, we won't use it even for
Estimated hours taken: 4.5

Remove support for --args simple. We don't use it, we won't use it even for
experiments, and it is unnecessary complication.

If anybody were using --args simple, this would need bootstrapping, but
since nobody does, there is no need, and this can be committed as an
ordinary change.

compiler/options.m:
doc/user_guide.texi:
scripts/*.in:
scripts/*.sh-subr:
	Remove the --args option.

compiler/globals.m:
	Remove the args_method global and its access predicates.

compiler/handle_options.m:
	Don't set the args_method global from the option.

compiler/arg_info.m:
	Remove support for --args simple. This allows us to remove a now
	redundant argument from an exported predicate.

compiler/mercury_compile.m:
	Remove the code for passing -DCOMPACT_ARGS to the C compiler.

compiler/bytecode_gen.m:
compiler/fact_table.m:
compiler/follow_vars.m:
compiler/live_vars.m:
compiler/call_gen.m:
	Don't pass the unnecessary argument to arg_info.

compiler/call_gen.m:
compiler/unify_gen.m:
	Remove now unnecessary assertions.

compiler/hlds_pred.m:
	Don't include an args_method in proc_infos; instead, include
	a slot that says whether the procedure's address is taken or not.
	(In most cases, this determined whether the args_method was
	simple or compact.) We will need this bool in the near future
	(when we generate layout structures for procedures whose address
	is taken).

	Modify the signatures of exported predicates to accommodate
	this change to the data structure.

compiler/hlds_out.m:
	Print the new slot, not the args_method.

compiler/lambda.m:
	When creating procedures from lambdas, set the address-taken slot
	to address_is_taken instead of setting up its args_method.

compiler/make_hlds.m:
	Minor changes to conform to the changes in the signatures of
	the predicates exported from hlds_pred.m.

compiler/check_typeclass.m:
compiler/clause_to_proc.m:
compiler/dnf.m:
compiler/magic.m:
compiler/magic_util.m:
compiler/modecheck_call.m:
compiler/pd_info.m:
compiler/post_typecheck.m:
compiler/unify_gen.m:
	Minor changes to conform to the changes in the signatures of
	the predicates exported from hlds_pred.m and make_hlds.m.

runtime/mercury_type_info.h:
	Remove the conditional definition of the macros that provided
	an argument-method-independent way of referring to the registers
	holding the inputs and outputs of e.g. unification procedures.
	We don't need the independence anymore, and using registers instead
	of macros in the code ensures that maintainers are aware of register
	reuse issues (e.g. they copy an input from r1 before overwriting it
	with an output).

runtime/mercury_conf_param.h:
runtime/mercury_grade.h:
	Remove support for the args method component of the grade.

runtime/mercury_ho_call.c:
runtime/mercury_tabling.c:
library/*.m:
	Conform to the changes in runtime/mercury_type_info.h by effectively
	applying the #defines appropriate to compact args by hand.

	Remove code and data structures only needed for simple args.
	Remove comments needed only in the presence of uncertainty about
	the args method.
1999-06-01 09:46:20 +00:00
Zoltan Somogyi
95517bc1c8 Remove support for --args simple. We don't use it, we won't use it even for
Estimated hours taken: 4.5

Remove support for --args simple. We don't use it, we won't use it even for
experiments, and it is unnecessary complication.

If anybody were using --args simple, this would need bootstrapping, but
since nobody does, there is no need, and this can be committed as an
ordinary change.

compiler/options.m:
doc/user_guide.texi:
scripts/*.in:
scripts/*.sh-subr:
	Remove the --args option.

compiler/globals.m:
	Remove the args_method global and its access predicates.

compiler/handle_options.m:
	Don't set the args_method global from the option.

compiler/arg_info.m:
	Remove support for --args simple. This allows us to remove a now
	redundant argument from an exported predicate.

compiler/mercury_compile.m:
	Remove the code for passing -DCOMPACT_ARGS to the C compiler.

compiler/bytecode_gen.m:
compiler/fact_table.m:
compiler/follow_vars.m:
compiler/live_vars.m:
compiler/call_gen.m:
	Don't pass the unnecessary argument to arg_info.

compiler/call_gen.m:
compiler/unify_gen.m:
	Remove now unnecessary assertions.

compiler/hlds_pred.m:
	Don't include an args_method in proc_infos; instead, include
	a slot that says whether the procedure's address is taken or not.
	(In most cases, this determined whether the args_method was
	simple or compact.) We will need this bool in the near future
	(when we generate layout structures for procedures whose address
	is taken).

	Modify the signatures of exported predicates to accommodate
	this change to the data structure.

compiler/hlds_out.m:
	Print the new slot, not the args_method.

compiler/lambda.m:
	When creating procedures from lambdas, set the address-taken slot
	to address_is_taken instead of setting up its args_method.

compiler/make_hlds.m:
	Minor changes to conform to the changes in the signatures of
	the predicates exported from hlds_pred.m.

compiler/check_typeclass.m:
compiler/clause_to_proc.m:
compiler/dnf.m:
compiler/magic.m:
compiler/magic_util.m:
compiler/modecheck_call.m:
compiler/pd_info.m:
compiler/post_typecheck.m:
compiler/unify_gen.m:
	Minor changes to conform to the changes in the signatures of
	the predicates exported from hlds_pred.m and make_hlds.m.

runtime/mercury_type_info.h:
	Remove the conditional definition of the macros that provided
	an argument-method-independent way of referring to the registers
	holding the inputs and outputs of e.g. unification procedures.
	We don't need the independence anymore, and using registers instead
	of macros in the code ensures that maintainers are aware of register
	reuse issues (e.g. they copy an input from r1 before overwriting it
	with an output).

runtime/mercury_conf_param.h:
runtime/mercury_grade.h:
	Remove support for the args method component of the grade.

runtime/mercury_ho_call.c:
runtime/mercury_tabling.c:
library/*.m:
	Conform to the changes in runtime/mercury_type_info.h by effectively
	applying the #defines appropriate to compact args by hand.

	Remove code and data structures only needed for simple args.
	Remove comments needed only in the presence of uncertainty about
	the args method.
1999-06-01 09:46:19 +00:00
Fergus Henderson
67b2853b47 Ensure that `ml' by default reports errors about undefined symbols
Estimated hours taken: 1.5

Ensure that `ml' by default reports errors about undefined symbols
when building shared libraries.  Add a new option `--allow-undefined'
to enable the previous, more permissive behaviour.

configure.in:
	Define new variables ALLOW_UNDEFINED and ERROR_UNDEFINED,
	which get set to the appropriate linker options for
	allowing/disallowing undefined symbol errors when building
	shared libraries.

scripts/ml.in:
	Add new option --allow-undefined.  When building shared libraries,
	pass either $ALLOW_UNDEFINED or $ERROR_UNDEFINED to the linker,
	depending on the setting of this new option.
1999-05-22 02:16:47 +00:00
Fergus Henderson
c66dbd7265 Include the grade options in the help message.
Estimated hours taken: 0.25

scripts/c2init.in:
	Include the grade options in the help message.
	Include the file `final_grade_options.sh-subr' so
	that options will get properly post-processed.
1999-04-26 03:10:23 +00:00
Zoltan Somogyi
dc03496d06 Rewrite significant parts of minimal model tabling so that it works
Estimated hours taken: 130

Rewrite significant parts of minimal model tabling so that it works
in a much wider variety of situations, including coups. Also, clean up
the tabling implementation to make it more maintainable, and introduce
a new grade component, .mm, that enables minimal model tabling.
(Minimal model tabling requires distributed fat, and we don't want to
incur such costs unless necessary.)

compiler/options.m:
	Add a new option --use-minimal-model, which for now is documented
	as "not for general use". This option is a grade option, and is
	required if minimal model tabling is to work.

compiler/handle_options.m:
	When --use-minimal-model is given, do not allow nondet frame hijacks,
	since minimal model tabling cannot cope with hijacks.

	Make --use-minimal-model a grade component.

compiler/code_info.m:
	When --use-minimal-model is given, insert calls to MR_commit_{mark,cut}
	around goals being committed across. This is now necessary, so that we
	can detect and handle sitations where a goal being committed across
	starts but does not complete a tabled goal.

compiler/table_gen.m:
	Rename many of the tabling helper predicates, using a naming scheme
	that separates predicates used for model_non procedures from those
	used to implement simpler forms of tabling, while bringing out
	the parallels between these two sets of predicates.

	When calls to two tabling helper predicates always occur
	one after the other, merge the two into one.

	Generate and use more meaningful variable names; having all of the
	several variables inserted by this transformation named TableVar
	was quite confusing.

library/private_builtin.m:
	Reorganize this file, to separate out the different sections.
	The contents of the non-tabling sections were not modified, only
	moved around.

	Rename the predicates referred to by table_gen.m.

	Move most of the type declarations and complex code out of here,
	into runtime/mercury_tabling.c. This makes it easier to debug them,
	since (a) creating a new executable is quicker, since you don't have
	to wait for lots of mercury compiler invocations, and (b) gdb doesn't
	get confused by #line directives. It also makes it easier to write
	them, since you don't have to !&(*U&( remember to double all your
	double quotes and to backslash all your backslashes.

runtime/mercury_grade.h:
	Include a grade component reflecting whether MR_USE_MINIMAL_MODEL
	is defined.

runtime/mercury_conf_param.h:
	Document MR_USE_MINIMAL_MODEL.

runtime/mercury_stacks.[ch]:
	The changes to tabling require the addition of two new stacks,
	the generator stack and the cut stack. This module defines the
	structures of the frames of these stacks and provides the
	operations on these stacks.

	The header file also contains some additional macros that return
	the addresses of fixed nondet stack slots, not their contents,
	for use by tabling code.

runtime/mercury_context.[ch]:
runtime/mercury_memory.[ch]:
runtime/mercury_wrapper.[ch]:
	Declare and set up the two new stacks, both in saved contexts and in
	the active context, if MR_USE_MINIMAL_MODEL is defined.

runtime/mercury_regorder.h:
	Add four new global virtual machine registers to hold pointers
	to the memory areas of the two new stacks and the current offsets
	within them. These are defined whether MR_USE_MINIMAL_MODEL is defined
	or not, since the cost is minimal and the potential bugs we avoid
	would be hard to track down.

runtime/mercury_engine.h:
runtime/mercury_wrapper.c:
	Add support for a new debugging flag, -dS, which prints the contents
	of the nondet stack at several points during tabling.

runtime/mercury_tabling.[ch]:
	The implementation of the new tabling system. Much of the new code here
	is stuff moved from library/private_builtin.m, but in a significantly
	rewritten form. There is also substantial new code, e.g. to handle
	the extension of saved stack segments, and to manage dependencies
	between subgoals in general.

	Improve the documentation considerably.

	Replace lists stored as Mercury data structures with lists stored
	as linked structures in the usual C fashion. This allows us to use
	debuggers such as ddd on these data structures, whose complexity
	requires this.

	Ensure that global names start with MR_.

runtime/mercury_init.h:
	Explicitly include mercury_regs.h at the start. Without this,
	we get an error, because now mercury_wrappers.h, which mercury_init.h
	includes, also includes mercury_regs.h, but not before functions
	have been declared.

runtime/Mmakefile:
	Refer to the new file mercury_stacks.c (mercury_stacks.h already
	existed, but the module consisted entirely of macros.)

	Fix a sorting error.

scripts/{init,parse,final}_grade_options.sh-subr:
scripts/mgnuc.in:
	Handle the new grade component.

tests/tabling/*
	Add several new test cases that we now pass, most of which we couldn't
	pass before. Also add some new test cases that we don't pass yet,
	due to interactions between tabling and negated contexts.

trace/mercury_trace_internal.c:
	If MR_USE_MINIMAL_MODEL is defined, add a new command to print
	the generator stack. (The new command is deliberately not documented
	in doc/mdb_doc yet, since (a) it is intended for developers only,
	and (b) there is no way to test MR_USE_MINIMAL_MODEL in mdb_doc.)
1999-04-20 11:48:56 +00:00
Fergus Henderson
e011674971 A couple of fixes to trd's previous change:
Estimated hours taken: 0.25

scripts/ml.in:
	A couple of fixes to trd's previous change:
	- the libraries in TRACE_LIBS_SYSTEM should come before STDLIBS,
	  since the former might refer to the latter
	  (this is important with static linking and with DLLs,
	  since in both those situations you only get single-pass
	  linking unless you name the libraries multiple times on
	  the command line)
	- TRACE_LIBS_SYSTEM needs to be included even in the
	  `--mercury-libs none' case, otherwise compiler/Mmakefile
	  breaks.
1999-04-06 18:27:27 +00:00
Fergus Henderson
749e5a6f0d Search /usr/local/include after any directories specified by
Estimated hours taken: 0.25

scripts/mgnuc.in:
	Search /usr/local/include after any directories specified by
	the user, rather than before.  This is necessary to ensure
	that we pick up the right version of gc.h (there's another
	file called gc.h, quite different from boehm_gc/gc.h,
	which often resides in /usr/local/include).
1999-04-06 17:13:01 +00:00
Tyson Dowd
6157c50f67 Bootstrapping was a problem on my machine at home -- kept getting
Estimated hours taken: 3

Bootstrapping was a problem on my machine at home -- kept getting
linking errors with the debugging tests.

scripts/ml.in:
	Separate the variables for Mercury libraries from those
	with system libraries.  When bootstrapping we want to
	override the Mercury libraries to use the stage 2 version,
	but we don't want to override other library options such as -ldl
	and -lreadline, because they are system specific while the
	bootstrapping script is general.
1999-04-05 15:05:28 +00:00
Zoltan Somogyi
be8c5590bb Fix a bug fjh introduced in his last change to mgnuc.
Estimated hours taken: 1 (by trd)

scripts/mgnuc.in:
        Fix a bug fjh introduced in his last change to mgnuc.
        C_INCL_DIR was renamed as MERC_C_INCL_DIR, but the old
        variable name was used to set the include path.
1999-04-05 11:45:41 +00:00
Fergus Henderson
3dd5b4ea9d Search for header files and libraries in /usr/local/include
Estimated hours taken: 0.75

configure.in:
scripts/mgnuc.in:
scripts/ml.in:
	Search for header files and libraries in /usr/local/include
	and /usr/local/lib.  This is useful because readline is often
	installed there.
1999-04-03 17:10:55 +00:00
Fergus Henderson
ab8545cec1 Add GNU readline support to the debugger.
Estimated hours taken: 16

Add GNU readline support to the debugger.

Because GNU readline is licensed under the GPL, not the LGPL,
I was careful to ensure that (1) the readline library is
only linked into your application if it is compiled with
debugging enabled and (2) even in the latter case, the readline
support is disable-able (if you use the source distribution).

Mmakefile:
bindist/Mmakefile:
	Add dependency of configure on new file aclocal.m4.

aclocal.m4:
	Define a macro MERCURY_CHECK_READLINE to check for the readline
	headers, the readline library, and for libraries needed by readline,
	in particular -l{termcap,curses,ncurses}.
	If they're not found, define MR_NO_USE_READLINE.
	Otherwise, define various variables for using & installing readline.

bindist/bindist.configure.in:
configure.in:
	Add call to MERCURY_CHECK_READLINE to check for readline.

scripts/ml.in:
	If tracing is enabled, then (by default) link in readline,
	and hence also termcap/curses/ncurses.
	Add a new option `--no-readline' to disable this.

trace/mercury_trace_internal.c:
	Delete the FILE * parameter from the MR_getline() function,
	because there are actually two files involved (MR_mdb_in and
	MR_mdb_out), and they are always the same for all calls to this
	function.
	Also change this function so that it calls MR_trace_readline() rather
	than printing the prompt and then calling MR_trace_getline_raw().
	Delete the MR_trace_getline_raw() function -- this has been renamed
	as MR_trace_readline_raw() and moved to mercury_trace_readline.c.

trace/mercury_trace_readline.h:
trace/mercury_trace_readline.c:
	New module containing a new function MR_trace_readline() that prints
	a prompt and reads a line in by calling the readline library.
	I put all this new code inside `#ifndef MR_NO_USE_READLINE' so that
	the use of readline can be disabled.  If that symbol is defined,
	it reverts to the old implementation using MR_trace_readline_raw()
	(formerly called MR_trace_getline_raw()).

runtime/mercury_conf.h.in:
	Define the new configuration parameter `MR_NO_USE_READLINE'.

trace/Mmakefile:
	Add the new files mercury_trace_readline.[ch].
	Ensure that this new module is compiled with warnings disabled,
	to avoid spurious warnings resulting from the readline header files.
	Also simplify the code by deleting unnecessary uses of $(EXTRA_*) --
	that's handled by scripts/Mmake.vars now.

NEWS:
	Mention the readline support.

.INSTALL.in:
	Mention that it is helpful to have GNU Readline installed.

bindist/bindist.INSTALL:
	Mention that you may need to have GNU Readline installed.
1999-03-30 05:45:54 +00:00
Fergus Henderson
b44a1d88bd For Linux with ELF, if `--trace' is enabled, then
Estimated hours taken: 0.25

scripts/ml.in:
	For Linux with ELF, if `--trace' is enabled, then
	pass `-rdynamic' to gcc.   This is needed to make symbols
	exported for use in code linked in with dlopen(),
	which is used for interactive queries in the
	Mercury debugger.
1999-03-29 10:55:34 +00:00
Fergus Henderson
e06fa4993d For --use-subdirs, add `-I.' to ALL_MGNUCFLAGS rather than to
Estimated hours taken: 0.25

scripts/Mmake.rules:
	For --use-subdirs, add `-I.' to ALL_MGNUCFLAGS rather than to
	MGNUCFLAGS.  This avoids problems where EXTRA_MGNUCFLAGS and
	MGNUCFLAGS_FOR_TARGET were being interpreted as gcc options
	rather than as mgnuc options, because `-I.' is a gcc option
	rather than an mgnuc option and so all options which follow
	it are assumed to be gcc options.
1999-03-29 10:33:20 +00:00
Fergus Henderson
11d5604fec Fix a bug: it was using the wrong variable name for the variable
Estimated hours taken: 0.25

scripts/ml.in:
	Fix a bug: it was using the wrong variable name for the variable
	which holds the name of the library for dlopen() etc.
	(s/DL_LIB/DL_LIBRARY).
1999-03-25 14:45:39 +00:00
Fergus Henderson
c675130989 Fix a bug: it was not installing the emacs script (gud.el).
Estimated hours taken: 0.5

scripts/Mmakefile:
	Fix a bug: it was not installing the emacs script (gud.el).
1999-03-24 12:57:29 +00:00
Fergus Henderson
77b319d2a5 Fix a bug where it was generating code that referred to
Estimated hours taken: 0.5

scripts/c2init.in:
	Fix a bug where it was generating code that referred to
	the initialization functions for the browser library
	even when `--trace' was not specified on the command line
	and the grade was not a debugging grade.
1999-03-21 04:40:31 +00:00
Fergus Henderson
21bb73950c Fix a typo in the documentation.
Estimated hours taken: 0.01

scripts/ml.in:
	Fix a typo in the documentation.
1999-03-18 10:55:52 +00:00
Fergus Henderson
c35bcebf9c Alias EMPTY and NUMBER to "step", to simplify the code in
Estimated hours taken: 0.75

scripts/mdbrc.in:
	Alias EMPTY and NUMBER to "step", to simplify the code in
	mercury_trace_internal.c for handling those.

trace/mercury_trace_internal.c:
	Split the very long and complicated function MR_trace_debug_cmd()
	into two, one of which contains all the before-and-after processing,
	and the other being the main command dispatch switch.
	Delete the special-case handling of EMPTY and NUMBER since it's
	now done by scripts/mdbrc.in.

	Add some recently-added command names to the list of valid commands.
1999-03-18 08:19:17 +00:00
Fergus Henderson
cdf63a9b38 Improve the autoconfiguration for sockets and the dlopen() stuff,
Estimated hours taken: 3

Improve the autoconfiguration for sockets and the dlopen() stuff,
and ensure that the libraries needed for these are only linked in
when debugging.

This change also fixes a bug: Erwan's recent change to add -lsocket
broke static linking on Solaris 2.6 machines.  This change means that
static linking works again, so long as you don't enable debugging.
1999-03-18 00:15:14 +00:00
Fergus Henderson
965f113b60 Remove support for NU-Prolog and SICStus Prolog.
Estimated hours taken: 0.25

Remove support for NU-Prolog and SICStus Prolog.

scripts/Mmakefile:
	Delete the rules for installing the NU-Prolog and SICStus Prolog
	scripts.
1999-03-15 16:28:06 +00:00
Fergus Henderson
14728289fa Remove support for NU-Prolog and SICStus Prolog.
Estimated hours taken: 5

Remove support for NU-Prolog and SICStus Prolog.

The reasons for this are:
(a) We now have a proper working debugger, so we don't need to use
    NU-Prolog or SICStus Prolog for debugging.
(b) The Prolog support was only ever a hack, not a proper solution;
    Mercury language features like functions or mode reordering
    were never supported.
(c) It was a maintenance problem.

compiler/make_hlds.m:
	Warn that NU-Prolog `when' declarations are deprecated.

compiler/prog_io.m:
	Update a comment to say that NU-Prolog `when' declarations
	are now deprecated.

library/*.m:
	Delete `when' declarations.

configure.in:
bindist/bindist.configure.in:
	Delete the autoconf tests for NU-Prolog and SICStus Prolog.
	Delete the stuff for generating the NU-Prolog and SICStus Prolog
	scripts.

tools/bootcheck:
	Delete the options for testing using SICStus Prolog.

library/Mmakefile:
	Delete the rules for building NU-Prolog and SICStus Prolog stuff.

library/library.nu.nl.in:
	library/swi_*.m:
	library/*.nu.nl:
library/array.nu.nl:
library/assoc_list.nu.nl:
library/char.nu.nl:
library/float.nu.nl:
library/int.nu.nl:
library/io.nu.nl:
library/library.nu.nl.in:
library/map.nu.nl:
library/mercury_builtin.nu.nl:
library/nc_builtin.nl:
library/require.nu.nl:
library/sp_builtin.nl:
library/sp_lib.nl:
library/std_util.nu.nl:
library/store.nu.nl:
library/string.nu.nl:
library/swi_builtin.m:
library/swi_lib.m:
library/term_io.nu.nl:
	Delete these files.

scripts/mnc.in:
scripts/mnp.in:
scripts/mnl.in:
scripts/msc.in:
scripts/msl.in:
scripts/msp.in:
	Delete these files.

doc/user_guide.texi:
	Delete the documentation about the Prolog support.

NEWS:
w3/news/newsdb.inc:
        Mention that we've removed the Prolog support.
1999-03-15 08:48:36 +00:00
Warwick Harvey
4a52a9b94c Separated out all the commands to create installation directories
Estimated hours taken: 0.5

boehm_gc/Mmakefile:
browser/Mmakefile:
compiler/Mmakefile:
doc/Mmakefile:
library/Mmakefile:
runtime/Mmakefile:
scripts/Mmakefile:
	Separated out all the commands to create installation directories
	into a single target in each Mmakefile, upon which all targets which
	used to create directories depend.  This avoids a race condition
	with parallel installs into a new directory tree, whereby two or
	more `mkdir -p' commands simultaneously try to create the same
	missing path component, resulting in all but one failing.
1999-03-15 00:39:30 +00:00
Fergus Henderson
f6e2258668 Re-enable the passing of -ansi' to gcc, unless --no-ansi' is
Estimated hours taken: 0.5

scripts/mgnuc.in:
	Re-enable the passing of `-ansi' to gcc, unless `--no-ansi' is
	specified.  I think Tom Conway's change to disable it in all cases
	was committed accidentally.

	Change the code which disables `-ansi' if `--thread-safe' is
	specified and it's a sparc (since the Solaris "pthread.h"
	doesn't work with -ansi) to check the OS (Solaris or SunOS)
	rather than the architecture (sparc).
1999-03-12 23:39:43 +00:00
Erwan Jahier
033ba2bb2e Enable by default the use of the external debugger on architectures that
Estimated hours taken: 9

Enable by default the use of the external debugger on architectures that
support sockets.

configure.in:
bindist/bindist.configure.in:
	Define MR_USE_EXTERNAL_DEBUGGER for systems that support sockets.

	Pass down a variable SOCKET_LIBRARY that contains the name of the
	socket library (may varies from one system to another).

scripts/ml.in:
	Add the name of the socket library to the libraries passed in
	argument of ml.

runtime/mercury_conf.h.in:
	Add "#undef  MR_USE_EXTERNAL_DEBUGGER".

runtime/mercury_conf_param.h:
	Remove a useless comment.

trace/mercury_trace_external.c:
	Update a comment.
1999-03-11 19:18:09 +00:00
Fergus Henderson
3f81c08fad Check for cygwin' as well as cygwin32', since
Estimated hours taken: 0.1

scripts/ml.in:
	Check for `cygwin' as well as `cygwin32', since
	Cygwin32 has been renamed as Cygwin now.
1999-02-20 15:30:42 +00:00