for review: MERCURY_ALL_C_INCL_DIRS

Zoltan Somogyi zs at cs.mu.OZ.AU
Tue Mar 3 16:41:04 AEDT 1998


scripts/mgnuc.in:
	Use a new environment variable MERCURY_ALL_C_INCL_DIRS, which may
	be defined by the user as a list of -I<dir> options, whose default
	value is -I$MERCURY_C_INCL_DIR. This replaces MERCURY_GC_INCL_DIR.
	The advantage of the new arrangement is that it allows the garbage
	collector header files to be in more than one directory, as they
	are with the Boehm collector (the file gc_inl.h, which is needed at
	-O6, is in boehm_gc/include, while the usual gc.h is in boehm_gc).

tools/bootcheck:
	Set up MERCURY_ALL_C_INCL_DIRS instead of MERCURY_GC_INCL_DIR.
	Tidy some other parts of the script.

doc/user_guide.texi:
	Document the change.

Zoltan.

Index: scripts/mgnuc.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/mgnuc.in,v
retrieving revision 1.46
diff -u -u -r1.46 mgnuc.in
--- 1.46	1998/01/01 04:29:35
+++ mgnuc.in	1998/02/17 05:35:38
@@ -43,7 +43,7 @@
 	but this can be changed using the \`--no-ansi' or \`--no-check'
 	options.
 Environment variables:
-	MERCURY_C_INCL_DIR, MERCURY_DEFAULT_GRADE.
+	MERCURY_C_INCL_DIR, MERCURY_ALL_C_INCL_DIRS, MERCURY_DEFAULT_GRADE.
 "
 
 # *************************************************************************
@@ -54,7 +54,7 @@
 FULLARCH=@FULLARCH@
 NONSHARED_LIB_DIR=${MERCURY_NONSHARED_LIB_DIR=@NONSHARED_LIB_DIR@}
 C_INCL_DIR=${MERCURY_C_INCL_DIR=@LIBDIR@/inc}
-GC_INCL_DIR=${MERCURY_GC_INCL_DIR=@LIBDIR@/inc}
+ALL_C_INCL_DIRS=${MERCURY_ALL_C_INCL_DIRS=-I$C_INCL_DIR}
 DEFAULT_GRADE=${MERCURY_DEFAULT_GRADE=@DEFAULT_GRADE@}
 CC=${MERCURY_C_COMPILER="@CC@"}
 CFLAGS_FOR_REGS="@CFLAGS_FOR_REGS@"
@@ -345,7 +345,7 @@
 
 # please keep the three long lines below in sync
 case $verbose in true)
-	echo $CC -I$C_INCL_DIR -I$GC_INCL_DIR $ANSI_OPTS $CHECK_OPTS \
+	echo $CC $ALL_C_INCL_DIRS $ANSI_OPTS $CHECK_OPTS \
 		$GRADE_OPTS $GC_OPTS \
 		$PROF_TIME_OPTS $PROF_CALLS_OPTS $PROF_MEMORY_OPTS \
 		$INLINE_ALLOC_OPTS $TRAIL_OPTS $SPLIT_OPTS \
@@ -353,13 +353,13 @@
 		"$@" $OVERRIDE_OPTS ;;
 esac
 case $# in
-	0) exec $CC -I$C_INCL_DIR -I$GC_INCL_DIR $ANSI_OPTS $CHECK_OPTS \
+	0) exec $CC $ALL_C_INCL_DIRS $ANSI_OPTS $CHECK_OPTS \
 		$GRADE_OPTS $GC_OPTS \
 		$PROF_TIME_OPTS $PROF_CALLS_OPTS $PROF_MEMORY_OPTS \
 		$INLINE_ALLOC_OPTS $TRAIL_OPTS $SPLIT_OPTS \
 		$PICREG_OPTS $ARCH_OPTS $ARG_OPTS \
 		$OVERRIDE_OPTS ;;
-	*) exec $CC -I$C_INCL_DIR -I$GC_INCL_DIR $ANSI_OPTS $CHECK_OPTS \
+	*) exec $CC $ALL_C_INCL_DIRS $ANSI_OPTS $CHECK_OPTS \
 		$GRADE_OPTS $GC_OPTS \
 		$PROF_TIME_OPTS $PROF_CALLS_OPTS $PROF_MEMORY_OPTS \
 		$INLINE_ALLOC_OPTS $TRAIL_OPTS $SPLIT_OPTS \
Index: tools/bootcheck
===================================================================
RCS file: /home/mercury1/repository/mercury/tools/bootcheck,v
retrieving revision 1.46
diff -u -u -r1.46 bootcheck
--- 1.46	1998/02/10 23:41:47
+++ bootcheck	1998/02/17 23:02:31
@@ -135,7 +135,7 @@
 if $test_sicstus
 then
 	echo "Building SICStus stage 1..." 1>&2
-	if 
+	if
 		cd $root/library &&
 		mmake $mmake_opts $jfactor sicstus &&
 		cd $root/compiler &&
@@ -223,7 +223,7 @@
 
 	set -x
 
-	if 
+	if
 		cd stage2_sicstus &&
 		mmake $mmake_opts depend_library depend_compiler &&
 		cd $root
@@ -239,7 +239,7 @@
 	MMAKE_DIR=$root/scripts
 	export MMAKE_DIR
 
-	if 
+	if
 		cd stage2_sicstus/library &&
 		mmake $mmake_opts $jfactor ints &&
 		mmake $mmake_opts $jfactor cs
@@ -251,7 +251,7 @@
 	fi
 	cd $root
 
-	if 
+	if
 		cd stage2_sicstus/compiler &&
 		mmake $mmake_opts $jfactor cs
 	then
@@ -578,17 +578,16 @@
                 -lm"
 	export MERCURY_LIBS
 
-	MERCURY_C_INCL_DIR="$root/stage2/runtime"
-	export MERCURY_C_INCL_DIR
-
-	MERCURY_GC_INCL_DIR="$root/stage2/boehm_gc"
-	export MERCURY_GC_INCL_DIR
+	MERCURY_ALL_C_INCL_DIRS="-I$root/stage2/runtime
+		-I$root/stage2/boehm_gc
+		-I$root/stage2/boehm_gc/include"
+	export MERCURY_ALL_C_INCL_DIRS
 
 	MMAKE_DIR="$root/stage2/scripts"
 	export MMAKE_DIR
 
-	MERCURY_MOD_LIB_MODS="$root/stage2/runtime/runtime.init \
-				$root/stage2/library/libmercury.init"
+	MERCURY_MOD_LIB_MODS="$root/stage2/runtime/runtime.init
+		$root/stage2/library/libmercury.init"
 	export MERCURY_MOD_LIB_MODS
 
 		# for mkinit, mmc, mgnuc, ml etc
Index: doc/user_guide.texi
===================================================================
RCS file: /home/mercury1/repository/mercury/doc/user_guide.texi,v
retrieving revision 1.117
diff -u -u -r1.117 user_guide.texi
--- user_guide.texi	1998/02/09 10:24:08	1.117
+++ user_guide.texi	1998/03/03 05:39:09
@@ -2612,10 +2612,18 @@
 @sp 1
 @item MERCURY_C_INCL_DIR
 Directory for the C header files for the Mercury runtime system (@file{*.h}).
+This environment variable is used
+only to define the default value of MERCURY_ALL_C_INCL_DIRS,
+so if you define that environment variable separately,
+the value of MERCURY_C_INCL_DIR is ignored.
 
 @sp 1
- at item MERCURY_GC_INCL_DIR
-Directory for the C header files for the Mercury garbage collector (@file{*.h}).
+ at item MERCURY_ALL_C_INCL_DIRS
+A list of options for the C compiler that specifies
+all the directories the C compiler should search for the C header files
+of the Mercury runtime system and garbage collector.
+The default value of this option is -I$MERCURY_C_INCL_DIR,
+since usually all these header files are installed in one directory.
 
 @sp 1
 @item MERCURY_INT_DIR



More information about the developers mailing list