diff: mc --> mmc

Tyson Richard DOWD trd at cs.mu.oz.au
Tue Jul 15 13:52:20 AEST 1997


Hiya,

Fergus, can you please review this?

===================================================================

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.

Index: configure.in
===================================================================
RCS file: /home/staff/zs/imp/mercury/configure.in,v
retrieving revision 1.95
diff -u -r1.95 configure.in
--- configure.in	1997/06/23 11:39:40	1.95
+++ configure.in	1997/07/15 03:00:08
@@ -65,7 +65,7 @@
 esac
 #-----------------------------------------------------------------------------#
 MERCURY_MSG("looking for an already installed Mercury compiler to bootstrap with...")
-AC_PATH_PROG(BOOTSTRAP_MC,mc)
+AC_PATH_PROG(BOOTSTRAP_MC,mmc)
 if test "$BOOTSTRAP_MC" != ""; then
 	AC_MSG_CHECKING(whether $BOOTSTRAP_MC works and is sufficiently recent)
 	cat > conftest.m << EOF
@@ -94,6 +94,40 @@
 	rm -f conftest*
 fi
 #-----------------------------------------------------------------------------#
+# No `mmc' was installed - perhaps there was an `mc' around.
+# XXX This is only temporary.
+if test "$BOOTSTRAP_MC" = ""; then
+MERCURY_MSG("still looking for an already installed Mercury compiler to bootstrap with...")
+AC_PATH_PROG(BOOTSTRAP_MC,mc)
+if test "$BOOTSTRAP_MC" != ""; then
+	AC_MSG_CHECKING(whether $BOOTSTRAP_MC works and is sufficiently recent)
+	cat > conftest.m << EOF
+		% this module contains features which didn't work in
+		% previous versions of the Mercury compiler
+		:- module conftest.
+		:- interface.
+		:- import_module io.
+		:- pred main(io__state::unique->clobbered, io__state::uo)
+			is det.
+		:- implementation.
+		:- pragma(c_code, "").
+		:- type type_containing_pred(T) ---> foo(pred(T)).
+		main --> io__write_string("Hello, world\n").
+EOF
+	if
+		 echo $BOOTSTRAP_MC conftest >&AC_FD_CC 2>&1 &&
+		 $BOOTSTRAP_MC conftest </dev/null >&AC_FD_CC 2>&1 &&
+		 test "`./conftest 2>&1`" = "Hello, world"
+	then
+		AC_MSG_RESULT(yes)
+	else
+		BOOTSTRAP_MC=
+		AC_MSG_RESULT(no)
+	fi
+	rm -f conftest*
+fi
+fi
+#-----------------------------------------------------------------------------#
 MERCURY_MSG("looking for GNU Make...")
 AC_PROGRAMS_CHECK(GNU_MAKE,gmake make)
 if test "$GNU_MAKE" != ""; then
@@ -1418,13 +1452,13 @@
 AC_SUBST(LIBRARY_RM_C)
 #-----------------------------------------------------------------------------#
 if test "$BOOTSTRAP_MC" = ""; then
-	BOOTSTRAP_MC=mc
+	BOOTSTRAP_MC=mmc
 fi
 BOOTSTRAP_MC="$BOOTSTRAP_MC $HAVE_BOXED_FLOATS --conf-low-tag-bits $LOW_TAG_BITS --bits-per-word $BITS_PER_WORD --bytes-per-word $BYTES_PER_WORD"
 AC_SUBST(BOOTSTRAP_MC)
 #-----------------------------------------------------------------------------#
 
