[m-dev.] for review: use new compiler when building library grades

Fergus Henderson fjh at cs.mu.OZ.AU
Thu May 25 09:35:04 AEST 2000


On 24-May-2000, Warwick Harvey <wh at icparc.ic.ac.uk> wrote:
> Fergus wrote:
> > configure.in:
> >         When testing whether the installed compiler is sufficiently up-to-date,
> >         use `--high-level-code', since the installation process now requires
> >         the compiler to generate .dep files that support --high-level-code.
> 
> Hope the relevant version got tagged to aid bootstrapping.  :-)

Not until you mentioned it. ;-)

> Why does `BOOTSTRAP_MC_FLAGS' include `$BOOTSTRAP_MC'?

Cut-and-paste error.  Thanks for spotting it.

Hmm, I wonder how Pete's test could have passed...

Oh, I see now, in the Mmakefile I mispelt the variable as `BOOSTRAP_MC_FLAGS'
rather than `BOOTSTRAP_MC_FLAGS'.  So that variable wasn't being used at all!

> The rest looks fine, unless you want to introduce a variable for
> `mmc $(BOOSTRAP_MC_FLAGS)', say `INSTALL_MC'.  (If you do that, you
> could even wire in the installed pathname, so that you don't need to fiddle
> with the `PATH' variable, right?)

Hmm... you got me thinking.  I realized that we don't need to pass
$(BOOTSTRAP_MC_FLAGS) at all; they are only needed when using a
different mmc script to bootstrap.  If we use the mmc script from
the current installation, then it already sets --conf-low-tag-bits
etc. to the correct values.  Likewise, we don't even need to run
the installed version of the mmc script, we can just run the copy
in the `scripts' directory, which will still run the installed
`mercury_compile' executable.  So I came up with the following
patch, which is a fair bit simpler than the original one.

----------

Estimated hours taken: 1

configure.in:
	When testing whether the installed compiler is sufficiently up-to-date,
	use `--high-level-code', since the installation process now requires
	the compiler to generate .dep files that support --high-level-code.

Mmakefile:
	In the rule for `install_grades', override MC with INSTALL_MC,
	so that we build the different grades of the libraries
	using the newly installed compiler rather than the bootstrap
	compiler.

Workspace: /home/pgrad/fjh/ws/hg
Index: configure.in
===================================================================
RCS file: /home/mercury1/repository/mercury/configure.in,v
retrieving revision 1.204
diff -u -d -r1.204 configure.in
--- configure.in	2000/05/17 12:16:06	1.204
+++ configure.in	2000/05/24 22:41:29
@@ -102,7 +102,8 @@
 EOF
 	if
 	 	 echo $BOOTSTRAP_MC conftest >&AC_FD_CC 2>&1 &&
-	 	 $BOOTSTRAP_MC conftest </dev/null >&AC_FD_CC 2>&1 &&
+	 	 $BOOTSTRAP_MC --high-level-code conftest \
+		 	</dev/null >&AC_FD_CC 2>&1 &&
 		 test "`./conftest 2>&1`" = "Hello, world"
 	then
 		AC_MSG_RESULT(yes)
Index: Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/Mmakefile,v
retrieving revision 1.52
diff -u -d -r1.52 Mmakefile
--- Mmakefile	2000/05/20 10:50:19	1.52
+++ Mmakefile	2000/05/24 23:23:37
@@ -349,6 +349,13 @@
 			Mercury/cs/*.c Mercury/os/*.o tmp_dir || true; }
 	cd trace && rm -rf tmp_dir && mkdir tmp_dir && \
 		{ mv -f *.o *.pic_o *.a *.so tmp_dir || true; }
+	#
+	# Use the newly installed compiler to build the libraries
+	# in various different grades.  We need to override MC=mmc
+	# so that we use the mmc from the scripts directory, which
+	# runs the newly installed compiler, rather than using the
+	# bootstrap compiler.
+	#
 	for grade in x $(LIBGRADES); do \
 	    if [ "$$grade" != "x" ]; then \
 	        case "$$grade" in \
@@ -360,18 +367,19 @@
 		        ;; \
 	        esac; \
 	        ( cd boehm_gc && \
-		  $(SUBDIR_MMAKE) GRADE=$$grade PROF=$$prof install_lib ) && \
+		  $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade PROF=$$prof \
+		  	install_lib ) && \
 		( cd runtime && \
-		  $(SUBDIR_MMAKE) GRADE=$$grade install_lib ) && \
+		  $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade install_lib ) && \
 		( cd library && \
-		  $(SUBDIR_MMAKE) GRADE=$$grade depend && \
-		  $(SUBDIR_MMAKE) GRADE=$$grade install_hdrs && \
-		  $(SUBDIR_MMAKE) GRADE=$$grade install_library ) && \
+		  $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade depend && \
+		  $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade install_hdrs && \
+		  $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade install_library ) && \
 		( cd browser && \
-		  $(SUBDIR_MMAKE) GRADE=$$grade depend && \
-		  $(SUBDIR_MMAKE) GRADE=$$grade install_library ) && \
+		  $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade depend && \
+		  $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade install_library ) && \
 		( cd trace && \
-		  $(SUBDIR_MMAKE) GRADE=$$grade install_lib ) && \
+		  $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade install_lib ) && \
 		( cd boehm_gc && rm -f *.o *.pic_o *.a *.so ) && \
 		( cd runtime && rm -f *.o *.pic_o *.a *.so ) && \
 		( cd library && rm -f *.dep *.h *.c *.o *.pic_o *.a *.so \
@@ -402,9 +410,16 @@
 	mkdir tmp_dir && \
 	{ mv -f *.dir *.dep *.h *.c *.o *.pic_o *.a *.so \
 		Mercury/cs/*.c Mercury/os/*.o tmp_dir || true; } && \
+	#
+	# Use the newly installed compiler to build the libraries
+	# in various different grades.  We need to override MC=mmc
+	# so that we use the mmc from the scripts directory, which
+	# runs the newly installed compiler, rather than using the
+	# bootstrap compiler.
+	#
 	for grade in $(GRADE) $(LIBGRADES); do \
-	        $(SUBDIR_MMAKE) GRADE=$$grade depend && \
-	        $(SUBDIR_MMAKE) GRADE=$$grade install_split_library || \
+	        $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade depend && \
+	        $(SUBDIR_MMAKE) MC=mmc GRADE=$$grade install_split_library || \
 			{ scripts/mercury_cleanup_install; exit 1; }; \
 	        rm -rf *.dir *.dep *.h *.c *.o *.pic_o *.a *.so \
 			Mercury/cs/*.c Mercury/os/*.o; \
-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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