mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 01:13:30 +00:00
Let the host and target env types be overridden in the environment.
If not set in the environment, then they default to the values
determined by the configure script.
Use this capability to let Mercury compilers built in one of the MSYS2
environments be usable from both the MSYS2 shell (via the mmc script) and
also from cmd.exe (via the mercury.bat batch file), _without_ requiring any
modifications to Mercury.config.
scripts/Mercury.config.in:
Add two new variables that hold the host and target env type.
scripts/mercury.bat.in:
Set the host and target env types to "windows" when we are
invoked via this batch file.
169 lines
7.4 KiB
Bash
169 lines
7.4 KiB
Bash
# vim: ts=4 sw=4 expandtab ft=sh
|
|
#
|
|
# This file has no hash-bang line since it isn't intended to be executable.
|
|
# Instead, it is read directly by the Mercury compiler, and it can also be
|
|
# 'sourced' by other shell scripts.
|
|
#
|
|
# @configure_input@
|
|
#---------------------------------------------------------------------------#
|
|
# Copyright (C) 2003-2007, 2010-2012 The University of Melbourne.
|
|
# Copyright (C) 2013-2016, 2018-2021, 2023-2025 The Mercury team.
|
|
# 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.
|
|
#
|
|
# Note to developers: we automatically generate *two* files from
|
|
# Mercury.config.in: Mercury.config, and Mercury.config.bootstrap.
|
|
# The difference between two is that we use the latter to build the workspace
|
|
# (though we happen to use it not just for stage 1, but later stages as well.)
|
|
# This use requires that Mercury.config.bootstrap should contain
|
|
# only options that are understood by the installed compiler.
|
|
#
|
|
# If you ever add any option to this file that the installed compiler
|
|
# does NOT (yet) understand, then you should temporarily modify configure.ac,
|
|
# at the spot that you will find if you search for NEWOPTION, to filter
|
|
# any references to such options out of Mercury.config.bootstrap.
|
|
#
|
|
# Historical note: for a long time, we maintained separate Mercury.config.in
|
|
# and Mercury.config.bootstrap.in files. This did not end well, because the
|
|
# double maintenance this required was usually overlooked.
|
|
#
|
|
# Environment variables:
|
|
#
|
|
# MERCURY_CSHARP_COMPILER
|
|
# MERCURY_C_COMPILER
|
|
# MERCURY_DEFAULT_GRADE
|
|
# MERCURY_DEFAULT_OPT_LEVEL
|
|
# MERCURY_JAVA_COMPILER
|
|
# MERCURY_JAVA_INTERPRETER
|
|
# MERCURY_STDLIB_DIR
|
|
|
|
# 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_C_COMPILER_TYPE=@C_COMPILER_TYPE@
|
|
MERCURY_MATH_LIB=@MATH_LIB@
|
|
MERCURY_JAVA_COMPILER=@JAVAC@
|
|
MERCURY_JAVA_INTERPRETER=@JAVA_INTERPRETER@
|
|
MERCURY_CSHARP_COMPILER=@CSC@
|
|
MERCURY_CSHARP_COMPILER_TYPE=@CSHARP_COMPILER_TYPE@
|
|
MERCURY_CLI_INTERPRETER=@CLI_INTERPRETER@
|
|
MERCURY_TARGET_ARCH=@FULLARCH@
|
|
MERCURY_HOST_ENV_TYPE=@HOST_ENV_TYPE@
|
|
MERCURY_TARGET_ENV_TYPE=@TARGET_ENV_TYPE@
|
|
# $(MATH_LIB) needs to be defined because it may
|
|
# be used by the substitution for SHARED_LIBS.
|
|
MATH_LIB=$(MERCURY_MATH_LIB)
|
|
|
|
# If you change these, you will also need to change the files
|
|
# indicated in scripts/c2init.in.
|
|
RT_LIB_NAME=mer_rt
|
|
STD_LIB_NAME=mer_std
|
|
|
|
DEFAULT_MERCURY_LINKAGE=@DEFAULT_LINKAGE@
|
|
|
|
DEFAULT_GRADEFLAGS=--grade "$(MERCURY_DEFAULT_GRADE)"
|
|
|
|
# NOTE Most of the autoconfigured values below, such as @CFLAGS_FOR_OPT@,
|
|
# are string valued, which is why they are preceded by the name of the option
|
|
# whose value they represent. Some, such as @SHLIB_USE_INSTALL_NAME@,
|
|
# are boolean options, and they *include* the option name, along with
|
|
# any "no-" prefix.
|
|
|
|
# The default optimization level should be after
|
|
# all the options that describe the machine configuration. XXX Why?
|
|
#
|
|
# The indentation should give an idea of the different groups
|
|
# that these autoconfigured values can be classified into.
|
|
DEFAULT_MCFLAGS=\
|
|
@ALL_LOCAL_C_INCL_DIR_MMC_OPTS@ \
|
|
@ALL_LOCAL_C_LIB_DIR_MMC_OPTS@ \
|
|
--cc "$(MERCURY_C_COMPILER)" \
|
|
--c-compiler-type "$(MERCURY_C_COMPILER_TYPE)" \
|
|
--java-compiler "$(MERCURY_JAVA_COMPILER)" \
|
|
--java-interpreter "$(MERCURY_JAVA_INTERPRETER)" \
|
|
--csharp-compiler "$(MERCURY_CSHARP_COMPILER)" \
|
|
--csharp-compiler-type "$(MERCURY_CSHARP_COMPILER_TYPE)" \
|
|
--cli-interpreter "$(MERCURY_CLI_INTERPRETER)" \
|
|
--java-flags "@JAVAC_FLAGS_FOR_HEAP_SIZE_CONFIG@" \
|
|
--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-sanitizers "@CFLAGS_FOR_SANITIZERS@" \
|
|
--cflags-for-regs "@CFLAGS_FOR_REGS@" \
|
|
--cflags-for-gotos "@CFLAGS_FOR_GOTOS@" \
|
|
--cflags-for-pic "@CFLAGS_FOR_PIC@" \
|
|
--cflags-for-lto "@CFLAGS_FOR_LTO@" \
|
|
--c-flag-to-name-object-file "@OBJFILE_OPT@" \
|
|
--object-file-extension ".@OBJ_SUFFIX@" \
|
|
--pic-object-file-extension ".@EXT_FOR_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@" \
|
|
--ranlib-flags "@RANLIBFLAGS@" \
|
|
--link-executable-command "@LINK_EXE@" \
|
|
--link-shared-lib-command "@LINK_SHARED_OBJ@" \
|
|
--strip-executable-command "@STRIP_EXE@" \
|
|
--strip-executable-shared-flags "@STRIP_EXE_SHARED_FLAGS@" \
|
|
--strip-executable-static-flags "@STRIP_EXE_STATIC_FLAGS@" \
|
|
--trace-libs "@TRACE_BASE_LIBS_SYSTEM@" \
|
|
--thread-libs "@THREAD_LIBS@" \
|
|
--shared-libs "@SHARED_LIBS@" \
|
|
--math-lib "@MATH_LIB@" \
|
|
--readline-libs "@READLINE_LIBRARIES@" \
|
|
--hwloc-libs "@HWLOC_LIBS@" \
|
|
--hwloc-static-libs "@HWLOC_STATIC_LIBS@" \
|
|
--linker-debug-flags "@LDFLAGS_FOR_DEBUG@" \
|
|
--linker-link-lib-flag "@LINK_LIB@" \
|
|
--linker-link-lib-suffix "@LINK_LIB_SUFFIX@" \
|
|
--linker-lto-flags "@LDFLAGS_FOR_LTO@" \
|
|
--linker-opt-separator "@LINK_OPT_SEP@" \
|
|
--linker-path-flag "@LIB_LIBPATH@" \
|
|
--linker-rpath-flag "@EXE_RPATH_OPT@" \
|
|
--linker-rpath-separator "@EXE_RPATH_SEP@" \
|
|
--linker-sanitizer-flags "@LDFLAGS_FOR_SANITIZERS@" \
|
|
--linker-static-flags "@LD_STATIC_FLAGS@" \
|
|
--linker-strip-flag "@LD_STRIP_FLAG@" \
|
|
--linker-thread-flags "@LDFLAGS_FOR_THREADS@" \
|
|
--linker-trace-flags "@LDFLAGS_FOR_TRACE@" \
|
|
--shlib-linker-debug-flags "@LD_LIBFLAGS_FOR_DEBUG@" \
|
|
--shlib-linker-link-lib-flag "@LINK_LIB@" \
|
|
--shlib-linker-link-lib-suffix "@LINK_LIB_SUFFIX@" \
|
|
--shlib-linker-rpath-flag "@SHLIB_RPATH_OPT@" \
|
|
--shlib-linker-rpath-separator "@SHLIB_RPATH_SEP@" \
|
|
--shlib-linker-thread-flags "@LD_LIBFLAGS_FOR_THREADS@" \
|
|
--shlib-linker-trace-flags "@LD_LIBFLAGS_FOR_TRACE@" \
|
|
@SHLIB_USE_INSTALL_NAME@ \
|
|
--shlib-linker-install-name-flag "@SHLIB_INSTALL_NAME_FLAG@" \
|
|
--linker-allow-undefined-flag "@ALLOW_UNDEFINED@" \
|
|
--linker-error-undefined-flag "@ERROR_UNDEFINED@" \
|
|
--install-prefix "@PREFIX@" \
|
|
--default-opt-level "$(MERCURY_DEFAULT_OPT_LEVEL)" \
|
|
--host-env-type "$(MERCURY_HOST_ENV_TYPE)" \
|
|
--target-arch "$(MERCURY_TARGET_ARCH)" \
|
|
--target-env-type "$(MERCURY_TARGET_ENV_TYPE)" \
|
|
--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@" \
|
|
--sync-term-size "@SYNC_TERM_SIZE@" \
|
|
@RESTRICTED_COMMAND_LINE_OPT@ \
|
|
@INSTALL_METHOD_OPT@ \
|
|
@HAVE_DELAY_SLOT@ \
|
|
@HAVE_BOXED_FLOATS@ \
|
|
@HAVE_BOXED_INT64S@ \
|
|
@MCFLAGS_FOR_CC@ \
|
|
@MMC_USE_SYMLINKS_OPT@
|