From 8f8bca7350c25d21e079e3513d9b8fad93c42812 Mon Sep 17 00:00:00 2001 From: Eran Meir Date: Sat, 2 Jan 2016 03:49:39 +0200 Subject: Prevent pthread cflags options from being passed to linker (in order to fix build issue on mac) --- src/compiler.sml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler.sml b/src/compiler.sml index bf7491e5..5ac024d4 100644 --- a/src/compiler.sml +++ b/src/compiler.sml @@ -878,7 +878,7 @@ fun parseUrp' accLibs fname = | "jsFile" => (Settings.setFilePath thisPath; Settings.addJsFile arg) - + | _ => ErrorMsg.error ("Unrecognized command '" ^ cmd ^ "'"); read () end @@ -1518,7 +1518,7 @@ fun compileC {cname, oname, ename, libs, profile, debug, linker, link = link'} = ^ " " ^ #compile proto ^ " -c " ^ escapeFilename cname ^ " -o " ^ escapeFilename oname - val linker = Option.getOpt (linker, (Settings.getCCompiler ()) ^ " -Werror" ^ opt ^ " " ^ Config.ccArgs ^ " " ^ Config.pthreadCflags ^ " " ^ Config.pthreadLibs) + val linker = Option.getOpt (linker, (Settings.getCCompiler ()) ^ " -Werror" ^ opt ^ " " ^ Config.ccArgs ^ " " ^ Config.pthreadLibs) val ssl = if Settings.getStaticLinking () then Config.openssl ^ " -ldl -lz" -- cgit v1.2.3 From 93cb1ae6e054471a464637a89fe8def57617487b Mon Sep 17 00:00:00 2001 From: Eran Meir Date: Sat, 2 Jan 2016 04:26:23 +0200 Subject: updating mlton tap --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ead1ad85..d0870280 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ before_install: - if command -v apt-get &>/dev/null; then sudo apt-get update -qq; fi - if command -v apt-get &>/dev/null; then sudo apt-get install -y mlton; fi - if command -v brew &>/dev/null; then brew update; fi - - if command -v brew &>/dev/null; then brew tap homebrew/boneyard; fi + - if command -v brew &>/dev/null; then brew tap urweb/homebrew-ur; fi - if command -v brew &>/dev/null; then brew install openssl mlton; fi - if command -v brew &>/dev/null; then export CONFIGURE_ARGS="--with-openssl=/usr/local/opt/openssl"; fi -- cgit v1.2.3 From decad4728cde057b7ea89967afe8aa0a1a6245db Mon Sep 17 00:00:00 2001 From: Eran Meir Date: Sat, 2 Jan 2016 04:51:06 +0200 Subject: Remove static linking enforcement when passing -boot flag --- src/main.mlton.sml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main.mlton.sml b/src/main.mlton.sml index 67732b58..c07af1ee 100644 --- a/src/main.mlton.sml +++ b/src/main.mlton.sml @@ -16,7 +16,7 @@ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN @@ -64,7 +64,7 @@ fun oneRun args = fun doArgs args = case args of [] => () - | "-version" :: rest => + | "-version" :: rest => printVersion () | "-numeric-version" :: rest => printNumericVersion () @@ -151,7 +151,6 @@ fun oneRun args = doArgs rest) | "-boot" :: rest => (Compiler.enableBoot (); - Settings.setStaticLinking true; doArgs rest) | "-sigfile" :: name :: rest => (Settings.setSigFile (SOME name); @@ -318,7 +317,7 @@ val () = case CommandLine.arguments () of (* Redirect the daemon's output to the socket. *) redirect Posix.FileSys.stdout; redirect Posix.FileSys.stderr; - + loop' ("", []); Socket.close sock; -- cgit v1.2.3 From 6747f5ff7d80001f112fd23af51a1275471f5bf0 Mon Sep 17 00:00:00 2001 From: Eran Meir Date: Sat, 2 Jan 2016 13:56:35 +0200 Subject: 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. --- src/compiler.sml | 4 +++- src/main.mlton.sml | 8 ++++---- src/settings.sig | 3 +++ src/settings.sml | 4 ++++ 4 files changed, 14 insertions(+), 5 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 67732b58..f595134f 100644 --- a/src/main.mlton.sml +++ b/src/main.mlton.sml @@ -16,7 +16,7 @@ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN @@ -64,7 +64,7 @@ fun oneRun args = fun doArgs args = case args of [] => () - | "-version" :: rest => + | "-version" :: rest => printVersion () | "-numeric-version" :: rest => printNumericVersion () @@ -151,7 +151,7 @@ fun oneRun args = doArgs rest) | "-boot" :: rest => (Compiler.enableBoot (); - Settings.setStaticLinking true; + Settings.setBootLinking true; doArgs rest) | "-sigfile" :: name :: rest => (Settings.setSigFile (SOME name); @@ -318,7 +318,7 @@ val () = case CommandLine.arguments () of (* Redirect the daemon's output to the socket. *) redirect Posix.FileSys.stdout; redirect Posix.FileSys.stderr; - + loop' ("", []); Socket.close sock; 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 -- cgit v1.2.3