diff: sicstus bootcheck

Fergus Henderson fjh at cs.mu.oz.au
Wed May 7 06:28:09 AEST 1997


tools/bootcheck:
	Implement the following new options:
		-s, --sicstus
			As well as running the normal bootcheck, also
			build a SICStus Prolog version of the compiler
			and check it against the stage 2 directory.
		--keep-stage-2-sicstus
			Don't rebuild the SICStus stage 2 directory
			from scratch after building stage 1.  Instead
			use the existing SICStus stage 2 directory.

	Also a few other minor changes:
		- use `&&' rather than `;'
		- avoid problems with symbolic links to /mount/munkora/...
		  not working on mundook, by setting root=$trueroot.

Index: bootcheck
===================================================================
RCS file: /home/staff/zs/imp/mercury/tools/bootcheck,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- bootcheck	1997/01/24 03:57:19	1.35
+++ bootcheck	1997/05/06 20:26:32	1.36
@@ -18,12 +18,20 @@
 	-t, --no-test-suite
 		By default, bootcheck will also run the test quite.
 		This option prevents that.
+	-s, --sicstus
+		As well as running the normal bootcheck, also build a SICStus
+		Prolog version of the compiler and check it against the
+		stage 2 directory.
 	-2, --keep-stage-2
 		Don't rebuild the stage 2 directory from scratch after
 		building stage 1.  Instead use the existing stage 2 directory.
 	-3, --keep-stage-3
 		Don't rebuild the stage 3 directory from scratch after
 		building stage 1.  Instead use the existing stage 3 directory.
+	--keep-stage-2-sicstus
+		Don't rebuild the SICStus stage 2 directory from scratch after
+		building stage 1.  Instead use the existing SICStus stage 2
+		directory.
 "
 
 jfactor=""
@@ -33,6 +41,8 @@
 copy_runtime=false
 keep_stage_2=false
 keep_stage_3=false
+keep_stage_2_sicstus=false
+test_sicstus=false
 
 while [ $# -gt 0 ]; do
 	case "$1" in
@@ -62,12 +72,18 @@
 	-t|--no-test-suite)
 		runtests=false ;;
 
+	-s|--sicstus)
+		test_sicstus=true ;;
+
 	-2|--keep-stage-2)
 		keep_stage_2=true ;;
 
 	-3|--keep-stage-3)
 		keep_stage_3=true ;;
 
+	--keep-stage-2-sicstus)
+		keep_stage_2_sicstus=true ;;
+
 	--)	
 		shift; break ;;
 	-*)
@@ -90,8 +106,7 @@
 
 set -x
 
-root=`/bin/pwd`
-trueroot=`echo $root | sed 's:/mount/munkora/mercury:/home/mercury:'`
+root=`/bin/pwd | sed 's:/mount/munkora/mercury:/home/mercury:'`
 PATH=$root/tools:$PATH
 export PATH
 
@@ -100,6 +115,166 @@
 	RMSTAGECMD="/bin/rm -fr"
 fi
 
