From 81e4a62fd6e083420211a4cd9684bb9802405c75 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Tue, 10 Jan 2012 17:38:00 -0500 Subject: Make Ubuntu linking patch more general --- src/config.sml.in | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/config.sml.in') diff --git a/src/config.sml.in b/src/config.sml.in index 03f3cc71..51d572eb 100644 --- a/src/config.sml.in +++ b/src/config.sml.in @@ -18,9 +18,15 @@ val ccArgs = "@CCARGS@" 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@" -- cgit v1.2.3