Commit Graph

62 Commits

Author SHA1 Message Date
Julien Fischer
460a11ec3d Fix the debugger tests with MSYS2/MinGW64.
These were failing because debugger expects Windows-style paths in the
test_mdbrc file, but it was being generated with Unix-style paths. A
similar problem was recently fixed for MSVC, this change extends that
fix to also work for MSYS2/MinGW64.

configure.ac:
    Define a new configuration variable, FIX_PATH_FOR_WINDOWS, that expands
    to the command used to do path conversion in Unix-like environments on
    Windows. (The previous fix for MSVC used FIX_PATH_FOR_CC to do this,
    but the MinGW64 port of GCC does use Unix-style paths so that cannot
    be used here.)

scripts/Mmake.vars.in:
    Add a new mmake variable, FIX_PATH_FOR_WINDOWS.

scripts/Mmakefile:
    Use FIX_PATH_FOR_WINDOWS when creating the test_mdbrc file.
2023-07-26 21:24:28 +10:00
Julien Fischer
74ae4b80b7 Fix debugger tests on Windows.
scripts/Mmakefile:
    Use Windows-style paths in test_mdbrc on Windows.
2023-07-23 00:12:05 +10:00
Zoltan Somogyi
05ef8e01fb Rename the .ll_debug grade component to .c_debug.
Rename mmc and mgnuc options that set this grade component to --c-debug-grade.
Let the options named --c-debug of both mmc and mgnuc enable C level debugging
of only the module being compiled.

runtime/mercury_grade.h:
    Rename the .ll_debug grade component to .c_debug. Also rename the C macro
    that controls the presence or absence of this grade component
    from MR_LL_DEBUG to MR_C_DEBUG_GRADE.

runtime/mercury_conf_param.h:
runtime/mercury_debug.c:
runtime/mercury_debug.h:
runtime/mercury_engine.c:
runtime/mercury_label.c:
runtime/mercury_memory_zones.c:
runtime/mercury_memory_zones.h:
runtime/mercury_overflow.c:
runtime/mercury_std.h:
runtime/mercury_wrapper.c:
    Rename the MR_LOWLEVEL_DEBUG macro to MR_DEBUG_THE_RUNTIME.
    Previously, the name of this macro wrongly implied that it had
    something to do with the old .ll_debug grade component, even though

    - the MR_LOWLEVEL_DEBUG macro was designed to debug LLDS grades,
      since only these existed when it was created, while

    - the .ll_debug grade component (now .c_debug) is useful only for
      MLDS grades targeting C.

compiler/options.m:
    Rename the old confusingly named low_level_debug option to c_debug_grade.
    Move it to the list of grade options, and fix its documentation, which
    was completely wrong:

    - code in compile_target_code.m treated it as being a synonym of
      the .ll_debug (now .c_debug) grade component, while
    - its (commented out) documentation here in options.m said it called for
      the enabling of what is now MR_DEBUG_THE_RUNTIME.

compiler/compile_target_code.m:
    Conform to the rename just above.

    Define MR_C_DEBUG_GRADE instead of MR_LL_DEBUG if c_debug_grade is enabled.

    Pass -g to the C compiler if either c_debug_grade or target_debug
    is enabled.

    Add an XXX about a missing safety check for an obsolete experimental
    feature.

compiler/compute_grade.m:
    When given a grade with a .c_debug grade component, set only the
    c_debug_grade option; don't set the target_debug option, which is NOT
    a grade option. The change to compile_target_code.m above handles the
    only situation in which this implication was formerly required.

scripts/canonical_grade.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
    Look for and process the .c_debug grade component instead of .ll_debug.
    Use a sh variable named c_debug_grade to record its absence/presence.

    Look for and process the --c-debug-grade grade-component option,
    setting the same sh variable, c_debug_grade. (All grade components
    can be set piecemeal using sh options to the scripts using these
    subroutines.) This replaces the old, confusingly named option
    --low-level-debug.

scripts/mgnuc.in:
scripts/mgnuc_file_opts.sh-subr:
    Consistently use the sh variable c_debug to record the presence of
    the (non-grade) --c-debug option to mgnuc, and the sh variable
    c_debug_grade to record the presence of the .c_debug grade component.

    Stop looking for and handling the --low-level-debug option, which
    mgnuc used to document, even though this duplicated the same documentation
    in init_grade_options.sh-subr, which mgnuc includes. The difference was
    that init_grade_options.sh-subr meant it to represent the old .ll_debug
    MLDS grade component, while mgnuc treated it as specifying what is now
    MR_DEBUG_THE_RUNTIME for LLDS grades. It didn't help that two sh variables
    with quite different semantics had names that differed only in an
    underscore: LLDEBUG_OPTS vs LL_DEBUG_OPTS.

scripts/Mmakefile:
    Add a missing dependency to force the rebuild of mgnuc after each update
    of its sh subroutine mgnuc_file_ops.sh-subr.

doc/user_guide.texi:
    Document the --c-debug-grade option of mmc. This option was not publicly
    documented under its original misleading name (--low-level-debug), but
    its documentation is now possible without contorted dancing around the
    name.

    Clarify the documentation of mgnuc's --c-debug option.

README.sanitizers:
configure.ac:
    Conform to the rename of the grade component.

grade_lib/grade_spec.m:
grade_lib/grade_string.m:
grade_lib/grade_structure.m:
grade_lib/try_all_grade_structs.m:
    Conform to the rename of the grade component .ll_debug to .c_debug.

    Don't allow the .c_debug grade component in LLDS grades.

    In grade_string.m, add some obvious implications of some grade components.

grade_lib/choose_grade.m:
grade_lib/grade_lib.m:
grade_lib/test_grades.m:
grade_lib/var_value_names.m:
    Fix white space.

scripts/ml.in:
tools/lmc.in:
tools/test_mercury:
    Conform to the change in compile_target_code.m to the naming of
    Boehm gc library variants.
2022-12-29 20:33:08 +11:00
Zoltan Somogyi
adf6c55847 Shut up mmake actions for check_namespace.
This reduces the size of the output of tools/bootcheck by 3700+ lines,
or about 25%.

Mmake.common.in:
    Don't print the actions implementing namespace cleanliness checks.
    To allow the attribution of any violations of the namespace rules,
    print the name of the C module before any list of detected
    nonallowed symbols.

    To avoid mmake printing the actions for creating the .o files
    that some of the check_namespace actions later check, rename
    the affected object files .pseudo_o files, so that we can specify
    a rule for them that is a copy of the rule for .o files, differing
    only in not printing the compilation command.

    Mark the files involved in check_namespace actions as dependencies
    of .SECONDARY, which means that mmake does not automatically delete them
    after building them as intermediate files. The reason for this is that
    there is no way to tell make to delete intermediate files *silently*,
    i.e. without writing out the rm command that deletes them.
    To make up for this, tools/bootcheck now cleans up each directory
    immediately after "mmake check_namespace" with "mmake clean_check",
    which invokes mmake rules that do not print the rm commands.

    This change does have the effect that these intermediate files *will*
    hang around if the check_namespace target is every invoked manually.
    However,

    - we just about never run check_namespace in a directory manually, and
    - when we do, a simple "mmake clean_check" will do the required cleanup.

scripts/Mmake.rules:
    Move the vim tag line to its usual place at the top.

    Replace old-school rules such as .m.err with their modern equivalents
    (such as %.err: %.m).

