Mercurial > urweb
comparison src/compiler.sml @ 1095:bed675db3aff
Dynamic linking of the runtime system
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sun, 27 Dec 2009 13:18:32 -0500 |
parents | db52c32dbe42 |
children | 324c9ffe8ff9 |
comparison
equal
deleted
inserted
replaced
1094:db52c32dbe42 | 1095:bed675db3aff |
---|---|
1023 val toSqlify = transform sqlify "sqlify" o toMono_opt2 | 1023 val toSqlify = transform sqlify "sqlify" o toMono_opt2 |
1024 | 1024 |
1025 fun compileC {cname, oname, ename, libs, profile, debug, link = link'} = | 1025 fun compileC {cname, oname, ename, libs, profile, debug, link = link'} = |
1026 let | 1026 let |
1027 val proto = Settings.currentProtocol () | 1027 val proto = Settings.currentProtocol () |
1028 val urweb_o = clibFile "urweb.o" | 1028 |
1029 val memmem_o = clibFile "memmem.o" | 1029 val lib = if Settings.getStaticLinking () then |
1030 clibFile "request.o" ^ " " ^ clibFile "queue.o" ^ " " ^ clibFile "urweb.o" | |
1031 ^ " " ^ clibFile "memmem.o" ^ " " ^ #linkStatic proto | |
1032 else | |
1033 "-L" ^ Config.libC ^ " -lurweb " ^ #linkDynamic proto | |
1030 | 1034 |
1031 val compile = "gcc " ^ Config.gccArgs ^ " -Wimplicit -Werror -O3 -fno-inline -I " ^ Config.includ | 1035 val compile = "gcc " ^ Config.gccArgs ^ " -Wimplicit -Werror -O3 -fno-inline -I " ^ Config.includ |
1032 ^ " -c " ^ cname ^ " -o " ^ oname | 1036 ^ " -c " ^ cname ^ " -o " ^ oname |
1033 val link = "gcc -Werror -O3 -lm -lmhash -pthread " ^ Config.gccArgs ^ " " ^ libs ^ " " ^ urweb_o ^ " " ^ oname | 1037 val link = "gcc -Werror -O3 -lm -lmhash -pthread " ^ Config.gccArgs ^ " " ^ libs ^ " " ^ lib ^ " " ^ oname |
1034 ^ " " ^ memmem_o ^ " " ^ #link proto ^ " -o " ^ ename | 1038 ^ " -o " ^ ename |
1035 | 1039 |
1036 val (compile, link) = | 1040 val (compile, link) = |
1037 if profile then | 1041 if profile then |
1038 (compile ^ " -pg", link ^ " -pg") | 1042 (compile ^ " -pg", link ^ " -pg") |
1039 else | 1043 else |