mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-29 08:14:31 +00:00
Estimated hours taken: 16
Add GNU readline support to the debugger.
Because GNU readline is licensed under the GPL, not the LGPL,
I was careful to ensure that (1) the readline library is
only linked into your application if it is compiled with
debugging enabled and (2) even in the latter case, the readline
support is disable-able (if you use the source distribution).
Mmakefile:
bindist/Mmakefile:
Add dependency of configure on new file aclocal.m4.
aclocal.m4:
Define a macro MERCURY_CHECK_READLINE to check for the readline
headers, the readline library, and for libraries needed by readline,
in particular -l{termcap,curses,ncurses}.
If they're not found, define MR_NO_USE_READLINE.
Otherwise, define various variables for using & installing readline.
bindist/bindist.configure.in:
configure.in:
Add call to MERCURY_CHECK_READLINE to check for readline.
scripts/ml.in:
If tracing is enabled, then (by default) link in readline,
and hence also termcap/curses/ncurses.
Add a new option `--no-readline' to disable this.
trace/mercury_trace_internal.c:
Delete the FILE * parameter from the MR_getline() function,
because there are actually two files involved (MR_mdb_in and
MR_mdb_out), and they are always the same for all calls to this
function.
Also change this function so that it calls MR_trace_readline() rather
than printing the prompt and then calling MR_trace_getline_raw().
Delete the MR_trace_getline_raw() function -- this has been renamed
as MR_trace_readline_raw() and moved to mercury_trace_readline.c.
trace/mercury_trace_readline.h:
trace/mercury_trace_readline.c:
New module containing a new function MR_trace_readline() that prints
a prompt and reads a line in by calling the readline library.
I put all this new code inside `#ifndef MR_NO_USE_READLINE' so that
the use of readline can be disabled. If that symbol is defined,
it reverts to the old implementation using MR_trace_readline_raw()
(formerly called MR_trace_getline_raw()).
runtime/mercury_conf.h.in:
Define the new configuration parameter `MR_NO_USE_READLINE'.
trace/Mmakefile:
Add the new files mercury_trace_readline.[ch].
Ensure that this new module is compiled with warnings disabled,
to avoid spurious warnings resulting from the readline header files.
Also simplify the code by deleting unnecessary uses of $(EXTRA_*) --
that's handled by scripts/Mmake.vars now.
NEWS:
Mention the readline support.
.INSTALL.in:
Mention that it is helpful to have GNU Readline installed.
bindist/bindist.INSTALL:
Mention that you may need to have GNU Readline installed.
58 lines
2.2 KiB
Bash
Executable File
58 lines
2.2 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# INSTALL - installation instructions and installation script
|
|
# for the binary distribution of Mercury.
|
|
#
|
|
# You need GNU C (2.6.3 or later) and GNU Make (3.69 or later) in order
|
|
# to use Mercury, though you don't need them to install this distribution.
|
|
# To use the Mercury debugger, you may also need GNU Readline.
|
|
#
|
|
# Step 0. Extract the files from the gzipped tar archive.
|
|
#
|
|
# Note: the mercury-*.tar.gz file itself contains
|
|
# some other .tar.gz files (lib.tar.gz, info.tar.gz).
|
|
# Do NOT mess with these nested .tar.gz files;
|
|
# they will be extracted automatically in step 2.
|
|
#
|
|
# Step 1. Run `configure'. (Just type `sh configure'.)
|
|
#
|
|
# By default, the files will be installed in the directory
|
|
# /usr/local/mercury-<VERSION>.
|
|
# If you want the files to be installed someplace else,
|
|
# use the `--prefix <directory>' option to `configure'.
|
|
#
|
|
# Step 2. Run `make install'.
|
|
# This step will copy the various files that make up the distribution
|
|
# to their final places.
|
|
#
|
|
# Step 3. Check the permissions on the installed files.
|
|
# Add /usr/local/mercury-<VERSION>/bin to your PATH, and
|
|
# add /usr/local/mercury-<VERSION>/man to your MANPATH.
|
|
# add /usr/local/mercury-<VERSION>/info to your INFOPATH.
|
|
# You can also add a WWW link to the Mercury documentation in
|
|
# /usr/local/mercury-<VERSION>/lib/mercury/html to your WWW
|
|
# home page, and you may want to print out a hard-copy of the
|
|
# documentation from the DVI files in
|
|
# /usr/local/mercury-<VERSION>/lib/mercury/doc.
|
|
#
|
|
# To use the emacs debugger interface ("M-x mdb"), you also need to
|
|
# add the following lines to the `.emacs' file in your home directory:
|
|
#
|
|
# (setq load-path (cons (expand-file-name
|
|
# "/usr/local/mercury-@VERSION@/lib/mercury/elisp") load-path))
|
|
# (autoload 'mdb "gud" "Invoke the Mercury debugger" t)
|
|
#
|
|
# As a short-cut, steps 1 & 2 are listed below, so they can be replaced
|
|
# by just executing this script.
|
|
|
|
sh configure &&
|
|
make install
|
|
|
|
# De-installation:
|
|
# ----------------
|
|
#
|
|
# You may eventually want to uninstall this version of Mercury
|
|
# (to free up disk space so you can install the next version ;-).
|
|
# If you installed in the default location, you can simply
|
|
# use `rm -rf /usr/local/mercury-<VERSION>' to uninstall.
|