Files
mercury/scripts/mc.in
Fergus Henderson d664d48d8d Always pass --bits-per-word 32, since for some reason
Estimated hours taken: 0.1
	Plus lots of debugging time

scripts/mc.in
	Always pass --bits-per-word 32, since for some reason
	--bits-per-word 64 causes the compiler to generate incorrect
	code for lookup switches.
1996-05-05 18:55:10 +00:00

62 lines
2.1 KiB
Bash

#! /bin/sh
# @configure_input@
#---------------------------------------------------------------------------#
# Copyright (C) 1995 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.
#---------------------------------------------------------------------------#
#
# MC - Mercury Compiler.
#
# Use `mc -h' for help.
#
# Environment variables: MERCURY_INT_DIR, MERCURY_C_INCL_DIR,
# MERCURY_COMPILER, MERCURY_DEFAULT_GRADE, MERCURY_C_COMPILER.
INTDIR=${MERCURY_INT_DIR=@LIBDIR@/ints}
C_INCL=${MERCURY_C_INCL_DIR=@LIBDIR@/inc}
MC=${MERCURY_COMPILER="@LIBDIR@/bin/@FULLARCH@/mercury_compile"}
DEFAULT_GRADE=${MERCURY_DEFAULT_GRADE=@DEFAULT_GRADE@}
CC=${MERCURY_C_COMPILER=@CC@}
CFLAGS_FOR_REGS="@CFLAGS_FOR_REGS@"
CFLAGS_FOR_GOTOS="@CFLAGS_FOR_GOTOS@"
LOW_TAG_BITS=@LOW_TAG_BITS@
# XXX for some reason, --bits-per-word 64 seems to be broken
# BITS_PER_WORD=@BITS_PER_WORD@
BITS_PER_WORD=32
BYTES_PER_WORD=@BYTES_PER_WORD@
NUM_REAL_R_REGS=@NUM_REAL_R_REGS@
NUM_REAL_TEMPS=@NUM_REAL_TEMPS@
HAVE_DELAY_SLOT=@HAVE_DELAY_SLOT@
DEFAULT_OPT_LEVEL=-O2
# The default optimization level should be after
# all the options that describe the machine configuration.
case $# in
0) exec $MC -I "$INTDIR" --c-include-directory "$C_INCL" \
--cc "$CC" --grade "$DEFAULT_GRADE" \
--cflags-for-regs "$CFLAGS_FOR_REGS" \
--cflags-for-gotos "$CFLAGS_FOR_GOTOS" \
--num-real-r-regs "$NUM_REAL_R_REGS" \
--num-real-temps "$NUM_REAL_TEMPS" \
--conf-low-tag-bits "$LOW_TAG_BITS" \
--bits-per-word "$BITS_PER_WORD" \
--bytes-per-word "$BYTES_PER_WORD" \
$HAVE_DELAY_SLOT $DEFAULT_OPT_LEVEL \
;;
*) exec $MC -I "$INTDIR" --c-include-directory "$C_INCL" \
--cc "$CC" --grade "$DEFAULT_GRADE" \
--cflags-for-regs "$CFLAGS_FOR_REGS" \
--cflags-for-gotos "$CFLAGS_FOR_GOTOS" \
--num-real-r-regs "$NUM_REAL_R_REGS" \
--num-real-temps "$NUM_REAL_TEMPS" \
--conf-low-tag-bits "$LOW_TAG_BITS" \
--bits-per-word "$BITS_PER_WORD" \
--bytes-per-word "$BYTES_PER_WORD" \
$HAVE_DELAY_SLOT $DEFAULT_OPT_LEVEL \
"$@" ;;
esac