scripts/Mmakefile:
    Instead of printing the rules that make test_mdbrc, print only a
    "making test_mdbrc" message.

runtime/Mmakefile:
    Conform to the change of the name of a make variable in Mmake.common.in.

ssdb/Mmakefile:
    Fix an old bug that something else in this diff tickled: make the
    .depend target of each main module depend on SSDB_FLAGS, *not* just
    the phony general "depend" target. This was a bug because tools/bootcheck

    - copied across to stage 2 ONLY SSDB_FLAGS.in, and NOT SSDB_FLAGS,

    - did NOT explicitly make SSDB_FLAGS from SSDB_FLAGS.in, even though
      pretty much invocations of the Mercury compiler in this directory
      have "--flags SSDB_FLAGS" as an implicit argument, and then

    - built dependencies in the ssdb directory by invoking the top
      Mmakefile's dep_ssdb target, which (indirectly) invokes
      $(SSDB_LIB_NAME).depend.

    Due to all the above, I don't actually know how tools/bootcheck
    could ever build stage2/ssdb until now :-(

tools/bootcheck:
    Invoke "mmake clean_check" after each "mmake check_namespace".

    Change the code that explicitly builds the directory-specific
    X_FLAGS file in each directory (which is invoked only when using
    mmc --make) to actually build all such files, when previously
    it built only a subset.

tests/invalid/Mmakefile:
tests/invalid_nodepend/Mmakefile:
tests/invalid_onlydepend/Mmakefile:
tests/invalid_options_file/Mmakefile:
tests/invalid_purity/Mmakefile:
tests/invalid_submodules/Mmakefile:
tests/stm/Mmakefile:
    Fix an unintended consequence of replacing the .m.err rule in
    scripts/Mmake.rules with %.err: %.m, which is that the %.err: %.m
    rules in these mmakefiles became ineffective, because they appear
    in the makefile we construct *after* the rule in scripts/Mmake.rules,
    which specify a different action (the rules here return a nonzero
    status in the *absence* of failure, which would be ridiculous
    for the rule in scripts/Mmake.rules). Apparently, the %.err: %.m rules
    overrode the rule in scripts/Mmake.rules while it had the old form,
    but do not do so now it has the new form.

    The fix is to make replace all the "%.err: %.m" rules in these Mmakefiles
    with "$(PROGS:%=%.err): %.err: %.m" rules, which specify that they
    override the generic rule for the .err files of the test cases
    in each directory.

    In invalid_purity/Mmakefile, fix a bug: -nodepend suffixes make sense
    in only in the name of a *test*, not the name of a *program*, so
    move such a suffix from a program name to a test name. Without this,
    the program's .err file would be included in the list of .err files
    to which the ".err: .m" rule applies under the wrong name.

    In invalid_submodules/Mmakefile, fix the misleading names of some
    make variables, and fix a misspelt directory name.

    Standardize on "$(PROGS:%=%.err)" notation, replacing earlier instances
    of "$(addsuffix .err,$(PROGS))". The reason for this is that when I tried
    using "$addsuffix .int_err,$(PROGS))" in tests/invalid/invalid_make_int,
    it did not work. (A google search on "gnu make addsuffix" did not yield
    any clues as to why. Maybe you can only add suffixes that do not contain
    underscores?)
2022-01-24 17:38:35 +11:00
Peter Wang
89e59e7cc8 Delete support for browsing terms as XML.
The 'browse --xml' command has not worked with current versions of
xsltproc for quite some time, but we have not received any bug reports,
nor has anyone tried to fix it. We have a method for interactively
exploring a term in 'browse --web' so IMHO there is no need to keep
support for 'browse --xml'.

browser/browse.m:
browser/browser_info.m:
browser/declarative_user.m:
trace/mercury_trace_browse.c:
trace/mercury_trace_browse.h:
trace/mercury_trace_cmd_browsing.c:
trace/mercury_trace_cmd_parameter.c:
trace/mercury_trace_cmd_parameter.h:
trace/mercury_trace_internal.c:
    Delete code.

doc/mdb_categories:
doc/user_guide.texi:
    Delete documentation.

configure.ac:
    Don't search for a XUL browser and xsltproc.

scripts/mdbrc.in:
    Delete 'xml_browser_cmd' and 'xml_tmp_filename' lines.

scripts/xul_tree.xsl:
    Delete now unused file.

scripts/Mmakefile:
    Conform to deletions.

tests/debugger/Mmakefile:
tests/debugger/browser_test.exp:
tests/debugger/browser_test.exp3:
tests/debugger/browser_test.inp:
tests/debugger/mdb_command_test.inp:
tests/debugger/save.exp2:
tests/declarative_debugger/browse_arg.exp:
tests/declarative_debugger/browse_arg.inp:
    Don't test 'browse --xml' any longer.

extras/xml_stylesheets/README:
    Delete reference to 'browse --xml' command.

NEWS:
    Announce change.
2020-10-14 17:41:54 +11:00
Zoltan Somogyi
be3f9443b1 Simplify the setup of mdbrc for tests.
We used to set up *two* mdbrc files for use by test cases:
scripts/test_mdbrc, and tests/mdbrc. Tools/bootcheck said
the tests should use the former, while tests/Mmake.common
said they should use the latter. This diff deletes the latter,
and uniformly uses the former.

The setup code was also scattered, with parts being done by
the configure script, and part being done by tools/bootcheck.
Move it all to scripts/Mmakefile, since that is the natural
place to put code to build scripts/test_mdbrc.

Mmakefile:
    Fix the action for cleaning up the tests directory.
    This started out as the reason for this whole change.
    As it happens, a *working* action for cleaning up the tests
    broke things, because it deleted an autoconfigured file
    (tests/mdbrc) that there was no rule for rebuilding.
    This issue is what required the rest of this diff.

    When doing "mmake clean/realclean", clean the extras as well.

configure.ac:
    Delete the code creating tests/mdbrc.in.

scripts/Mmakefile:
    Add a rule to build test_mdbrc, as mentioned above.

tests/Mmake.common:
    Switch to using scripts/test_mdbrc in test cases
    run under mdb.

    Mark the rules that clean up mdbrc and mdbrc.in
    as obsolete, since we will now stop creating those files.

tools/bootcheck:
    Delete the code that used to build tests/mdbrc. Instead,
    rebuild scripts/test_mdbrc (in case the workspace was moved),
    and use that.

tests/Mmakefile:
    When cleaning the tests directory, clean its subdirectories
    (since the top level directory does not have much clean).
2020-10-04 23:00:29 +11:00
Julien Fischer
fb643a2ca7 Support 'mercury' as a synonym for 'mmc' on all platforms.
On Windows the name 'mmc' is also used for the executable for Microsoft
Management Console.  For the MSVC port on the Windows command line we have long
provided a batch file named 'mercury' as an alternative to `mmc' in order to
avoid this clash.  (Re-arranging your PATH to avoid the clash is not always an
option.)

Provide a shell script named 'mercury' that serves the same purpose elsewhere.
Its main use is to avoid the name clash on MinGW/MSYS, Cygwin etc., but
making the name available everywhere should avoid unnecessary changes in build
scripts and alike.

Document the issue with the name clash in the appropriate chapter of the user's
guide and also in the top-level Windows README file.

scripts/mercury.in:
     Add a template for the 'mercury' script.

configure.ac:
     Create the 'mercury' wrapper script.

scripts/Mmakefile:
     Add 'mercury' to the list of scripts.

doc/user_guide.texi:
     Add a paragraph describing the 'mmc' name clash on Windows and what
     to do about it.

     Unrelated change: ':' is no longer a module qualifier.

README.MS-Windows:
     Point users to the relevant chapter of the user's guide for ways
     to deal with the `mmc' name clash.

NEWS:
     Announce the addition.
2020-06-16 16:33:22 +10:00
Zoltan Somogyi
b8b845a568 Fix mmakefile rules for os,cs,css,javas.
The main objective of this change is to get bootchecks in the csharp
and java grades to actually build the slice, profiler, deep_profiler
and mfilterjavac directories, which (due to the bug this diff fixes)
they weren't doing before.

However, since one side effect of this change is to eliminate
one source of annoying warnings from mmake about references to undefined
variables, a subsidiary objective is to eliminate other sources of such
warnings as well, which mostly come from the rules for making tags files.

browser/Mmakefile:
deep_profiler/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
ssdb/Mmakefile:
    When creating stage 3, the bootcheck builds, in each directory,
    only the files that it wants to compare against their stage 2 versions.
    This means that it wants to build all the .c, .cs or .java files,
    which it does via the cs, css and javas mmake targets.

    The correct definitions of the rules of these targets depends on
    whether mmc --make is being used or not, so we need at least two
    sets of definitions: one for mmc --make, and for no mmc --make,
    and conditionally selecting the appropriate one. The latter definition
    has the problem that it refers to mmake variables that are intended
    to be defined in .dv files created by mmc --generate-dependencies,
    but until that has been run, those mmake variables are undefined.

    Until now, the only directories that had both the mmc --make
    and the no mmc --make definitions were the ones needed to build
    the compiler. Bootchecks in the csharp and java grades, which
    always use --make make, got errors when they tried to build
    the directories that bootcheck builds after the compiler:
    the slice, profiler, deep_prof and mfilterjavac directories.

    This diff ensures that all directories we build in bootcheck
    get all both versions of the os, cs, css, and javas targets.
    In fact, they get two subversions of the no mmc --make version:
    one for use in the presence of .dv files, and one for use in their
    absence. The latter just builds the .dv files and invokes mmake
    again. This avoids one source of warnings about undefined mmake
    variables.

    To avoid another source, make the rules for tags files and their
    proxies depends on *.m instead of mmake variables such as $(mcov.ms),
    since this makes sense even before making dependencies. The only price
    is that any untracked Mercury source files in the directory have to
    either be given some other suffix, or moved somewhere else.

    Where relevant, make the mtags invocation prefer the master versions
    of files that are copied from the mdbcomp directory to other directories,
    since this is the only writeable version.

    Make the os and cs rules consistently NOT build the _init.[co] files.
    The way we use those files in bootcheck, we never need them;
    when we need them, the right target to give is the executable anyway.

    In the slice directory, don't put mcov between mtc_union and mtc_diff.

    Eliminate unnecessary duplication, e.g. of sources in rules.

    Eliminate double negatives in conditionals.

    Fix formatting.

Mmake.common.in:
bindist/Mmakefile:
bytecode/Mmakefile:
compiler/Mmakefile:
doc/Mmakefile:
grade_lib/Mmakefile:
robdd/Mmakefile:
samples/Mmakefile:
scripts/Mmakefile:
tools/Mmakefile:
trace/Mmakefile:
util/Mmakefile:
    Add "ft=make" to vim modelines. This is redundant for the files whose
    names is Mmakefile, but it is needed for Mmake.common.
2020-04-11 20:10:38 +10:00
Peter Wang
5686126f21 Use non-minified copies of jQuery and jsTree.
The Debian packaging system complains about minified files not being
built from non-minified sources so distribute and install the
non-minified sources instead. Fixes Mantis bug #473.

scripts/jquery.slim.js
    Add non-minified copy of jQuery slim 3.3.1 from https://jquery.com/

scripts/jstree.js
scripts/jstree.style.css
    Add non-minified copy of jsTree 3.2.1 from https://www.jstree.com/

scripts/jquery.slim.min.js:
scripts/jstree.min.js:
scripts/jstree.style.min.css:
    Delete old minified files.

LICENSE:
browser/term_to_html.m:
scripts/Mmakefile
    Update paths.
2018-11-19 11:42:45 +11:00
Paul Bone
4ee7e744b7 Don't pack scripts/config.log in source tarballs
Mmakefile:
    Delete this file before making the source tarball.

scripts/Mmakefile:
    Delete this file in make realclean
2018-11-18 16:20:56 +11:00
Peter Wang
0d273769fc Add web browser-based term browsing in the debugger.
browser/browse.m:
    Add save_and_browse_browser_term_web to be called when
    "browse --web" is entered at the mdb prompt.

    Add browser_term_to_html_flat_string, a helper predicate for
    term_to_html.

    Make portray_flat_write_browser_term work take a stream parameter
    instead of writing to the current output stream. It is called by
    browser_term_to_html_flat_string, writing to a string builder
    stream.

browser/browser_info.m:
    Add web_browser_cmd field to browser_persistent_state.

browser/mdb.m:
browser/term_to_html.m:
    Add new module to generate an HTML document. The document contains a
    JavaScript represention of a Mercury term.

    (The JavaScript string escaping code is adapted from Julien's
    mercury-json project.)

browser/percent_encoding.m:
    Add new module to perform percent-encoding.

scripts/mdb_term_browser.css:
scripts/mdb_term_browser.js:
    Add JavaScript and CSS files referenced by the generated HTML file
    to create a tree view of a Mercury term using jstree.

scripts/32px.png:
scripts/40px.png:
scripts/throbber.gif:
scripts/jstree.min.js:
scripts/jstree.style.min.css:
    Add local copy of jstree files <https://www.jstree.com/>

scripts/jquery.slim.min.js:
    Add local copy of jquery <https://jquery.com/>

scripts/Mmakefile:
    Install the new files into the same directory as mdbrc and other
    mdb-related files.

trace/mercury_trace_browse.c:
trace/mercury_trace_browse.h:
trace/mercury_trace_cmd_browsing.c:
trace/mercury_trace_cmd_parameter.c:
trace/mercury_trace_cmd_parameter.h:
trace/mercury_trace_internal.c:
    Add "browse --web" and "web_browser_cmd" commands.

doc/user_guide.texi:
    Document "browse --web" and "web_browser_cmd" commands.

configure.ac:
scripts/mdbrc.in:
    Set a reasonable default command to launch a web browser from mdb.
    (Only tested on Linux.)

NEWS:
    Announce the new feature.

.README.in:
    Mention jquery and jstree licensing.

tests/debugger/Mmakefile:
tests/debugger/completion.exp:
tests/debugger/mdb_command_test.inp:
tests/debugger/save.exp2:
    Update debugger tests for new commands.
2017-08-15 16:14:55 +10:00
Julien Fischer
18c9eecbce Make it possible to run an installed compiler built in the C# grade.
scripts/mercury_compile.sh-csharp:
   Add a script script that runs an installed compiler built in the C#
   grade using Mono.  As with compilers built in the Java grade, the
   wrapper script we generate in the compiler directory only works
   in situ and we require a separate script for the installed version.

   XXX TODO: we will need to handle .NET differently, probably by simply
   renaming top_level.exe -> mercury_compile.exe.

scripts/Mmakefile:
    Install the new script if the compiler was built in the C# grade.
2015-12-18 00:04:05 +11:00
Julien Fischer
b309c87d9f Make it possible to run the installed Java version of the compiler.
Make it possible to run the installed Java version of the compiler by
installing versions of the wrapper scripts for 'mercury_compile' and
'mfilterjavac' that have the CLASSPATH set to point to the installed versions
of the standard library Java archives.

The wrapper script generated in the compiler directory is not suitable for this
because as generated it sets the CLASSPATH relative to the compiler directory,
not the installation directory.  Modifying that file is not a good idea since
that will mean that then the compiler cannot be executed in situ.  Instead we
provide a handwritten version of the wrapper script in the scripts directory
that is installed in place of the generated one.  Ditto for mfilterjavac.

While this does create a small maintenance problem, I think that any other
approach, for example, modifying the generation of wrapper scripts to account
for this, is going to be a larger maintenance problem.

TODO:
    - handle batch file launchers for Windows.
    - handle other executables in the Mercury system (although most of these
      are not so important in this context).

compiler/Mmakefile:
mfilterjavac/Mmakefile:
    Do not install generated wrapper scripts from these directories in the Java
    grade.

scripts/mercury_compile.sh-java:
scripts/mfilterjavac.sh-java:
    Java wrappers scripts for the installed versions of the compiler
    and mfilterjavac.

scripts/Mmakefile:
    In the Java grade install the wrapper scripts for the compiler and
    mfilterjavac from this directory.
2015-09-04 13:55: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
Julien Fischer
3d2b8d72a2 Clean up a file created by the bootcheck script.
scripts/Mmakefile:
     During a realclean delete the file test_mdbrc if
     it is present.
2013-03-26 14:24:44 +11:00
Julien Fischer
03d0ca4712 Improve and update documentation of the MSVC port.
Branches: 11.07, main

Improve and update documentation of the MSVC port.

Add batch files for invoking mdb and mprof; avoid problem with mercury.bat.

README.MS-VisualC:
	Rewrite this file, it was very much out-of-date.
	The major changes are:

	+ we now describe how to set up a Cygwin or MSYS shell
  	  with MSVC available.

	+ the source distribution now works with MSVC.

	+ a list of the limitations of the MSVC port has been added.

	+ a description of how to set up the compiler so that it
	  works from the Windows command prompt has been added.

scripts/mercury/mercury.bat.in:
	Delete support for the MERCURY_COMPILER and MERCURY_CONFIG_DIR
	enviorment variables; the handling of them in this batch file
	doesn't appear to be portable across different versions of
	Windows and it's more important that this file work in the
	normal case.  (Keeping it simple is the way to ensure this.)

scripts/mdb.bat.in:
scripts/mprof.bat.in:
	Templates for invoking mdb and mprof on Windows.
	(I'm not sure how to reproduce all the functionality of the mdb
	script in a batch file, so the command line options provided by
	the mdb script aren't currently replicated here.)

configure.in:
scripts/Mmakefile:
	Add the new batch files.

scripts/Mercury.config.in:
	Use the Windows-style installation prefix on Cygwin systems.

browser/util.m:
	Use the conventional name for the I/O state.

	Use don't-care variables for the I/O state in foreign procs.
	This avoids suprious warnings from MSVC.
2011-11-08 03:11:42 +00:00
Zoltan Somogyi
4346f276cb Fix typo.
Estimated hours taken: 0.1
Branches: main

scripts/Mmakefile:
	Fix typo.
2009-09-01 23:54:38 +00:00
Zoltan Somogyi
f3bf8ab3aa The tags file for the compiler directory is 14.8 megabytes in size,
Estimated hours taken: 0.5
Branches: main

The tags file for the compiler directory is 14.8 megabytes in size,
which is a problem for e.g. laptops with limited disk capacity. Much of this
size is accounted for by entries that do not seem useful. This diff allows
the contents of the tags file to be controlled better. With the new defaults,
compiler/tags is now a bit less than half its previous size (7.1 Mb), with no
significant loss of amenity.

scripts/mtags.in:
	Add options to mtags to control which module qualified tags it
	generates entries for. These options control this in two dimenions.

	The first dimension is whether mtags will generate tags using "__"
	as well as "." as the module qualifier. If the user specifies the
	new option --underscore-qualified-names, mtags does; by default,
	it doesn't.

	Given a fully qualified name, the second dimension controls
	which versions of it mtags generates entries for. The old behavior
	was to generate entries for the fully qualified name, for the
	unqualified name, and for all the partially qualified versions in
	between in which the missing qualifiers were a prefix of the fully
	qualified name.

	This behavior can still be obtained by specifying the new option
	--all-module-qualified-names.

	The new option --no-module-qualified-names" makes mtags not generate
	entries for any fully or partially module qualified names, generating
	entries only for the unqualified names. (With this, and no "__"
	qualified names, compiler/tags is only 4.5 Mb in size.)

	The default is to always generate entries for unqualified names, but
	generate entries for partially or fully qualified names only if they
	are 30 characters or less in length. This means that we generate
	entries for

		map.search

	but not for

		abstract_mode_constraints.allproc_annotated_constraints

	The rationales for this are that

	- short names are more likely to be ambiguous, and thus require
	  disambiguating module qualifiers at call sites or other reference
	  sites, and

	- references to long names are unlikely to be module qualified simply
	  because the qualified name is likely to lead to excessively long
	  lines.

scripts/Mmakefile:
	Fix an old annoyance: do not sprinkle garbage into the output
	when rebuilding mtags.
2009-09-01 23:45:21 +00:00
Julien Fischer
8919bc1fc1 Fix the Mmakefile in the scripts directory.
Estimated hours taken: 0.1
Branches: main

Fix the Mmakefile in the scripts directory.

scripts/Mmakefile:
	Remove a reference to the recently deleted mercury_cleanup_install
	script.

	`mtags' is now generated by configure.

scripts/.cvsignore:
	Conform to recent changes.
2008-02-26 15:15:04 +00:00
Zoltan Somogyi
a55a04097b Currently we prepare all grades for installation inside one directory, tmp_dir,
Estimated hours taken: 1
Branches: main

Currently we prepare all grades for installation inside one directory, tmp_dir,
so that once we are finished installing one grade, we have to delete it
to make room for the next. This diff prepares each grade in its own install
directory, so that we can *leave* all the install directories to be included
in a source distribution. (This diff does not do that last step.)

Mmakefile:
	Make the above change.

scripts/prepare_tmp_dir_fixed_part.in:
scripts/prepare_tmp_dir_grade_part:
	Delete these scripts, since there is no longer a "fixed part" of files
	in the shared tmp dir that is used for all grades.

scripts/prepare_install_dir.in:
	Replace them both with this script, which does both their jobs.

configure.log:
	Do substitutions in prepare_tmp_dir, not prepare_tmp_dir_fixed_part.

scripts/mercury_cleanup_install:
	This script has long been obsolete, so remove it.
2008-02-25 07:21:21 +00:00
Ian MacLarty
fa31f399ad Add an mdb `track' command. This command invokes an mdb script to start up
Estimated hours taken: 0.5
Branches: main

Add an mdb `track' command.  This command invokes an mdb script to start up
the declarative debugger, invoke the declarative debugger's `track' command
and then exits the declarative debugger.

NEWS:
	Mention the new command.

doc/mdb_categories:
doc/user_guide.texi:
	Document the new command.

scripts/Mmakefile:
	Install the new script.

scripts/mdb_track:
	Add the new script.

scripts/mdbrc.in:
	Add an alias for the new script.
2007-05-29 08:18:26 +00:00
Ian MacLarty
2ece43e394 Add a new mdb command, 'shell', that allows users to execute shell commands
Estimated hours taken: 5
Branches: main

Add a new mdb command, 'shell', that allows users to execute shell commands
from within the debugger.

Allow the user to give up to nine additional arguments to the 'source' command.
Occurrences of the strings "$1" through "$9" in the sourced file are replaced
by the corresponding additional arguments, allowing for parameterised scripts.

Use the two new features mentioned above to add two more mdb commands: one
to open a term, goal or exception in an external editor another command
to perform a grep on a term, goal or exception (useful for seeing if a value
occurs in a big map, for example).

NEWS
	Mention the new commands.

doc/mdb_categories:
doc/user_guide.texi:
	Document the new commands.

scripts/Mmakefile:
scripts/mdb_open:
scripts/mdb_vim:
	Add scripts for the new commands.

scripts/mdbrc.in:
	Add aliases for the new shell, emacs, grep and vim commands.

tests/debugger/completion.exp:
tests/debugger/mdb_command_test.inp:
	Adjust for new commands.

tests/debugger/save.exp:
tests/debugger/save.exp2:
	Adjust for new commands.  Replace system dependent strings
	with ZZZ instead of XXX.

tests/debugger/Mmakefile:
tests/debugger/shell.exp:
tests/debugger/shell.inp:
tests/debugger/shell.m:
tests/debugger/shell_test_script:
	Test the shell and source commands.

trace/mercury_trace_cmd_misc.c:
	Check if there are extra arguments to the source mdb command
	and pass them to MR_trace_source if there are.

trace/mercury_trace_cmd_misc.h:
	Add shell command handling function prototype.

trace/mercury_trace_declarative.c:
	Call MR_trace_call_system_display_error_on_failure instead
	of system when displaying benchmarking statistics for the
	declarative debugger.

trace/mercury_trace_internal.c:
trace/mercury_trace_internal.h:
	Implement the shell command and extend the source command
	to handle the optional extra arguments.

trace/mercury_trace_readline.c:
trace/mercury_trace_readline.h:
	Add a new function to read a line and replace all the
	occurrences of "$[1-9]" with the corresponding value from an array.

	Delete comments in the .c file that are duplicated in the .h file.

trace/mercury_trace_util.c:
trace/mercury_trace_util.h:
	Implement MR_trace_call_system_display_error_on_failure that
	executes a system call and displays an error message if the system
	call terminates abnormally.
2006-06-13 09:49:04 +00:00
Zoltan Somogyi
dd44e0ef62 Replace the "set" command of mdb with a bunch of commands: the `format',
Estimated hours taken: 16
Branches: main, release

Replace the "set" command of mdb with a bunch of commands: the `format',
`format_param', `list_context_lines', `list_path', `xml_browser_cmd',
`xml_tmp_filename', `fail_trace_counts', `pass_trace_counts' and
`max_io_actions' commands. Each of these set just one parameter
or one of set of closely related parameters.

Move all these commands, and some existing commands that set parameters
that were elsewhere, to the "parameter" command category.

Extend some of these commands so that if given no arguments, they report
the current values of the parameters they would otherwise set.

Replace the "set" commands of the mdb browser and of the declarative debugger
with a bunch of commands: "format", "depth", "size", "width", "lines",
"actions" and "params" (the last prints the current value of the parameters).

For each category of mdb commands, create files mercury_trace_cmd_<cat>.[ch],
and move the functions dealing with that category of commands there from
mercury_trace_internal.c. Give each of these new files a logical structure
that was sometimes missing from the relevant parts of mercury_trace_internal.c.

NEWS:
	Mention these changes.

doc/mdb_categories:
	Document these changes.

doc/user_guide.texi:
	Document these changes.

	Fix an old documentation bug: you couldn't set listing paramaters
	from a declarative debugger command.

	Fix an old documentation bug: the description of the goal_path step
	for scopes was obsolete.

	Fix some obsolete references to : as module qualifier.

browser/parse.m:
	Update the browser command set along the lines at the top.

browser/declarative_user.m:
	Update the declarative debugger command set along the lines at the top.

	Move the declaration for the type representing declarative debugger
	commands to near the top of the file.

browser/browser_info.m:
	Provide some access predicates.

	Update the predicate that generates mdb commands to save the persistent
	state of the debugger to generate the new forms of parameter commands.

	Move types and predicates for dealing with browser parameters from
	browse.m to here, so that declarative_user.m can use them too.

browser/browse.m:
	Delete the code moved to browser_info.m, and conform to the other
	changes in the other modules.

browser/listing.m:
	Provide a predicate to return the type of listing paths.

scripts/mdbrc.in:
	Update the commands that set the XML parameters.

scripts/Mmakefile:
	Get mmake to rebuild mdbrc from mdbrc.in when mdbrc.in changes.

trace/mercury_trace_internal.c:
trace/mercury_trace_cmds.h:
trace/mercury_trace_cmd_*.[ch]:
	Implement the changes described at the top.

	Fix an old bug: the commands that update the search path for the "list"
	command don't make the search path term permanent, which is needed in
	non-conservative-gc grades.

trace/mercury_trace_spy.c:
	Fix some obsolete references to : as module qualifier.

trace/mercury_trace_browse.[ch]:
	Delete the functionality now moved to mercury_trace_cmd_parameter.c.

tests/debugger/mdb_command_test.inp:
	Update the set of commands being tested.

tests/debugger/save.{inp,exp}:
	Update the parameter commands in this test case.
2006-04-04 07:37:31 +00:00
Zoltan Somogyi
e26a9c7978 Fix another two typos that prevented mdbrc from being installed.
Estimated hours taken: 0.1
Branches: main

scripts/Mmakefile:
	Fix another two typos that prevented mdbrc from being installed.
2005-05-25 05:19:50 +00:00
Zoltan Somogyi
ce4489278f Fix a typo that prevented mdbrc from being installed.
Estimated hours taken: 0.1
Branches: main

scripts/Mmakefile:
	Fix a typo that prevented mdbrc from being installed.
2005-05-23 02:24:15 +00:00
Zoltan Somogyi
d124cad510 Reduce the amount of clutter on mgnuc command lines by moving arguments that
Estimated hours taken: 4
Branches: main

Reduce the amount of clutter on mgnuc command lines by moving arguments that
are always the same for a given directory into a file that is always consulted
by mgnuc in the current directory.

scripts/mgnuc.in:
	Always include as C compiler arguments the contents of a file named
	.mgnuc_copts in the current directory, if it exists. (It is named
	.mgnuc_copts instead of .mgnuc_opts because it may not contain
	general mgnuc options, such as --no-mercury-stdlib-dir.)

Mmake.workspace:
	Comment out the additions of search paths to CFLAGS.

*/Mmakefile:
	Delete the additions of search paths to CFLAGS.

*/.mgnuc_copts:
	New files containing the directory-specific search paths, and in some
	cases the required macro definitions. These replace what was taken out
	of Mmake.workspace and */Mmakefile. In some cases, the old search paths
	included inappropriate directories; the .mgnuc_copt files don't.

tests/.mgnuc_copts.ws:
	New files containing the directory-specific search paths; bootcheck
	makes tests/.mgnuc_copts from it.

*/.nocopyright:
	Don't require copyright notices in .mgnuc_copts files.

tools/bootcheck:
	Copy the various .mgnuc_copts files from the stage1 to stages 2 and 3.
	They aren't needed in stage3 right now, but that may change.

	Create tests/.mgnuc_copts.

browser/util.m:
	Delete an unused and inappropriate #include.

scripts/Mmake.rules:
	Use a single invocation of mkdir -p to create all subdirectories
	needed by Java. Update a piece of documentation.

scripts/Mmakefile:
	Reorganize the process of invoking config.status to avoid invoking
	it on inappropriate files, and to ensure the right permissions
	on the files it is invoked on.

scripts/prepare_tmp_dir_grade_part:
	Copy the .mgnuc_copts files when populating tmp_dir.
2005-05-20 06:15:28 +00:00
Zoltan Somogyi
5ebb612c9c Provide a mechanism that allows the user to specify that a certain
Estimated hours taken: 2
Branches: main

util/mkinit.c:
	Provide a mechanism that allows the user to specify that a certain
	function should always be executed on Mercury startup. This is intended
	to be used to initialize global variables that point to Mercury data.
	This is useful e.g. in constraint solvers, because it removes the need
	for the solver to check, on every access to its state, whether it has
	been initialized yet.

scripts/parse_ml_options-sh-subr.in:
scripts/c2init.in:
	Pass along the required option to mkinit.

scripts/Mmakefile:
	Provide a mechanism to automatically rebuild c2init and other
	configured files when ../config.status changes.
2005-05-09 08:10:22 +00:00
Zoltan Somogyi
55e0983a79 Add this new script (Mercury trace count, by analogy with mdb),
Estimated hours taken: 0.5
Branches: main

scripts/mtc:
	Add this new script (Mercury trace count, by analogy with mdb),
	which simply invokes the command represented by the rest of the
	command line after setting up MERCURY_OPTIONS to ask for the trace
	counts to be generated.

scripts/Mmakefile:
	Add the new script to the list of scripts.

scripts/mdb.in:
	Fix a grammar error.
2005-03-17 02:29:44 +00:00
Zoltan Somogyi
6b0fb566ce Move the mdbcomp library to its own directory.
Estimated hours taken: 12
Branches: main

Move the mdbcomp library to its own directory. To make this change less painful
to test, improve the way we handle installs.

browser/mdbcomp.m:
browser/mer_mdbcomp.m:
browser/prim_data.m:
browser/program_representation.m:
browser/trace_counts.m:
	Move these files to the mdbcomp directory.

browser/Mmakefile:
browser/Mercury.options:
mdbcomp/Mmakefile:
mdbcomp/Mercury.options:
	Split the contents of the old Mmakefile and Mercury.options file
	in the browser directory between these files as appropriate.
	Simplify away the stuff not needed now that there is only one library
	per directory. Make the browser directory see the relevant files
	from the mdbcomp directory.

Mmake.common.in:
	Separate out the prefixes allowed in the browser and the mdbcomp
	directories.

Mmake.workspace:
	Set up a make variable to refer to the mdbcomp directory.

	Adjust references to the mdbcomp library to point to its new location.

Mmakefile:
	Make invocations visit the mdbcomp library as necessary.

	Improve the way we install grades. Making temporary backups of the
	directories modified by the install process is unsatisfactory for two
	reasons. First, if the install fails, the cleanup script, which is
	necessary for user friendliness, destroys any evidence of the cause.
	Second, the restore of the backup wasn't perfect, e.g. it left the
	.d files modified to depend on .mih files, which don't exist in
	LLDS grades, and also left altered timestamps.

	This diff changes the install process to make a single tmp_dir
	subdirectory of the workspace, with all the work of install_grade
	being done inside tmp_dir. The original directories aren't touched
	at all.

*/Mmakefile:
	Adjust references to the browser directory to refer to the mdbcomp
	directory instead or as well.

scripts/Mmake.rules:
*/Mmakefile:
	Make it easier to debug Mmakefiles. Previously, creating a
	Mmake.makefile with mmake -s and invoking "make -d" ignored the
	most fundamental rules of mmake, because Mmake.rules was treating
	an unset MMAKE_USE_MMC_MAKE as if it were set to "yes", simply because
	it was different from "no". This diff changes it to treat an unset
	MMAKE_USE_MMC_MAKE as if it were set to "no", which is a more
	sensible default.

scripts/prepare_tmp_dir_fixed_part.in:
scripts/scripts/prepare_tmp_dir_grade_part:
	Two new scripts that each do half the work of preparing tmp_dir for
	the real work of the install_grade make target. The fixed_part script
	prepares the parts of tmp_dir that are grade-independent, while the
	grade_part scripts prepares the parts that are grade-dependent.

configure.in:
	Test C files in the mdbcomp directory to see whether they need to
	be recompiled after reconfiguration.

	Create prepare_tmp_dir_fixed_part from prepare_tmp_dir_fixed_part.in.

compiler/*.m:
runtime/mercury_wrapper.c:
	Update the references to the moved files.

compiler/notes/overall_design.html:
	Mention the new directory.
2005-01-28 07:12:05 +00:00
Ian MacLarty
c5c53432fb Allow terms to be saved as XML in mdb and allow an XML browser to be invoked on
Estimated hours taken: 5
Branches: main

Allow terms to be saved as XML in mdb and allow an XML browser to be invoked on
browsable objects in mdb.  The user can set two options which control where the
XML is dumped and the command used to browse the XML.  The defaults assume
xsltproc and mozilla are installed.

configure.in
	Check for mozilla/firefox and xsltproc so default the mdb XML browser
	command can be set if they are found.

browser/browse.m
	Add a predicate to save a browser term as XML to a file.

doc/user_guide.texi
	Document new --xml option for the mdb `browse' command.
	Document new --xml option for the mdb `save_to_file' command.
	Document the `set xml_tmp_filename' and `set xml_browser_cmd' commands.

scripts/Mmakefile
	Copy extras/xml_stylesheets/xul_tree.xsl to the mdb install
	directory so it can be used by the default XML browser command.

scripts/mdbrc.in
	Set default values for xml_browser_cmd and xml_tmp_filename.

scripts/xul_tree.xsl
	Copy this stylesheet here so there isn't a dependency on the extras
	directory.

tests/debugger/browser_test.inp
tests/debugger/browser_test.exp
	Test --xml option for `browse' command.

trace/mercury_trace_browse.c
trace/mercury_trace_browse.h
	Add functions to save a term as XML to a file and then
	invoke the user's XML browser.

trace/mercury_trace_internal.c
	Add --xml option to `browse' and `save_to_file' mdb commands and
	handle this option.
2004-12-11 01:59:52 +00:00
Simon Taylor
287e868e21 Make it easier to boostrap the addition of new configuration
Estimated hours taken: 0.5
Branches: main

Make it easier to boostrap the addition of new configuration
options.

scripts/Mercury.config.bootstrap.in:
	A version of Mercury.config.in that does not contain
	any options which are not understood by the installed
	compilers. This is used when building the stage1 compiler.

	Mercury.config is used to build the stage2 and stage3
	compilers, and when running the tests. Mercury.config is
	installed by `mmake install'.

	Mercury.config.bootstrap.in is currently the same
	as Mercury.config.in.

Mmake.workspace:
tools/bootcheck:
tools/binary_step:
tools/lmc.in:
	Work out which configuration file to use.

configure.in:
scripts/Mmakefile:
scripts/mercury_config.in:
	Handle Mercury.config.bootstrap.
2003-05-15 07:23:45 +00:00
Simon Taylor
ceaa856013 Move the setting of configuration options from mmc.in to
Estimated hours taken: 20
Branches: main

Move the setting of configuration options from mmc.in to
an options file Mercury.config. This has a few advantages:
- reduces the duplication between mmc and mercury.bat
- reduces the chance of running out of environment space
  on crappy operating systems (although we probably exceed
  the command line length limits on those systems anyway).
- makes it easier to bootstrap changes which add new
  configuration options.

Always read the options files, even without `--make',
to avoid inconsistent behaviour.

scripts/Mercury.config.in:
	New file containing the configuration code from mmc.in.

configure.in:
	Create scripts/Mercury.config.

bindist/Mmakefile:
	Make sure Mercury.config.in goes in the binary distribution.

Mmakefile:
bindist/Mmakefile:
Mmake.common.in:
	Make sure we get the correct setting of INSTALL_PREFIX
	when building the binary distribution.

scripts/Mmakefile:
scripts/mercury_config.in:
bindist/bindist.Mmakefile.in:
	Install Mercury.config.

compiler/options.m:
doc/user_guide.texi:
	Add documentation for the `--config-file' option, which gives
	the name of the configuration file to read.

	Add an option `read-config-file-2003-03-01' which will be
	used in configure.in to test whether the compiler is up
	to date after the configuration code is removed from mmc.in
	(after this change is installed everywhere).

	Add `--mercury-config-dir' as an abbreviation for
	`--mercury-configuration-directory'.

Mmake.workspace:
	Use the configuration file in scripts/Mercury.config.

browser/Mmakefile:
compiler/Mmakefile:
scripts/Mmake.vars.in:
	Always pass ALL_MCFLAGS to mmc so that mmc will
	use the configuration file specified in the options.

compiler/handle_options.m:
	Handle the default value of `--config-file'.

compiler/mercury_compile.m:
	Read the configuration file.

	Always read the options files, even without `--make',
	to avoid inconsistent behaviour.

compiler/make.m:
	Pass the variable settings from the configuration file
	to make__process_args.

	The options files have already been read in mercury_compile.m,
	so don't read them again here.

compiler/make.util.m:
	Add a version of build_with_module_options which doesn't
	need a make_info, for use by mercury_compile.m.

compiler/options_file.m:
	Export a predicate to read a single options file.

	Make the predicates to read options files add to an initial
	options_variables map, rather than always creating a new one.

	Allow MERCURY_STDLIB_DIR and MERCURY_CONFIG_DIR
	to be set in the options file or environment.

scripts/mmc.in:
	Set MERCURY_STDLIB_DIR and MERCURY_CONFIG_DIR in
	mercury_compile's environment.
2003-03-01 06:35:17 +00:00
Simon Taylor
7597ca1e80 Allow reconfiguration of existing installations, for example
Estimated hours taken: 20
Branches: main

Allow reconfiguration of existing installations, for example
to use a different C compiler. The reconfiguration works
by making a new copy of the scripts and mercury_conf.h,
and storing them in a partial installation directory tree
which uses the libraries and executables from the existing
installation.

Use this method to configure binary distributions, rather
than using a cut down version of the configuration script,
to avoid code duplication and to handle the case where the
C compiler in use on the installation machine is different
than that used to build the binary distribution.

This is more robust than the previous method of using a different
C compiler, which was to set the MERCURY_C_COMPILER variable and
hope the different C compilers were compatible enough.

Mmakefile:
runtime/Mmakefile:
scripts/Mmakefile:
	Modify the `install' targets to store files needed to create
	a new configuration in $INSTALL_LIBDIR/reconf.

runtime/Mmakefile:
	Install mercury_conf.h in $INSTALL_LIBDIR/conf, rather than
	$INSTALL_LIBDIR/inc, so that it can be overridden by a
	different configuration.

scripts/mercury_config.in:
	Create a new configuration, by creating part of a Mercury
	source tree from the files stored in $INSTALL_LIBDIR/reconf,
	running configure, then copying the files into a partial
	installation tree.

scripts/Mmake.vars.in:
	Define ENABLE_DEEP_PROFILER, for use by bindist/bindist.Makefile.

	Define variables INSTALL_CONF_DIR (contains the files describing
	the configuration) and INSTALL_RECONF_DIR (contains files needed
	to reconfigure an installation).

configure.in:
	Add an option `--enable-reconfigure', for use by
	mercury_config.in.

	Don't look for runtime/mercury_wrapper.c when checking
	for the sources -- it isn't present when reconfiguring.
	Look for scripts/mmc.in instead.

	Look for the runtime headers in the installation hierarchy
	rather than the `runtime/' and `trace/' directories when
	reconfiguring.

	Output the help message for the `configure' script to
	`configure.help'.  This is included in the help message
	for `mercury_config'.

	Add new configuration variables CONFIG_PREFIX and CONFIG_LIBDIR,
	which are like PREFIX and LIBDIR except that they point
	to the configuration files, not the library files.
	In the normal case PREFIX and CONFIG_PREFIX will be the same.

bindist/bindist.INSTALL.in:
bindist/bindist.Makefile.in:
	Use mercury_config to configure binary distributions.

bindist/Mmakefile:
bindist/bindist.configure.in:
bindist/bindist.build_vars.in:
	Remove bindist.configure.in and bindist.build_vars.in.

compiler/options.m:
scripts/parse_ml_options.sh-subr.in:
scripts/mgnuc.in:
doc/user_guide.texi:
	Add an option `--mercury-config-dir', and an environment
	variable MERCURY_CONFIG_DIR, which tell the compiler and
	scripts where to find the configuration files for the
	installation.
	MERCURY_CONFIG_DIR is not documented because it should
	only be used by the scripts.

compiler/compile_target_code.m:
	Pass `--mercury-config-dir' to the scripts.

compiler/handle_options.m:
	Add `--c-include-directory $MERCURY_CONFIG_DIR/conf'.

library/getopt.m:
	Handle `maybe_string_special' options.

doc/user_guide.texi:
	Update the "Using a different C compiler" chapter.

NEWS:
	Document the changes.
2003-01-24 07:17:13 +00:00
Fergus Henderson
6d01f7e69a Fix a bug introduced in Zoltan's recent change to the main branch:
Estimated hours taken: 0.25
Branches: main

scripts/Mmakefile:
        Fix a bug introduced in Zoltan's recent change to the main branch:
        delete a reference to the "install_cgi_scripts" target, since that
        target no longer exists.
2002-11-29 04:16:40 +00:00
Zoltan Somogyi
3da281372f Delete refs to the mdprof shell script.
Estimated hours taken: 0.1
Branches: main

scripts/Mmakefile:
	Delete refs to the mdprof shell script.
2002-11-28 05:53:14 +00:00
Simon Taylor
30686b9e1d Remove Prolog support.
Estimated hours taken: 0.5
Branches: main

Remove Prolog support.

Makefile:
	Don't clean up Prolog files.

configure.in:
bindist/bindist.configure.in:
scripts/Mmakefile:
scripts/sicstus_conv.in:
	Remove sicstus_conv.in.

scripts/Mmake.rules:
scripts/Mmake.vars.in:
	Remove Prolog-related variables and targets.
2002-05-16 06:48:43 +00:00
Simon Taylor
93f2516efb Write the grade in the header comment in the generated `<module>_init.c' file.
Estimated hours taken: 0.25
Branches: main

Write the grade in the header comment in the generated `<module>_init.c' file.
The `<module>_init.c' file contains grade dependent conditional compilation,
so the `<module>_init.o' file must be rebuilt when the grade changes.

util/mkinit.c:
	Add an option `-g' for the grade.
	Add the grade to the header comment.

scripts/c2init.in:
	Pass the grade to mkinit.

scripts/Mmakefile:
scripts/canonical_grade.sh-subr:
	canonical_grade.sh-subr is now used by c2init.
2001-12-18 05:44:17 +00:00
Simon Taylor
5c9f6f5841 Combine the options for ml and c2init. Once mmake has been
Estimated hours taken: 1
Branches: main

Combine the options for ml and c2init. Once mmake has been
altered to pass MLFLAGS to c2init users will be able to
mostly ignore the existence of c2init.

This change requires an installed compiler which uses `--init-c-file'
rather than `-o' to name c2init's output file. This is difficult to
test for in configure.in.

Bootstrap CVS tag: bootstrap_20011203_init_c_file_c2init_option

scripts/parse_ml_options.sh-subr.in:
	Parse the combined options for ml and c2init.

	The `-o' and `--output' options for c2init have been removed
	(`-o' conflicts with a linker option), use `--init-c-file' instead.

configure.in:
	Add parse_ml_options.sh-subr.in to the list of files to substitute.

scripts/ml.in:
scripts/c2init.in:
	Include parse_ml_options.sh-subr.

scripts/Mmakefile:
	ml and c2init depend on parse_ml_options.sh-subr.
2001-12-03 03:11:26 +00:00
Zoltan Somogyi
142f66e8e6 Document why we don't uninstall $(EMACS_SCRIPTS) here.
Estimated hours taken: 0.2
Branches: main

scripts/Mmakefile:
	Document why we don't uninstall $(EMACS_SCRIPTS) here.
2001-07-16 08:08:47 +00:00
Zoltan Somogyi
1a0b253854 Add rules for installing the deep profiler from source. (Installing it from
Estimated hours taken: 2
Branches: main

Add rules for installing the deep profiler from source. (Installing it from
binary distributions is future work.)

configure.in:
	Add an option, --enable-deep-profiler=/path/name, that specifies the
	path name of the directory in which the CGI script should be installed
	(the default is apache's /usr/lib/cgi-bin).

	Report an error if the user requests deep profiling but it is not
	available.

Mmakefile:
	Remind the user to copy the CGI script to its directory.

scripts/Mmakefile:
	Document why we can't install the CGI script automatically.

	Be consistent about the order of rules.

scripts/Mmake.vars.in:
	Record the CGI directory for use in the toplevel Mmakefile.

scripts/mdprof.in:
	Record that mdprof_cgi and mdprof_server are installed in the directory
	for non-user-visible programs, alongside mercury_compile and
	mercury_profile.
2001-07-09 04:58:52 +00:00
Fergus Henderson
273bbc39b5 A small start towards getting the Mercury compiler to run on Mingw,
Estimated hours taken: 5
Branches: main

A small start towards getting the Mercury compiler to run on Mingw,
without Cygwin: add a `mercury.bat' batch file for invoking the Mercury
compiler.

Note that currently Cygwin is still required:
	(1) For `c2init' and `ml'.
	(2) For `mmake'.
	(3) For installation (`configure' and `make install').
	(4) For mercury_update_interface.
	(5) For mkdir.
	(6) For fact tables.

However, there are work-arounds for most of these:
	(1) Currently the only work-around for `c2init' and `ml' is to use
	    the .NET back-end, which doesn't require them.
	(2) `mmake' is not strictly necessary; you can always invoke the
	    necessary commands by hand.  This is of course tedious and
	    error-prone, so we might eventually include more of mmake's
	    functionality into the Mercury compiler itself.
	(3) This would be easy enough to avoid; if we're willing to hard-code
	    the installation path, we could easily package up the installation
	    in a WinZip file or something similar.
	(4) XXX There's no good work-around for this right now.
	(5) Don't use --use-subdirs or --split-c-files.
	(6) Don't use fact tables.

scripts/mercury.bat.in:
	New file.  This is a rewrite of scripts/mmc.in using Windows batch
	file commands rather than Bourne shell.
	Note that this is named mercury.bat.in rather than mmc.bat.in
	because on Windows 2000 the name `mmc' is used for the
	Microsoft Management Console.

configure.in:
bindist/bindist.configure.in:
	Generate scripts/mercury.bat.
	Also add a new autoconf variable WINDOWS_LIBDIR, which is like
	LIBDIR except in Windows path format rather than Cygwin (Unix)
	path format; this is used by scripts/mercury.bat.in.

scripts/Mmakefile:
	Add mercury.bat to the list of scripts to install.
2001-05-27 10:52:08 +00:00
Zoltan Somogyi
7e0a04f17c Add options to configure that allow the user to specify the set of library
Estimated hours taken: 8

Add options to configure that allow the user to specify the set of library
grades to be installed more precisely.

configure.in:
	Add an option --enable-libgrade=<gradelist> that specifies
	the list of library grades precisely.

	Add an option, --disable-most-grades, that reduces the installed
	grades to a "minimum" level for developers (asm_fast.gc,
	asm_fast.gc.debug.tr and hlc.gc), since this is useful to minimize
	installation time e.g. when installing a release of the day on a
	laptop.

	Add an option, --disable-nogc-grades, that prevents the installation
	of grades without garbage collection.

	Add an option, --disable-prof-grades, that prevents the installation
	of profiling grades.

	Add an option, --disable-trail-grades, that prevents the installation
	of trailing grades.

	Add an option, --disable-pair-grades, that prevents the installation
	of thread-safe grades.

.INSTALL.in:
	Mention the new configure options, as well as some previously
	undocumented old ones.

scripts/canonical_grade.in:
	A new script to be used by configure.in. Its jobs is to print the
	canonical version of a grade string.

scripts/canonical_grade.sh-subr:
	A new sh subroutine, containing code previously from ml.in that is
	now also needed by canonical_grade.in.

scripts/ml.in:
	Move code from here to canonical_grade.sh-subr.

Mmakefile:
	Include scripts/canonical_grade in tar files, since configure.in
	needs it.

bindist/Mmakefile:
	Include scripts/canonical_grade in binary distributions, since
	configure.in needs it.
2000-12-18 07:17:44 +00:00
Fergus Henderson
d4d8b5bfb1 Fix a permissions problem: don't fail if `chmod u+w' fails.
Estimated hours taken: 0.25

scripts/Mmakefile:
	Fix a permissions problem: don't fail if `chmod u+w' fails.
	That can happen even if the file is writable, if you don't
	own it; if the failure is really going to cause a problem
	then the problem will be detected when we try to write
	to the file (e.g. next time it is installed).
2000-02-01 22:08:37 +00:00
Fergus Henderson
241d9559f9 Fix a problem reported by Luke Evans <Luke.Evans@seagatesoftware.com>.
Estimated hours taken: 0.25

Fix a problem reported by Luke Evans <Luke.Evans@seagatesoftware.com>.

scripts/Mmakefile:
	Make sure that we make the previously installed mdbrc
	(if any) writable before trying to install the new mdbrc.
1999-11-23 08:49:37 +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
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
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
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
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
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