2013-07-05 09:40:11 -04:00
|
|
|
#!/usr/bin/python
|
|
|
|
import os
|
|
|
|
|
2013-07-07 22:27:26 -04:00
|
|
|
# Configuration variables
|
2013-07-05 12:14:51 -04:00
|
|
|
CONFIG_VERSION = 6.0
|
|
|
|
CONFIG_DEBUG = True
|
2013-07-05 09:40:11 -04:00
|
|
|
|
2013-07-07 21:17:27 -04:00
|
|
|
|
|
|
|
# Set up default environment
|
|
|
|
CONFIG_ENV = [ "-O2" ]
|
2013-07-05 12:14:51 -04:00
|
|
|
if CONFIG_DEBUG == True:
|
2013-07-07 21:17:27 -04:00
|
|
|
CONFIG_ENV = [ "-Wall", "-Werror", "-g", "-DCONFIG_DEBUG" ]
|
|
|
|
|
|
|
|
env = Environment( CCFLAGS = CONFIG_ENV )
|
|
|
|
env.Append(CPPPATH = os.path.abspath("include"))
|
|
|
|
env.Append(CXXCOMSTR = "C++ $TARGET")
|
|
|
|
env.Append(LINKCOMSTR = "Linking $TARGET")
|
2013-07-05 09:40:11 -04:00
|
|
|
|
|
|
|
|
2013-07-07 22:27:26 -04:00
|
|
|
# Class to store configuration data
|
|
|
|
class Config:
|
|
|
|
# Set up reasonable defaults
|
|
|
|
def __init__(self):
|
2013-08-10 23:38:57 -04:00
|
|
|
self.VERSION = CONFIG_VERSION
|
|
|
|
self.DEBUG = CONFIG_DEBUG
|
|
|
|
self.ENV = CONFIG_ENV
|
2013-09-29 21:07:15 -04:00
|
|
|
self.reset();
|
2013-07-27 11:40:16 -04:00
|
|
|
|
|
|
|
def package(self, name):
|
|
|
|
env.ParseConfig("pkg-config --cflags --libs %s" % name)
|
2013-07-07 22:27:26 -04:00
|
|
|
|
|
|
|
def reconfigure(self):
|
|
|
|
env.Replace( CCFLAGS = self.ENV )
|
2013-09-29 21:07:15 -04:00
|
|
|
if self.TEST: env.Append( CCFLAGS = [ "-DCONFIG_TEST" ])
|
2013-07-07 22:27:26 -04:00
|
|
|
|
2013-09-29 21:07:15 -04:00
|
|
|
def reset(self, TEST = False):
|
2013-12-31 16:58:40 -05:00
|
|
|
self.AUDIO = False
|
|
|
|
self.DATABASE = False
|
|
|
|
self.DECK = False
|
|
|
|
self.FILE = False
|
|
|
|
self.FILTER = False
|
|
|
|
self.IDLE = False
|
|
|
|
self.LIBRARY = False
|
|
|
|
self.PLAYLIST = False
|
|
|
|
self.PLAYQUEUE = False
|
|
|
|
self.TEST = TEST
|
2013-07-07 22:27:26 -04:00
|
|
|
self.reconfigure()
|
|
|
|
|
|
|
|
CONFIG = Config()
|
|
|
|
Export("env", "CONFIG")
|
|
|
|
|
2013-07-05 09:40:11 -04:00
|
|
|
|
|
|
|
# Import SConscript files
|
|
|
|
include = SConscript("include/Sconscript")
|
2013-07-06 11:42:13 -04:00
|
|
|
design = SConscript("design/Sconscript")
|
2013-07-05 09:40:11 -04:00
|
|
|
tests = SConscript("tests/Sconscript")
|