[m-rev.] bootstrapping of configuration options

Simon Taylor stayl at cs.mu.OZ.AU
Thu May 15 11:44:19 AEST 2003


Estimated hours taken: 0.5
Branches: main

Make it easier to boostrap the addition of new configuration
options.

scripts/Mercury.config.bootstrap.in:
	A version of Mercury.config.in that does not contain
	any options which are not understood by the installed
	compilers. This is used when building the stage1 compiler.

	Mercury.config is used to build the stage2 and stage3
	compilers, and when running the tests. Mercury.config is
	installed by `mmake install'.

	Mercury.config.bootstrap.in is currently the same
	as Mercury.config.in.

Mmake.workspace:
tools/bootcheck:
tools/binary_step:
tools/lmc.in:
	Work out which configuration file to use.

configure.in:
scripts/Mmakefile:
scripts/mercury_config.in:
	Handle Mercury.config.bootstrap.

Index: Mmake.workspace
===================================================================
RCS file: /home/mercury1/repository/mercury/Mmake.workspace,v
retrieving revision 1.13
diff -u -u -r1.13 Mmake.workspace
--- Mmake.workspace	1 Mar 2003 06:34:45 -0000	1.13
+++ Mmake.workspace	14 May 2003 14:25:50 -0000
@@ -98,7 +98,11 @@
 
 VPATH =		$(LIBRARY_DIR)
 
-MCFLAGS +=	--config-file $(SCRIPTS_DIR)/Mercury.config
+ifeq ($(origin MERCURY_CONFIG_FILE),undefined)
+MERCURY_CONFIG_FILE =	$(SCRIPTS_DIR)/Mercury.config.bootstrap
+endif
+
+MCFLAGS +=	--config-file $(MERCURY_CONFIG_FILE)
 
 ifeq ($(MMAKE_USE_MMC_MAKE),yes)
 MCFLAGS +=	--options-file $(WORKSPACE)/Mercury.options
Index: configure.in
===================================================================
RCS file: /home/mercury1/repository/mercury/configure.in,v
retrieving revision 1.364
diff -u -u -r1.364 configure.in
--- configure.in	9 May 2003 13:29:15 -0000	1.364
+++ configure.in	14 May 2003 14:27:36 -0000
@@ -3574,7 +3574,8 @@
 scripts/mgnuc scripts/parse_ml_options.sh-subr scripts/ml
 scripts/c2init scripts/mmake scripts/mdb scripts/mdbrc scripts/mdprof
 scripts/mkfifo_using_mknod bindist/bindist.INSTALL bindist/bindist.Makefile
-scripts/mercury_config scripts/Mercury.config tools/lmc tools/dotime
+scripts/mercury_config scripts/Mercury.config scripts/Mercury.config.bootstrap
+tools/lmc tools/dotime
 ,
 [
 # Only do this when compiling the source, not when reconfiguring
Index: scripts/Mercury.config.bootstrap.in
===================================================================
RCS file: scripts/Mercury.config.bootstrap.in
diff -N scripts/Mercury.config.bootstrap.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ scripts/Mercury.config.bootstrap.in	14 May 2003 14:31:12 -0000
@@ -0,0 +1,88 @@
+#! /bin/sh
+# @configure_input@
+#---------------------------------------------------------------------------#
+# Copyright (C) 2003 The University of Melbourne.
+# This file may only be copied under the terms of the GNU General
+# Public License - see the file COPYING in the Mercury distribution.
+#---------------------------------------------------------------------------#
+#
+# Mercury.config
+#
+# Configuration file for the Melbourne Mercury Compiler.
+#
+# Environment variables: MERCURY_STDLIB_DIR, MERCURY_C_COMPILER,
+# MERCURY_DEFAULT_GRADE, MERCURY_DEFAULT_OPT_LEVEL.
+
+# These settings won't override settings in the environment.
+MERCURY_STDLIB_DIR=@LIBDIR@
+MERCURY_DEFAULT_OPT_LEVEL=-O2
+MERCURY_DEFAULT_GRADE=@DEFAULT_GRADE@
+MERCURY_C_COMPILER=@CC@
+MERCURY_MATH_LIB=@MATH_LIB@
+# $(MATH_LIB) needs to be defined because it may
+# be used by the substitution for SHARED_LIBS.
+MATH_LIB=$(MERCURY_MATH_LIB)
+
+DEFAULT_MERCURY_LINKAGE=@DEFAULT_LINKAGE@
+
+# The default optimization level should be after
+# all the options that describe the machine configuration.
+DEFAULT_MCFLAGS=\
+		@ALL_LOCAL_C_INCL_DIR_MMC_OPTS@ \
+		@ALL_LOCAL_C_LIB_DIR_MMC_OPTS@ \
+		--cc "$(MERCURY_C_COMPILER)" \
+		--grade "$(MERCURY_DEFAULT_GRADE)" \
+		--cflags-for-ansi "@CFLAGS_FOR_ANSI@" \
+		--cflags-for-optimization "@CFLAGS_FOR_OPT@" \
+		--cflags-for-warnings "@CFLAGS_FOR_WARNINGS@" \
+		--cflags-for-threads "@CFLAGS_FOR_THREADS@" \
+		--cflags-for-debug "@CFLAGS_FOR_DEBUG@" \
+		--cflags-for-regs "@CFLAGS_FOR_REGS@" \
+		--cflags-for-gotos "@CFLAGS_FOR_GOTOS@" \
+		--cflags-for-pic "@CFLAGS_FOR_PIC@" \
+		--c-flag-to-name-object-file "@OBJFILE_OPT@" \
+		--object-file-extension ". at OBJ_SUFFIX@" \
+		--pic-object-file-extension ". at EXT_FOR_PIC_OBJECTS@" \
+		--link-with-pic-object-file-extension ". at EXT_FOR_LINK_WITH_PIC_OBJECTS@" \
+		--executable-file-extension "@EXT_FOR_EXE@" \
+		--shared-library-extension ". at EXT_FOR_SHARED_LIB@" \
+		--library-extension ". at LIB_SUFFIX@" \
+		--create-archive-command "@AR@" \
+		--create-archive-command-output-flag "@AR_LIBFILE_OPT@" \
+		--create-archive-command-flags "@ARFLAGS@" \
+		--ranlib-command "@RANLIB@" \
+		--link-executable-command "@LINK_EXE@" \
+		--link-shared-lib-command "@LINK_SHARED_OBJ@" \
+		--trace-libs "@TRACE_LIBS_SYSTEM@" \
+		--thread-libs "@THREAD_LIBS@" \
+		--shared-libs "@SHARED_LIBS@" \
+		--math-lib "@MATH_LIB@" \
+		--readline-libs "@READLINE_LIBRARIES@" \
+		--linker-thread-flags "@LDFLAGS_FOR_THREADS@" \
+		--shlib-linker-thread-flags "@LD_LIBFLAGS_FOR_THREADS@" \
+		--linker-trace-flags "@LDFLAGS_FOR_TRACE@" \
+		--shlib-linker-trace-flags "@LD_LIBFLAGS_FOR_TRACE@" \
+		--linker-static-flags "@LD_STATIC_FLAGS@" \
+		--linker-strip-flag "@LD_STRIP_FLAG@" \
+		--linker-debug-flags "@LDFLAGS_FOR_DEBUG@" \
+		--shlib-linker-debug-flags "@LD_LIBFLAGS_FOR_DEBUG@" \
+		--linker-rpath-flag "@EXE_RPATH_OPT@" \
+		--linker-rpath-separator "@EXE_RPATH_SEP@" \
+		--shlib-linker-rpath-flag "@SHLIB_RPATH_OPT@" \
+		--shlib-linker-rpath-separator "@SHLIB_RPATH_SEP@" \
+		--linker-allow-undefined-flag "@ALLOW_UNDEFINED@" \
+		--linker-error-undefined-flag "@ERROR_UNDEFINED@" \
+		--fullarch "@FULLARCH@" \
+		--install-prefix "@prefix@" \
+		--num-real-r-regs "@NUM_REAL_R_REGS@" \
+		--num-real-r-temps "@NUM_REAL_R_TEMPS@" \
+		--conf-low-tag-bits "@LOW_TAG_BITS@" \
+		--bits-per-word "@BITS_PER_WORD@" \
+		--bytes-per-word "@BYTES_PER_WORD@" \
+		--dotnet-library-version "@MS_DOTNET_LIBRARY_VERSION@" \
+		@HAVE_DELAY_SLOT@ \
+		@HAVE_BOXED_FLOATS@ \
+		@MCFLAGS_FOR_CC@ \
+		$(MERCURY_DEFAULT_OPT_LEVEL) \
+		@LIBGRADE_OPTS@ 
+
Index: scripts/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/Mmakefile,v
retrieving revision 1.31
diff -u -u -r1.31 Mmakefile
--- scripts/Mmakefile	1 Mar 2003 06:35:17 -0000	1.31
+++ scripts/Mmakefile	14 May 2003 14:25:50 -0000
@@ -34,7 +34,7 @@
 
 .PHONY: all
 all: $(SCRIPTS) $(DEBUGGER_SCRIPTS) $(EMACS_SCRIPTS)
-all: Mmake.vars Mercury.config
+all: Mmake.vars Mercury.config Mercury.config.bootstrap
 
 #-----------------------------------------------------------------------------#
 
Index: scripts/mercury_config.in
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/mercury_config.in,v
retrieving revision 1.2
diff -u -u -r1.2 mercury_config.in
--- scripts/mercury_config.in	1 Mar 2003 06:35:17 -0000	1.2
+++ scripts/mercury_config.in	14 May 2003 14:25:51 -0000
@@ -126,6 +126,7 @@
 mkdir $TMPDIR/bindist || exit 1
 
 # The configure script tries to process these files, but they won't be used.
+touch $TMPDIR/scripts/Mercury.config.bootstrap.in || exit 1
 touch $TMPDIR/Mmake.common.in $TMPDIR/bindist/bindist.INSTALL.in || exit 1
 touch $TMPDIR/bindist/bindist.Makefile.in || exit 1
 
Index: tools/binary_step
===================================================================
RCS file: /home/mercury1/repository/mercury/tools/binary_step,v
retrieving revision 1.19
diff -u -u -r1.19 binary_step
--- tools/binary_step	13 Apr 2003 05:48:37 -0000	1.19
+++ tools/binary_step	14 May 2003 14:25:51 -0000
@@ -148,6 +148,9 @@
 MERCURY_COMPILER=$root/compiler/mercury_compile
 export MERCURY_COMPILER
 
+MERCURY_CONFIG_FILE=$root/scripts/Mercury.config
+export MERCURY_CONFIG_FILE
+
 MMAKE_VPATH=.
 export MMAKE_VPATH
 MMAKE_DIR=../scripts
Index: tools/bootcheck
===================================================================
RCS file: /home/mercury1/repository/mercury/tools/bootcheck,v
retrieving revision 1.150
diff -u -u -r1.150 bootcheck
--- tools/bootcheck	1 May 2003 08:03:15 -0000	1.150
+++ tools/bootcheck	14 May 2003 14:25:51 -0000
@@ -457,6 +457,9 @@
 	MERCURY_COMPILER=$root/compiler/mercury_compile
 	export MERCURY_COMPILER
 
+	MERCURY_CONFIG_FILE=$root/scripts/Mercury.config
+	export MERCURY_CONFIG_FILE
+
 	[ -d stage2 ] || mkdir stage2
 	if $keep_stage_2
 	then
@@ -1046,6 +1049,9 @@
 
 	MERCURY_COMPILER=$root/stage2/compiler/mercury_compile
 	export MERCURY_COMPILER
+
+	MERCURY_CONFIG_FILE=$root/scripts/Mercury.config
+	export MERCURY_CONFIG_FILE
 
 	if test "$test_grade" = "$grade"
 	then
Index: tools/lmc.in
===================================================================
RCS file: /home/mercury1/repository/mercury/tools/lmc.in,v
retrieving revision 1.1
diff -u -u -r1.1 lmc.in
--- tools/lmc.in	17 Apr 2003 06:24:29 -0000	1.1
+++ tools/lmc.in	14 May 2003 14:25:43 -0000
@@ -108,4 +108,4 @@
 
 PATH="$WORKSPACE/scripts:$WORKSPACE/util:$PATH"
 export PATH
-exec mmc --no-mercury-stdlib-dir -I $WORKSPACE/library -I $WORKSPACE/analysis $CDEBUG_FLAGS $C_FLAGS $INIT_FLAGS $LIB_FLAGS "$@"
+exec mmc --no-mercury-stdlib-dir --config-file $WORKSPACE/scripts/Mercury.config -I $WORKSPACE/library -I $WORKSPACE/analysis $CDEBUG_FLAGS $C_FLAGS $INIT_FLAGS $LIB_FLAGS "$@"
--------------------------------------------------------------------------
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