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
parent2cf66be04453bb212948e720d08dca4cfa96b35c (diff)
downloadswift-contrib-7459eb89d67db4d1245603b3c7cde1140a999474.zip
swift-contrib-7459eb89d67db4d1245603b3c7cde1140a999474.tar.bz2
Fix SCons build on windows.
-rw-r--r--3rdParty/LibIDN/SConscript4
-rw-r--r--BuildTools/SCons/Tools/qt4.py3
-rw-r--r--SConstruct78
-rw-r--r--Swift/QtUI/SConscript3
4 files changed, 55 insertions, 33 deletions
diff --git a/3rdParty/LibIDN/SConscript b/3rdParty/LibIDN/SConscript
index 9e408ff..5853a85 100644
--- a/3rdParty/LibIDN/SConscript
+++ b/3rdParty/LibIDN/SConscript
@@ -1,4 +1,4 @@
-Import("env")
+Import(["env", "conf_env"])
env["LIBIDN_FLAGS"] = {
"CPPDEFINES": ["IDNA_STATIC"],
@@ -13,7 +13,7 @@ myenv = env.Clone()
myenv.Replace(CCFLAGS = [flag for flag in env["CCFLAGS"] if flag not in ["-W", "-Wall"]])
# Check for strcasecmp() or replacement
-conf = Configure(myenv)
+conf = Configure(conf_env)
if not conf.CheckFunc('strcasecmp') :
if conf.CheckFunc("stricmp") :
myenv.Append(CPPDEFINES = [("strcasecmp", "stricmp")])
diff --git a/BuildTools/SCons/Tools/qt4.py b/BuildTools/SCons/Tools/qt4.py
index 6df945b..1eb1273 100644
--- a/BuildTools/SCons/Tools/qt4.py
+++ b/BuildTools/SCons/Tools/qt4.py
@@ -463,6 +463,8 @@ def enable_modules(self, modules, debug=False, crosscompiling=False) :
self.AppendUnique(CPPPATH=[os.path.join("$QTDIR","include","QtAssistant")])
modules.remove("QtAssistant")
modules.append("QtAssistantClient")
+ # FIXME: Phonon Hack
+ self.AppendUnique(LIBS=['phonon4'+debugSuffix])
self.AppendUnique(LIBS=[lib+'4'+debugSuffix for lib in modules if lib not in staticModules])
self.PrependUnique(LIBS=[lib+debugSuffix for lib in modules if lib in staticModules])
if 'QtOpenGL' in modules:
@@ -482,6 +484,7 @@ def enable_modules(self, modules, debug=False, crosscompiling=False) :
self.AppendUnique(LINKFLAGS="-F$QTDIR/lib")
self.AppendUnique(CPPFLAGS="-F$QTDIR/lib")
self.AppendUnique(LINKFLAGS="-L$QTDIR/lib") #TODO clean!
+ # FIXME: Phonon Hack
self.Append(LINKFLAGS=['-framework', "phonon"])
if debug : debugSuffix = 'd'
for module in modules :
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
diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript
index 36cf850..2fd1bc1 100644
--- a/Swift/QtUI/SConscript
+++ b/Swift/QtUI/SConscript
@@ -75,7 +75,8 @@ sources = [
]
if env["PLATFORM"] == "win32" :
- sources += ["../resources/Windows/Swift.rc"]
+ myenv.RES("../resources/Windows/Swift.rc")
+ sources += ["../resources/Windows/Swift.res"]
if env["PLATFORM"] == "darwin" or env["PLATFORM"] == "win32" :
myenv.Program("Swift", sources)