|
|
#Useful functions | #Useful functions |
# | # |
| |
|
def getSVNRevision(): # GPL code taken from http://trac.zeitherrschaft.org/zzub/browser/trunk/SConstruct |
|
# if this is a repository, take the string from svnversion |
|
svnversionpath = env.WhereIs('svnversion', os.environ['PATH']) |
|
if os.path.isdir('../.svn') and (svnversionpath != None): # we always start in .obj for some reason, so we must use ../.svn |
|
rev = os.popen('svnversion ..').readline().strip() |
|
if rev != "" and rev != "exported": |
|
return rev |
|
return "" |
|
|
#Checks for OpenGL on all three platforms | #Checks for OpenGL on all three platforms |
def CheckOpenGL(): | def CheckOpenGL(): |
if not conf.CheckLib('GL') and not conf.CheckLib('opengl32') and not conf.CheckCHeader('/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/gl.h'): | if not conf.CheckLib('GL') and not conf.CheckLib('opengl32') and not conf.CheckCHeader('/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/gl.h'): |
|
|
| |
return | return |
| |
|
#Check for FFMPEG support |
|
def CheckFFMPEG(conf, sources): |
|
flags_ffmpeg = ARGUMENTS.get('ffmpeg', 0) |
|
if int(flags_ffmpeg): |
|
if platform == 'linux': |
|
#Check for libavcodec, libavformat |
|
#I just randomly picked version numbers lower than mine for this - Albert |
|
if not conf.CheckForPKG('libavcodec', '51.20.0'): |
|
print 'libavcodec not found.' |
|
Exit(1) |
|
if not conf.CheckForPKG('libavformat', '51.1.0'): |
|
print 'libavcodec not found.' |
|
Exit(1) |
|
else: |
|
#Grabs the libs and cflags for ffmpeg |
|
env.ParseConfig('pkg-config libavcodec --silence-errors --cflags --libs') |
|
env.ParseConfig('pkg-config libavformat --silence-errors --cflags --libs') |
|
env.Append(CXXFLAGS = '-D__FFMPEGFILE__') |
|
else: |
|
# aptitude install libavcodec-dev libavformat-dev liba52-0.7.4-dev libdts-dev |
|
env.Append(LIBS = 'avcodec') |
|
env.Append(LIBS = 'avformat') |
|
env.Append(LIBS = 'z') |
|
env.Append(LIBS = 'a52') |
|
env.Append(LIBS = 'dts') |
|
env.Append(LIBS = 'gsm') |
|
env.Append(LIBS = 'dc1394_control') |
|
env.Append(LIBS = 'dl') |
|
env.Append(LIBS = 'vorbisenc') |
|
env.Append(LIBS = 'raw1394') |
|
env.Append(LIBS = 'avutil') |
|
env.Append(LIBS = 'vorbis') |
|
env.Append(LIBS = 'm') |
|
env.Append(LIBS = 'ogg') |
|
env.Append(CXXFLAGS = '-D__FFMPEGFILE__') |
|
sources += Split("""soundsourceffmpeg.cpp """) |
|
print "Not working FFMPEG support... enabled" |
|
else: |
|
print "Not working FFMPEG support... disabled" |
|
return |
|
|
|
|
# Checks for pkg-config on Linux | # Checks for pkg-config on Linux |
def CheckForPKGConfig( context, version='0.0.0' ): | def CheckForPKGConfig( context, version='0.0.0' ): |
context.Message( "Checking for pkg-config (at least version %s)... " % version ) | context.Message( "Checking for pkg-config (at least version %s)... " % version ) |
|
|
result.append(el) | result.append(el) |
return result | return result |
| |
|
def getFlags(env, argflag, default=0): |
|
""" |
|
* get value passed as an argument to scons as argflag=value |
|
* if no value is passed to scons use stored value |
|
* if no value is stored, use default |
|
Returns the value and stores it in env[argflag] |
|
""" |
|
flags = ARGUMENTS.get(argflag, -1) |
|
if int(flags) < 0: |
|
if env.has_key(argflag): |
|
flags = env[argflag] |
|
else: #default value |
|
flags = default |
|
env[argflag] = flags |
|
return flags |
|
1 |
###### MAIN LINE ###### | ###### MAIN LINE ###### |
####################### | ####################### |
#Get the platform/OS that we're building on: | #Get the platform/OS that we're building on: |
|
|
print 'Platform: Unknown (assuming Linux-like)' | print 'Platform: Unknown (assuming Linux-like)' |
platform = 'linux' | platform = 'linux' |
| |
|
|
#Figure out what the QT path is | #Figure out what the QT path is |
if platform == 'linux': | if platform == 'linux': |
default_qtdir = '/usr/share/qt4' | default_qtdir = '/usr/share/qt4' |
|
|
env = Environment(tools=['default','qt4', 'msvs'], toolpath=['../', './'], QTDIR=flags_qtdir, QT_LIB='', VCINSTALLDIR = os.getenv('VCInstallDir'), ENV = os.environ) | env = Environment(tools=['default','qt4', 'msvs'], toolpath=['../', './'], QTDIR=flags_qtdir, QT_LIB='', VCINSTALLDIR = os.getenv('VCInstallDir'), ENV = os.environ) |
# env.Append(LIBPATH = (flags_qtdir + "/plugins/iconengines")) | # env.Append(LIBPATH = (flags_qtdir + "/plugins/iconengines")) |
| |
#env.Append(CPPPATH='.') |
## Global cache directory |
|
## Put all project files in it so a rm -rf cache will clean up the config |
|
if not env.has_key('CACHEDIR'): |
|
env['CACHEDIR'] =os.getcwd()+ '/../../cache/' |
|
if not os.path.isdir(env['CACHEDIR']): |
|
os.mkdir(env['CACHEDIR']) |
|
|
|
## Avoid spreading .sconsign files everywhere - keep this line |
|
env.SConsignFile(env['CACHEDIR']+'/scons_signatures') |
|
|
|
#Hijack scons -h and --help |
|
cachefile = env['CACHEDIR'] + 'custom.py' |
|
opts = Options(cachefile) |
|
opts.Add('prefix', 'Set to your install prefix', '/usr/local') |
|
opts.Add('qtdir', 'Set to your QT4 directory', '/usr/share/qt4') |
|
opts.Add('djconsole', 'Set to 1 to enable Hercules support through libdjconsole', 0) |
|
opts.Add('djconsole_legacy', 'Set to 1 to enable legacy Hercules support (for Hercules MP3 Control only, not MK2', 0) |
|
opts.Add('hifieq', 'Set to 1 to enable high quality EQs', 1) |
|
opts.Add('ladspa', '(EXPERIMENTAL) Set to 1 to enable LADSPA plugin support', 0) |
|
opts.Add('ffmpeg', '(EXPERIMENTAL) Set to 1 to enable FFMPEG support', 0) |
|
opts.Add('vinylcontrol', 'Set to 1 to enable vinyl control support', 1) |
|
opts.Add('shoutcast', 'Set to 1 to enable shoutcast support', 0) |
|
opts.Add('msvshacks', 'Set to 1 to build properly with MS Visual Studio 2005 (Express users should leave this off)', 0) |
|
opts.Add('cmetrics', 'Set to 1 to enable crash reporting/usage statistics via Case Metrics (This should be disabled on development builds)', 0) |
|
opts.Add('optimize', 'Set to 1 to enable -O3 compiler optimizations. Set to 2 to enable Pentium 4 optimizations.', 1) |
|
if not platform == 'win32': |
|
opts.Add('gprof', '(DEVELOPER) Set to 1 to enable profiling using gprof', 0) |
|
opts.Add('tuned', '(EXPERIMENTAL) Set to 1 to optimise mixxx for this CPU', 0) |
|
#env = Environment(options = opts) |
|
opts.Update(env) |
|
Help(opts.GenerateHelpText(env)) |
|
|
|
# user-defined CXXFLAGS |
|
if os.environ.has_key('CXXFLAGS'): |
|
env.Append(CXXFLAGS = SCons.Util.CLVar( os.environ['CXXFLAGS'] )) |
|
|
|
### embed SVN version into build |
|
build_rev = getSVNRevision() |
|
### Old way - causes everything to be rebuilt each time the SVN ver moves. :( |
|
#if build_rev != '': |
|
# env.Append(CXXFLAGS = '-DBUILD_REV=\\"' + build_rev + '\\"') |
|
### Put version info into a file, so it doesn't force a rebuild of everything :) |
|
f = open("../.mixxx_version.svn","w") |
|
try: |
|
f.write('#define BUILD_REV "' + build_rev + '"\n') |
|
finally: |
|
f.close() |
| |
#Mixxx sources to build | #Mixxx sources to build |
sources = Split("""enginebuffercue.cpp input.cpp mixxxmenuplaylists.cpp trackplaylistlist.cpp mixxxkeyboard.cpp configobject.cpp controlobjectthread.cpp | sources = Split("""enginebuffercue.cpp input.cpp mixxxmenuplaylists.cpp trackplaylistlist.cpp mixxxkeyboard.cpp configobject.cpp controlobjectthread.cpp |
|
|
| |
#Check for OpenGL (it's messy to do it for all three platforms) | #Check for OpenGL (it's messy to do it for all three platforms) |
CheckOpenGL() | CheckOpenGL() |
|
|
|
#Check if FFMPEG was enabled |
|
CheckFFMPEG(conf, sources) |
| |
#Platform-specific checks for Linux and Win32... | #Platform-specific checks for Linux and Win32... |
if platform == 'linux' or platform == 'win32': | if platform == 'linux' or platform == 'win32': |
|
|
if os.system("which g++ > /dev/null"): #Checks for non-zero return code | if os.system("which g++ > /dev/null"): #Checks for non-zero return code |
print "Did not find gcc/g++, exiting!" | print "Did not find gcc/g++, exiting!" |
Exit(1) | Exit(1) |
|
|
#Check for pkg-config | #Check for pkg-config |
if not conf.CheckForPKGConfig('0.15.0'): | if not conf.CheckForPKGConfig('0.15.0'): |
print 'pkg-config >= 0.15.0 not found.' | print 'pkg-config >= 0.15.0 not found.' |
|
|
Exit(1) | Exit(1) |
| |
#Check for libdjconsole, if it was passed as a flag | #Check for libdjconsole, if it was passed as a flag |
flags_djconsole = ARGUMENTS.get('djconsole', 0) |
flags_djconsole = getFlags(env, 'djconsole', 0) |
flags_djconsole_legacy = ARGUMENTS.get('djconsole_legacy', 0) |
flags_djconsole_legacy = getFlags(env, 'djconsole_legacy', 0) |
if int(flags_djconsole): | if int(flags_djconsole): |
if not conf.CheckLibWithHeader('djconsole', 'libdjconsole/djconsole.h', 'C++'): | if not conf.CheckLibWithHeader('djconsole', 'libdjconsole/djconsole.h', 'C++'): |
print "Did not find libdjconsole or it\'s development headers, exiting!" | print "Did not find libdjconsole or it\'s development headers, exiting!" |
|
|
env.Uic4('dlgbpmschemedlg.ui') | env.Uic4('dlgbpmschemedlg.ui') |
env.Uic4('dlgbpmtapdlg.ui') | env.Uic4('dlgbpmtapdlg.ui') |
env.Uic4('dlgprefvinyldlg.ui') | env.Uic4('dlgprefvinyldlg.ui') |
|
env.Uic4('dlgprefrecorddlg.ui') |
env.Uic4('dlgaboutdlg.ui') | env.Uic4('dlgaboutdlg.ui') |
| |
#Add the QRC file which compiles in some extra resources (prefs icons, etc.) | #Add the QRC file which compiles in some extra resources (prefs icons, etc.) |
|
|
| |
| |
#Parse command-line build flags | #Parse command-line build flags |
|
build_flags = "" |
| |
print "\nFeatures Summary:\n================" | print "\nFeatures Summary:\n================" |
| |
|
|
#Hercules support through libdjconsole on Linux | #Hercules support through libdjconsole on Linux |
#(handled somewhere else above this in the file... | #(handled somewhere else above this in the file... |
# just printing the summary here) | # just printing the summary here) |
flags_djconsole = ARGUMENTS.get('djconsole', 0) |
flags_djconsole = getFlags(env, 'djconsole', 0) |
if int(flags_djconsole) == 0: | if int(flags_djconsole) == 0: |
print "libdjconsole support... disabled" | print "libdjconsole support... disabled" |
else: | else: |
print "libdjconsole support... enabled" | print "libdjconsole support... enabled" |
|
build_flags += 'djconsole ' |
| |
#High quality EQs | #High quality EQs |
flags_hifieq = ARGUMENTS.get('hifieq', 1) |
flags_hifieq = getFlags(env, 'hifieq', 1) |
if int(flags_hifieq) == 0: | if int(flags_hifieq) == 0: |
env.Append(CXXFLAGS = '-D__LOFI__ -D__NO_INTTYPES__') #Enables old crappy EQs | env.Append(CXXFLAGS = '-D__LOFI__ -D__NO_INTTYPES__') #Enables old crappy EQs |
print "High quality EQs... disabled" | print "High quality EQs... disabled" |
else: | else: |
print "High quality EQs... enabled" | print "High quality EQs... enabled" |
|
build_flags += 'hifieq ' |
#Experimental Recording |
|
flags_experimentalrecording = ARGUMENTS.get('experimentalrecord', 0) |
|
if int(flags_experimentalrecording): |
|
env.Append(CXXFLAGS = '-D__EXPERIMENTAL_RECORDING__') |
|
env.Uic4('dlgprefrecorddlg.ui') |
|
sources += Split(""" dlgprefrecord.cpp enginerecord.cpp writeaudiofile.cpp """ ) |
|
print "Experimental recording... enabled" |
|
else: |
|
print "Experimental recording... disabled" |
|
| |
#Case Metrics | #Case Metrics |
flags_cmetrics = ARGUMENTS.get('cmetrics', 0) |
flags_cmetrics = getFlags(env, 'cmetrics', 0) |
if int(flags_cmetrics): | if int(flags_cmetrics): |
env.Append(CXXFLAGS = '-D__C_METRICS__') | env.Append(CXXFLAGS = '-D__C_METRICS__') |
if platform == 'win32': | if platform == 'win32': |
|
|
env.Append(CPPPATH='../../lib/cmetrics') | env.Append(CPPPATH='../../lib/cmetrics') |
sources += SConscript('../../lib/cmetrics/SConscript') | sources += SConscript('../../lib/cmetrics/SConscript') |
print "Case Metrics profiling... enabled" | print "Case Metrics profiling... enabled" |
|
build_flags += 'cmetrics ' |
else: | else: |
print "Case Metrics profiling... disabled" | print "Case Metrics profiling... disabled" |
| |
#Experimental Shoutcast | #Experimental Shoutcast |
flags_shoutcast = ARGUMENTS.get('shoutcast', 0) |
flags_shoutcast = getFlags(env, 'shoutcast', 0) |
if int(flags_shoutcast): | if int(flags_shoutcast): |
#TODO: check for libshout | #TODO: check for libshout |
env.Append(LIBS = 'shout'); | env.Append(LIBS = 'shout'); |
|
|
sources += Split(""" dlgprefshoutcast.cpp engineshoutcast.cpp encodervorbis.cpp """ ) | sources += Split(""" dlgprefshoutcast.cpp engineshoutcast.cpp encodervorbis.cpp """ ) |
env.Uic4('dlgprefshoutcastdlg.ui') | env.Uic4('dlgprefshoutcastdlg.ui') |
print "Shoutcast support... enabled" | print "Shoutcast support... enabled" |
|
build_flags += 'shoutcast ' |
else: | else: |
print "Shoutcast support... disabled" | print "Shoutcast support... disabled" |
| |
#LADSPA | #LADSPA |
#TODO: Make sure we check for ladspa.h and the library... | #TODO: Make sure we check for ladspa.h and the library... |
flags_ladspa = ARGUMENTS.get('ladspa', 0) |
flags_ladspa = getFlags(env, 'ladspa', 0) |
if int(flags_ladspa): | if int(flags_ladspa): |
env.Append(CXXFLAGS = '-D__LADSPA__') | env.Append(CXXFLAGS = '-D__LADSPA__') |
sources += Split("""engineladspa.cpp ladspaloader.cpp ladspalibrary.cpp ladspaplugin.cpp ladspainstance.cpp ladspacontrol.cpp ladspainstancestereo.cpp ladspainstancemono.cpp ladspaview.cpp ladspapreset.cpp ladspapresetmanager.cpp ladspapresetknob.cpp ladspapresetinstance.cpp dlgladspa.cpp""") | sources += Split("""engineladspa.cpp ladspaloader.cpp ladspalibrary.cpp ladspaplugin.cpp ladspainstance.cpp ladspacontrol.cpp ladspainstancestereo.cpp ladspainstancemono.cpp ladspaview.cpp ladspapreset.cpp ladspapresetmanager.cpp ladspapresetknob.cpp ladspapresetinstance.cpp dlgladspa.cpp""") |
print "LADSPA support... enabled" | print "LADSPA support... enabled" |
|
build_flags += 'ladspa ' |
else: | else: |
print "LADSPA support... disabled" | print "LADSPA support... disabled" |
| |
#Vinyl Control | #Vinyl Control |
flags_vinylcontrol = ARGUMENTS.get('vinylcontrol', 1) |
flags_vinylcontrol = getFlags(env, 'vinylcontrol', 1) |
if int(flags_vinylcontrol): | if int(flags_vinylcontrol): |
env.Append(CXXFLAGS = '-D__VINYLCONTROL__') | env.Append(CXXFLAGS = '-D__VINYLCONTROL__') |
sources += Split(""" vinylcontrol.cpp vinylcontrolproxy.cpp vinylcontrolscratchlib.cpp vinylcontrolxwax.cpp dlgprefvinyl.cpp | sources += Split(""" vinylcontrol.cpp vinylcontrolproxy.cpp vinylcontrolscratchlib.cpp vinylcontrolxwax.cpp dlgprefvinyl.cpp |
|
|
env.Append(CPPPATH='../../lib/scratchlib') | env.Append(CPPPATH='../../lib/scratchlib') |
sources += Split("""../../lib/scratchlib/DAnalyse.cpp """) | sources += Split("""../../lib/scratchlib/DAnalyse.cpp """) |
print "Vinyl Control... enabled" | print "Vinyl Control... enabled" |
|
build_flags += 'vinylcontrol ' |
else: | else: |
print "Vinyl Control... disabled" | print "Vinyl Control... disabled" |
| |
flags_msvcdebug = ARGUMENTS.get('msvcdebug', 1) |
flags_msvcdebug = getFlags(env, 'msvcdebug', 1) |
if int(flags_msvcdebug) and platform == 'win32': | if int(flags_msvcdebug) and platform == 'win32': |
env.Append(LINKFLAGS = '/DEBUG') | env.Append(LINKFLAGS = '/DEBUG') |
env.Append(CXXFLAGS = '/ZI') | env.Append(CXXFLAGS = '/ZI') |
print "MSVC Debugging... enabled" | print "MSVC Debugging... enabled" |
|
build_flags += 'msvcdebug ' |
else: | else: |
print "MSVC Debugging... disabled" | print "MSVC Debugging... disabled" |
| |
flags_script = ARGUMENTS.get('script', 0) |
flags_script = getFlags(env, 'script', 0) |
if int(flags_script): | if int(flags_script): |
if platform == 'win32': | if platform == 'win32': |
env.Append(LIBS = 'QtScript4') | env.Append(LIBS = 'QtScript4') |
else: | else: |
env.Append(LIBS = 'QtScript') | env.Append(LIBS = 'QtScript') |
print "SuperCoolAwesomeScript (name contest pending)... enabled" | print "SuperCoolAwesomeScript (name contest pending)... enabled" |
|
build_flags += 'script ' |
sources += Split("""script/scriptengine.cpp script/scriptcontrolqueue.cpp | sources += Split("""script/scriptengine.cpp script/scriptcontrolqueue.cpp |
script/scriptstudio.cpp script/scriptrecorder.cpp | script/scriptstudio.cpp script/scriptrecorder.cpp |
script/playinterface.cpp script/macro.cpp | script/playinterface.cpp script/macro.cpp |
|
|
| |
#Optimization | #Optimization |
if platform == 'win32': | if platform == 'win32': |
flags_optimize = ARGUMENTS.get('optimize', 0) #Default to off on win32 |
flags_optimize = getFlags(env, 'optimize', 0) #Default to off on win32 |
else: | else: |
flags_optimize = ARGUMENTS.get('optimize', 1) #Default to on for Linux/OS X |
flags_optimize = getFlags(env, 'optimize', 1) #Default to on for Linux/OS X |
if int(flags_optimize): | if int(flags_optimize): |
if platform == 'win32': | if platform == 'win32': |
if int(flags_msvcdebug): | if int(flags_msvcdebug): |
|
|
env.Append(LINKFLAGS = '/LTCG:STATUS') | env.Append(LINKFLAGS = '/LTCG:STATUS') |
else: | else: |
print "Optimizations... enabled" | print "Optimizations... enabled" |
|
build_flags += 'optimize=' + str(flags_optimize) + ' ' |
if flags_optimize=='1': | if flags_optimize=='1': |
env.Append(CXXFLAGS = '-O3') | env.Append(CXXFLAGS = '-O3') |
elif flags_optimize=='2': | elif flags_optimize=='2': |
|
|
print "Optimizations... disabled" | print "Optimizations... disabled" |
| |
| |
#ffmpeg support |
|
flags_ffmpeg = ARGUMENTS.get('ffmpeg', 0) |
|
if int(flags_ffmpeg): |
|
env.Append(LIBS = 'avcodec') |
|
env.Append(LIBS = 'avformat') |
|
env.Append(LIBS = 'z') |
|
env.Append(LIBS = 'a52') |
|
env.Append(LIBS = 'dts') |
|
env.Append(LIBS = 'gsm') |
|
env.Append(LIBS = 'dc1394_control') |
|
env.Append(LIBS = 'dl') |
|
env.Append(LIBS = 'vorbisenc') |
|
env.Append(LIBS = 'raw1394') |
|
env.Append(LIBS = 'avutil') |
|
env.Append(LIBS = 'vorbis') |
|
env.Append(LIBS = 'm') |
|
env.Append(LIBS = 'ogg') |
|
env.Append(CXXFLAGS = '-D__FFMPEGFILE__') |
|
sources += Split("""soundsourceffmpeg.cpp """) |
|
print "Not working FFMPEG support... enabled" |
|
else: |
|
print "Not working FFMPEG support... disabled" |
|
| |
# Profiling and Optimization | # Profiling and Optimization |
if not platform == 'win32': | if not platform == 'win32': |
flags_gprof = ARGUMENTS.get('gprof', 0) |
flags_gprof = getFlags(env, 'gprof', 0) |
if int(flags_gprof): | if int(flags_gprof): |
env.Append(CCFLAGS = '-pg') | env.Append(CCFLAGS = '-pg') |
env.Append(LINKFLAGS = '-pg') | env.Append(LINKFLAGS = '-pg') |
print "gprof profiling support... enabled" | print "gprof profiling support... enabled" |
|
build_flags += 'gprof ' |
else: | else: |
print "gprof profiling support... disabled" | print "gprof profiling support... disabled" |
flags_tuned = ARGUMENTS.get('tuned', 0) |
flags_tuned = getFlags(env, 'tuned', 0) |
if int(flags_tuned): | if int(flags_tuned): |
ccv = env['CCVERSION'].split('.') | ccv = env['CCVERSION'].split('.') |
if int(ccv[0]) >= 4 and int(ccv[1]) >= 2: | if int(ccv[0]) >= 4 and int(ccv[1]) >= 2: |
env.Append(CCFLAGS = '-march=native') | env.Append(CCFLAGS = '-march=native') |
env.Append(LINKFLAGS = '-march=native') | env.Append(LINKFLAGS = '-march=native') |
print "Optimizing for this CPU... yes" | print "Optimizing for this CPU... yes" |
|
build_flags += 'tuned ' |
else: | else: |
print "Optimizing for this CPU... no (requires gcc >= 4.2.0)" | print "Optimizing for this CPU... no (requires gcc >= 4.2.0)" |
else: | else: |
print "Optimizing for this CPU... no" | print "Optimizing for this CPU... no" |
| |
#Visual Studio 2005 hacks (MSVS Express Edition users shouldn't enable this) | #Visual Studio 2005 hacks (MSVS Express Edition users shouldn't enable this) |
flags_msvshacks = ARGUMENTS.get('msvshacks', 0) |
flags_msvshacks = getFlags(env, 'msvshacks', 0) |
if int(flags_msvshacks): | if int(flags_msvshacks): |
env.Append(CXXFLAGS = '-D__MSVS2005__') | env.Append(CXXFLAGS = '-D__MSVS2005__') |
print "MSVS 2005 hacks... enabled" | print "MSVS 2005 hacks... enabled" |
|
build_flags += 'msvshacks ' |
else: | else: |
print "MSVS 2005 hacks... disabled" | print "MSVS 2005 hacks... disabled" |
| |
print "================\n" | print "================\n" |
| |
#Hijack scons -h and --help |
### Put flags info into a file |
opts = Options('custom.py') |
f = open("../.mixxx_flags.svn","w") |
opts.Add('prefix', 'Set to your install prefix', '/usr/local') |
try: |
opts.Add('qtdir', 'Set to your QT4 directory', '/usr/share/qt4') |
f.write('#define BUILD_FLAGS "' + build_flags + '"\n') |
opts.Add('djconsole', 'Set to 1 to enable Hercules support through libdjconsole', 0) |
finally: |
opts.Add('djconsole_legacy', 'Set to 1 to enable legacy Hercules support (for Hercules MP3 Control only, not MK2', 0) |
f.close() |
opts.Add('experimentalrecord', '(EXPERIMENTAL) Set to 1 to enable output recording feature', 0) |
|
opts.Add('hifieq', 'Set to 1 to enable high quality EQs', 1) |
|
opts.Add('ladspa', '(EXPERIMENTAL) Set to 1 to enable LADSPA plugin support', 0) |
|
opts.Add('ffmpeg', '(EXPERIMENTAL) Set to 1 to enable FFMPEG support', 0) |
|
opts.Add('vinylcontrol', 'Set to 1 to enable vinyl control support', 1) |
|
opts.Add('msvshacks', 'Set to 1 to build properly with MS Visual Studio 2005 (Express users should leave this off)', 0) |
|
opts.Add('cmetrics', 'Set to 1 to enable crash reporting/usage statistics via Case Metrics (This should be disabled on development builds)', 0) |
|
opts.Add('optimize', 'Set to 1 to enable -O3 compiler optimizations. Set to 2 to enable Pentium 4 optimizations.', 1) |
|
if not platform == 'win32': |
|
opts.Add('gprof', '(DEVELOPER) Set to 1 to enable profiling using gprof', 0) |
|
opts.Add('tuned', '(EXPERIMENTAL) Set to 1 to optimise mixxx for this CPU', 0) |
|
#env = Environment(options = opts) |
|
Help(opts.GenerateHelpText(env)) |
|
| |
|
#Save the options to cache |
|
opts.Save(cachefile, env) |
| |
#Tell SCons to build Mixxx | #Tell SCons to build Mixxx |
#========================= | #========================= |