comparison src/compiler.sml @ 1096:324c9ffe8ff9

Protocol-specific compiler options
author Adam Chlipala <adamc@hcoop.net>
date Sun, 27 Dec 2009 14:25:22 -0500
parents bed675db3aff
children 72670131dace
comparison
equal deleted inserted replaced
1095:bed675db3aff 1096:324c9ffe8ff9
527 NONE => () 527 NONE => ()
528 | SOME _ => ErrorMsg.error "Duplicate 'timeout' directive"; 528 | SOME _ => ErrorMsg.error "Duplicate 'timeout' directive";
529 timeout := SOME (valOf (Int.fromString arg))) 529 timeout := SOME (valOf (Int.fromString arg)))
530 | "ffi" => ffi := relify arg :: !ffi 530 | "ffi" => ffi := relify arg :: !ffi
531 | "link" => let 531 | "link" => let
532 val arg = if size arg >= 2 andalso String.substring (arg, 0, 2) = "-l" then 532 val arg = if size arg >= 1
533 andalso String.sub (arg, 0) = #"-" then
533 arg 534 arg
534 else 535 else
535 relifyA arg 536 relifyA arg
536 in 537 in
537 link := arg :: !link 538 link := arg :: !link
1031 ^ " " ^ clibFile "memmem.o" ^ " " ^ #linkStatic proto 1032 ^ " " ^ clibFile "memmem.o" ^ " " ^ #linkStatic proto
1032 else 1033 else
1033 "-L" ^ Config.libC ^ " -lurweb " ^ #linkDynamic proto 1034 "-L" ^ Config.libC ^ " -lurweb " ^ #linkDynamic proto
1034 1035
1035 val compile = "gcc " ^ Config.gccArgs ^ " -Wimplicit -Werror -O3 -fno-inline -I " ^ Config.includ 1036 val compile = "gcc " ^ Config.gccArgs ^ " -Wimplicit -Werror -O3 -fno-inline -I " ^ Config.includ
1037 ^ " " ^ #compile proto
1036 ^ " -c " ^ cname ^ " -o " ^ oname 1038 ^ " -c " ^ cname ^ " -o " ^ oname
1039
1037 val link = "gcc -Werror -O3 -lm -lmhash -pthread " ^ Config.gccArgs ^ " " ^ libs ^ " " ^ lib ^ " " ^ oname 1040 val link = "gcc -Werror -O3 -lm -lmhash -pthread " ^ Config.gccArgs ^ " " ^ libs ^ " " ^ lib ^ " " ^ oname
1038 ^ " -o " ^ ename 1041 ^ " -o " ^ ename
1039 1042
1040 val (compile, link) = 1043 val (compile, link) =
1041 if profile then 1044 if profile then