summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Sergey Mironov <grrwlf@gmail.com>2013-08-20 17:13:50 +0400
committerGravatar Sergey Mironov <grrwlf@gmail.com>2013-08-20 17:13:50 +0400
commit4b6ba24685efdbfafa35540100f3fd5f19a7a801 (patch)
tree230b638a28394d5a1d7b3dea239b961a20d209e7 /src
parenta696bef5a00f98e3855b5a509d3a60a4abbd89e6 (diff)
Add -ccompiler command line argument
This allows user to overwrite the compiler set during the configure phase
Diffstat (limited to 'src')
-rw-r--r--src/compiler.sml4
-rw-r--r--src/main.mlton.sml7
-rw-r--r--src/settings.sig3
-rw-r--r--src/settings.sml5
4 files changed, 15 insertions, 4 deletions
diff --git a/src/compiler.sml b/src/compiler.sml
index 6410c932..51f96eb8 100644
--- a/src/compiler.sml
+++ b/src/compiler.sml
@@ -1479,12 +1479,12 @@ fun compileC {cname, oname, ename, libs, profile, debug, linker, link = link'} =
else
" -O3"
- val compile = Config.ccompiler ^ " " ^ Config.ccArgs ^ " " ^ Config.pthreadCflags ^ " -Wimplicit -Werror -Wno-unused-value"
+ val compile = (Settings.getCCompiler ()) ^ " " ^ Config.ccArgs ^ " " ^ Config.pthreadCflags ^ " -Wimplicit -Werror -Wno-unused-value"
^ opt ^ " -I " ^ !Settings.configInclude
^ " " ^ #compile proto
^ " -c " ^ escapeFilename cname ^ " -o " ^ escapeFilename oname
- val linker = Option.getOpt (linker, Config.ccompiler ^ " -Werror" ^ opt ^ " " ^ Config.ccArgs ^ " " ^ Config.pthreadCflags ^ " " ^ Config.pthreadLibs)
+ val linker = Option.getOpt (linker, (Settings.getCCompiler ()) ^ " -Werror" ^ opt ^ " " ^ Config.ccArgs ^ " " ^ Config.pthreadCflags ^ " " ^ Config.pthreadLibs)
val ssl = if Settings.getStaticLinking () then
Config.openssl ^ " -ldl -lz"
diff --git a/src/main.mlton.sml b/src/main.mlton.sml
index 19022cb7..91bbdc0c 100644
--- a/src/main.mlton.sml
+++ b/src/main.mlton.sml
@@ -61,12 +61,15 @@ fun oneRun args =
case args of
[] => ()
| "-version" :: rest =>
- printVersion ()
+ printVersion ()
| "-numeric-version" :: rest =>
- printNumericVersion ()
+ printNumericVersion ()
| "-css" :: rest =>
(css := true;
doArgs rest)
+ | "-ccompiler" :: ccomp :: rest =>
+ (Settings.setCCompiler ccomp;
+ doArgs rest)
| "-demo" :: prefix :: rest =>
(demo := SOME (prefix, false);
doArgs rest)
diff --git a/src/settings.sig b/src/settings.sig
index 453ba486..7675b9c8 100644
--- a/src/settings.sig
+++ b/src/settings.sig
@@ -256,4 +256,7 @@ signature SETTINGS = sig
val setTimeFormat : string -> unit
val getTimeFormat : unit -> string
+
+ val getCCompiler : unit -> string
+ val setCCompiler : string -> unit
end
diff --git a/src/settings.sml b/src/settings.sml
index 6839d39e..afe84617 100644
--- a/src/settings.sml
+++ b/src/settings.sml
@@ -33,6 +33,11 @@ val configSrcLib = ref Config.srclib
val configInclude = ref Config.includ
val configSitelisp = ref Config.sitelisp
+val configCCompiler = ref Config.ccompiler
+
+fun getCCompiler () = !configCCompiler
+fun setCCompiler cc = configCCompiler := cc
+
fun libUr () = OS.Path.joinDirFile {dir = !configSrcLib,
file = "ur"}
fun libC () = OS.Path.joinDirFile {dir = !configSrcLib,