mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 17:33:38 +00:00
ab8545cec141ba87b5bb1ca0ccfdd5d0aaa4d8d9
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.
…
…
…
…
…
…
Reportedly Mercury does not work on Solaris 2.5.1 if it is compiled with
gcc 2.7.x. It should however work fine on Solaris 2.5.1 if you compile
it with gcc 2.8, or if you use gcc 2.7.x with an earlier version of Solaris.
The binary distribution for Solaris that we distribute was compiled
with gcc 2.7.2, so if you have Solaris 2.5.1, you may need to compile
Mercury yourself from our source distribution.
("Solaris 2.x" is also known as "SunOS 5.x".)
Languages
Mercury
85.4%
C
8.7%
Shell
1.4%
Makefile
1%
JavaScript
1%
Other
2%