Commit Graph

286 Commits

Author SHA1 Message Date
Fergus Henderson
e6ac077bae Add support for memory profiling.
Estimated hours taken: 40 (+ unknown time by Zoltan)

Add support for memory profiling.

(A significant part of this change is actuallly Zoltan's work.  Zoltan
did the changes to the compiler and a first go at the changes to the
runtime and library.  I rewrote much of Zoltan's changes to the runtime
and library, added support for the new options/grades, added code to
interface with mprof, did the changes to the profiler, and wrote the
documentation.)

[TODO: add test cases.]

NEWS:
	Mention support for memory profiling.

runtime/mercury_heap_profile.h:
runtime/mercury_heap_profile.c:
	New files.  These contain code to record heap profiling information.

runtime/mercury_heap.h:
	Add new macros incr_hp_msg(), tag_incr_hp_msg(),
	incr_hp_atomic_msg(), and tag_incr_hp_atomic_msg().
	These are like the non-`msg' versions, except that if
	PROFILE_MEMORY is defined, they also call MR_record_allocation()
	from mercury_heap_profile.h to record heap profiling information.
	Also, fix up the indentation in lots of places.

runtime/mercury_prof.h:
runtime/mercury_prof.c:
	Added code to dump out memory profiling information to files
	`Prof.MemoryWords' and `Prof.MemoryCells' (for use by mprof).
	Change the format of the `Prof.Counts' file so that the
	first line says what it is counting, the units, and a scale
	factor.  Prof.MemoryWords and Prof.MemoryCells can thus have
	exactly the same format as Prof.Counts.
	Also cleaned up the interface to mercury_prof.c a bit, and did
	various other minor cleanups -- indentation changes, changes to
	use MR_ prefixes, additional comments, etc.

runtime/mercury_prof_mem.h:
runtime/mercury_prof_mem.c:
	Rename prof_malloc() as MR_prof_malloc().
	Rename prof_make() as MR_PROF_NEW() and add MR_PROF_NEW_ARRAY().

runtime/mercury_wrapper.h:
	Minor modifications to reflect the new interface to mercury_prof.c.

runtime/mercury_wrapper.c:
runtime/mercury_label.c:
	Rename the old `-p' (primary cache size) option as `-C'.
	Add a new `-p' option to disable profiling.

runtime/Mmakefile:
	Add mercury_heap_profile.[ch].
	Put the list of files in alphabetical order.
	Delete some obsolete stuff for supporting `.mod' files.
	Mention that libmer_dll.h and libmer_globals.h are
	produced by Makefile.DLLs.

runtime/mercury_imp.h:
	Mention that libmer_dll.h is produced by Makefile.DLLs.

runtime/mercury_dummy.c:
	Change a comment to refer to libmer_dll.h rather than
	libmer_globals.h.

compiler/llds.m:
	Add a new field to `create' and `incr_hp' instructions
	holding the name of the type, for heap profiling.

compiler/unify_gen.m:
	Initialize the new field of `create' instructions with
	the appropriate type name.

compiler/llds_out.m:
	Output incr_hp_msg() / tag_incr_hp_msg() instead of
	incr_hp() / tag_incr_hp().

compiler/*.m:
	Minor changes to most files in the compiler back-end to
	accomodate the new field in `incr_hp' and `create' instructions.

library/io.m:
	Add `io__report_full_memory_stats'.

library/benchmarking.m:
	Add `report_full_memory_stats'.  This uses the information saved
	by runtime/mercury_heap_profile.{c,h} to print out a report
	of memory usage by procedures and by types.
	Also modify `report_stats' to print out some of that information.

compiler/mercury_compile.m:
	If `--statistics' is enabled, call io__report_full_memory_stats
	at the end of main/2.  This will print out full memory statistics,
	if the compiler was compiled with memory profiling enabled.

