[m-rev.] halt configure if bootstrap mmc is missing & needed

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Dec 16 00:51:17 AEDT 2003


Estimated hours taken: 0.75
Branches: main

configure.in:
	Report an error if there is no working bootstrap mmc and the
	.c files are not present, since a working mmc is needed to bootstrap.
	Reporting the error quickly here is much friendlier to the user.

	But as an exception, if there is a mercury_compile executable in
	the directory that we are going to install into, we may be able
	to use it for bootstraping, so in that case only issue a warning.

	Change the message that we output when checking whether mmc works
	to avoid generating a very long line.

Workspace: /home/jupiter/fjh/ws-jupiter/mercury
Index: configure.in
===================================================================
RCS file: /home/mercury1/repository/mercury/configure.in,v
retrieving revision 1.381
diff -u -d -r1.381 configure.in
--- configure.in	13 Nov 2003 15:08:00 -0000	1.381
+++ configure.in	15 Dec 2003 13:50:22 -0000
@@ -169,7 +169,7 @@
 MERCURY_MSG("looking for an already installed Mercury compiler to bootstrap with...")
 AC_PATH_PROG(BOOTSTRAP_MC,mmc)
 if test "$BOOTSTRAP_MC" != ""; then
-	AC_MSG_CHECKING(whether $BOOTSTRAP_MC works and is sufficiently recent)
+	AC_MSG_CHECKING(whether the above mmc works and is sufficiently recent)
 	cat > conftest.m << EOF
 		% this module contains features which didn't work in
 		% previous versions of the Mercury compiler
@@ -224,6 +224,24 @@
 	else
 		BOOTSTRAP_MC=
 		AC_MSG_RESULT(no)
+		# This will only work if the user is working with a source
+		# distribution which includes the pre-generated .C files.
+		# So do a quick check now to ensure that we fail early with a
+		# reasonable error message if they are not present.
+		if	test -f compiler/top_level.c ||
+		   	test -f compiler/Mercury/cs/top_level.c
+		then
+			true
+		elif
+			test -f $LIBDIR/bin/$FULLARCH/mercury_compile ||
+			test -f $LIBDIR/bin/$FULLARCH/mercury_compile.exe
+		then
+			AC_MSG_WARN(
+[using $LIBDIR/bin/$FULLARCH/mercury_compile to bootstrap])
+		else
+			AC_MSG_ERROR(
+[You need a working Mercury compiler to bootstrap with])
+		fi
 	fi
 	rm -f conftest*
 fi

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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