[m-dev.] for review: lmc
Zoltan Somogyi
zs at cs.mu.OZ.AU
Mon Jan 15 16:03:35 AEDT 2001
On 15-Jan-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
<several comments, which I have addressed>
Here is the updated script.
tools/lmc:
A shell script to allow you to execute a version of the Mercury
compiler that you have built in a workspace. Everything that the
compilation process needs will come from that workspace: the libraries
for the runtime system, the trace system, the Mercury standard library,
the Boehm collector, etc.
tools/gdbrun:
A helper script for lmc, written by Fergus.
Zoltan.
cvs diff: Diffing .
Index: gdbrun
===================================================================
RCS file: gdbrun
diff -N gdbrun
--- /dev/null Thu Sep 2 15:00:04 1999
+++ gdbrun Mon Jan 15 15:43:11 2001
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# Usage: gdbrun <program> <arguments>
+# Invokes gdb on <program>, and runs the program with the given <arguments>.
+#
+program="$1"
+tmpfile=/tmp/gdbrun.$$
+trap "rm -f $tmpfile" 0 1 2 3 13 15
+shift
+echo run "$@" > "$tmpfile"
+echo gdb --command="$tmpfile" $program
+gdb --command="$tmpfile" $program
Index: lmc
===================================================================
RCS file: lmc
diff -N lmc
--- /dev/null Thu Sep 2 15:00:04 1999
+++ lmc Mon Jan 15 15:55:29 2001
@@ -0,0 +1,58 @@
+#!/bin/sh
+#
+# This shell script allows you to execute a version of the Mercury compiler
+# that you have built in a workspace. Everything that the compilation process
+# needs will come from that workspace: the libraries for the runtime system,
+# the trace system, the Mercury standard library, the Boehm collector, etc.
+# You specify the directory containing the workspace by setting the value of
+# the WORKSPACE environment variable. This can be done by setting up a small
+# shell script for each workspace you have:
+#
+# #!/bin/sh
+# WORKSPACE=$HOME/mer/ws1
+# export WORKSPACE
+# $WORKSPACE/tools/lmc "$@"
+#
+# If you want to track down some C level bug, you can ask this script to
+# pass -g to the C compiler and to the linker by setting the environment
+# variable MMC_CDEBUG to the string "true".
+#
+# If you want to track down some low level bug, you can ask this script to
+# execute the Mercury compiler under gdb by setting the environment variable
+# MMC_UNDER_GDB to the string "true".
+
+MERCURY_COMPILER=$WORKSPACE/compiler/mercury_compile
+export MERCURY_COMPILER
+MERCURY_INT_DIR=$WORKSPACE/library
+export MERCURY_INT_DIR
+MERCURY_LIBS="$WORKSPACE/trace/libmer_trace.a $WORKSPACE/browser/libmer_browser.a $WORKSPACE/library/libmer_std.a $WORKSPACE/runtime/libmer_rt.a $WORKSPACE/boehm_gc/libgc.a -lm"
+export MERCURY_LIBS
+MERCURY_ALL_C_INCL_DIRS="-I$WORKSPACE/runtime -I$WORKSPACE/trace -I$WORKSPACE/boehm_gc -I$WORKSPACE/boehm_gc/include"
+export MERCURY_ALL_C_INCL_DIRS
+MMAKE_DIR=$WORKSPACE/scripts
+export MMAKE_DIR
+MERCURY_TRACE_LIB_MODS="$WORKSPACE/browser/mer_browser.init"
+export MERCURY_TRACE_LIB_MODS
+MERCURY_MOD_LIB_MODS="$WORKSPACE/library/mer_std.init $WORKSPACE/runtime/mer_rt.init"
+export MERCURY_MOD_LIB_MODS
+PATH="$WORKSPACE/scripts:$WORKSPACE/util:$PATH"
+export PATH
+
+if test "$MMC_CDEBUG" = true
+then
+ CDEBUG_FLAGS="--link-flags -g --cflags -g"
+else
+ CDEBUG_FLAGS=""
+fi
+
+DIR_FLAGS="--cflags -I$WORKSPACE/trace --cflags -I$WORKSPACE/runtime --cflags -I$WORKSPACE/boehm_gc --cflags -I$WORKSPACE/boehm_gc/include"
+
+set -x
+
+if test "$MMC_UNDER_GDB" = true
+then
+ MERCURY_COMPILER="$WORKSPACE/tools/gdbrun $MERCURY_COMPILER"
+ export MERCURY_COMPILER
+fi
+
+mmc $CDEBUG_FLAGS $DIR_FLAGS "$@"
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list