summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-08-10 17:18:35 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-08-10 17:18:35 (GMT)
commit1eda0e0025550acde2c0c9c937a29063227201b1 (patch)
treea8401714b4ae7e12c86b6b24113bb53ff9f7baa5
parent2edf74915432242ba99e7820a7633a06c755c17b (diff)
downloadswift-contrib-1eda0e0025550acde2c0c9c937a29063227201b1.zip
swift-contrib-1eda0e0025550acde2c0c9c937a29063227201b1.tar.bz2
Migrated all configure flags to SCons.
-rw-r--r--3rdParty/Boost/SConscript5
-rw-r--r--3rdParty/LibIDN/SConscript3
-rw-r--r--BuildTools/SCons/Tools/.gitignore (renamed from site_scons/site_tools/.gitignore)0
-rw-r--r--BuildTools/SCons/Tools/qt4.py (renamed from site_scons/site_tools/qt4.py)0
-rw-r--r--QA/SConscript1
-rw-r--r--SConstruct142
-rw-r--r--Swift/QtUI/QtSystemTray.cpp2
-rw-r--r--Swift/QtUI/Roster/QtTreeWidgetItem.cpp2
-rw-r--r--Swift/QtUI/Roster/RosterDelegate.h2
-rw-r--r--Swift/QtUI/Roster/RosterModel.cpp2
-rw-r--r--Swift/QtUI/Roster/RosterModel.h2
-rw-r--r--Swift/QtUI/SConscript4
12 files changed, 123 insertions, 42 deletions
diff --git a/3rdParty/Boost/SConscript b/3rdParty/Boost/SConscript
index d75ac29..769a67d 100644
--- a/3rdParty/Boost/SConscript
+++ b/3rdParty/Boost/SConscript
@@ -8,6 +8,9 @@ env["BOOST_FLAGS"] = {
"LIBS": ["Boost"]
}
+myenv = env.Clone()
+myenv.Replace(CCFLAGS = [flag for flag in env["CCFLAGS"] if flag not in ["-W", "-Wall"]])
+
sources = [
"libs/date_time/src/gregorian/date_generators.cpp",
"libs/date_time/src/gregorian/greg_month.cpp",
@@ -60,4 +63,4 @@ else :
if env["PLATFORM"] == "cygwin" :
env["BOOST_FLAGS"]["CPPDEFINES"] += ["__USE_W32_SOCKETS"]
-env.StaticLibrary("Boost", sources, CPPFLAGS = "-I" + Dir(".").abspath, CPPDEFINES = cppdefines)
+myenv.StaticLibrary("Boost", sources, CPPFLAGS = "-I" + Dir(".").abspath, CPPDEFINES = cppdefines)
diff --git a/3rdParty/LibIDN/SConscript b/3rdParty/LibIDN/SConscript
index 7e134dd..9e408ff 100644
--- a/3rdParty/LibIDN/SConscript
+++ b/3rdParty/LibIDN/SConscript
@@ -9,6 +9,9 @@ env["LIBIDN_FLAGS"] = {
myenv = env.Clone()
+# Remove warn flags
+myenv.Replace(CCFLAGS = [flag for flag in env["CCFLAGS"] if flag not in ["-W", "-Wall"]])
+
# Check for strcasecmp() or replacement
conf = Configure(myenv)
if not conf.CheckFunc('strcasecmp') :
diff --git a/site_scons/site_tools/.gitignore b/BuildTools/SCons/Tools/.gitignore
index 0d20b64..0d20b64 100644
--- a/site_scons/site_tools/.gitignore
+++ b/BuildTools/SCons/Tools/.gitignore
diff --git a/site_scons/site_tools/qt4.py b/BuildTools/SCons/Tools/qt4.py
index 6df945b..6df945b 100644
--- a/site_scons/site_tools/qt4.py
+++ b/BuildTools/SCons/Tools/qt4.py
diff --git a/QA/SConscript b/QA/SConscript
new file mode 100644
index 0000000..32aece4
--- /dev/null
+++ b/QA/SConscript
@@ -0,0 +1 @@
+SConscript("UnitTest/SConscript")
diff --git a/SConstruct b/SConstruct
index f0a5d4e..1f41d19 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1,44 +1,84 @@
-import sys
+import sys, os
-# Default build environment
-env = Environment(CPPPATH = "#")
-env.Dump()
+################################################################################
+# Set up default build 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"
- #Progress(' \033[0;35;140mDEP\033[0m $TARGET\n', overwrite = True)
+ 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" :
+ env.Append(CCFLAGS = "/O2")
else :
- env["CCCOMSTR"] = " CC $TARGET"
- env["CXXCOMSTR"] = " CXX $TARGET"
- env["LINKCOMSTR"] = " LINK $TARGET"
- env["ARCOMSTR"] = " AR $TARGET"
- env["RANLIBCOMSTR"] = " RANLIB $TARGET"
- #Progress(' \033[0;35;140mDEP\033[0m $TARGET\n', overwrite = True)
-
-# FIXME: Should check compiler
-if env["PLATFORM"] != "win32" :
- if ARGUMENTS.get("debug", 1) :
- env.Append(CCFLAGS = "-g")
-else :
- if ARGUMENTS.get("debug", 1) :
+ env.Append(CCFLAGS = "-O2")
+
+if int(ARGUMENTS.get("debug", 1)) == 1 :
+ if env["PLATFORM"] == "win32" :
env.Append(CCFLAGS = ["/Zi", "/MDd"])
+ else :
+ env.Append(CCFLAGS = "-g")
+
+if int(ARGUMENTS.get("universal", 0)) == 1 :
+ assert(env["PLATFORM"] == "darwin")
+ env.Append(CCFLAGS = [
+ "-isysroot", "/Developer/SDKs/MacOSX10.4u.sdk",
+ "-arch", "i386",
+ "-arch", "ppc"])
+ env.Append(LINKFLAGS = [
+ "-mmacosx-version-min=10.4",
+ "-Wl", "-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk",
+ "-arch", "i386",
+ "-arch", "ppc"])
+
+if int(ARGUMENTS.get("warnings", 1)) == 1 :
+ if env["PLATFORM"] == "win32" :
+ env.Append(CCFLAGS = ["/Wall"])
+ else :
+ env.Append(CCFLAGS = ["-W", "-Wall"])
+ #env.Append(CCFLAGS = ["-W", "-Wall", "-Wredundant-decls", "-pedantic", "-Wno-long-long", "-Woverloaded-virtual", "-Wundef", "-Wfloat-equal", "-Wold-style-cast"])
+
+if int(ARGUMENTS.get("coverage", 0)) == 1 :
+ assert(env["PLATFORM"] != "win32")
+ env.Append(CCFLAGS = ["-fprofile-arcs", "-ftest-coverage"])
+ env.Append(LINKFLAGS = ["-fprofile-arcs", "-ftest-coverage"])
+
+if env["PLATFORM"] == "win32" :
env.Append(CCFLAGS = "/EHsc")
if env["PLATFORM"] == "darwin" :
env.Append(FRAMEWORKS = "AppKit")
-print "Platform: " + env["PLATFORM"]
Export("env")
+
################################################################################
# Platform configuration
################################################################################
@@ -75,22 +115,56 @@ if conf.CheckCHeader("expat.h") and conf.CheckLib("expat") :
conf.Finish()
+bundledExpat = False
if not env.get("HAVE_EXPAT", 0) :
print "Expat or LibXML not found. Using bundled Expat"
SConscript("3rdParty/Expat/SConscript")
env["HAVE_EXPAT"] = 1
+ bundledExpat = True
################################################################################
# Project files
################################################################################
+# Third-party modules
SConscript([
"3rdParty/CppUnit/SConscript",
"3rdParty/Boost/SConscript",
"3rdParty/LibIDN/SConscript",
- "3rdParty/SQLite/SConscript",
- "Swiften/SConscript",
- "Swift/SConscript",
- "QA/UnitTest/SConscript",
- ])
+ "3rdParty/SQLite/SConscript"])
+
+# Swiften
+SConscript("Swiften/SConscript")
+
+# Projects
+for dir in os.listdir(".") :
+ if dir in ["QA", "Swiften"] :
+ continue
+ sconscript = os.path.join(dir, "SConscript")
+ if os.path.isfile(sconscript) :
+ SConscript(sconscript)
+
+# QA
+SConscript("QA/SConscript")
+
+
+################################################################################
+# Print summary
+################################################################################
+
+print
+print " Build Configuration"
+print " -------------------"
+
+parsers = []
+if env.get("HAVE_LIBXML", 0):
+ parsers.append("LibXML")
+if env.get("HAVE_EXPAT", 0):
+ parsers.append("Expat")
+ if bundledExpat:
+ parsers.append("(Bundled)")
+print " XML Parsers: " + ' '.join(parsers)
+
+print " TLS Support: " + ("OpenSSL" if env["HAVE_OPENSSL"] else "Disabled")
+print
diff --git a/Swift/QtUI/QtSystemTray.cpp b/Swift/QtUI/QtSystemTray.cpp
index b22da6b..f1c8e27 100644
--- a/Swift/QtUI/QtSystemTray.cpp
+++ b/Swift/QtUI/QtSystemTray.cpp
@@ -18,4 +18,4 @@ void QtSystemTray::setUnreadMessages(bool some) {
trayIcon_->setIcon(some ? newMessageIcon_ : standardIcon_);
}
-} \ No newline at end of file
+}
diff --git a/Swift/QtUI/Roster/QtTreeWidgetItem.cpp b/Swift/QtUI/Roster/QtTreeWidgetItem.cpp
index 51784df..27e978c 100644
--- a/Swift/QtUI/Roster/QtTreeWidgetItem.cpp
+++ b/Swift/QtUI/Roster/QtTreeWidgetItem.cpp
@@ -152,4 +152,4 @@ bool QtTreeWidgetItem::isExpanded() {
return expanded_;
}
-} \ No newline at end of file
+}
diff --git a/Swift/QtUI/Roster/RosterDelegate.h b/Swift/QtUI/Roster/RosterDelegate.h
index 934f0bb..9ec800f 100644
--- a/Swift/QtUI/Roster/RosterDelegate.h
+++ b/Swift/QtUI/Roster/RosterDelegate.h
@@ -8,7 +8,7 @@ namespace Swift {
QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const;
void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const;
private:
- static const int avatarSize_ = 32;
+ static const int avatarSize_ = 28;
static const int margin_ = 4;
};
}
diff --git a/Swift/QtUI/Roster/RosterModel.cpp b/Swift/QtUI/Roster/RosterModel.cpp
index 1df2117..f54290a 100644
--- a/Swift/QtUI/Roster/RosterModel.cpp
+++ b/Swift/QtUI/Roster/RosterModel.cpp
@@ -68,4 +68,4 @@ int RosterModel::rowCount(const QModelIndex& parent) const {
return item->rowCount();
}
-} \ No newline at end of file
+}
diff --git a/Swift/QtUI/Roster/RosterModel.h b/Swift/QtUI/Roster/RosterModel.h
index fc9b1f3..d32f241 100644
--- a/Swift/QtUI/Roster/RosterModel.h
+++ b/Swift/QtUI/Roster/RosterModel.h
@@ -26,4 +26,4 @@ private:
QtTreeWidgetItem* tree_;
};
-} \ No newline at end of file
+}
diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript
index a5993be..36cf850 100644
--- a/Swift/QtUI/SConscript
+++ b/Swift/QtUI/SConscript
@@ -38,13 +38,13 @@ myenv.MergeFlags(env["EXPAT_FLAGS"])
myenv.MergeFlags(env["ZLIB_FLAGS"])
myenv.MergeFlags(env["OPENSSL_FLAGS"])
-myenv.Tool("qt4")
+myenv.Tool("qt4", toolpath = ["#/BuildTools/SCons/Tools"])
myenv.EnableQt4Modules(['QtCore', 'QtGui', 'QtWebKit'], debug = False)
myenv.Append(CPPPATH = ["/usr/include/phonon"])
myenv.Append(CPPPATH = ["."])
-myenv.Command("DefaultTheme.qrc", "../resources/themes/Default", generateDefaultTheme)
+myenv.Command("DefaultTheme.qrc", "../resources/themes/Default", Action(generateDefaultTheme, cmdstr = "$GENCOMSTR"))
sources = [
"main.cpp",