Make it easier to boostrap the addition of new configuration

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.
This commit is contained in:
Simon Taylor
2003-05-15 07:23:45 +00:00
parent 5a40cfb536
commit 287e868e21
9 changed files with 114 additions and 4 deletions

View File

@@ -98,7 +98,11 @@ MTAGSFLAGS += $(EXTRA_MTAGSFLAGS)
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

View File

@@ -3574,7 +3574,8 @@ scripts/mercury.bat scripts/mprof scripts/mercury_update_interface
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

View File

@@ -0,0 +1,92 @@
#! /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.bootstrap
#
# Configuration file for the Melbourne Mercury Compiler.
#
# This file is used instead of Mercury.config when building the
# stage1 compiler. It should only refer to options which are
# understood by the installed compilers.
#
# 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 ".@OBJ_SUFFIX@" \
--pic-object-file-extension ".@EXT_FOR_PIC_OBJECTS@" \
--link-with-pic-object-file-extension ".@EXT_FOR_LINK_WITH_PIC_OBJECTS@" \
--executable-file-extension "@EXT_FOR_EXE@" \
--shared-library-extension ".@EXT_FOR_SHARED_LIB@" \
--library-extension ".@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@

View File

@@ -10,6 +10,9 @@
#
# Configuration file for the Melbourne Mercury Compiler.
#
# Note to developers: when updating this file consider whether
# Mercury.config.bootstrap.in should also be updated.
#
# Environment variables: MERCURY_STDLIB_DIR, MERCURY_C_COMPILER,
# MERCURY_DEFAULT_GRADE, MERCURY_DEFAULT_OPT_LEVEL.

View File

@@ -34,7 +34,7 @@ EMACS_SCRIPTS = gud.el
.PHONY: all
all: $(SCRIPTS) $(DEBUGGER_SCRIPTS) $(EMACS_SCRIPTS)
all: Mmake.vars Mercury.config
all: Mmake.vars Mercury.config Mercury.config.bootstrap
#-----------------------------------------------------------------------------#

View File

@@ -126,6 +126,7 @@ cp -r $input_libdir/reconf/* $TMPDIR || exit 1
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

View File

@@ -148,6 +148,9 @@ root=`/bin/pwd`
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

View File

@@ -457,6 +457,9 @@ then
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
@@ -1047,6 +1050,9 @@ then
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
stage2_insert="/stage2"

View File

@@ -108,4 +108,4 @@ fi
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 "$@"