Files
mercury/scripts/mmc.in
Simon Taylor 7620b07c54 Use `DEFAULT_MCFLAGS=${DEFAULT_MCFLAGS-...}' rather than
Estimated hours taken: 0.25
Branches: main, release

scripts/mmc:
	Use `DEFAULT_MCFLAGS=${DEFAULT_MCFLAGS-...}' rather than
	`DEFAULT_MCFLAGS=${DEFAULT_MCFLAGS=...}'. The latter form
	causes /bin/sh on mundroo (Solaris/x86 2.8) to crash when
	the RHS of the assignment is very long.
2002-08-08 06:22:00 +00:00

72 lines
2.5 KiB
Bash

#! /bin/sh
# @configure_input@
#---------------------------------------------------------------------------#
# Copyright (C) 1994-1998, 2000-2002 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_STDLIB_DIR, MERCURY_INT_DIR,
# MERCURY_ALL_MC_C_INCL_DIRS, MERCURY_COMPILER, MERCURY_C_COMPILER,
# MERCURY_DEFAULT_GRADE, MERCURY_DEFAULT_OPT_LEVEL.
MC=${MERCURY_COMPILER="@LIBDIR@/bin/@FULLARCH@/mercury_compile"}
case "$MERCURY_INT_DIR" in
"")
INT_DIR_OPT=
STDLIB_DIR=${MERCURY_STDLIB_DIR=@LIBDIR@}
STDLIB_DIR_OPT="--mercury-standard-library-directory \"${STDLIB_DIR}\""
;;
*)
INT_DIR_OPT="-I $MERCURY_INT_DIR"
STDLIB_DIR_OPT=--no-mercury-standard-library-directory
;;
esac
# The default options settings are passed in the DEFAULT_MCFLAGS enviroment
# variable, rather than on the command line, so that they can be overridden
# by the value of MCFLAGS in the Mercury.options file.
#
# The default optimization level should be after
# all the options that describe the machine configuration.
DEFAULT_MCFLAGS=${DEFAULT_MCFLAGS-"\
$MERCURY_ALL_MC_C_INCL_DIRS \
--cc \"${MERCURY_C_COMPILER=@CC@}\" \
--grade \"${MERCURY_DEFAULT_GRADE=@DEFAULT_GRADE@}\" \
--cflags-for-threads \"@CFLAGS_FOR_THREADS@\" \
--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@\" \
--create-archive-command \"@AR@\" \
--create-archive-command-output-flag \"@AR_LIBFILE_OPT@\" \
--create-archive-command-flags \"@ARFLAGS@\" \
--ranlib-command \"@RANLIB@\" \
--fullarch \"@FULLARCH@\" \
--install-prefix \"@prefix@\" \
@LIBGRADE_OPTS@ \
--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@ \
${MERCURY_DEFAULT_OPT_LEVEL=-O2} \
$STDLIB_DIR_OPT \
"}
export DEFAULT_MCFLAGS
case $# in
0) exec $MC $INT_DIR_OPT ;;
*) exec $MC "$@" $INT_DIR_OPT ;;
esac