diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-12-27 13:18:32 -0500 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-12-27 13:18:32 -0500 |
commit | c5a46fa63373c129e9595373d4c126030266d957 (patch) | |
tree | 4a63c8e1de989b220775c95117ae849c20f76f1c /src/compiler.sml | |
parent | 129b1c431efebc77a7a0046c725380ba29b814cf (diff) |
Dynamic linking of the runtime system
Diffstat (limited to 'src/compiler.sml')
-rw-r--r-- | src/compiler.sml | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/compiler.sml b/src/compiler.sml index a596a21d..1ef8c5b1 100644 --- a/src/compiler.sml +++ b/src/compiler.sml @@ -1025,13 +1025,17 @@ val toSqlify = transform sqlify "sqlify" o toMono_opt2 fun compileC {cname, oname, ename, libs, profile, debug, link = link'} = let val proto = Settings.currentProtocol () - val urweb_o = clibFile "urweb.o" - val memmem_o = clibFile "memmem.o" + + val lib = if Settings.getStaticLinking () then + clibFile "request.o" ^ " " ^ clibFile "queue.o" ^ " " ^ clibFile "urweb.o" + ^ " " ^ clibFile "memmem.o" ^ " " ^ #linkStatic proto + else + "-L" ^ Config.libC ^ " -lurweb " ^ #linkDynamic proto val compile = "gcc " ^ Config.gccArgs ^ " -Wimplicit -Werror -O3 -fno-inline -I " ^ Config.includ ^ " -c " ^ cname ^ " -o " ^ oname - val link = "gcc -Werror -O3 -lm -lmhash -pthread " ^ Config.gccArgs ^ " " ^ libs ^ " " ^ urweb_o ^ " " ^ oname - ^ " " ^ memmem_o ^ " " ^ #link proto ^ " -o " ^ ename + val link = "gcc -Werror -O3 -lm -lmhash -pthread " ^ Config.gccArgs ^ " " ^ libs ^ " " ^ lib ^ " " ^ oname + ^ " -o " ^ ename val (compile, link) = if profile then |