summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-08-10 21:45:30 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-08-10 21:53:13 (GMT)
commit701843a2ee1ef8d40097a8d3682c725348807a76 (patch)
tree70627566c4afde4f569c21d8966882d61d738027 /SConstruct
parent5b45133a6cc563ea32daa3cafa48b173fc1e61ab (diff)
downloadswift-contrib-701843a2ee1ef8d40097a8d3682c725348807a76.zip
swift-contrib-701843a2ee1ef8d40097a8d3682c725348807a76.tar.bz2
Add --with-openssl scons flag.
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct37
1 files changed, 29 insertions, 8 deletions
diff --git a/SConstruct b/SConstruct
index 6e52bc5..c5f8506 100644
--- a/SConstruct
+++ b/SConstruct
@@ -98,6 +98,12 @@ if env["PLATFORM"] == "win32" :
################################################################################
+# Configuration options
+################################################################################
+
+AddOption("--with-openssl", dest="openssl_prefix", type="string", nargs=1, action="store", metavar="DIR", help="OpenSSL installation prefix")
+
+################################################################################
# Platform configuration
################################################################################
@@ -106,14 +112,6 @@ conf = Configure(conf_env)
if conf.CheckCHeader("pthread.h") :
env["HAVE_PTHREAD"] = 1
-if conf.CheckCHeader("openssl/ssl.h") :
- env["HAVE_OPENSSL"] = 1
- env["OPENSSL_FLAGS"] = {
- "LIBS": ["ssl", "crypto"]
- }
-else :
- env["OPENSSL_FLAGS"] = ""
-
if conf.CheckLib("z") :
env.Append(LIBS = "z")
env["ZLIB_FLAGS"] = ""
@@ -143,6 +141,29 @@ if not env.get("HAVE_EXPAT", 0) :
env["HAVE_EXPAT"] = 1
bundledExpat = True
+# OpenSSL
+openssl_env = conf_env.Clone()
+openssl_prefix = GetOption("openssl_prefix")
+if openssl_prefix :
+ openssl_flags = { "CPPPATH": [os.path.join(openssl_prefix, "include")] }
+ if env["PLATFORM"] == "win32" :
+ openssl_flags["LIBPATH"] = [os.path.join(openssl_prefix, "lib", "VC")]
+ else :
+ openssl_flags["LIBPATH"] = [os.path.join(openssl_prefix, "lib")]
+ openssl_env.MergeFlags(openssl_flags)
+
+openssl_conf = Configure(openssl_env)
+if openssl_conf.CheckCHeader("openssl/ssl.h") :
+ env["HAVE_OPENSSL"] = 1
+ env["OPENSSL_FLAGS"] = openssl_flags
+ if env["PLATFORM"] == "win32" :
+ env["OPENSSL_FLAGS"]["LIBS"] = ["libeay32MT", "ssleay32MT"]
+ else:
+ env["OPENSSL_FLAGS"]["LIBS"] = ["ssl", "crypto"]
+else :
+ env["OPENSSL_FLAGS"] = ""
+openssl_conf.Finish()
+
################################################################################
# Project files