diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-08-10 21:45:30 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-08-10 21:53:13 (GMT) |
commit | 701843a2ee1ef8d40097a8d3682c725348807a76 (patch) | |
tree | 70627566c4afde4f569c21d8966882d61d738027 /SConstruct | |
parent | 5b45133a6cc563ea32daa3cafa48b173fc1e61ab (diff) | |
download | swift-contrib-701843a2ee1ef8d40097a8d3682c725348807a76.zip swift-contrib-701843a2ee1ef8d40097a8d3682c725348807a76.tar.bz2 |
Add --with-openssl scons flag.
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 37 |
1 files changed, 29 insertions, 8 deletions
@@ -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 |