Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/azatoth/minidlna.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Fürstenberg <azatoth@gmail.com>2011-03-28 00:40:53 +0400
committerCarl Fürstenberg <azatoth@gmail.com>2011-03-28 00:40:53 +0400
commit860c29f00275a92c791e2ead1c1f2a1df874596c (patch)
tree7bcec064ad408535eeae1764ea194ac9fac18736
parentfe3ac9085ed8c2fcee81661a3a6d6b171503fb26 (diff)
Modify build output to be less verbose
Enabling less verbose and more colorful output when building, can be disabled by passing the --verbose flag
-rw-r--r--SConstruct47
1 files changed, 44 insertions, 3 deletions
diff --git a/SConstruct b/SConstruct
index 4b59566..864a2aa 100644
--- a/SConstruct
+++ b/SConstruct
@@ -5,14 +5,55 @@
import SCons
import SCons.Script as scons
from distutils import sysconfig, version
-import platform
-import os
-import re
+import os, sys, re, platform
EnsurePythonVersion(2, 5)
EnsureSConsVersion(2, 0)
+colors = {}
+colors['cyan'] = '\033[96m'
+colors['purple'] = '\033[95m'
+colors['blue'] = '\033[94m'
+colors['green'] = '\033[92m'
+colors['yellow'] = '\033[93m'
+colors['red'] = '\033[91m'
+colors['end'] = '\033[0m'
+
+#If the output is not a terminal, remove the colors
+if not sys.stdout.isatty():
+ for key, value in colors.iteritems():
+ colors[key] = ''
+
env = Environment()
+
+AddOption(
+ "--verbose",
+ action="store_true",
+ dest="verbose_flag",
+ default=False,
+ help="verbose output"
+)
+
+if not GetOption("verbose_flag"):
+ env["CXXCOMSTR"] = \
+ '%(blue)sCompiling%(purple)s: %(yellow)s$SOURCE%(end)s' % colors,
+ env["CCCOMSTR"] = \
+ '%(blue)sCompiling%(purple)s: %(yellow)s$SOURCE%(end)s' % colors,
+ env["SHCCCOMSTR"] = \
+ '%(blue)sCompiling shared%(purple)s: %(yellow)s$SOURCE%(end)s' % colors,
+ env["SHCXXCOMSTR"] = \
+ '%(blue)sCompiling shared%(purple)s: %(yellow)s$SOURCE%(end)s' % colors,
+ env["ARCOMSTR"] = \
+ '%(red)sLinking Static Library%(purple)s: %(yellow)s$TARGET%(end)s' % colors,
+ env["RANLIBCOMSTR"] = \
+ '%(red)sRanlib Library%(purple)s: %(yellow)s$TARGET%(end)s' % colors,
+ env["SHLINKCOMSTR"] = \
+ '%(red)sLinking Shared Library%(purple)s: %(yellow)s$TARGET%(end)s' % colors,
+ env["LINKCOMSTR"] = \
+ '%(red)sLinking Program%(purple)s: %(yellow)s$TARGET%(end)s' % colors,
+ env["INSTALLSTR"] = \
+ '%(green)sInstalling%(purple)s: %(yellow)s$SOURCE%(purple)s => %(yellow)s$TARGET%(end)s' % colors
+
AddOption(
'--prefix',
dest='prefix',