[m-rev.] for review: installing the default grade

Zoltan Somogyi zs at cs.mu.OZ.AU
Fri Oct 11 16:21:36 AEST 2002


For review by Fergus.

Zoltan.

Mmakefile:
	Fix a bug that sometimes caused the libraries not to be installed
	in the default grade.

Index: Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/Mmakefile,v
retrieving revision 1.87
diff -u -b -r1.87 Mmakefile
--- Mmakefile	23 Sep 2002 17:22:26 -0000	1.87
+++ Mmakefile	4 Oct 2002 22:46:24 -0000
@@ -425,7 +425,37 @@
 	# runs the newly installed compiler, rather than using the
 	# bootstrap compiler.
 	#
-	+for grade in x $(LIBGRADES); do \
+	# The install_grades target does not install the libraries in grade
+	# $(GRADE), since these should have been installed earlier by the
+	# install_main target. To compensate for this, the configure script
+	# deletes the value that $(GRADE) has at configure time from
+	# $(LIBGRADES), to prevent install_grades installing that grade twice.
+	#
+	# Normally, GRADE and DEFAULT_GRADE are the same, so install_main also
+	# takes care of installing the libraries in $(DEFAULT_GRADE). However,
+	# the programmer may override the value of $(GRADE) computed by
+	# the configure script in an Mmake.params file. In that case, it can
+	# happen that $(DEFAULT_GRADE) isn't equal to $(GRADE) and doesn't
+	# appear in $(LIBGRADES) either. Since installing a bunch of grades
+	# without installing the default one doesn't make much sense, we
+	# compensate for this by including $(DEFAULT_GRADE) in the list of
+	# grades installed by install_grades if this happens.
+	#
+	+found=false; \
+	if test $(DEFAULT_GRADE) = $(GRADE); then \
+	    found=true; \
+	fi; \
+	for grade in x $(LIBGRADES); do \
+	    if test $(DEFAULT_GRADE) = $grade; then \
+		found=true; \
+	    fi; \
+	done; \
+	if test $found = true; then \
+	    INSTALL_LIBGRADES="$(LIBGRADES)"; \
+	else \
+	    INSTALL_LIBGRADES="$(DEFAULT_GRADE) $(LIBGRADES)"; \
+	fi; \
+	for grade in x $INSTALL_LIBGRADES; do \
 	    if [ "$$grade" != "x" ]; then \
 	    	gc_grade=`scripts/ml --grade $$grade --print-gc-grade`; \
 	        ( cd boehm_gc && \
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list