Make sure we don't link with the obsolete OpenSSL shipped with macOS.

* SConstruct: Prepend OpenSSL include and library paths on macOS.


git-svn-id: https://svn.apache.org/repos/asf/serf/trunk@1769776 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/SConstruct b/SConstruct
index b6f22fc..6d8ea42 100644
--- a/SConstruct
+++ b/SConstruct
@@ -403,8 +403,17 @@
   env.Append(CPPPATH=['$ZLIB/include'])
   env.Append(LIBPATH=['$ZLIB/lib'])
 
-  env.Append(CPPPATH=['$OPENSSL/include'])
-  env.Append(LIBPATH=['$OPENSSL/lib'])
+  # MacOS ships ancient OpenSSL libraries, but no headers, so we can
+  # assume we're building with an OpenSSL installed outside the
+  # default include and link paths. To prevent accidentally linking to
+  # the old shared libraries, make sure that the OpenSSL paths are
+  # first in the search lists.
+  if sys.platform == 'darwin':
+    env.Prepend(CPPPATH=['$OPENSSL/include'])
+    env.Prepend(LIBPATH=['$OPENSSL/lib'])
+  else:
+    env.Append(CPPPATH=['$OPENSSL/include'])
+    env.Append(LIBPATH=['$OPENSSL/lib'])
 
 
 # If build with gssapi, get its information and define SERF_HAVE_GSSAPI