summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2010-11-18 14:22:04 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2010-11-18 14:22:04 -0500
commitfb86b2e0894c5c51a30dc38cf530e80ce68a710a (patch)
tree21d925508e3cebab2d7dc4092845a7538df70dac /src
parent15195cea4dff60d3b0d3355a96e99c81dc37a1aa (diff)
Karn Kallio's patch for static mhash linking
Diffstat (limited to 'src')
-rw-r--r--src/c/Makefile.in1
-rw-r--r--src/compiler.sml10
-rw-r--r--src/config.sig1
-rw-r--r--src/config.sml.in1
4 files changed, 8 insertions, 5 deletions
diff --git a/src/c/Makefile.in b/src/c/Makefile.in
index 59d7b3e4..afbd033e 100644
--- a/src/c/Makefile.in
+++ b/src/c/Makefile.in
@@ -145,6 +145,7 @@ LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
+MHASH_LIB_DIR = @MHASH_LIB_DIR@
MKDIR_P = @MKDIR_P@
MLLEX = @MLLEX@
MLTON = @MLTON@
diff --git a/src/compiler.sml b/src/compiler.sml
index 038fa0ff..c4e8977f 100644
--- a/src/compiler.sml
+++ b/src/compiler.sml
@@ -1225,16 +1225,16 @@ fun compileC {cname, oname, ename, libs, profile, debug, link = link'} =
let
val proto = Settings.currentProtocol ()
- val lib = if Settings.getStaticLinking () then
- #linkStatic proto ^ " " ^ Config.lib ^ "/../liburweb.a"
- else
- "-L" ^ Config.lib ^ "/.. -lurweb " ^ #linkDynamic proto
+ val (lib, mhash) = if Settings.getStaticLinking () then
+ (#linkStatic proto ^ " " ^ Config.lib ^ "/../liburweb.a", Config.libMhash ^ "/libmhash.a")
+ else
+ ("-L" ^ Config.lib ^ "/.. -lurweb " ^ #linkDynamic proto, "-L" ^ Config.libMhash ^ " -lmhash")
val compile = "gcc " ^ Config.gccArgs ^ " -Wimplicit -Werror -O3 -fno-inline -I " ^ Config.includ
^ " " ^ #compile proto
^ " -c " ^ cname ^ " -o " ^ oname
- val link = "gcc -Werror -O3 -lm -lmhash -pthread " ^ Config.gccArgs ^ " " ^ libs ^ " " ^ lib ^ " " ^ oname
+ val link = "gcc -Werror -O3 -lm -pthread " ^ Config.gccArgs ^ " " ^ libs ^ " " ^ lib ^ " " ^ mhash ^ " " ^ oname
^ " -o " ^ ename
val (compile, link) =
diff --git a/src/config.sig b/src/config.sig
index 90fb72e7..0e8a03c5 100644
--- a/src/config.sig
+++ b/src/config.sig
@@ -9,4 +9,5 @@ signature CONFIG = sig
val libJs : string
val gccArgs : string
+ val libMhash : string
end
diff --git a/src/config.sml.in b/src/config.sml.in
index c7d231d5..24ef2ca2 100644
--- a/src/config.sml.in
+++ b/src/config.sml.in
@@ -13,5 +13,6 @@ val libJs = OS.Path.joinDirFile {dir = lib,
file = "js"}
val gccArgs = "@GCCARGS@"
+val libMhash = "@MHASH_LIB_DIR@"
end