#! /bin/sh
# Generated automatically from mmc.in by configure.
#---------------------------------------------------------------------------#
# Copyright (C) 1994-1998, 2000 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.
#---------------------------------------------------------------------------#
#
# MMC - Melbourne Mercury Compiler.
#
# Use `mmc -h' for help.
#
# Environment variables: MERCURY_INT_DIR, MERCURY_C_INCL_DIR,
# MERCURY_ALL_MC_C_INCL_DIRS,
# MERCURY_COMPILER, MERCURY_C_COMPILER,
# MERCURY_DEFAULT_GRADE, MERCURY_DEFAULT_OPT_LEVEL.

INTDIR=${MERCURY_INT_DIR=/usr/lib/mercury/ints}
MERC_C_INCL_DIR=${MERCURY_C_INCL_DIR=/usr/lib/mercury/inc}
MERC_ALL_MC_C_INCL_DIRS=${MERCURY_ALL_MC_C_INCL_DIRS="--c-include-directory $MERC_C_INCL_DIR"}
MC=${MERCURY_COMPILER="/usr/lib/mercury/bin/i686-pc-linux-gnu/mercury_compile"}
DEFAULT_GRADE=${MERCURY_DEFAULT_GRADE=asm_fast.gc}
CC=${MERCURY_C_COMPILER="gcc"}
CFLAGS_FOR_REGS="-fno-builtin -fno-omit-frame-pointer"
CFLAGS_FOR_GOTOS="-fno-defer-pop -fno-function-cse -fno-gcse"
CFLAGS_FOR_THREADS="-DMR_THREAD_SAFE -DLINUX_THREADS 			-D_THREAD_SAFE -D_REENTRANT"
CFLAG_TO_NAME_OBJECT_FILE="-o "
OBJECT_FILE_EXTENSION="o"
LOW_TAG_BITS=2
BITS_PER_WORD=32
BYTES_PER_WORD=4
NUM_REAL_R_REGS=1
NUM_REAL_R_TEMPS=0
HAVE_DELAY_SLOT=
HAVE_BOXED_FLOATS=--no-unboxed-float
DEFAULT_OPT_LEVEL=${MERCURY_DEFAULT_OPT_LEVEL="-O2"}

# XXX Temporary hack for bootstrapping purposes:
# invoke $MC to test if it supports the --cflags-for-threads option.
case "`$MC --cflags-for-threads </dev/null 2>&1`" in
	*"unrecognized option"*)
		# This value will get overridden by
		# the later setting of --cflags-for-regs, so
		# it will just get ignored
		THREADS_OPT="--cflags-for-regs"
		;;
	*)
		THREADS_OPT="--cflags-for-threads"
esac

# The default optimization level should be after
# all the options that describe the machine configuration.

case $# in
	0) exec $MC \
		$MERC_ALL_MC_C_INCL_DIRS \
		--cc "$CC" --grade "$DEFAULT_GRADE" \
		$THREADS_OPT "$CFLAGS_FOR_THREADS" \
		--cflags-for-regs "$CFLAGS_FOR_REGS" \
		--cflags-for-gotos "$CFLAGS_FOR_GOTOS" \
		--c-flag-to-name-object-file "$CFLAG_TO_NAME_OBJECT_FILE" \
		--object-file-extension "$OBJECT_FILE_EXTENSION" \
		--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" \
		$HAVE_DELAY_SLOT \
		$HAVE_BOXED_FLOATS \
		$DEFAULT_OPT_LEVEL \
		-I "$INTDIR"
		;;
	*) exec $MC \
		$MERC_ALL_MC_C_INCL_DIRS \
		--cc "$CC" --grade "$DEFAULT_GRADE" \
		$THREADS_OPT "$CFLAGS_FOR_THREADS" \
		--cflags-for-regs "$CFLAGS_FOR_REGS" \
		--cflags-for-gotos "$CFLAGS_FOR_GOTOS" \
		--c-flag-to-name-object-file "$CFLAG_TO_NAME_OBJECT_FILE" \
		--object-file-extension "$OBJECT_FILE_EXTENSION" \
		--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" \
		$HAVE_DELAY_SLOT \
		$HAVE_BOXED_FLOATS \
		$DEFAULT_OPT_LEVEL \
		"$@" \
		-I "$INTDIR"
		;;
esac
