summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-08-10 20:30:13 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-08-10 20:30:30 (GMT)
commit7459eb89d67db4d1245603b3c7cde1140a999474 (patch)
treed9c9418f3f21fe342c5e492719e0f246e026f41d /SConstruct
parent2cf66be04453bb212948e720d08dca4cfa96b35c (diff)
downloadswift-7459eb89d67db4d1245603b3c7cde1140a999474.zip
swift-7459eb89d67db4d1245603b3c7cde1140a999474.tar.bz2
Fix SCons build on windows.
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct78
1 files changed, 48 insertions, 30 deletions
diff --git a/SConstruct b/SConstruct
index 1f41d19..541f2a8 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1,38 +1,11 @@
import sys, os
################################################################################
-# Set up default build environment
+# Set up default build & configure environment
################################################################################
env = Environment(CPPPATH = "#", ENV = {'PATH' : os.environ['PATH']})
-# Pretty output
-if ARGUMENTS.get("V") != "1":
- if sys.stdout.isatty() and env["PLATFORM"] != "win32":
- env["CCCOMSTR"] = " \033[0;33;140mCC\033[0m $TARGET"
- env["CXXCOMSTR"] = " \033[0;32;140mCXX\033[0m $TARGET"
- env["LINKCOMSTR"] = " \033[0;31;140mLINK\033[0m $TARGET"
- env["ARCOMSTR"] = " \033[0;31;140mAR\033[0m $TARGET"
- env["RANLIBCOMSTR"] = " \033[0;31;140mRANLIB\033[0m $TARGET"
- env["QT4_RCCCOMSTR"] = " \033[0;34;140mRCC\033[0m $TARGET"
- env["QT4_UICCOMSTR"] = " \033[0;34;140mUIC\033[0m $TARGET"
- env["QT4_MOCFROMHCOMSTR"] = " \033[0;34;140mMOC\033[0m $TARGET"
- env["QT4_MOCFROMCXXCOMSTR"] = " \033[0;34;140mMOC\033[0m $TARGET"
- env["GENCOMSTR"] = " \033[0;34;140mGEN\033[0m $TARGET"
- #Progress( " \033[0;35;140mDEP\033[0m $TARGET\n")
- else :
- env["CCCOMSTR"] = " CC $TARGET"
- env["CXXCOMSTR"] = " CXX $TARGET"
- env["LINKCOMSTR"] = " LINK $TARGET"
- env["ARCOMSTR"] = " AR $TARGET"
- env["RANLIBCOMSTR"] = " RANLIB $TARGET"
- env["QT4_RCCCOMSTR"] = " RCC $TARGET"
- env["QT4_UICCOMSTR"] = " UIC $TARGET"
- env["QT4_MOCFROMHCOMSTR"] = " MOC $TARGET"
- env["QT4_MOCFROMCXXCOMSTR"] = " MOC $TARGET"
- env["GENCOMSTR"] = " GEN $TGENGET"
- #Progress(' DEP $TARGET\n')
-
# Default compiler flags
if int(ARGUMENTS.get("optimize", 0)) == 1 :
if env["PLATFORM"] == "win32" :
@@ -71,19 +44,64 @@ if int(ARGUMENTS.get("coverage", 0)) == 1 :
env.Append(LINKFLAGS = ["-fprofile-arcs", "-ftest-coverage"])
if env["PLATFORM"] == "win32" :
+ env.Append(LIBS = ["dnsapi", "ws2_32", "wsock32"])
env.Append(CCFLAGS = "/EHsc")
if env["PLATFORM"] == "darwin" :
env.Append(FRAMEWORKS = "AppKit")
+conf_env = env.Clone()
+
Export("env")
+Export("conf_env")
+
+
+################################################################################
+# Extend the default build environment (not affecting the configure env)
+#
+# Keeping both environments separated mostly because of SCons Issue 2391,
+# although it doesn't hurt to separate them (e.g. not have pretty printed
+# strings in config.log)
+################################################################################
+
+# Pretty output
+if int(ARGUMENTS.get("V", 0)) == 0:
+ if sys.stdout.isatty() and env["PLATFORM"] != "win32":
+ env["CCCOMSTR"] = " \033[0;33;140mCC\033[0m $TARGET"
+ env["CXXCOMSTR"] = " \033[0;32;140mCXX\033[0m $TARGET"
+ env["LINKCOMSTR"] = " \033[0;31;140mLINK\033[0m $TARGET"
+ env["ARCOMSTR"] = " \033[0;31;140mAR\033[0m $TARGET"
+ env["RANLIBCOMSTR"] = " \033[0;31;140mRANLIB\033[0m $TARGET"
+ env["QT4_RCCCOMSTR"] = " \033[0;34;140mRCC\033[0m $TARGET"
+ env["QT4_UICCOMSTR"] = " \033[0;34;140mUIC\033[0m $TARGET"
+ env["QT4_MOCFROMHCOMSTR"] = " \033[0;34;140mMOC\033[0m $TARGET"
+ env["QT4_MOCFROMCXXCOMSTR"] = " \033[0;34;140mMOC\033[0m $TARGET"
+ env["GENCOMSTR"] = " \033[0;34;140mGEN\033[0m $TARGET"
+ env["RCCOMSTR"] = " \033[0;34;140mRC\033[0m $TARGET"
+ #Progress( " \033[0;35;140mDEP\033[0m $TARGET\n")
+ else :
+ env["CCCOMSTR"] = " CC $TARGET"
+ env["CXXCOMSTR"] = " CXX $TARGET"
+ env["LINKCOMSTR"] = " LINK $TARGET"
+ env["ARCOMSTR"] = " AR $TARGET"
+ env["RANLIBCOMSTR"] = " RANLIB $TARGET"
+ env["QT4_RCCCOMSTR"] = " RCC $TARGET"
+ env["QT4_UICCOMSTR"] = " UIC $TARGET"
+ env["QT4_MOCFROMHCOMSTR"] = " MOC $TARGET"
+ env["QT4_MOCFROMCXXCOMSTR"] = " MOC $TARGET"
+ env["GENCOMSTR"] = " GEN $TARGET"
+ env["RCCOMSTR"] = " RC $TARGET"
+ #Progress(' DEP $TARGET\n')
+
+if env["PLATFORM"] == "win32" :
+ env["MSVC_BATCH"] = 1
################################################################################
# Platform configuration
################################################################################
-conf = Configure(env)
+conf = Configure(conf_env)
if conf.CheckCHeader("pthread.h") :
env["HAVE_PTHREAD"] = 1
@@ -166,5 +184,5 @@ if env.get("HAVE_EXPAT", 0):
parsers.append("(Bundled)")
print " XML Parsers: " + ' '.join(parsers)
-print " TLS Support: " + ("OpenSSL" if env["HAVE_OPENSSL"] else "Disabled")
+print " TLS Support: " + ("OpenSSL" if env.get("HAVE_OPENSSL",0) else "Disabled")
print