-AC_OUTPUT(Mmake.common scripts/Mmake.vars scripts/mc scripts/mprof
+AC_OUTPUT(Mmake.common scripts/Mmake.vars scripts/mmc scripts/mprof
 scripts/mercury_update_interface scripts/mgnuc scripts/mint scripts/ml
 scripts/mmake scripts/mnc scripts/mnl scripts/mnp scripts/c2init
 scripts/msc scripts/msl scripts/msp scripts/sicstus_conv
Index: bindist/Mmakefile
===================================================================
RCS file: /home/staff/zs/imp/mercury/bindist/Mmakefile,v
retrieving revision 1.1
diff -u -r1.1 Mmakefile
--- Mmakefile	1997/02/13 21:38:09	1.1
+++ Mmakefile	1997/06/30 07:49:45
@@ -41,8 +41,8 @@
 .PHONY: binary_distribution
 binary_distribution: bindist.configure bindist.build_vars
 	# Make a quick check that there is a mercury installation in
-	# $(INSTALL_DIR) by looking for mc and mercury_compile.
-	test -f $(INSTALL_BINDIR)/mc
+	# $(INSTALL_DIR) by looking for mmc and mercury_compile.
+	test -f $(INSTALL_BINDIR)/mmc
 	test -f $(INSTALL_MERC_BIN_DIR)/mercury_compile
 	# create a temporary directory in which to assemble the distribution
 	test -d $(MERCURY_VERSION) || mkdir $(MERCURY_VERSION)
Index: bindist/bindist.configure.in
===================================================================
RCS file: /home/staff/zs/imp/mercury/bindist/bindist.configure.in,v
retrieving revision 1.9
diff -u -r1.9 bindist.configure.in
--- bindist.configure.in	1996/12/19 10:20:02	1.9
+++ bindist.configure.in	1997/06/30 07:49:56
@@ -154,7 +154,7 @@
 AC_SUBST(CC)
 #-----------------------------------------------------------------------------#
 
-AC_OUTPUT(Makefile scripts/mc scripts/mprof
+AC_OUTPUT(Makefile scripts/mmc scripts/mprof
 scripts/mercury_update_interface scripts/mgnuc scripts/mint scripts/ml
 scripts/mmake scripts/mnc scripts/mnl scripts/mnp scripts/c2init
 scripts/msc scripts/msl scripts/msp scripts/sicstus_conv
Index: doc/Mmakefile
===================================================================
RCS file: /home/staff/zs/imp/mercury/doc/Mmakefile,v
retrieving revision 1.3
diff -u -r1.3 Mmakefile
--- Mmakefile	1997/02/28 17:12:39	1.3
+++ Mmakefile	1997/07/04 05:29:33
@@ -75,7 +75,7 @@
 	library_1.html faq_1.html transition_guide_1.html
 
 .PHONY: manpages
-manpages: c2init.1 mc.1 mgnuc.1 ml.1 mmake.1 msc.1 mprof.1
+manpages: c2init.1 mmc.1 mgnuc.1 ml.1 mmake.1 msc.1 mprof.1
 
 #-----------------------------------------------------------------------------#
 
Index: doc/user_guide.texi
===================================================================
RCS file: /home/staff/zs/imp/mercury/doc/user_guide.texi,v
retrieving revision 1.87
diff -u -r1.87 user_guide.texi
--- user_guide.texi	1997/05/19 02:17:42	1.87
+++ user_guide.texi	1997/07/04 05:28:27
@@ -76,7 +76,7 @@
 @menu
 * Introduction::    General overview
 * Filenames::       File naming conventions
-* Using mc::        Compiling and linking programs with the Mercury compiler
+* Using mmc::        Compiling and linking programs with the Mercury compiler
 * Using Prolog::    Building and debugging Mercury programs with Prolog
 * Using Mmake::     ``Mercury Make'', a tool for building Mercury programs
 * Profiling::       The Mercury profiler @samp{mprof}, a tool for analyzing
@@ -91,14 +91,14 @@
 @chapter Introduction
 
 This document describes the compilation environment of Mercury.
-It describes how to use @samp{mc}, the Mercury compiler;
+It describes how to use @samp{mmc}, the Mercury compiler;
 how to use @samp{mmake}, the ``Mercury make'' program,
 a tool built on top of ordinary or GNU make
 to simplify the handling of Mercury programs;
 and how to use Prolog to debug Mercury programs.
 
 We strongly recommend that programmers use @samp{mmake} rather
-than invoking @samp{mc} directly, because @samp{mmake} is generally
+than invoking @samp{mmc} directly, because @samp{mmake} is generally
 easier to use and avoids unnecessary recompilation.
 
 Since the Mercury implementation is essentially a native-code compiler
@@ -162,26 +162,26 @@
 @file{.no} files are NU-Prolog object code, and
 @file{.ql} files are SICStus Prolog object code.
 
- at node Using mc
+ at node Using mmc
 @chapter Using the Mercury compiler
 
 Following a long Unix tradition,
-the Mercury compiler is called @samp{mc}.
+the Mercury compiler is called @samp{mmc}.
 Some of its options (e.g. @samp{-c}, @samp{-o}, and @samp{-I})
 have a similar meaning to that in other Unix compilers.
 
-Arguments to @samp{mc} that name Mercury source files
+Arguments to @samp{mmc} that name Mercury source files
 may omit the @samp{.m} suffix.
 
 To compile a program which consists of just a single module,
 use the command
 
 @example
-mc @var{module}.m
+mmc @var{module}.m
 @end example
 
 Unlike traditional Unix compilers, however,
- at samp{mc} will put the executable into a file called @file{@var{module}},
+ at samp{mmc} will put the executable into a file called @file{@var{module}},
 not @file{a.out}.
 
 For programs that consist of more than one module, we recommend
@@ -194,10 +194,10 @@
 use the command
 
 @example
-mc -c @var{module}.m
+mmc -c @var{module}.m
 @end example
 
- at samp{mc} will put the object code into a file called @file{@var{module}.o}.
+ at samp{mmc} will put the object code into a file called @file{@var{module}.o}.
 It also will leave the intermediate C code in a file called
 @file{@var{module}.c}.
 
@@ -207,15 +207,15 @@
 You can create the interface files for one or more modules using the commands
 
 @example
-mc --make-short-int @var{module1}.m @var{module2}.m ...
-mc --make-int @var{module1}.m @var{module2}.m ...
+mmc --make-short-int @var{module1}.m @var{module2}.m ...
+mmc --make-int @var{module1}.m @var{module2}.m ...
 @end example
 
 If you are going to compile with @samp{--intermodule-optimization} enabled,
 then you also need to create the optimization interface files.
 
 @example
-mc --make-opt-int @var{module1}.m @var{module2}.m ...
+mmc --make-opt-int @var{module1}.m @var{module2}.m ...
 @end example
 
 Given that you have made all the interface files,
@@ -224,7 +224,7 @@
 using the command
 
 @example
-mc @var{module1}.m @var{module2}.m ...
+mmc @var{module1}.m @var{module2}.m ...
 @end example
 
 This will by default put the resulting executable in @file{@var{module1}},
@@ -232,7 +232,7 @@
 name for the output file, if you so desire.
 
 The other way to create an executable for a multi-module program
-is to compile each module separately using @samp{mc -c},
+is to compile each module separately using @samp{mmc -c},
 and then link the resulting object files together.
 The linking is a two stage process.
 
@@ -274,9 +274,9 @@
 The same command line without the @samp{-o} option
 would put the executable into the file @file{a.out}.
 
- at samp{mc} and @samp{ml} both accept a @samp{-v} (verbose) option.
+ at samp{mmc} and @samp{ml} both accept a @samp{-v} (verbose) option.
 You can use that option to see what is actually going on.
-For the full set of options of @samp{mc}, see @ref{Invocation}.
+For the full set of options of @samp{mmc}, see @ref{Invocation}.
 
 Once you have created an executable for a Mercury program,
 you can go ahead and execute it.  You may however wish to specify
@@ -316,7 +316,7 @@
 The command
 
 @example
-mc -e @var{module1}.m ...
+mmc -e @var{module1}.m ...
 @end example
 
 causes the Mercury compiler
@@ -923,9 +923,9 @@
 @chapter Invocation
 
 This section contains a brief description of all the options
-available for @samp{mc}, the Mercury compiler.
+available for @samp{mmc}, the Mercury compiler.
 Sometimes this list is a little out-of-date;
-use @samp{mc --help} to get the most up-to-date list.
+use @samp{mmc --help} to get the most up-to-date list.
 
 @menu
 * Invocation overview::
@@ -944,9 +944,9 @@
 @node Invocation overview
 @section Invocation overview
 
- at code{mc} is invoked as
+ at code{mmc} is invoked as
 @example
-mc [@var{options}] @var{modules}
+mmc [@var{options}] @var{modules}
 @end example
 
 For module names, the trailing @file{.m} is optional.
@@ -2000,11 +2000,11 @@
 You can do this either by setting the @samp{MERCURY_C_COMPILER}
 environment variable, by adding a line
 @samp{MGNUC=MERCURY_C_COMPILER=@dots{} mgnuc} to your @samp{Mmake} file,
-or by using the @samp{--cc} option to @samp{mc}.
+or by using the @samp{--cc} option to @samp{mmc}.
 You may need to specify some option(s) to the C compiler
 to ensure that it uses an ANSI preprocessor (e.g. if you
 are using the DEC Alpha/OSF 3.2 C compiler, you would need to
-pass @samp{--cc="cc -std"} to @samp{mc} so that it will pass the
+pass @samp{--cc="cc -std"} to @samp{mmc} so that it will pass the
 @samp{-std} option to @samp{cc}).
 
 @item
@@ -2012,7 +2012,7 @@
 You can specify the grade in one of three ways: by setting the
 @samp{MERCURY_DEFAULT_GRADE} environment variable, by adding a line
 @samp{GRADE=@dots{}} to your @samp{Mmake} file, or by using the
- at samp{--grade} option to @samp{mc}.  (You will also need to install
+ at samp{--grade} option to @samp{mmc}.  (You will also need to install
 those grades of the Mercury library, if you have not already done so.)
 
 @item
Index: scripts/Mmake.vars.in
===================================================================
RCS file: /home/staff/zs/imp/mercury/scripts/Mmake.vars.in,v
retrieving revision 1.6
diff -u -r1.6 Mmake.vars.in
--- Mmake.vars.in	1997/03/18 05:58:16	1.6
+++ Mmake.vars.in	1997/06/30 07:50:14
@@ -22,7 +22,7 @@
 DEFAULT_GRADE	= $(MERCURY_DEFAULT_GRADE)
 GRADE		= $(DEFAULT_GRADE)
 
-MC		= mc
+MC		= mmc
 MCS		= $(MC) --split-c-files --compile-only
 MCG		= $(MC) --compile-to-c
 MCD		= $(MC) --generate-dependencies
Index: scripts/Mmakefile
===================================================================
RCS file: /home/staff/zs/imp/mercury/scripts/Mmakefile,v
retrieving revision 1.1
diff -u -r1.1 Mmakefile
--- Mmakefile	1996/11/27 06:26:08	1.1
+++ Mmakefile	1997/06/30 07:50:29
@@ -14,7 +14,7 @@
 
 #-----------------------------------------------------------------------------#
 
-SCRIPTS = mmake mc mod2c c2init mgnuc ml mprof mint \
+SCRIPTS = mmake mmc mod2c c2init mgnuc ml mprof mint \
 	  sicstus_conv mtags vpath_find mercury_update_interface \
 	  mkfifo_using_mknod
 NUPROLOG_SCRIPTS = mnc mnl mnp
Index: scripts/msl.in
===================================================================
RCS file: /home/staff/zs/imp/mercury/scripts/msl.in,v
retrieving revision 1.12
diff -u -r1.12 msl.in
--- msl.in	1997/05/19 02:17:01	1.12
+++ msl.in	1997/06/30 07:50:51
@@ -140,7 +140,7 @@
 	  garbage_collect,
 	  save('$target', 1),
 	  ( prolog_flag(argv, Args) -> true ; unix(argv(Args)) ),
-	  run([mc|Args])
+	  run([mmc|Args])
 	), print_message(error, Error)), halt ; halt.
 	e
 	e
Index: tools/expand_params
===================================================================
RCS file: /home/staff/zs/imp/mercury/tools/expand_params,v
retrieving revision 1.2
diff -u -r1.2 expand_params
--- expand_params	1996/11/11 05:29:20	1.2
+++ expand_params	1997/06/30 07:54:03
@@ -13,7 +13,7 @@
 #	opt <integer>			meaning that optimization level
 #
 # Other arguments are also allowed; these are expected to be other arguments
-# to mc.
+# to mmc.
 
 usage="$0 [grade g] [args {s,c}] [typeinfo {1,2,s,d}] [opt N] mcflags ..."
 
@@ -83,7 +83,7 @@
 	esac
 done
 
-echo "MC = ../scripts/mc"
+echo "MC = ../scripts/mmc"
 echo "GRADE = $GRADE"
 echo "MCFLAGS = $MCFLAGS"
 echo "EXTRA_CFLAGS = $CFLAGS"
Index: tools/optstages
===================================================================
RCS file: /home/staff/zs/imp/mercury/tools/optstages,v
retrieving revision 1.2
diff -u -r1.2 optstages
--- optstages	1997/01/12 00:35:51	1.2
+++ optstages	1997/06/30 07:54:22
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Given the name of a file containing output generated by mc --debug-opt,
+# Given the name of a file containing output generated by mmc --debug-opt,
 # e.g. Out, generate a series of files Out.stage.N, each containing the
 # output of one stage of the optimization process.
 #
Index: tools/speedtest
===================================================================
RCS file: /home/staff/zs/imp/mercury/tools/speedtest,v
retrieving revision 1.3
diff -u -r1.3 speedtest
--- speedtest	1997/04/05 10:12:49	1.3
+++ speedtest	1997/06/30 07:54:36
@@ -4,7 +4,7 @@
 
 usage="Usage: speedtest [-c cmd] [-nN] batchname"
 limit=4
-cmd="mc -C -O2 -I../compiler make_hlds.m"
+cmd="mmc -C -O2 -I../compiler make_hlds.m"
 
 while test $# -gt 0
 do
Index: tools/test_mercury
===================================================================
RCS file: /home/staff/zs/imp/mercury/tools/test_mercury,v
retrieving revision 1.45
diff -u -r1.45 test_mercury
--- test_mercury	1997/06/25 05:17:23	1.45
+++ test_mercury	1997/06/30 07:55:01
@@ -148,7 +148,7 @@
 # if [ -s tools/list.$HOST ]; then
 # 	tools/expand_params `tools/cur_param tools $HOST` > Mmake.params
 # else
-	echo "MC = ../scripts/mc" > Mmake.params
+	echo "MC = ../scripts/mmc" > Mmake.params
 	echo "EXTRA_MCFLAGS = $TEST_MCFLAGS" >> Mmake.params
 	echo "EXTRA_CFLAGS = $TEST_CFLAGS" >> Mmake.params
 # fi

-- 
       Tyson Dowd           # 4.4: People keep saying the behavior is undefined,
                            # but I just tried it on an ANSI-conforming compiler
     trd at cs.mu.oz.au        # and got the results I expected.
http://www.cs.mu.oz.au/~trd # A: They were wrong. Flame them mercilessly. C-IAQ



More information about the developers mailing list