[m-rev.] diff: allow the target architecture to be set in the environment

Julien Fischer jfischer at opturion.com
Mon Oct 21 02:16:03 AEDT 2013


Branches: master

Allow the target architecture to be set in the environment.

scripts/Mercury.config.in:
scripts/Mercury.config.boostrap.in:
 	Add the environment variable MERCURY_TARGET_ARCH, which allows
 	the compiler's target architecture to be overridden in the
 	environment.

compiler/options.m:
 	Add the option --target-arch as a synonym (and eventually, replacement)
 	for the --fullarch option.

Julien.


diff --git a/compiler/options.m b/compiler/options.m
index af4b6d0..94b3568 100644
--- a/compiler/options.m
+++ b/compiler/options.m
@@ -2905,6 +2905,7 @@ long_option("help",                 help).
  long_option("version",              version).
  long_option("filenames-from-stdin", filenames_from_stdin).
  long_option("fullarch",             fullarch).
+long_option("target-arch",          fullarch).
  long_option("cross-compiling",      cross_compiling).
  long_option("local-module-id",      local_module_id).
  long_option("analysis-file-cache-dir",  analysis_file_cache_dir).
diff --git a/scripts/Mercury.config.bootstrap.in b/scripts/Mercury.config.bootstrap.in
index d78982c..c9c730e 100644
--- a/scripts/Mercury.config.bootstrap.in
+++ b/scripts/Mercury.config.bootstrap.in
@@ -36,6 +36,7 @@ MERCURY_CSHARP_COMPILER_TYPE=@CSHARP_COMPILER_TYPE@
  MERCURY_CLI_INTERPRETER=@CLI_INTERPRETER@
  MERCURY_ERLANG_COMPILER=@ERLC@
  MERCURY_ERLANG_INTERPRETER=@ERL@
+MERCURY_TARGET_ARCH=@FULLARCH@
  # $(MATH_LIB) needs to be defined because it may
  # be used by the substitution for SHARED_LIBS.
  MATH_LIB=$(MERCURY_MATH_LIB)
@@ -117,7 +118,7 @@ DEFAULT_MCFLAGS=\
  		--shlib-linker-install-name-flag "@SHLIB_INSTALL_NAME_FLAG@" \
  		--linker-allow-undefined-flag "@ALLOW_UNDEFINED@" \
  		--linker-error-undefined-flag "@ERROR_UNDEFINED@" \
-		--fullarch "@FULLARCH@" \
+		--fullarch "$(MERCURY_TARGET_ARCH)" \
  		--install-prefix "@prefix@" \
  		--num-real-r-regs "@NUM_REAL_R_REGS@" \
  		--num-real-r-temps "@NUM_REAL_R_TEMPS@" \
diff --git a/scripts/Mercury.config.in b/scripts/Mercury.config.in
index d487803..80a6166 100644
--- a/scripts/Mercury.config.in
+++ b/scripts/Mercury.config.in
@@ -35,6 +35,7 @@ MERCURY_CSHARP_COMPILER_TYPE=@CSHARP_COMPILER_TYPE@
  MERCURY_CLI_INTERPRETER=@CLI_INTERPRETER@
  MERCURY_ERLANG_COMPILER=@ERLC@
  MERCURY_ERLANG_INTERPRETER=@ERL@
+MERCURY_TARGET_ARCH=@FULLARCH@
  # $(MATH_LIB) needs to be defined because it may
  # be used by the substitution for SHARED_LIBS.
  MATH_LIB=$(MERCURY_MATH_LIB)
@@ -114,7 +115,7 @@ DEFAULT_MCFLAGS=\
  		--shlib-linker-install-name-flag "@SHLIB_INSTALL_NAME_FLAG@" \
  		--linker-allow-undefined-flag "@ALLOW_UNDEFINED@" \
  		--linker-error-undefined-flag "@ERROR_UNDEFINED@" \
-		--fullarch "@FULLARCH@" \
+		--fullarch "$(MERCURY_TARGET_ARCH)" \
  		--install-prefix "@PREFIX@" \
  		--num-real-r-regs "@NUM_REAL_R_REGS@" \
  		--num-real-r-temps "@NUM_REAL_R_TEMPS@" \



More information about the reviews mailing list