summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Eran Meir <eranmeir@gmail.com>2016-01-02 14:22:47 +0200
committerGravatar Eran Meir <eranmeir@gmail.com>2016-01-02 14:22:47 +0200
commit4489a6b433f38be0b20e5a69fd4a52ef81ef731b (patch)
treeed4744430468c99054572d3dfa04e68a3575816b
parentdecad4728cde057b7ea89967afe8aa0a1a6245db (diff)
parent6747f5ff7d80001f112fd23af51a1275471f5bf0 (diff)
Untagle boot and static flags
-boot flag should build a dynamic executable but link urweb libraries statically (from build tree). This should fix the problem of not being able to build static executables on OSX.
-rw-r--r--src/compiler.sml4
-rw-r--r--src/main.mlton.sml1
-rw-r--r--src/settings.sig3
-rw-r--r--src/settings.sml4
4 files changed, 11 insertions, 1 deletions
diff --git a/src/compiler.sml b/src/compiler.sml
index 5ac024d4..e2dc168e 100644
--- a/src/compiler.sml
+++ b/src/compiler.sml
@@ -1503,7 +1503,9 @@ fun compileC {cname, oname, ename, libs, profile, debug, linker, link = link'} =
let
val proto = Settings.currentProtocol ()
- val lib = if Settings.getStaticLinking () then
+ val lib = if Settings.getBootLinking () then
+ !Settings.configLib ^ "/" ^ #linkStatic proto ^ " " ^ !Settings.configLib ^ "/liburweb.a"
+ else if Settings.getStaticLinking () then
" -static " ^ !Settings.configLib ^ "/" ^ #linkStatic proto ^ " " ^ !Settings.configLib ^ "/liburweb.a"
else
"-L" ^ !Settings.configLib ^ " " ^ #linkDynamic proto ^ " -lurweb"
diff --git a/src/main.mlton.sml b/src/main.mlton.sml
index c07af1ee..f595134f 100644
--- a/src/main.mlton.sml
+++ b/src/main.mlton.sml
@@ -151,6 +151,7 @@ fun oneRun args =
doArgs rest)
| "-boot" :: rest =>
(Compiler.enableBoot ();
+ Settings.setBootLinking true;
doArgs rest)
| "-sigfile" :: name :: rest =>
(Settings.setSigFile (SOME name);
diff --git a/src/settings.sig b/src/settings.sig
index 732a31fa..c75f12a3 100644
--- a/src/settings.sig
+++ b/src/settings.sig
@@ -238,6 +238,9 @@ signature SETTINGS = sig
val setStaticLinking : bool -> unit
val getStaticLinking : unit -> bool
+ val setBootLinking : bool -> unit
+ val getBootLinking : unit -> bool
+
val setDeadlines : bool -> unit
val getDeadlines : unit -> bool
diff --git a/src/settings.sml b/src/settings.sml
index 94692a2e..38ea30fc 100644
--- a/src/settings.sml
+++ b/src/settings.sml
@@ -686,6 +686,10 @@ val staticLinking = ref false
fun setStaticLinking b = staticLinking := b
fun getStaticLinking () = !staticLinking
+val bootLinking = ref false
+fun setBootLinking b = bootLinking := b
+fun getBootLinking () = !bootLinking
+
val deadlines = ref false
fun setDeadlines b = deadlines := b
fun getDeadlines () = !deadlines