compiler/options.m:
compiler/handle_options.m:
runtime/mercury_grade.h:
scripts/ml.in:
scripts/mgnuc.in:
scripts/init_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
	Add new option `--memory-profiling' and new grade `.memprof'.
	Add `--time-profiling' as a new synonym for `--profiling'.
	Also add `--profile-memory' for more fine-grained control:
	`--memory-profiling' implies both `--profile-memory' and
	`--profile-calls'.

scripts/mprof_merge_runs:
	Update to handle the new format of Prof.Counts and to
	also merge Prof.MemoryWords and Prof.MemoryCells.

profiler/options.m:
profiler/mercury_profile.m:
	Add new options `--profile memory-words' (`-m'),
	`--profile memory-cells' (`-M') and `--profile time' (`-t').
	Thes options make the profiler select a different count file,
	Prof.MemoryWords or Prof.MemoryCells instead of Prof.Counts.
	specific to time profiling.

profiler/read.m:
profiler/process_file.m:
profiler/prof_info.m:
profiler/generate_output.m:
	Update to handle the new format of the counts file.
	When reading the counts file, look at the first line of
	the file to determine what is being profiled.

profiler/globals.m:
	Add a new global variable `what_to_profile' that records
	what is being profiled.

profiler/output.m:
	Change the headings to reflect what is being profiled.

doc/user_guide.texi:
	Document memory profiling.
	Document new options.

doc/user_guide.texi:
compiler/options.m:
	Comment out the documentation for `.proftime'/`--profile-time',
	since doing time and call profiling seperately doesn't work,
	because the code addresses change when you recompile with a
	different grade.  Ditto for `.profmem'/`--profile-memory'.
	Also comment out the documentation for
	`.profcalls'/`--profile-calls', since it is redundant --
	`.memprof' produces the same information and more.

configure.in:
	Build a `.memprof' grade.  (Hmm, should we do this only
	if `--enable-all-grades' is specified?)
	Don't ever build a `.profcalls' grade.
1997-12-05 15:58:34 +00:00
Fergus Henderson
36599a2060 Delete calls to `chmod -r'. Turning off read permission seems
Estimated hours taken: 0.5

configure.in:
scripts/Mmake.rules:
	Delete calls to `chmod -r'.  Turning off read permission seems
	to cause more problems than it solves.  Amoung other things,
	it causes problems on systems such as Windows where you can't
	delete a read-only file.  (GNU-win32 has some work-arounds for
	that, but there are bugs in the work-arounds.)
	We should probably also delete the various calls to `chmod +w',
	since they are no longer needed, but for the moment I have left
	them in for backwards compatibility.  We can reconsider this
	in a year or two's time.
1997-11-21 12:34:19 +00:00
Fergus Henderson
1acfdbff07 Add support for a new `GRADEFLAGS' variable to Mmake,
Estimated hours taken: 1

Add support for a new `GRADEFLAGS' variable to Mmake,
so that you can use the more readable (and more portable)
`GRADEFLAGS = --profiling' rather than e.g. `GRADEFLAGS = asm_fast.gc.prof'.

scripts/Mmake.vars.in:
	Add GRADEFLAGS variable, defaulting to `--grade $(GRADE)'.

scripts/Mmake.rules:
	Change various rules to use `$(GRADEFLAGS)' instead of
	`--grade $(GRADE)'.

compiler/modules.m:
	Change various rules in the generated `.dep' files to
	use `$(GRADEFLAGS)' instead of `--grade $(GRADE)'.

doc/user_guide.texi:
	Modify the documentation to reflect the above changes.
1997-11-21 08:08:32 +00:00
Fergus Henderson
c98155751b Delete support for `.mod' files, since they are obsolete now.
Estimated hours taken: 0.5

Delete support for `.mod' files, since they are obsolete now.

scripts/mod2c:
	Delete this script.

scripts/Mmakefile:
	Delete reference to `mod2c'.

scripts/Mmake.rules:
	Delete the `.mod' suffix and the rule for .mod -> .c,

scripts/Mmake.vars.in:
	Delete the MOD2C, MOD2CFLAGS, MOD2H, and MOD2HFLAGS variables.

doc/user_guide.texi
	Delete mention of `.mod' files.
1997-11-21 07:11:01 +00:00
Fergus Henderson
557e1591c4 Set GPATH to the same value as VPATH.
Estimated hours taken: 4

scripts/Mmake.vars.in:
	Set GPATH to the same value as VPATH.
	This is necessary to make things work with GNU Make versions >= 3.76.
	(Otherwise GNU Make tries to build the library interface files in
	the current directory rather than the library directory,
	if they are out-of-date with respect to the datestamp files,
	and then since they don't exist in the current directory,
	it thinks they have changed, even if they haven't.)
1997-10-18 17:25:14 +00:00
Fergus Henderson
9560996907 Change the layout of the `--help' message so that
Estimated hours taken: 0.5

scripts/mprof_merge_runs:
	Change the layout of the `--help' message so that
	the formatting of the automatically-generated man page
	comes out OK.
1997-10-15 16:44:33 +00:00
Fergus Henderson
6f6843745b When building foo from foo.in, check to ensure there were no
Estimated hours taken: 0.25

scripts/Mmakefile:
	When building foo from foo.in, check to ensure there were no
	mispelt autoconf variable names.
1997-10-15 16:30:33 +00:00
Fergus Henderson
e4786a27a3 New file. A script for merging multiple runs into a single
Estimated hours taken: 2

scripts/mprof_merge_runs:
	New file.  A script for merging multiple runs into a single
	profile.

scripts/Mmakefile:
	Add mprof_merge_runs to the list of scripts.

doc/Mmakefile:
	Add mprof_merge_runs to the list of things which need manpages.
	(The manpage will be created automatically by `make_manpage'.)

doc/user_guide.texi:
	Document the use of mprof_merge_runs.
1997-10-14 09:35:07 +00:00
Fergus Henderson
300761d01d Fix a bug in the setting of the MERCURY_LPSOLVE environment
Estimated hours taken: 0.25

scripts/mmc.in:
	Fix a bug in the setting of the MERCURY_LPSOLVE environment
	variable.
1997-10-14 03:29:02 +00:00
Fergus Henderson
3b1b5166f0 Make the user's -R' (-rpath') options precede the Mercury ones.
Estimated hours taken: 0.25

scripts/ml.in:
	Make the user's `-R' (`-rpath') options precede the Mercury ones.
	This allows the user to use their own local copies of the
	Mercury shared libraries.
1997-10-12 13:46:45 +00:00
Fergus Henderson
269cbfb37c Set the MERCURY_LPSOLVE environment variable to the full path
Estimated hours taken: 0.25

scripts/mmc.in:
	Set the MERCURY_LPSOLVE environment variable to the full path
	"@BINDIR@/lp_solve", if not already set, so that it won't matter
	if users have another command called `lp_solve' in their path.
1997-10-11 12:37:58 +00:00
Fergus Henderson
eb7bcf0fd9 Change mgnuc and ml to support the same
compilation model options as mmc.
Allow the user to mix `--grade foo' options with
other options that affect the grade such as `--profiling'.
Compute the final grade to link with from the options.

Also add a few new options and grade modifiers.

compiler/options.m:
compiler/mercury_compile.m:
	Add `--profile-time' and `--profile-calls' options.
	Change `--profiling' to now just imply both of those.
	Add `--pic-reg' option (just implies `-DPIC_REG' in cflags).

compiler/handle_options.m:
	Add support for grade modifiers `.proftime' and `.profcalls'.
	Make `.debug' a grade modifier, rather than having a base
	grade `debug'.

scripts/init_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
	New files containing sh subroutines for parsing grade-related
	options.

configure.in:
bindist/bindist.configure.in:
	Use AC_SUBST_FILE to allow #inclusion of the above-mentioned
	`.sh-subr' files.

scripts/ml.in:
scripts/mgnuc.in:
	Use the above-mentioned sh subroutines.

scripts/ml.in:
compiler/mercury_compile.m:
compiler/handle_options.m:
	Compute the final grade to link with from the various
	grade-related options.

scripts/mgnuc.in:
	Support the `--inline-alloc' option.

doc/user_guide.texi:
README.Linux:
	Document the above changes.
1997-10-08 13:16:33 +00:00
Fergus Henderson
5852b953ea For Linux, make --make-shared-lib' imply --mercury-libs shared',
Estimated hours taken: 0.5

scripts/ml.in:
	For Linux, make `--make-shared-lib' imply `--mercury-libs shared',
	since on Linux the shared and non-shared grades are not compatible.
1997-10-07 17:50:53 +00:00
Fergus Henderson
64c2d3e991 Fix a bug that broke things on SunOS 4.x.
Estimated hours taken: 0.25

Fix a bug that broke things on SunOS 4.x.

scripts/ml.in:
	Don't pass -rpath options unless the system supports shared
	libraries.
1997-10-02 16:23:08 +00:00
Fergus Henderson
a6357c33bb Fix a small quoting bug in my previous change.
Estimated hours taken: 0.1

scripts/c2init.in:
	Fix a small quoting bug in my previous change.
1997-09-06 12:04:15 +00:00
Fergus Henderson
8bc9cf2d1c Use only libmercury.init and runtime.init in $MERCURY_MOD_LIB_DIR,
Estimated hours taken: 0.25

scripts/c2init.in:
	Use only libmercury.init and runtime.init in $MERCURY_MOD_LIB_DIR,
	rather than using `$MERCURY_MOD_LIB_DIR/*'.  This avoids problems
	if other .init files (e.g. cfloat_lib.init) are installed in
	the same directory.
1997-09-06 11:44:02 +00:00
Fergus Henderson
d1cc2ddee4 Split up the startup interface so that there are seperate
Estimated hours taken: 8

Split up the startup interface so that there are seperate
initialization and termination functions, rather than just a single
mercury_runtime_main() function which does everything.
Also change things so that the io__state data is stored in global
variables.

runtime/init.h:
util/mkinit.c:
runtime/wrapper.h:
runtime/wrapper.mod:
	Move declarations for stuff defined in wrapper.mod from init.h
	to wrapper.h.  Clean up the remainder of init.h so that it
	is clear which parts are interface and which are just there
	for use by *_init.c.

	Change the automatically-generated *_init.c files
	so that they call mercury_runtime_init(),
	mercury_runtime_main(), and mercury_runtime_terminate(),
	rather than just mercury_runtime_main().
	Define these new two functions in wrapper.mod.

	Delete the library_entry_point; change do_interpreter
	to call program_entry_point directly, rather than via
	library_entry_point.

runtime/engine.h:
runtime/engine.mod:
	Add new function terminate_engine().
	Delete the function start_mercury_engine();
	move the code that used to be there to the end
	of init_engine().

runtime/context.h:
runtime/context.mod:
	Add new function shutdown_processes().
	(The current implementation is just a stub.)
	Add a call to debug_memory() in init_process_context().

runtime/memory.h:
runtime/memory.c:
	Export the debug_memory() function, for use by context.c.

library/io.m:
library/io.nu.nl:
	Change things so that the io__state data is stored in C global
	variables (or, for Prolog, using assert/retract), rather than
	passing around a data structure.  (Actually we still pass the
	data structure around, but it is just a dummy Word that never
	gets used.)

	Delete the old hand-coded io__run predicate, which was
	the library entry point; instead export C functions
	ML_io_init_state() and ML_io_finalize_state().	Move the
	code for handling profiling from io__run to do_interpreter
	in runtime/wrapper.mod.

scripts/c2init.in:
	Change the default entry point from io__run_0_0 to main_2_0
1997-09-05 22:38:58 +00:00
Fergus Henderson
c32a966e86 Improve a variable name: s/CNSTR_OPTS/TRAIL_OPTS/g.
Estimated hours taken: 0.25

scripts/mgnuc.in:
	Improve a variable name: s/CNSTR_OPTS/TRAIL_OPTS/g.
1997-08-28 16:04:10 +00:00
Fergus Henderson
86a4d3b3cb Add a `--vim' option to work-around limitations in vim;
Estimated hours taken: 0.5

scripts/mtags:
	Add a `--vim' option to work-around limitations in vim;
	if `--vim' is specified, it generates a dumbed-down tags
	file that vim can understand.
1997-08-27 14:23:23 +00:00
Fergus Henderson
88957b5c23 This change is part one of a group of changes to generalize the
Estimated hours: 1

This change is part one of a group of changes to generalize the
current support for trailing.  This part just involves changing
the names from application-specific (--constraints) to more
general ones (--use-trail).

scripts/mgnuc.in:
compiler/handle_options.m:
	Rename the `*.cnstr' grades as `*.tr', and use
	`-DMR_USE_TRAIL' rather than `-DCONSTRAINTS'.

compiler/options.m:
	Rename the `--constraints' option as `--use-trail'.

compiler/code_gen.m:
compiler/disj_gen.m:
compiler/ite_gen.m:
compiler/mercury_compile.m:
	Trivial changes to handle the renaming of the `constraints'
	option as `use_trail'.
1997-08-23 13:10:29 +00:00
Tyson Dowd
bc7d3fc1c1 Remove mc.in, it is no longer needed.
Estimated hours taken: 0.05

scripts/mc.in:
	Remove mc.in, it is no longer needed.

scripts/.cvsingore:
	Remove mc from .cvsignore, add mmc in its place.
1997-08-05 04:40:21 +00:00
Fergus Henderson
04b720630b Update the copyright messages so that (a) they contain the correct years
and (b) they say "Copyright (C) ... _The_ University of Melbourne".
1997-07-27 15:09:59 +00:00
Fergus Henderson
e6a0bcf591 If interface file has changed, print out a message, even
Estimated hours taken: 0.25

scripts/mercury_update_interface.in:
	If interface file has changed, print out a message, even
	if `-v' (verbose) was not specified.  Rationale: this is
	useful information, and printing it out makes it easier to
	understand why Mmake decides to remake things.
1997-07-18 06:49:29 +00:00
Tyson Dowd
9e9aea4053 Rename mc' as mmc'. (Remember to commit mmc.in this time ;)
Estimated hours taken: 0.5

Rename `mc' as `mmc'. (Remember to commit mmc.in this time ;)

scripts/mmc.in:
	Change references to mc into mmc.
1997-07-16 05:18:56 +00:00
Fergus Henderson
3a2a10c193 Simplify the process for creating and using Mercury libraries,
and document it.

compiler/modules.m:
	Add rules for creating the `.a', `.so', and `.init' files.
	The `.so' file is creating using ml's new `--make-shared-lib' option.

scripts/Mmake.vars.in:
	Add definitions for AR, ARFLAGS, RANLIB, and RANLIBFLAGS,
	for use by the new rules generated in `.dep' files by modules.m.

Mmake.common.in:
	Remove RANLIB, since it's now defined in scripts/Mmake.vars.in.

doc/user_guide.texi:
	Add a chapter on libraries.
1997-07-15 09:12:01 +00:00
Tyson Dowd
9484d33ff9 Rename mc' as mmc'.
Estimated hours taken: 2

Rename `mc' as `mmc'.

Note: we do not change the names of variables such as MCFLAGS, just the
`mc' executable.

configure.in:
	Look for mmc not mc. If you can't find mmc to bootstrap, try for
	mc.

bindist/Mmakefile:
bindist/bindist.configure.in:
doc/Mmakefile:
doc/user_guide.texi:
scripts/Mmake.vars.in:
scripts/Mmakefile:
scripts/msl.in:
tools/expand_params:
tools/optstages:
tools/speedtest:
tools/test_mercury:
	Change references to mc into mmc.
1997-07-15 08:05:15 +00:00
Fergus Henderson
94c8131746 Add support to `ml' for creating and using shared libraries.
Estimated hours taken: 2

Add support to `ml' for creating and using shared libraries.

scripts/ml.in:
	- Change the `--shared' option so that it does not pass
	  `-shared' to $CC.   This is because passing `-shared' to gcc
	  would have the effect of *creating* a shared library, but
	  ml's documentation for `--shared' says that it means the
	  generated executable should *use* shared libs.  Also rename
	  the variable $SHARED_OR_STATIC_OPT as $MAYBE_STATIC_OPT,
	  since the previous name was now misleading.

	- Add a new option `--make-shared-lib', for creating shared libraries.
	  This is to allow users to create their own shared libraries.

	- Add a new option `-R<dir>' / `--shared-lib-directory', that
	  adds a directory to the RPATH used by the dynamic linker to
	  search for shared libraries.  This is to allow users to link
	  in their own shared libraries.
1997-07-14 09:14:07 +00:00
Fergus Henderson
715634e5ef Fix a problem with shared libraries on Linux.
They weren't working because Linux requires the `-rpath' option
be specified when linking the shared libraries, as well as when
linking executables.  Previously we only passed `-rpath' option
when linking executables.

configure.in:
Mmake.common.in:
bindist/bindist.build_vars.in:
	Add new configuration variables for handling `-rpath' or `-R' options:
	EXE_RPATH_OPT, EXE_RPATH_SEP, SHLIB_RPATH_OPT, and SHLIB_RPATH_SEP.

scripts/ml.in:
	Rewrite the system-specific code for handling rpaths
	to instead use the new rpath configuration variables.

library/Mmakefile:
runtime/Mmakefile:
	When linking shared libraries that depend on other shared libraries,
	pass appropriate rpath options using the rpath configuration variables.
1997-06-16 13:35:34 +00:00
Tyson Dowd
f9674e6fb8 Remove references to .garb files.
Estimated hours taken: 0.5

compiler/modules.m:
scripts/Mmake.rules:
	Remove references to .garb files.
	We are not going to use a separate link phase for accurate gc
	anymore.
1997-06-03 07:01:10 +00:00
Fergus Henderson
c3e9d9bba5 Work around a new (mis-)feature present in GNU Make 3.74
Estimated hours taken: 8

scripts/Mmake.rules:
	Work around a new (mis-)feature present in GNU Make 3.74
	but not in 3.71: recent versions will not update the timestamp
	of a target if the commands for that target are just whitespace.
	Instead, we need to use an explicit sh `:' command.
1997-05-23 00:39:14 +00:00
David Jeffery
a044511f1a Added documentation of the new MERCURY_SP_OVERRIDING_LIB_OBJS (etc.)
Estimated hours taken: 0.5

Added documentation of the new MERCURY_SP_OVERRIDING_LIB_OBJS (etc.)
environment variables, and improved documentation of other Prolog related
Mercury environment variables.

scripts/msl.in:
	document MERCURY_SP_OVERRIDING_LIB_OBJS and add documentation for some
	other variables
scripts/mnl.in:
	document MERCURY_NU_OVERRIDING_LIB_OBJS, and add documentation for some
	other variables
1997-05-19 02:17:02 +00:00
David Jeffery
381f5e328c Improved the error messages for map__lookup failure by writing out the types
Estimated hours taken: 4

Improved the error messages for map__lookup failure by writing out the types
of the values and keys.

Also, since the Prologs cannot handle the type_of functions, a `normal'
version of map__lookup has been added to map.nu.nl

To accomodate this, this change implements a mechanism to override
definitions of predicates for particular Prologs. This mechanism makes
explicit which .no or .ql files contain preds overriding others, and so
makes things a bit more robust.

library/map.m:
	Implement the better error messages.
library/map.nu.nl:
	The Prolog version of map__lookup.
library/Mmakefile:
	Set new environment variables, MERCURY_NU_OVERRIDING_LIB_OBJS or
	MERCURY_SP_OVERRIDING_LIB_OBJS to be the files which are to be
	linked, but contain definitions which override others.
scripts/mnl.in:
	Link everything in MERCURY_NU_OVERRIDING_LIB_OBJS last.
scripts/msl.in:
	Link everything in MERCURY_SP_OVERRIDING_LIB_OBJS last.
1997-05-17 03:27:18 +00:00
Fergus Henderson
c878e0cb72 Work-around a bug in gcc 2.6.3 on mips that caused a gcc internal error
Estimated hours taken: 0.25

Work-around a bug in gcc 2.6.3 on mips that caused a gcc internal error
when compiling compiler/bytecode.c.

scripts/mgnuc.in:
	Ensure that bytecode.c is compiled with `-O1' rather than `-O2'.
1997-04-20 02:15:57 +00:00
Fergus Henderson
0d2a940783 Fix a bug with the `-v' (verbose) option: it was not echoing
Estimated hours taken: 0.25

scripts/ml.in:
	Fix a bug with the `-v' (verbose) option: it was not echoing
	all of the options it passed to gcc.
1997-04-15 04:39:58 +00:00
Fergus Henderson
c49f69398a Fix a problem on Windows reported by Dominique de Waleffe.
Estimated hours taken: 0.25

Fix a problem on Windows reported by Dominique de Waleffe.

scripts/mercury_update_interface.in:
	Delete the hard-coded setting of `PATH=/bin:/usr/bin'.

	The original intent was to avoid problems with people who have
	done things like putting shell scripts that override the
	standard commands such as `mv' and `cp' in their path.
	However, since we haven't done this consistently for all of our
	shell scripts, and since this causes problems for Windows
	installations (for which the binaries might not be in /bin
	or /usr/bin), it seems simplest to just remove it.

	If we run into any problems with this, it should be put back in
	as `PATH=/bin:/usr/bin:$PATH' rather than `PATH=/bin:/usr/bin',
	and it should be done consistently for all shell scripts, not just
	this one.
1997-03-18 16:03:42 +00:00
Tyson Dowd
a38d265a7f Use EXTRA_* environment variables for setting flags.
Estimated hours taken: 2

Use EXTRA_* environment variables for setting flags.

doc/user_guide.texi:
	Document that EXTRA_* variables can be used for setting flags
	when mmake is being used. Document the commonly used mmake
	variables.

scripts/Mmake.vars.in:
	Set *FLAGS variables according to EXTRA_*FLAGS.
1997-03-18 05:58:16 +00:00
Fergus Henderson
59cf271af1 Undo my previous change to use `exec', since that causes
Estimated hours taken: 0.25

scripts/mmake.in:
	Undo my previous change to use `exec', since that causes
	problems because the temporary files never get removed.
	Instead, I've just added a comment saying why `exec' can't
	be used.
1997-02-27 15:32:29 +00:00
Fergus Henderson
f25b679f39 Allow `*-cygwin32' as a another name for Windows running gnu-win32,
Estimated hours taken: 0.1

scripts/ml.in:
	Allow `*-cygwin32' as a another name for Windows running gnu-win32,
	since that is the name that `config.guess' outputs.
1997-02-26 14:43:48 +00:00
Fergus Henderson
da41b23096 Change the code so that it uses `exec' to run make,
Estimated hours taken: 0.25

scripts/mmake.in:
	Change the code so that it uses `exec' to run make,
	rather than just invoking it as a sub-process.  This
	should be a little more efficient.
1997-02-26 09:25:54 +00:00
Fergus Henderson
237a4c0524 Oops, fix another bug in the handling of -shared and -static:
Estimated hours taken: 0.25

scripts/ml.in:
	Oops, fix another bug in the handling of -shared and -static:
	it wasn't actually passing them on to gcc.
1997-02-10 07:18:53 +00:00
Fergus Henderson
39441951c0 Fix a problem where the new support for Linux ELF shared libraries
in gc 4.11 meant that `ml -static' didn't work on Linux, because
you got unresolved references to _DYNAMIC in dyn_load.o.

scripts/ml.in:
	If we're passed `-static' or `--static', then pass
	`-static -Wl,-defsym,_DYNAMIC=0' to gcc, so that gcc
	will pass `-defsym _DYNAMIC=0' to the linker.
1997-02-09 12:26:57 +00:00
Fergus Henderson
cc813fbac2 Fix a bug in the code to parse the new -static, --static, -shared and
Estimated hours taken: 0.25

scripts/ml.in:
	Fix a bug in the code to parse the new -static, --static, -shared and
	--shared options: add in some missing `shift' statements.
1997-02-09 11:20:02 +00:00
Fergus Henderson
186f71464e Add a tiny bit more documentation.
Estimated hours taken: 0.1

scripts/mmake.in:
	Add a tiny bit more documentation.
1997-02-09 03:50:43 +00:00
Fergus Henderson
1d3043d497 Make a couple of changes to the help message, as suggested
Estimated hours taken: 0.25

scripts/ml.in:
	Make a couple of changes to the help message, as suggested
	by Tyson.
1997-02-09 02:59:34 +00:00
Fergus Henderson
8ce103cc76 Add Unix-style man pages for most of the Mercury development tools.
scripts/c2init.in:
scripts/mmake.in:
scripts/msc.in:
	Small changes to the help messages to make them come out
	better when converted to man pages.

scripts/mgnuc.in:
	Add a `--help' option.
1997-02-07 14:17:41 +00:00
Fergus Henderson
ac041e1f8a Some work towards making it easier to use shared libraries on Linux.
Estimated hours taken: 1

Some work towards making it easier to use shared libraries on Linux.

scripts/ml.in:
	Add a `--mercury-libs {shared, static, none}' option
	(`--mercury-libs none' replaces the old `--no-libs' option).
	Add `--shared' and `--static' options.
	Add a `--help' option.
1997-02-07 13:46:06 +00:00
Fergus Henderson
3e0f071867 Add a rule for creating `.pic_s' files (which are the
Estimated hours taken: 0.25

scripts/Mmake.rules:
	Add a rule for creating `.pic_s' files (which are the
	assembler files corresponding to the `.pic_o' objects).
1997-02-07 13:21:01 +00:00
Fergus Henderson
726b1e24d2 Change the default compile mode from fastcode' to compactcode',
Estimated hours taken: 0.25

scripts/msc.in:
	Change the default compile mode from `fastcode' to `compactcode',
	because the SICStus 2.1#9 native code generator for Sparc
	has some bugs in it.
1997-02-05 05:58:43 +00:00
Fergus Henderson
a3aa0897f9 One of several changes to add support for ELF shared libraries on Linux.
Estimated hours taken: 0.5

One of several changes to add support for ELF shared libraries on Linux.

scripts/ml.in:
	For i?86-*-linux*, pass the appropriate flags to the linker to
	link in shared libraries, if there are any.

#endif
1997-02-05 05:40:41 +00:00
Fergus Henderson
d14bdd2eee More stuff to support non-Mercury main() programs.
Estimated hours taken: 0.5

More stuff to support non-Mercury main() programs.

util/c2init.c:
	Implement a new `-l' / `--libary' option.
	If this option is enabled, we pass `-l' to mkinit,
	which has the end result that we don't emit a main(),
	but instead we emit a mercury_main(argc, argv, stack_bottom)
	function that can be called from C.
1997-02-01 00:12:06 +00:00