Lines 21-26
Link Here
|
21 |
#Useful functions |
21 |
#Useful functions |
22 |
# |
22 |
# |
23 |
|
23 |
|
|
|
24 |
def getSVNRevision(): # GPL code taken from http://trac.zeitherrschaft.org/zzub/browser/trunk/SConstruct |
25 |
# if this is a repository, take the string from svnversion |
26 |
svnversionpath = env.WhereIs('svnversion', os.environ['PATH']) |
27 |
if os.path.isdir('../.svn') and (svnversionpath != None): # we always start in .obj for some reason, so we must use ../.svn |
28 |
rev = os.popen('svnversion ..').readline().strip() |
29 |
if rev != "" and rev != "exported": |
30 |
return rev |
31 |
return "" |
32 |
|
24 |
#Checks for OpenGL on all three platforms |
33 |
#Checks for OpenGL on all three platforms |
25 |
def CheckOpenGL(): |
34 |
def CheckOpenGL(): |
26 |
if not conf.CheckLib('GL') and not conf.CheckLib('opengl32') and not conf.CheckCHeader('/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/gl.h'): |
35 |
if not conf.CheckLib('GL') and not conf.CheckLib('opengl32') and not conf.CheckCHeader('/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/gl.h'): |
Lines 58-63
Link Here
|
58 |
|
67 |
|
59 |
return |
68 |
return |
60 |
|
69 |
|
|
|
70 |
#Check for FFMPEG support |
71 |
def CheckFFMPEG(conf, sources): |
72 |
flags_ffmpeg = ARGUMENTS.get('ffmpeg', 0) |
73 |
if int(flags_ffmpeg): |
74 |
if platform == 'linux': |
75 |
#Check for libavcodec, libavformat |
76 |
#I just randomly picked version numbers lower than mine for this - Albert |
77 |
if not conf.CheckForPKG('libavcodec', '51.20.0'): |
78 |
print 'libavcodec not found.' |
79 |
Exit(1) |
80 |
if not conf.CheckForPKG('libavformat', '51.1.0'): |
81 |
print 'libavcodec not found.' |
82 |
Exit(1) |
83 |
else: |
84 |
#Grabs the libs and cflags for ffmpeg |
85 |
env.ParseConfig('pkg-config libavcodec --silence-errors --cflags --libs') |
86 |
env.ParseConfig('pkg-config libavformat --silence-errors --cflags --libs') |
87 |
env.Append(CXXFLAGS = '-D__FFMPEGFILE__') |
88 |
else: |
89 |
# aptitude install libavcodec-dev libavformat-dev liba52-0.7.4-dev libdts-dev |
90 |
env.Append(LIBS = 'avcodec') |
91 |
env.Append(LIBS = 'avformat') |
92 |
env.Append(LIBS = 'z') |
93 |
env.Append(LIBS = 'a52') |
94 |
env.Append(LIBS = 'dts') |
95 |
env.Append(LIBS = 'gsm') |
96 |
env.Append(LIBS = 'dc1394_control') |
97 |
env.Append(LIBS = 'dl') |
98 |
env.Append(LIBS = 'vorbisenc') |
99 |
env.Append(LIBS = 'raw1394') |
100 |
env.Append(LIBS = 'avutil') |
101 |
env.Append(LIBS = 'vorbis') |
102 |
env.Append(LIBS = 'm') |
103 |
env.Append(LIBS = 'ogg') |
104 |
env.Append(CXXFLAGS = '-D__FFMPEGFILE__') |
105 |
sources += Split("""soundsourceffmpeg.cpp """) |
106 |
print "Not working FFMPEG support... enabled" |
107 |
else: |
108 |
print "Not working FFMPEG support... disabled" |
109 |
return |
110 |
|
111 |
|
61 |
# Checks for pkg-config on Linux |
112 |
# Checks for pkg-config on Linux |
62 |
def CheckForPKGConfig( context, version='0.0.0' ): |
113 |
def CheckForPKGConfig( context, version='0.0.0' ): |
63 |
context.Message( "Checking for pkg-config (at least version %s)... " % version ) |
114 |
context.Message( "Checking for pkg-config (at least version %s)... " % version ) |
Lines 99-104
Link Here
|
99 |
result.append(el) |
150 |
result.append(el) |
100 |
return result |
151 |
return result |
101 |
|
152 |
|
|
|
153 |
def getFlags(env, argflag, default=0): |
154 |
""" |
155 |
* get value passed as an argument to scons as argflag=value |
156 |
* if no value is passed to scons use stored value |
157 |
* if no value is stored, use default |
158 |
Returns the value and stores it in env[argflag] |
159 |
""" |
160 |
flags = ARGUMENTS.get(argflag, -1) |
161 |
if int(flags) < 0: |
162 |
if env.has_key(argflag): |
163 |
flags = env[argflag] |
164 |
else: #default value |
165 |
flags = default |
166 |
env[argflag] = flags |
167 |
return flags |
168 |
1 |
102 |
###### MAIN LINE ###### |
169 |
###### MAIN LINE ###### |
103 |
####################### |
170 |
####################### |
104 |
#Get the platform/OS that we're building on: |
171 |
#Get the platform/OS that we're building on: |
Lines 115-121
Link Here
|
115 |
print 'Platform: Unknown (assuming Linux-like)' |
182 |
print 'Platform: Unknown (assuming Linux-like)' |
116 |
platform = 'linux' |
183 |
platform = 'linux' |
117 |
|
184 |
|
118 |
|
|
|
119 |
#Figure out what the QT path is |
185 |
#Figure out what the QT path is |
120 |
if platform == 'linux': |
186 |
if platform == 'linux': |
121 |
default_qtdir = '/usr/share/qt4' |
187 |
default_qtdir = '/usr/share/qt4' |
Lines 146-152
Link Here
|
146 |
env = Environment(tools=['default','qt4', 'msvs'], toolpath=['../', './'], QTDIR=flags_qtdir, QT_LIB='', VCINSTALLDIR = os.getenv('VCInstallDir'), ENV = os.environ) |
212 |
env = Environment(tools=['default','qt4', 'msvs'], toolpath=['../', './'], QTDIR=flags_qtdir, QT_LIB='', VCINSTALLDIR = os.getenv('VCInstallDir'), ENV = os.environ) |
147 |
# env.Append(LIBPATH = (flags_qtdir + "/plugins/iconengines")) |
213 |
# env.Append(LIBPATH = (flags_qtdir + "/plugins/iconengines")) |
148 |
|
214 |
|
149 |
#env.Append(CPPPATH='.') |
215 |
## Global cache directory |
|
|
216 |
## Put all project files in it so a rm -rf cache will clean up the config |
217 |
if not env.has_key('CACHEDIR'): |
218 |
env['CACHEDIR'] =os.getcwd()+ '/../../cache/' |
219 |
if not os.path.isdir(env['CACHEDIR']): |
220 |
os.mkdir(env['CACHEDIR']) |
221 |
|
222 |
## Avoid spreading .sconsign files everywhere - keep this line |
223 |
env.SConsignFile(env['CACHEDIR']+'/scons_signatures') |
224 |
|
225 |
#Hijack scons -h and --help |
226 |
cachefile = env['CACHEDIR'] + 'custom.py' |
227 |
opts = Options(cachefile) |
228 |
opts.Add('prefix', 'Set to your install prefix', '/usr/local') |
229 |
opts.Add('qtdir', 'Set to your QT4 directory', '/usr/share/qt4') |
230 |
opts.Add('djconsole', 'Set to 1 to enable Hercules support through libdjconsole', 0) |
231 |
opts.Add('djconsole_legacy', 'Set to 1 to enable legacy Hercules support (for Hercules MP3 Control only, not MK2', 0) |
232 |
opts.Add('hifieq', 'Set to 1 to enable high quality EQs', 1) |
233 |
opts.Add('ladspa', '(EXPERIMENTAL) Set to 1 to enable LADSPA plugin support', 0) |
234 |
opts.Add('ffmpeg', '(EXPERIMENTAL) Set to 1 to enable FFMPEG support', 0) |
235 |
opts.Add('vinylcontrol', 'Set to 1 to enable vinyl control support', 1) |
236 |
opts.Add('shoutcast', 'Set to 1 to enable shoutcast support', 0) |
237 |
opts.Add('msvshacks', 'Set to 1 to build properly with MS Visual Studio 2005 (Express users should leave this off)', 0) |
238 |
opts.Add('cmetrics', 'Set to 1 to enable crash reporting/usage statistics via Case Metrics (This should be disabled on development builds)', 0) |
239 |
opts.Add('optimize', 'Set to 1 to enable -O3 compiler optimizations. Set to 2 to enable Pentium 4 optimizations.', 1) |
240 |
if not platform == 'win32': |
241 |
opts.Add('gprof', '(DEVELOPER) Set to 1 to enable profiling using gprof', 0) |
242 |
opts.Add('tuned', '(EXPERIMENTAL) Set to 1 to optimise mixxx for this CPU', 0) |
243 |
#env = Environment(options = opts) |
244 |
opts.Update(env) |
245 |
Help(opts.GenerateHelpText(env)) |
246 |
|
247 |
# user-defined CXXFLAGS |
248 |
if os.environ.has_key('CXXFLAGS'): |
249 |
env.Append(CXXFLAGS = SCons.Util.CLVar( os.environ['CXXFLAGS'] )) |
250 |
|
251 |
### embed SVN version into build |
252 |
build_rev = getSVNRevision() |
253 |
### Old way - causes everything to be rebuilt each time the SVN ver moves. :( |
254 |
#if build_rev != '': |
255 |
# env.Append(CXXFLAGS = '-DBUILD_REV=\\"' + build_rev + '\\"') |
256 |
### Put version info into a file, so it doesn't force a rebuild of everything :) |
257 |
f = open("../.mixxx_version.svn","w") |
258 |
try: |
259 |
f.write('#define BUILD_REV "' + build_rev + '"\n') |
260 |
finally: |
261 |
f.close() |
150 |
|
262 |
|
151 |
#Mixxx sources to build |
263 |
#Mixxx sources to build |
152 |
sources = Split("""enginebuffercue.cpp input.cpp mixxxmenuplaylists.cpp trackplaylistlist.cpp mixxxkeyboard.cpp configobject.cpp controlobjectthread.cpp |
264 |
sources = Split("""enginebuffercue.cpp input.cpp mixxxmenuplaylists.cpp trackplaylistlist.cpp mixxxkeyboard.cpp configobject.cpp controlobjectthread.cpp |
Lines 226-231
Link Here
|
226 |
|
339 |
|
227 |
#Check for OpenGL (it's messy to do it for all three platforms) |
340 |
#Check for OpenGL (it's messy to do it for all three platforms) |
228 |
CheckOpenGL() |
341 |
CheckOpenGL() |
|
|
342 |
|
343 |
#Check if FFMPEG was enabled |
344 |
CheckFFMPEG(conf, sources) |
229 |
|
345 |
|
230 |
#Platform-specific checks for Linux and Win32... |
346 |
#Platform-specific checks for Linux and Win32... |
231 |
if platform == 'linux' or platform == 'win32': |
347 |
if platform == 'linux' or platform == 'win32': |
Lines 247-253
Link Here
|
247 |
if os.system("which g++ > /dev/null"): #Checks for non-zero return code |
363 |
if os.system("which g++ > /dev/null"): #Checks for non-zero return code |
248 |
print "Did not find gcc/g++, exiting!" |
364 |
print "Did not find gcc/g++, exiting!" |
249 |
Exit(1) |
365 |
Exit(1) |
250 |
|
366 |
|
251 |
#Check for pkg-config |
367 |
#Check for pkg-config |
252 |
if not conf.CheckForPKGConfig('0.15.0'): |
368 |
if not conf.CheckForPKGConfig('0.15.0'): |
253 |
print 'pkg-config >= 0.15.0 not found.' |
369 |
print 'pkg-config >= 0.15.0 not found.' |
Lines 272-279
Link Here
|
272 |
Exit(1) |
388 |
Exit(1) |
273 |
|
389 |
|
274 |
#Check for libdjconsole, if it was passed as a flag |
390 |
#Check for libdjconsole, if it was passed as a flag |
275 |
flags_djconsole = ARGUMENTS.get('djconsole', 0) |
391 |
flags_djconsole = getFlags(env, 'djconsole', 0) |
276 |
flags_djconsole_legacy = ARGUMENTS.get('djconsole_legacy', 0) |
392 |
flags_djconsole_legacy = getFlags(env, 'djconsole_legacy', 0) |
277 |
if int(flags_djconsole): |
393 |
if int(flags_djconsole): |
278 |
if not conf.CheckLibWithHeader('djconsole', 'libdjconsole/djconsole.h', 'C++'): |
394 |
if not conf.CheckLibWithHeader('djconsole', 'libdjconsole/djconsole.h', 'C++'): |
279 |
print "Did not find libdjconsole or it\'s development headers, exiting!" |
395 |
print "Did not find libdjconsole or it\'s development headers, exiting!" |
Lines 401-406
Link Here
|
401 |
env.Uic4('dlgbpmschemedlg.ui') |
517 |
env.Uic4('dlgbpmschemedlg.ui') |
402 |
env.Uic4('dlgbpmtapdlg.ui') |
518 |
env.Uic4('dlgbpmtapdlg.ui') |
403 |
env.Uic4('dlgprefvinyldlg.ui') |
519 |
env.Uic4('dlgprefvinyldlg.ui') |
|
|
520 |
env.Uic4('dlgprefrecorddlg.ui') |
404 |
env.Uic4('dlgaboutdlg.ui') |
521 |
env.Uic4('dlgaboutdlg.ui') |
405 |
|
522 |
|
406 |
#Add the QRC file which compiles in some extra resources (prefs icons, etc.) |
523 |
#Add the QRC file which compiles in some extra resources (prefs icons, etc.) |
Lines 456-462
Link Here
|
456 |
|
573 |
|
457 |
|
574 |
|
458 |
#Parse command-line build flags |
575 |
#Parse command-line build flags |
459 |
|
576 |
build_flags = "" |
460 |
|
577 |
|
461 |
print "\nFeatures Summary:\n================" |
578 |
print "\nFeatures Summary:\n================" |
462 |
|
579 |
|
Lines 478-509
Link Here
|
478 |
#Hercules support through libdjconsole on Linux |
595 |
#Hercules support through libdjconsole on Linux |
479 |
#(handled somewhere else above this in the file... |
596 |
#(handled somewhere else above this in the file... |
480 |
# just printing the summary here) |
597 |
# just printing the summary here) |
481 |
flags_djconsole = ARGUMENTS.get('djconsole', 0) |
598 |
flags_djconsole = getFlags(env, 'djconsole', 0) |
482 |
if int(flags_djconsole) == 0: |
599 |
if int(flags_djconsole) == 0: |
483 |
print "libdjconsole support... disabled" |
600 |
print "libdjconsole support... disabled" |
484 |
else: |
601 |
else: |
485 |
print "libdjconsole support... enabled" |
602 |
print "libdjconsole support... enabled" |
|
|
603 |
build_flags += 'djconsole ' |
486 |
|
604 |
|
487 |
#High quality EQs |
605 |
#High quality EQs |
488 |
flags_hifieq = ARGUMENTS.get('hifieq', 1) |
606 |
flags_hifieq = getFlags(env, 'hifieq', 1) |
489 |
if int(flags_hifieq) == 0: |
607 |
if int(flags_hifieq) == 0: |
490 |
env.Append(CXXFLAGS = '-D__LOFI__ -D__NO_INTTYPES__') #Enables old crappy EQs |
608 |
env.Append(CXXFLAGS = '-D__LOFI__ -D__NO_INTTYPES__') #Enables old crappy EQs |
491 |
print "High quality EQs... disabled" |
609 |
print "High quality EQs... disabled" |
492 |
else: |
610 |
else: |
493 |
print "High quality EQs... enabled" |
611 |
print "High quality EQs... enabled" |
494 |
|
612 |
build_flags += 'hifieq ' |
495 |
#Experimental Recording |
|
|
496 |
flags_experimentalrecording = ARGUMENTS.get('experimentalrecord', 0) |
497 |
if int(flags_experimentalrecording): |
498 |
env.Append(CXXFLAGS = '-D__EXPERIMENTAL_RECORDING__') |
499 |
env.Uic4('dlgprefrecorddlg.ui') |
500 |
sources += Split(""" dlgprefrecord.cpp enginerecord.cpp writeaudiofile.cpp """ ) |
501 |
print "Experimental recording... enabled" |
502 |
else: |
503 |
print "Experimental recording... disabled" |
504 |
|
613 |
|
505 |
#Case Metrics |
614 |
#Case Metrics |
506 |
flags_cmetrics = ARGUMENTS.get('cmetrics', 0) |
615 |
flags_cmetrics = getFlags(env, 'cmetrics', 0) |
507 |
if int(flags_cmetrics): |
616 |
if int(flags_cmetrics): |
508 |
env.Append(CXXFLAGS = '-D__C_METRICS__') |
617 |
env.Append(CXXFLAGS = '-D__C_METRICS__') |
509 |
if platform == 'win32': |
618 |
if platform == 'win32': |
Lines 515-525
Link Here
|
515 |
env.Append(CPPPATH='../../lib/cmetrics') |
624 |
env.Append(CPPPATH='../../lib/cmetrics') |
516 |
sources += SConscript('../../lib/cmetrics/SConscript') |
625 |
sources += SConscript('../../lib/cmetrics/SConscript') |
517 |
print "Case Metrics profiling... enabled" |
626 |
print "Case Metrics profiling... enabled" |
|
|
627 |
build_flags += 'cmetrics ' |
518 |
else: |
628 |
else: |
519 |
print "Case Metrics profiling... disabled" |
629 |
print "Case Metrics profiling... disabled" |
520 |
|
630 |
|
521 |
#Experimental Shoutcast |
631 |
#Experimental Shoutcast |
522 |
flags_shoutcast = ARGUMENTS.get('shoutcast', 0) |
632 |
flags_shoutcast = getFlags(env, 'shoutcast', 0) |
523 |
if int(flags_shoutcast): |
633 |
if int(flags_shoutcast): |
524 |
#TODO: check for libshout |
634 |
#TODO: check for libshout |
525 |
env.Append(LIBS = 'shout'); |
635 |
env.Append(LIBS = 'shout'); |
Lines 528-548
Link Here
|
528 |
sources += Split(""" dlgprefshoutcast.cpp engineshoutcast.cpp encodervorbis.cpp """ ) |
638 |
sources += Split(""" dlgprefshoutcast.cpp engineshoutcast.cpp encodervorbis.cpp """ ) |
529 |
env.Uic4('dlgprefshoutcastdlg.ui') |
639 |
env.Uic4('dlgprefshoutcastdlg.ui') |
530 |
print "Shoutcast support... enabled" |
640 |
print "Shoutcast support... enabled" |
|
|
641 |
build_flags += 'shoutcast ' |
531 |
else: |
642 |
else: |
532 |
print "Shoutcast support... disabled" |
643 |
print "Shoutcast support... disabled" |
533 |
|
644 |
|
534 |
#LADSPA |
645 |
#LADSPA |
535 |
#TODO: Make sure we check for ladspa.h and the library... |
646 |
#TODO: Make sure we check for ladspa.h and the library... |
536 |
flags_ladspa = ARGUMENTS.get('ladspa', 0) |
647 |
flags_ladspa = getFlags(env, 'ladspa', 0) |
537 |
if int(flags_ladspa): |
648 |
if int(flags_ladspa): |
538 |
env.Append(CXXFLAGS = '-D__LADSPA__') |
649 |
env.Append(CXXFLAGS = '-D__LADSPA__') |
539 |
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""") |
650 |
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""") |
540 |
print "LADSPA support... enabled" |
651 |
print "LADSPA support... enabled" |
|
|
652 |
build_flags += 'ladspa ' |
541 |
else: |
653 |
else: |
542 |
print "LADSPA support... disabled" |
654 |
print "LADSPA support... disabled" |
543 |
|
655 |
|
544 |
#Vinyl Control |
656 |
#Vinyl Control |
545 |
flags_vinylcontrol = ARGUMENTS.get('vinylcontrol', 1) |
657 |
flags_vinylcontrol = getFlags(env, 'vinylcontrol', 1) |
546 |
if int(flags_vinylcontrol): |
658 |
if int(flags_vinylcontrol): |
547 |
env.Append(CXXFLAGS = '-D__VINYLCONTROL__') |
659 |
env.Append(CXXFLAGS = '-D__VINYLCONTROL__') |
548 |
sources += Split(""" vinylcontrol.cpp vinylcontrolproxy.cpp vinylcontrolscratchlib.cpp vinylcontrolxwax.cpp dlgprefvinyl.cpp |
660 |
sources += Split(""" vinylcontrol.cpp vinylcontrolproxy.cpp vinylcontrolscratchlib.cpp vinylcontrolxwax.cpp dlgprefvinyl.cpp |
Lines 555-578
Link Here
|
555 |
env.Append(CPPPATH='../../lib/scratchlib') |
667 |
env.Append(CPPPATH='../../lib/scratchlib') |
556 |
sources += Split("""../../lib/scratchlib/DAnalyse.cpp """) |
668 |
sources += Split("""../../lib/scratchlib/DAnalyse.cpp """) |
557 |
print "Vinyl Control... enabled" |
669 |
print "Vinyl Control... enabled" |
|
|
670 |
build_flags += 'vinylcontrol ' |
558 |
else: |
671 |
else: |
559 |
print "Vinyl Control... disabled" |
672 |
print "Vinyl Control... disabled" |
560 |
|
673 |
|
561 |
flags_msvcdebug = ARGUMENTS.get('msvcdebug', 1) |
674 |
flags_msvcdebug = getFlags(env, 'msvcdebug', 1) |
562 |
if int(flags_msvcdebug) and platform == 'win32': |
675 |
if int(flags_msvcdebug) and platform == 'win32': |
563 |
env.Append(LINKFLAGS = '/DEBUG') |
676 |
env.Append(LINKFLAGS = '/DEBUG') |
564 |
env.Append(CXXFLAGS = '/ZI') |
677 |
env.Append(CXXFLAGS = '/ZI') |
565 |
print "MSVC Debugging... enabled" |
678 |
print "MSVC Debugging... enabled" |
|
|
679 |
build_flags += 'msvcdebug ' |
566 |
else: |
680 |
else: |
567 |
print "MSVC Debugging... disabled" |
681 |
print "MSVC Debugging... disabled" |
568 |
|
682 |
|
569 |
flags_script = ARGUMENTS.get('script', 0) |
683 |
flags_script = getFlags(env, 'script', 0) |
570 |
if int(flags_script): |
684 |
if int(flags_script): |
571 |
if platform == 'win32': |
685 |
if platform == 'win32': |
572 |
env.Append(LIBS = 'QtScript4') |
686 |
env.Append(LIBS = 'QtScript4') |
573 |
else: |
687 |
else: |
574 |
env.Append(LIBS = 'QtScript') |
688 |
env.Append(LIBS = 'QtScript') |
575 |
print "SuperCoolAwesomeScript (name contest pending)... enabled" |
689 |
print "SuperCoolAwesomeScript (name contest pending)... enabled" |
|
|
690 |
build_flags += 'script ' |
576 |
sources += Split("""script/scriptengine.cpp script/scriptcontrolqueue.cpp |
691 |
sources += Split("""script/scriptengine.cpp script/scriptcontrolqueue.cpp |
577 |
script/scriptstudio.cpp script/scriptrecorder.cpp |
692 |
script/scriptstudio.cpp script/scriptrecorder.cpp |
578 |
script/playinterface.cpp script/macro.cpp |
693 |
script/playinterface.cpp script/macro.cpp |
Lines 591-599
Link Here
|
591 |
|
706 |
|
592 |
#Optimization |
707 |
#Optimization |
593 |
if platform == 'win32': |
708 |
if platform == 'win32': |
594 |
flags_optimize = ARGUMENTS.get('optimize', 0) #Default to off on win32 |
709 |
flags_optimize = getFlags(env, 'optimize', 0) #Default to off on win32 |
595 |
else: |
710 |
else: |
596 |
flags_optimize = ARGUMENTS.get('optimize', 1) #Default to on for Linux/OS X |
711 |
flags_optimize = getFlags(env, 'optimize', 1) #Default to on for Linux/OS X |
597 |
if int(flags_optimize): |
712 |
if int(flags_optimize): |
598 |
if platform == 'win32': |
713 |
if platform == 'win32': |
599 |
if int(flags_msvcdebug): |
714 |
if int(flags_msvcdebug): |
Lines 604-609
Link Here
|
604 |
env.Append(LINKFLAGS = '/LTCG:STATUS') |
719 |
env.Append(LINKFLAGS = '/LTCG:STATUS') |
605 |
else: |
720 |
else: |
606 |
print "Optimizations... enabled" |
721 |
print "Optimizations... enabled" |
|
|
722 |
build_flags += 'optimize=' + str(flags_optimize) + ' ' |
607 |
if flags_optimize=='1': |
723 |
if flags_optimize=='1': |
608 |
env.Append(CXXFLAGS = '-O3') |
724 |
env.Append(CXXFLAGS = '-O3') |
609 |
elif flags_optimize=='2': |
725 |
elif flags_optimize=='2': |
Lines 619-698
Link Here
|
619 |
print "Optimizations... disabled" |
735 |
print "Optimizations... disabled" |
620 |
|
736 |
|
621 |
|
737 |
|
622 |
#ffmpeg support |
738 |
|
623 |
flags_ffmpeg = ARGUMENTS.get('ffmpeg', 0) |
|
|
624 |
if int(flags_ffmpeg): |
625 |
env.Append(LIBS = 'avcodec') |
626 |
env.Append(LIBS = 'avformat') |
627 |
env.Append(LIBS = 'z') |
628 |
env.Append(LIBS = 'a52') |
629 |
env.Append(LIBS = 'dts') |
630 |
env.Append(LIBS = 'gsm') |
631 |
env.Append(LIBS = 'dc1394_control') |
632 |
env.Append(LIBS = 'dl') |
633 |
env.Append(LIBS = 'vorbisenc') |
634 |
env.Append(LIBS = 'raw1394') |
635 |
env.Append(LIBS = 'avutil') |
636 |
env.Append(LIBS = 'vorbis') |
637 |
env.Append(LIBS = 'm') |
638 |
env.Append(LIBS = 'ogg') |
639 |
env.Append(CXXFLAGS = '-D__FFMPEGFILE__') |
640 |
sources += Split("""soundsourceffmpeg.cpp """) |
641 |
print "Not working FFMPEG support... enabled" |
642 |
else: |
643 |
print "Not working FFMPEG support... disabled" |
644 |
|
739 |
|
645 |
# Profiling and Optimization |
740 |
# Profiling and Optimization |
646 |
if not platform == 'win32': |
741 |
if not platform == 'win32': |
647 |
flags_gprof = ARGUMENTS.get('gprof', 0) |
742 |
flags_gprof = getFlags(env, 'gprof', 0) |
648 |
if int(flags_gprof): |
743 |
if int(flags_gprof): |
649 |
env.Append(CCFLAGS = '-pg') |
744 |
env.Append(CCFLAGS = '-pg') |
650 |
env.Append(LINKFLAGS = '-pg') |
745 |
env.Append(LINKFLAGS = '-pg') |
651 |
print "gprof profiling support... enabled" |
746 |
print "gprof profiling support... enabled" |
|
|
747 |
build_flags += 'gprof ' |
652 |
else: |
748 |
else: |
653 |
print "gprof profiling support... disabled" |
749 |
print "gprof profiling support... disabled" |
654 |
flags_tuned = ARGUMENTS.get('tuned', 0) |
750 |
flags_tuned = getFlags(env, 'tuned', 0) |
655 |
if int(flags_tuned): |
751 |
if int(flags_tuned): |
656 |
ccv = env['CCVERSION'].split('.') |
752 |
ccv = env['CCVERSION'].split('.') |
657 |
if int(ccv[0]) >= 4 and int(ccv[1]) >= 2: |
753 |
if int(ccv[0]) >= 4 and int(ccv[1]) >= 2: |
658 |
env.Append(CCFLAGS = '-march=native') |
754 |
env.Append(CCFLAGS = '-march=native') |
659 |
env.Append(LINKFLAGS = '-march=native') |
755 |
env.Append(LINKFLAGS = '-march=native') |
660 |
print "Optimizing for this CPU... yes" |
756 |
print "Optimizing for this CPU... yes" |
|
|
757 |
build_flags += 'tuned ' |
661 |
else: |
758 |
else: |
662 |
print "Optimizing for this CPU... no (requires gcc >= 4.2.0)" |
759 |
print "Optimizing for this CPU... no (requires gcc >= 4.2.0)" |
663 |
else: |
760 |
else: |
664 |
print "Optimizing for this CPU... no" |
761 |
print "Optimizing for this CPU... no" |
665 |
|
762 |
|
666 |
#Visual Studio 2005 hacks (MSVS Express Edition users shouldn't enable this) |
763 |
#Visual Studio 2005 hacks (MSVS Express Edition users shouldn't enable this) |
667 |
flags_msvshacks = ARGUMENTS.get('msvshacks', 0) |
764 |
flags_msvshacks = getFlags(env, 'msvshacks', 0) |
668 |
if int(flags_msvshacks): |
765 |
if int(flags_msvshacks): |
669 |
env.Append(CXXFLAGS = '-D__MSVS2005__') |
766 |
env.Append(CXXFLAGS = '-D__MSVS2005__') |
670 |
print "MSVS 2005 hacks... enabled" |
767 |
print "MSVS 2005 hacks... enabled" |
|
|
768 |
build_flags += 'msvshacks ' |
671 |
else: |
769 |
else: |
672 |
print "MSVS 2005 hacks... disabled" |
770 |
print "MSVS 2005 hacks... disabled" |
673 |
|
771 |
|
674 |
print "================\n" |
772 |
print "================\n" |
675 |
|
773 |
|
676 |
#Hijack scons -h and --help |
774 |
### Put flags info into a file |
677 |
opts = Options('custom.py') |
775 |
f = open("../.mixxx_flags.svn","w") |
678 |
opts.Add('prefix', 'Set to your install prefix', '/usr/local') |
776 |
try: |
679 |
opts.Add('qtdir', 'Set to your QT4 directory', '/usr/share/qt4') |
777 |
f.write('#define BUILD_FLAGS "' + build_flags + '"\n') |
680 |
opts.Add('djconsole', 'Set to 1 to enable Hercules support through libdjconsole', 0) |
778 |
finally: |
681 |
opts.Add('djconsole_legacy', 'Set to 1 to enable legacy Hercules support (for Hercules MP3 Control only, not MK2', 0) |
779 |
f.close() |
682 |
opts.Add('experimentalrecord', '(EXPERIMENTAL) Set to 1 to enable output recording feature', 0) |
780 |
|
683 |
opts.Add('hifieq', 'Set to 1 to enable high quality EQs', 1) |
|
|
684 |
opts.Add('ladspa', '(EXPERIMENTAL) Set to 1 to enable LADSPA plugin support', 0) |
685 |
opts.Add('ffmpeg', '(EXPERIMENTAL) Set to 1 to enable FFMPEG support', 0) |
686 |
opts.Add('vinylcontrol', 'Set to 1 to enable vinyl control support', 1) |
687 |
opts.Add('msvshacks', 'Set to 1 to build properly with MS Visual Studio 2005 (Express users should leave this off)', 0) |
688 |
opts.Add('cmetrics', 'Set to 1 to enable crash reporting/usage statistics via Case Metrics (This should be disabled on development builds)', 0) |
689 |
opts.Add('optimize', 'Set to 1 to enable -O3 compiler optimizations. Set to 2 to enable Pentium 4 optimizations.', 1) |
690 |
if not platform == 'win32': |
691 |
opts.Add('gprof', '(DEVELOPER) Set to 1 to enable profiling using gprof', 0) |
692 |
opts.Add('tuned', '(EXPERIMENTAL) Set to 1 to optimise mixxx for this CPU', 0) |
693 |
#env = Environment(options = opts) |
694 |
Help(opts.GenerateHelpText(env)) |
695 |
|
781 |
|
|
|
782 |
#Save the options to cache |
783 |
opts.Save(cachefile, env) |
696 |
|
784 |
|
697 |
#Tell SCons to build Mixxx |
785 |
#Tell SCons to build Mixxx |
698 |
#========================= |
786 |
#========================= |