Mercurial > urweb
comparison src/compiler.sml @ 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 | 3683d1a8c1c8 |
comparison
equal
deleted
inserted
replaced
1845:c1e3805e604e | 1846:bcae365efa85 |
---|---|
1450 fun compileC {cname, oname, ename, libs, profile, debug, linker, link = link'} = | 1450 fun compileC {cname, oname, ename, libs, profile, debug, linker, link = link'} = |
1451 let | 1451 let |
1452 val proto = Settings.currentProtocol () | 1452 val proto = Settings.currentProtocol () |
1453 | 1453 |
1454 val lib = if Settings.getStaticLinking () then | 1454 val lib = if Settings.getStaticLinking () then |
1455 " " ^ !Settings.configLib ^ "/" ^ #linkStatic proto ^ " " ^ !Settings.configLib ^ "/liburweb.a" | 1455 " -static " ^ !Settings.configLib ^ "/" ^ #linkStatic proto ^ " " ^ !Settings.configLib ^ "/liburweb.a" |
1456 else | 1456 else |
1457 "-L" ^ !Settings.configLib ^ " " ^ #linkDynamic proto ^ " -lurweb" | 1457 "-L" ^ !Settings.configLib ^ " " ^ #linkDynamic proto ^ " -lurweb" |
1458 | 1458 |
1459 val opt = if debug then | 1459 val opt = if debug then |
1460 "" | 1460 "" |
1466 ^ " " ^ #compile proto | 1466 ^ " " ^ #compile proto |
1467 ^ " -c " ^ escapeFilename cname ^ " -o " ^ escapeFilename oname | 1467 ^ " -c " ^ escapeFilename cname ^ " -o " ^ escapeFilename oname |
1468 | 1468 |
1469 val linker = Option.getOpt (linker, Config.ccompiler ^ " -Werror" ^ opt ^ " " ^ Config.ccArgs ^ " " ^ Config.pthreadCflags ^ " " ^ Config.pthreadLibs) | 1469 val linker = Option.getOpt (linker, Config.ccompiler ^ " -Werror" ^ opt ^ " " ^ Config.ccArgs ^ " " ^ Config.pthreadCflags ^ " " ^ Config.pthreadLibs) |
1470 | 1470 |
1471 val ssl = if Settings.getStaticLinking () then | |
1472 Config.openssl ^ " -ldl -lz" | |
1473 else | |
1474 Config.openssl | |
1475 | |
1471 val link = linker | 1476 val link = linker |
1472 ^ " " ^ lib ^ " " ^ escapeFilename oname ^ " -lm " ^ Config.openssl ^ " " ^ libs ^ " -o " ^ escapeFilename ename | 1477 ^ " " ^ lib ^ " " ^ escapeFilename oname ^ " -lm " ^ ssl ^ " " ^ libs ^ " -o " ^ escapeFilename ename |
1473 | 1478 |
1474 val (compile, link) = | 1479 val (compile, link) = |
1475 if profile then | 1480 if profile then |
1476 (compile ^ " -pg", link ^ " -pg") | 1481 (compile ^ " -pg", link ^ " -pg") |
1477 else | 1482 else |