+if $sicstus
+then
+	echo "Building SICStus stage 1..." 1>&2
+	if 
+		cd $root/library &&
+		mmake $mmake_opts $jfactor sicstus &&
+		cd $root/compiler &&
+		mmake $mmake_opts $jfactor sicstus &&
+		cd $root
+	then
+		echo "building of SICStus stage 1 successful"
+	else
+		echo "building of SICStus stage 1 not successful"
+		exit 1
+	fi
+
+	MERCURY_COMPILER=$root/compiler/mercury_compile.sicstus
+	export MERCURY_COMPILER
+	MERCURY_INT_DIR=$root/stage2_sicstus/library
+	export MERCURY_INT_DIR
+
+	[ -d stage2_sicstus ] || mkdir stage2_sicstus
+	if $keep_stage_2_sicstus
+	then
+		echo keeping existing stage2_sicstus
+	else
+		# We try to do the removal of the stage 2 directory in parallel
+		# since recursive rm's across NFS can be quite slow ...
+		$RMSTAGECMD $root/stage2_sicstus/compiler < /dev/null &
+		$RMSTAGECMD $root/stage2_sicstus/library < /dev/null &
+		wait
+		$RMSTAGECMD $root/stage2_sicstus/* < /dev/null
+	fi
+
+	set +x
+	echo linking SICStus stage 2... 1>&2
+	cd stage2_sicstus
+	mkdir compiler
+	cd compiler
+	# Break up the links into several chunks.
+	# This is needed to cope with small limits on the size of argument
+	# vectors.
+
+	ln -s $root/compiler/[a-h]*.m .
+	ln -s $root/compiler/[i-s]*.m .
+	ln -s $root/compiler/[t-z]*.m .
+	cp $root/compiler/Mmake* .
+	cd $root/stage2_sicstus
+	mkdir library
+	cd library
+	ln -s $root/library/[a-l]*.m .
+	ln -s $root/library/[m-z]*.m .
+	ln -s $root/library/*.nl .
+	cp $root/library/Mmake* .
+	ln -s $root/library/library.init .
+	cd $root/stage2_sicstus
+	if test "$copy_runtime" = "true"
+	then
+		mkdir runtime
+		cd runtime
+		ln -s $root/runtime/*.h .
+		ln -s $root/runtime/*.c .
+		ln -s $root/runtime/*.mod .
+		ln -s $root/runtime/*.in .
+		cp $root/runtime/Mmake* .
+		ln -s $root/runtime/machdeps .
+		cd $root/stage2_sicstus
+	else
+		ln -s $root/runtime .
+	fi
+	ln -s $root/boehm_gc .
+	ln -s $root/doc .
+	ln -s $root/scripts .
+	ln -s $root/util .
+	ln -s $root/profiler .
+	ln -s $root/conf* .
+	rm -f config*.log
+	cp $root/Mmake* .
+	if test -f $root/Mmake.stage.params
+	then
+		/bin/rm -f Mmake.params
+		cp $root/Mmake.stage.params Mmake.params
+	fi
+	cd $root
+
+	set -x
+
+	if 
+		cd stage2_sicstus &&
+		mmake $mmake_opts depend_library depend_compiler &&
+		cd $root
+	then
+		echo "building of SICStus stage 2 dependencies successful"
+	else
+		echo "building of SICStus stage 2 dependencies not successful"
+		exit 1
+	fi
+
+	MMAKE_VPATH=.
+	export MMAKE_VPATH
+	MMAKE_DIR=$root/scripts
+	export MMAKE_DIR
+
+	if 
+		cd stage2_sicstus/library &&
+		mmake $mmake_opts $jfactor ints &&
+		mmake $mmake_opts $jfactor cs
+	then
+		echo "building of SICStus stage 2 library successful"
+	else
+		echo "building of SICStus stage 2 library not successful"
+		exit 1
+	fi
+	cd $root
+
+	if 
+		cd stage2_sicstus/compiler &&
+		mmake $mmake_opts $jfactor cs
+	then
+		echo "building of SICStus stage 2 compiler successful"
+	else
+		echo "building of SICStus stage 2 compiler not successful"
+		exit 1
+	fi
+	cd $root
+
+	sicstus_diff_status=0
+
+	exec 3>&1		# save stdout in fd 3
+	if [ -n "$outfile" ]
+	then
+		exec > "$outfile"	# redirect stdout to $outfile
+	fi
+
+	for dir in library compiler; do
+		for file in stage2/$dir/*.c; do
+			diff -u $file stage2_sicstus/$dir/`basename $file` ||
+				sicstus_diff_status=1
+		done
+	done
+
+	exec >&3		# restore stdout from fd 3
+	if [ $sicstus_diff_status -ne 0 ]; then
+		echo "error - SICStus stage 2 and Mercury stage 2 differ!"
+		exit 1
+	else
+		echo "SICStus stage 2 and Mercury stage 2 compare ok"
+		echo "removing SICStus stage 2..."
+		# We try to do the removal of the SICStus stage 2 directory
+		# in parallel since recursive rm's across NFS can be quite
+		# slow ...
+		$RMSTAGECMD $root/stage2_sicstus/compiler < /dev/null &
+		$RMSTAGECMD $root/stage2_sicstus/library < /dev/null &
+		wait
+		$RMSTAGECMD $root/stage2_sicstus/* < /dev/null
+		exit 0
+	fi
+
+fi
+
 if mmake $mmake_opts MMAKEFLAGS=$jfactor all
 then
 	echo "building of stage 1 successful"
@@ -108,8 +283,6 @@
 	exit 1
 fi
 
-root=`/bin/pwd`
-
 # the stage 1 compiler is copied to allow it to be worked on (slightly)
 # in parallel with the bootcheck itself.
 
@@ -128,10 +301,10 @@
 else
 	# We try to do the removal of the stage 2 directory in parallel
 	# since recursive rm's across NFS can be quite slow ...
-	$RMSTAGECMD $trueroot/stage2/compiler < /dev/null &
-	$RMSTAGECMD $trueroot/stage2/library < /dev/null &
+	$RMSTAGECMD $root/stage2/compiler < /dev/null &
+	$RMSTAGECMD $root/stage2/library < /dev/null &
 	wait
-	$RMSTAGECMD $trueroot/stage2/* < /dev/null
+	$RMSTAGECMD $root/stage2/* < /dev/null
 fi
 
 set +x
@@ -141,7 +314,6 @@
 cd compiler
 # Break up the links into several chunks.
 # This is needed to cope with small limits on the size of argument vectors.
-# We do not need to link .pp files.
 
 ln -s $root/compiler/[a-h]*.m .
 ln -s $root/compiler/[i-s]*.m .
@@ -187,7 +359,7 @@
 
 set -x
 
-if (cd stage2 ; mmake $mmake_opts $jfactor runtime)
+if (cd stage2 && mmake $mmake_opts $jfactor runtime)
 then
 	echo "building of stage 2 runtime successful"
 else
@@ -195,7 +367,7 @@
 	exit 1
 fi
 
-if (cd stage2 ; mmake $mmake_opts depend_library depend_compiler)
+if (cd stage2 && mmake $mmake_opts depend_library depend_compiler)
 then
 	echo "building of stage 2 dependencies successful"
 else
@@ -210,7 +382,7 @@
 
 # the `RM_C=:' ensures that the `.c' files do not get deleted
 
-if (cd stage2/library ; mmake $mmake_opts $jfactor RM_C=: mercury)
+if (cd stage2/library && mmake $mmake_opts $jfactor RM_C=: mercury)
 then
 	echo "building of stage 2 library successful"
 else
@@ -218,7 +390,7 @@
 	exit 1
 fi
 
-if (cd stage2/compiler ; mmake $mmake_opts $jfactor RM_C=: mercury_compile)
+if (cd stage2/compiler && mmake $mmake_opts $jfactor RM_C=: mercury_compile)
 then
 	echo "building of stage 2 compiler successful"
 else
@@ -229,7 +401,7 @@
 unset MMAKE_VPATH
 unset MMAKE_DIR
 
-if (cd stage2 ; mmake $mmake_opts $jfactor all)
+if (cd stage2 && mmake $mmake_opts $jfactor all)
 then
 	echo "building of stage 2 successful"
 else
@@ -249,10 +421,10 @@
 else
 	# We try to do the removal of the stage 3 directory in parallel
 	# since recursive rm's across NFS can be quite slow ...
-	$RMSTAGECMD $trueroot/stage3/compiler < /dev/null &
-	$RMSTAGECMD $trueroot/stage3/library < /dev/null &
+	$RMSTAGECMD $root/stage3/compiler < /dev/null &
+	$RMSTAGECMD $root/stage3/library < /dev/null &
 	wait
-	$RMSTAGECMD $trueroot/stage3/* < /dev/null
+	$RMSTAGECMD $root/stage3/* < /dev/null
 fi
 
 echo linking stage 3... 1>&2
@@ -262,7 +434,6 @@
 cd compiler
 # Break up the links into several chunks.
 # This is needed to cope with small limits on the size of argument vectors.
-# We do not need to link .pp files.
 ln -s $root/compiler/[a-h]*.m .
 ln -s $root/compiler/[i-s]*.m .
 ln -s $root/compiler/[t-z]*.m .
@@ -293,7 +464,7 @@
 cd $root
 set -x
 
-if (cd stage3 ; mmake $mmake_opts depend_library depend_compiler)
+if (cd stage3 && mmake $mmake_opts depend_library depend_compiler)
 then
 	echo "building of stage 3 dependencies successful"
 else
@@ -306,7 +477,7 @@
 MMAKE_DIR=$root/scripts
 export MMAKE_DIR
 
-if (cd stage3/library ; mmake $mmake_opts $jfactor ints ; mmake $mmake_opts $jfactor cs)
+if (cd stage3/library && mmake $mmake_opts $jfactor ints && mmake $mmake_opts $jfactor cs)
 then
 	echo "building of stage 3 library successful"
 else
@@ -314,7 +485,7 @@
 	exit 1
 fi
 
-if (cd stage3/compiler ; mmake $mmake_opts $jfactor cs)
+if (cd stage3/compiler && mmake $mmake_opts $jfactor cs)
 then
 	echo "building of stage 3 compiler successful"
 else
@@ -344,10 +515,10 @@
 	echo "removing stage 3..."
 	# We try to do the removal of the stage 3 directory in parallel
 	# since recursive rm's across NFS can be quite slow ...
-	$RMSTAGECMD $trueroot/stage3/compiler < /dev/null &
-	$RMSTAGECMD $trueroot/stage3/library < /dev/null &
+	$RMSTAGECMD $root/stage3/compiler < /dev/null &
+	$RMSTAGECMD $root/stage3/library < /dev/null &
 	wait
-	$RMSTAGECMD $trueroot/stage3/* < /dev/null
+	$RMSTAGECMD $root/stage3/* < /dev/null
 fi
 
 # since we may have removed the stage3 library, use the one in stage2
@@ -384,6 +555,7 @@
 else
 	test_status=0
 fi
+
 
 echo "finishing at `date`"
 

-- 
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.



More information about the developers mailing list