changeset 1846:bcae365efa85

Attempt to get more static linking for OpenSSL
author Adam Chlipala <adam@chlipala.net>
date Tue, 19 Mar 2013 19:10:31 -0400
parents c1e3805e604e
children 8958b580d026
files src/compiler.sml
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/compiler.sml	Fri Mar 15 16:09:55 2013 -0400
+++ b/src/compiler.sml	Tue Mar 19 19:10:31 2013 -0400
@@ -1452,7 +1452,7 @@
         val proto = Settings.currentProtocol ()
 
         val lib = if Settings.getStaticLinking () then
-                      " " ^ !Settings.configLib ^ "/" ^ #linkStatic proto ^ " " ^ !Settings.configLib ^ "/liburweb.a"
+                      " -static " ^ !Settings.configLib ^ "/" ^ #linkStatic proto ^ " " ^ !Settings.configLib ^ "/liburweb.a"
                   else
                       "-L" ^ !Settings.configLib ^ " " ^ #linkDynamic proto ^ " -lurweb"
 
@@ -1468,8 +1468,13 @@
 
         val linker = Option.getOpt (linker, Config.ccompiler ^ " -Werror" ^ opt ^ " " ^ Config.ccArgs ^ " " ^ Config.pthreadCflags ^ " " ^ Config.pthreadLibs)
 
+        val ssl = if Settings.getStaticLinking () then
+                      Config.openssl ^ " -ldl -lz"
+                  else
+                      Config.openssl
+
         val link = linker
-                   ^ " " ^ lib ^ " " ^ escapeFilename oname ^ " -lm " ^ Config.openssl ^ " " ^ libs ^ " -o " ^ escapeFilename ename
+                   ^ " " ^ lib ^ " " ^ escapeFilename oname ^ " -lm " ^ ssl ^ " " ^ libs ^ " -o " ^ escapeFilename ename
 
         val (compile, link) =
             if profile then