diff src/config.sml.in @ 1673:dae2c6fbf16c

Make Ubuntu linking patch more general
author Adam Chlipala <adam@chlipala.net>
date Tue, 10 Jan 2012 17:38:00 -0500
parents df8f18d50746
children c414850f206f
line wrap: on
line diff
--- a/src/config.sml.in	Tue Jan 10 17:32:48 2012 -0500
+++ b/src/config.sml.in	Tue Jan 10 17:38:00 2012 -0500
@@ -18,9 +18,15 @@
 val openssl = "@OPENSSL_LDFLAGS@ @OPENSSL_LIBS@"
 
 (* Something is rotten in the state of Ubuntu 11.10, so here's a manual fix that I hope doesn't break other platforms. *)
-val openssl = case String.tokens Char.isSpace openssl of
-                  ["-lssl", "-lcrypto"] => "-lcrypto -lssl"
-                | _ => openssl
+val openssl =
+    let
+        val tokens = String.tokens Char.isSpace openssl
+    in
+        if List.exists (fn s => s = "-lssl") tokens then
+            String.concatWith " " (List.filter (fn s => s <> "-lssl") tokens @ ["-lssl"])
+        else
+            openssl
+    end
 
 val pgheader = "@PGHEADER@"
 val msheader = "@MSHEADER@"