1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714
|
# -*- coding: utf-8 -*-
import os
import util
from mixxx import Dependence, Feature
import SCons.Script as SCons
class PortAudio(Dependence):
def configure(self, build, conf):
if not conf.CheckLib('portaudio'):
raise Exception('Did not find libportaudio.a, portaudio.lib, or the PortAudio-v19 development header files.')
#Turn on PortAudio support in Mixxx
build.env.Append(CPPDEFINES = '__PORTAUDIO__');
def sources(self, build):
return ['sounddeviceportaudio.cpp']
class PortMIDI(Dependence):
def configure(self, build, conf):
#Check for PortTime
if not conf.CheckLib(['porttime', 'libporttime']) and \
not conf.CheckHeader(['porttime.h']):
raise Exception("Did not find PortTime or its development headers.")
if not conf.CheckLib(['portmidi', 'libportmidi']) and \
not conf.CheckHeader(['portmidi.h']):
raise Exception('Did not find PortMidi or its development headers.')
def sources(self, build):
return ['midi/portmidienumerator.cpp', 'midi/midideviceportmidi.cpp']
class OpenGL(Dependence):
def configure(self, build, conf):
# Check for OpenGL (it's messy to do it for all three platforms) XXX
# this should *NOT* have hardcoded paths like this
if (not conf.CheckLib('GL') and
not conf.CheckLib('opengl32') and
not conf.CheckCHeader('/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/gl.h') and
not conf.CheckCHeader('GL/gl.h')):
raise Exception('Did not find OpenGL development files, exiting!')
if (not conf.CheckLib('GLU') and
not conf.CheckLib('glu32') and
not conf.CheckCHeader('/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/glu.h')):
raise Exception('Did not find GLU development files, exiting!')
if build.platform_is_osx:
build.env.Append(CPPPATH='/Library/Frameworks/OpenGL.framework/Headers/')
build.env.Append(LINKFLAGS='-framework OpenGL')
class OggVorbis(Dependence):
def configure(self, build, conf):
# if build.platform_is_windows and build.machine_is_64bit:
# For some reason this has to be checked this way on win64,
# otherwise it looks for the dll lib which will cause a conflict
# later
# if not conf.CheckLib('vorbisfile_static'):
# raise Exception('Did not find vorbisfile_static.lib or the libvorbisfile development headers.')
# else:
if not conf.CheckLib(['libvorbisfile', 'vorbisfile']):
Exception('Did not find libvorbisfile.a, libvorbisfile.lib, '
'or the libvorbisfile development headers.')
if not conf.CheckLib(['libvorbis', 'vorbis']):
raise Exception('Did not find libvorbis.a, libvorbis.lib, or the libvorbisfile development headers.')
if not conf.CheckLib(['libogg', 'ogg']):
raise Exception('Did not find libogg.a, libogg.lib, or the libogg development headers, exiting!')
def sources(self, build):
return ['soundsourceoggvorbis.cpp']
class SndFile(Dependence):
def configure(self, build, conf):
#if not conf.CheckLibWithHeader(['sndfile', 'libsndfile'], 'sndfile.h', 'C'):
if not conf.CheckLib(['sndfile', 'libsndfile']):
raise Exception("Did not find libsndfile or it\'s development headers, exiting!")
build.env.Append(CPPDEFINES = '__SNDFILE__')
def sources(self, build):
return ['soundsourcesndfile.cpp']
class FLAC(Dependence):
def configure(self, build, conf):
if not conf.CheckHeader('FLAC/stream_decoder.h'):
raise Exception('Did not find libFLAC development headers, exiting!')
elif not conf.CheckLib(['libFLAC', 'FLAC']):
raise Exception('Did not find libFLAC development libraries, exiting!')
return
def sources(self, build):
return ['soundsourceflac.cpp',]
class Qt(Dependence):
DEFAULT_QTDIRS = {'linux': '/usr/share/qt4',
'bsd': '/usr/local/lib/qt4',
'osx': '/Library/Frameworks',
'windows': 'C:\\qt\\4.6.0'}
def satisfy(self):
pass
def configure(self, build, conf):
# Emit various Qt defines
build.env.Append(CPPDEFINES = ['QT_SHARED',
'QT_TABLET_SUPPORT'])
# Enable Qt include paths
if build.platform_is_linux:
if not conf.CheckForPKG('QtCore', '4.6'):
raise Exception('QT >= 4.6 not found')
#Try using David's qt4.py's Qt4-module finding thingy instead of pkg-config.
#(This hopefully respects our qtdir=blah flag while linking now.)
build.env.EnableQt4Modules(['QtCore',
'QtGui',
'QtOpenGL',
'QtXml',
'QtSvg',
'QtSql',
'QtScript',
'QtXmlPatterns',
'QtWebKit'
#'QtUiTools',
#'QtDesigner',
],
debug=False)
elif build.platform_is_osx:
build.env.Append(LINKFLAGS = '-framework QtCore -framework QtOpenGL -framework QtGui -framework QtSql -framework QtXml -framework QtXmlPatterns -framework QtNetwork -framework QtSql -framework QtScript -framework QtWebKit')
build.env.Append(CPPPATH = ['/Library/Frameworks/QtCore.framework/Headers/',
'/Library/Frameworks/QtOpenGL.framework/Headers/',
'/Library/Frameworks/QtGui.framework/Headers/',
'/Library/Frameworks/QtXml.framework/Headers/',
'/Library/Frameworks/QtNetwork.framework/Headers/',
'/Library/Frameworks/QtSql.framework/Headers/',
'/Library/Frameworks/QtWebKit.framework/Headers/',
'/Library/Frameworks/QtScript.framework/Headers/'])
# Setup Qt library includes for non-OSX
if build.platform_is_linux or build.platform_is_bsd:
build.env.Append(LIBS = 'QtXml')
build.env.Append(LIBS = 'QtGui')
build.env.Append(LIBS = 'QtCore')
build.env.Append(LIBS = 'QtNetwork')
build.env.Append(LIBS = 'QtOpenGL')
build.env.Append(LIBS = 'QtWebKit')
build.env.Append(LIBS = 'QtScript')
elif build.platform_is_windows:
build.env.Append(LIBPATH=['$QTDIR/lib'])
build.env.Append(LIBS = 'QtXml4')
build.env.Append(LIBS = 'QtXmlPatterns4')
build.env.Append(LIBS = 'QtSql4')
build.env.Append(LIBS = 'QtGui4')
build.env.Append(LIBS = 'QtCore4')
build.env.Append(LIBS = 'QtWebKit4')
build.env.Append(LIBS = 'QtNetwork4')
build.env.Append(LIBS = 'QtOpenGL4')
# Set Qt include paths for non-OSX
if not build.platform_is_osx:
build.env.Append(CPPPATH=['$QTDIR/include/QtCore',
'$QTDIR/include/QtGui',
'$QTDIR/include/QtXml',
'$QTDIR/include/QtNetwork',
'$QTDIR/include/QtSql',
'$QTDIR/include/QtOpenGL',
'$QTDIR/include/QtWebKit',
'$QTDIR/include/Qt'])
# Set the rpath for linux/bsd/osx.
# This is not support on OS X before the 10.5 SDK.
using_104_sdk = (str(build.env["CCFLAGS"]).find("10.4") >= 0)
compiling_on_104 = False
if build.platform_is_osx:
compiling_on_104 = (os.popen('sw_vers').readlines()[1].find('10.4') >= 0)
#QtSQLite DLL
if build.platform_is_windows:
build.flags['sqlitedll'] = util.get_flags(build.env, 'sqlitedll', 1)
class FidLib(Dependence):
def sources(self, build):
symbol = None
if build.platform_is_windows:
if build.toolchain_is_msvs:
symbol = 'T_MSVC'
elif build.crosscompile:
# Not sure why, but fidlib won't build with mingw32msvc and
# T_MINGW
symbol = 'T_LINUX'
elif build.toolchain_is_gnu:
symbol = 'T_MINGW'
else:
symbol = 'T_LINUX'
return [build.env.StaticObject('#lib/fidlib-0.9.9/fidlib.c',
CPPDEFINES=symbol)]
def configure(self, build, conf):
build.env.Append(CPPPATH='#lib/fidlib-0.9.9/')
class KissFFT(Dependence):
def sources(self, build):
return ["#lib/kissfft/kiss_fft.c"]
def configure(self, build, conf):
build.env.Append(CPPPATH="#lib/kissfft")
class ReplayGain(Dependence):
def sources(self, build):
return ["#lib/replaygain/replaygain.cpp"]
def configure(self, build, conf):
build.env.Append(CPPPATH="#lib/replaygain")
class SoundTouch(Dependence):
def sources(self, build):
sources = ['engine/enginebufferscalest.cpp']
return sources
def configure(self, build, conf):
if not conf.CheckLib(['SoundTouch','libSoundTouch']):
raise Exception('Did not find libSoundTouch.a, libSoundTouch.lib, or the libSoundTouch development header files - exiting!')
build.env.Append(CPPPATH=[SCons.ARGUMENTS.get('prefix', '/usr/local') + '/include/soundtouch'])
build.env.Append(LIBS='SoundTouch')
# TODO(XXX) when we figure out a better way to represent features, fix
# this.
optimize = int(util.get_flags(build.env, 'optimize', 1))
if build.machine_is_64bit or \
(build.toolchain_is_msvs and optimize > 1) or \
(build.toolchain_is_gnu and optimize > 2):
build.env.Append(CPPDEFINES='ALLOW_X86_OPTIMIZATIONS')
class TagLib(Dependence):
def configure(self, build, conf):
if not conf.CheckLib('tag'):
raise Exception("Could not find libtag or its development headers.")
# Karmic seems to have an issue with mp4tag.h where they don't include
# the files correctly. Adding this folder ot the include path should fix
# it, though might cause issues. This is safe to remove once we
# deprecate Karmic support. rryan 2/2011
build.env.Append(CPPPATH='/usr/include/taglib/')
class MixxxCore(Feature):
def description(self):
return "Mixxx Core Features"
def enabled(self, build):
return True
def sources(self, build):
sources = ["mixxxkeyboard.cpp",
"configobject.cpp",
"controlobjectthread.cpp",
"controlobjectthreadwidget.cpp",
"controlobjectthreadmain.cpp",
"controlevent.cpp",
"controllogpotmeter.cpp",
"controlobject.cpp",
"controlnull.cpp",
"controlpotmeter.cpp",
"controlpushbutton.cpp",
"controlttrotary.cpp",
"controlbeat.cpp",
"dlgpreferences.cpp",
"dlgprefsound.cpp",
"dlgprefsounditem.cpp",
"dlgprefmidibindings.cpp",
"dlgprefplaylist.cpp",
"dlgprefnomidi.cpp",
"dlgprefcontrols.cpp",
"dlgprefbpm.cpp",
"dlgprefreplaygain.cpp",
"dlgprefnovinyl.cpp",
"dlgbpmscheme.cpp",
"dlgabout.cpp",
"dlgprefeq.cpp",
"dlgprefcrossfader.cpp",
"dlgmidilearning.cpp",
"dlgtrackinfo.cpp",
"dlgprepare.cpp",
"dlgautodj.cpp",
"engine/engineworker.cpp",
"engine/engineworkerscheduler.cpp",
"engine/syncworker.cpp",
"engine/enginebuffer.cpp",
"engine/enginebufferscale.cpp",
"engine/enginebufferscaledummy.cpp",
"engine/enginebufferscalelinear.cpp",
"engine/engineclipping.cpp",
"engine/enginefilterblock.cpp",
"engine/enginefilteriir.cpp",
"engine/enginefilter.cpp",
"engine/engineobject.cpp",
"engine/enginepregain.cpp",
"engine/enginechannel.cpp",
"engine/enginemaster.cpp",
"engine/enginedelay.cpp",
"engine/engineflanger.cpp",
"engine/enginevumeter.cpp",
"engine/enginevinylsoundemu.cpp",
"engine/enginesidechain.cpp",
"engine/enginefilterbutterworth8.cpp",
"engine/enginexfader.cpp",
"engine/enginemicrophone.cpp",
"engine/enginedeck.cpp",
"engine/enginepassthrough.cpp",
"engine/enginecontrol.cpp",
"engine/ratecontrol.cpp",
"engine/positionscratchcontroller.cpp",
"engine/loopingcontrol.cpp",
"engine/bpmcontrol.cpp",
"engine/cuecontrol.cpp",
"engine/quantizecontrol.cpp",
"engine/clockcontrol.cpp",
"engine/readaheadmanager.cpp",
"cachingreader.cpp",
"analyserrg.cpp",
"analyserqueue.cpp",
"analyserwavesummary.cpp",
"analyserbpm.cpp",
"analyserwaveform.cpp",
"midi/mididevice.cpp",
"midi/mididevicemanager.cpp",
"midi/midideviceenumerator.cpp",
"midi/midimapping.cpp",
"midi/midiinputmappingtablemodel.cpp",
"midi/midioutputmappingtablemodel.cpp",
"midi/midichanneldelegate.cpp",
"midi/midistatusdelegate.cpp",
"midi/midinodelegate.cpp",
"midi/midioptiondelegate.cpp",
"midi/midimessage.cpp",
"midi/midiledhandler.cpp",
"softtakeover.cpp",
"main.cpp",
"controlgroupdelegate.cpp",
"controlvaluedelegate.cpp",
"mixxxcontrol.cpp",
"mixxx.cpp",
"errordialoghandler.cpp",
"upgrade.cpp",
"soundsource.cpp",
"sharedglcontext.cpp",
"widget/wwidget.cpp",
"widget/wlabel.cpp",
"widget/wtracktext.cpp",
"widget/wnumber.cpp",
"widget/wnumberpos.cpp",
"widget/wnumberrate.cpp",
"widget/wknob.cpp",
"widget/wdisplay.cpp",
"widget/wvumeter.cpp",
"widget/wpushbutton.cpp",
"widget/wslidercomposed.cpp",
"widget/wslider.cpp",
"widget/wstatuslight.cpp",
"widget/woverview.cpp",
"widget/wspinny.cpp",
"widget/wskincolor.cpp",
"widget/wabstractcontrol.cpp",
"widget/wsearchlineedit.cpp",
"widget/wpixmapstore.cpp",
"widget/hexspinbox.cpp",
"widget/wtrackproperty.cpp",
"widget/wtime.cpp",
"mathstuff.cpp",
"rotary.cpp",
"widget/wtracktableview.cpp",
"widget/wtracktableviewheader.cpp",
"widget/wlibrarysidebar.cpp",
"widget/wlibrary.cpp",
"widget/wlibrarytableview.cpp",
"widget/wpreparelibrarytableview.cpp",
"widget/wpreparecratestableview.cpp",
"widget/wlibrarytextbrowser.cpp",
"library/preparecratedelegate.cpp",
"library/trackcollection.cpp",
"library/basesqltablemodel.cpp",
"library/basetrackcache.cpp",
"library/librarytablemodel.cpp",
"library/preparelibrarytablemodel.cpp",
"library/missingtablemodel.cpp",
"library/proxytrackmodel.cpp",
"library/playlisttablemodel.cpp",
"library/libraryfeature.cpp",
"library/preparefeature.cpp",
"library/autodjfeature.cpp",
"library/mixxxlibraryfeature.cpp",
"library/playlistfeature.cpp",
"library/browse/browsetablemodel.cpp",
"library/browse/browsethread.cpp",
"library/browse/browsefeature.cpp",
"library/browse/foldertreemodel.cpp",
"library/recording/recordingfeature.cpp",
"dlgrecording.cpp",
"recording/recordingmanager.cpp",
# External Library Features
"library/rhythmbox/rhythmboxfeature.cpp",
"library/rhythmbox/rhythmboxtrackmodel.cpp",
"library/rhythmbox/rhythmboxplaylistmodel.cpp",
"library/itunes/itunesfeature.cpp",
"library/itunes/itunestrackmodel.cpp",
"library/itunes/itunesplaylistmodel.cpp",
"library/traktor/traktorfeature.cpp",
"library/traktor/traktortablemodel.cpp",
"library/traktor/traktorplaylistmodel.cpp",
"library/cratefeature.cpp",
"library/sidebarmodel.cpp",
"library/libraryscanner.cpp",
"library/libraryscannerdlg.cpp",
"library/legacylibraryimporter.cpp",
"library/library.cpp",
"library/searchthread.cpp",
"library/dao/cratedao.cpp",
"library/cratetablemodel.cpp",
"library/dao/cuedao.cpp",
"library/dao/cue.cpp",
"library/dao/trackdao.cpp",
"library/dao/playlistdao.cpp",
"library/dao/libraryhashdao.cpp",
"library/dao/settingsdao.cpp",
"library/librarycontrol.cpp",
"library/schemamanager.cpp",
"library/promotracksfeature.cpp",
"library/featuredartistswebview.cpp",
"library/bundledsongswebview.cpp",
"library/songdownloader.cpp",
"library/starrating.cpp",
"library/stardelegate.cpp",
"library/stareditor.cpp",
"audiotagger.cpp",
"library/treeitemmodel.cpp",
"library/treeitem.cpp",
"xmlparse.cpp",
"library/parser.cpp",
"library/parserpls.cpp",
"library/parserm3u.cpp",
"bpm/bpmscheme.cpp",
"soundsourceproxy.cpp",
"widget/wvisualsimple.cpp",
"widget/wwaveformviewer.cpp",
"widget/wglwaveformviewer.cpp",
"waveformviewerfactory.cpp",
"waveform/renderobject.cpp",
"waveform/waveformrenderer.cpp",
"waveform/waveformrenderbackground.cpp",
"waveform/waveformrendersignal.cpp",
"waveform/waveformrendersignaltiles.cpp",
"waveform/waveformrendersignalpixmap.cpp",
"waveform/waveformrendermark.cpp",
"waveform/waveformrendermarkrange.cpp",
"waveform/waveformrenderbeat.cpp",
"skin/imginvert.cpp",
"skin/imgloader.cpp",
"skin/imgcolor.cpp",
"skin/skinloader.cpp",
"skin/legacyskinparser.cpp",
"skin/colorschemeparser.cpp",
"skin/propertybinder.cpp",
"sampleutil.cpp",
"trackinfoobject.cpp",
"track/beatgrid.cpp",
"track/beatmatrix.cpp",
"track/beatfactory.cpp",
"baseplayer.cpp",
"basetrackplayer.cpp",
"deck.cpp",
"sampler.cpp",
"playermanager.cpp",
"samplerbank.cpp",
"sounddevice.cpp",
"soundmanager.cpp",
"soundmanagerconfig.cpp",
"soundmanagerutil.cpp",
"dlgprefrecord.cpp",
"playerinfo.cpp",
"recording/enginerecord.cpp",
"recording/encoder.cpp",
"segmentation.cpp",
"tapfilter.cpp",
"util/pa_ringbuffer.c",
# Add the QRC file which compiles in some extra resources
# (prefs icons, etc.)
build.env.Qrc('#res/mixxx.qrc')
]
# Uic these guys (they're moc'd automatically after this) - Generates
# the code for the QT UI forms
build.env.Uic4('dlgpreferencesdlg.ui')
build.env.Uic4('dlgprefsounddlg.ui')
build.env.Uic4('dlgprefmidibindingsdlg.ui')
build.env.Uic4('dlgprefplaylistdlg.ui')
build.env.Uic4('dlgprefnomididlg.ui')
build.env.Uic4('dlgprefcontrolsdlg.ui')
build.env.Uic4('dlgprefeqdlg.ui')
build.env.Uic4('dlgprefcrossfaderdlg.ui')
build.env.Uic4('dlgprefbpmdlg.ui')
build.env.Uic4('dlgprefreplaygaindlg.ui')
build.env.Uic4('dlgbpmschemedlg.ui')
# build.env.Uic4('dlgbpmtapdlg.ui')
build.env.Uic4('dlgprefvinyldlg.ui')
build.env.Uic4('dlgprefnovinyldlg.ui')
build.env.Uic4('dlgprefrecorddlg.ui')
build.env.Uic4('dlgaboutdlg.ui')
build.env.Uic4('dlgmidilearning.ui')
build.env.Uic4('dlgtrackinfo.ui')
build.env.Uic4('dlgprepare.ui')
build.env.Uic4('dlgautodj.ui')
build.env.Uic4('dlgprefsounditem.ui')
build.env.Uic4('dlgrecording.ui')
if build.platform_is_windows:
# Add Windows resource file with icons and such
# force manifest file creation, apparently not necessary for all
# people but necessary for this committers handicapped windows
# installation -- bkgood
if build.toolchain_is_msvs:
build.env.Append(LINKFLAGS="/MANIFEST")
elif build.platform_is_osx:
build.env.Append(LINKFLAGS="-headerpad=ffff"); #Need extra room for code signing (App Store)
build.env.Append(LINKFLAGS="-headerpad_max_install_names"); #Need extra room for code signing (App Store)
return sources
def configure(self, build, conf):
# Evaluate this define. There are a lot of different things around the
# codebase that use different defines. (AMD64, x86_64, x86, i386, i686,
# EM64T). We need to unify them together.
if not build.machine=='alpha':
build.env.Append(CPPDEFINES=build.machine)
if build.toolchain_is_gnu:
# Default GNU Options
# TODO(XXX) always generate debugging info?
build.env.Append(CCFLAGS = '-pipe')
build.env.Append(CCFLAGS = '-Wall')
build.env.Append(CCFLAGS = '-Wextra')
build.env.Append(CCFLAGS = '-g')
# Check that g++ is present (yeah, SCONS is a bit dumb here)
if os.system("which g++ > /dev/null"): #Checks for non-zero return code
raise Exception("Did not find g++.")
elif build.toolchain_is_msvs:
# Validate the specified winlib directory exists
mixxx_lib_path = SCons.ARGUMENTS.get('winlib', '..\\..\\..\\mixxx-win32lib-msvc100-release')
if not os.path.exists(mixxx_lib_path):
print mixxx_lib_path
raise Exception("Winlib path does not exist! Please specify your winlib directory"
"path by running 'scons winlib=[path]'")
Script.Exit(1)
#mixxx_lib_path = '#/../../mixxx-win%slib-msvc100-release' % build.bitwidth
# Set include and library paths to work with this
build.env.Append(CPPPATH=mixxx_lib_path)
build.env.Append(LIBPATH=mixxx_lib_path)
#Ugh, MSVC-only hack :( see
#http://www.qtforum.org/article/17883/problem-using-qstring-fromstdwstring.html
build.env.Append(CXXFLAGS = '/Zc:wchar_t-')
# Still needed?
build.env.Append(CPPPATH=[
"$VCINSTALLDIR/include/atl",
"C:/Program Files/Microsoft Platform SDK/Include/atl"])
if build.platform_is_windows:
build.env.Append(CPPDEFINES='__WINDOWS__')
build.env.Append(CPPDEFINES='_ATL_MIN_CRT') #Helps prevent duplicate symbols
# Need this on Windows until we have UTF16 support in Mixxx
build.env.Append(CPPDEFINES='UNICODE')
build.env.Append(CPPDEFINES='WIN%s' % build.bitwidth) # WIN32 or WIN64
# Tobias: Don't remove this line
# I used the Windows API in foldertreemodel.cpp
# to quickly test if a folder has subfolders
build.env.Append(LIBS = 'shell32');
elif build.platform_is_linux:
build.env.Append(CPPDEFINES='__LINUX__')
#Check for pkg-config >= 0.15.0
if not conf.CheckForPKGConfig('0.15.0'):
raise Exception('pkg-config >= 0.15.0 not found.')
elif build.platform_is_osx:
#Stuff you may have compiled by hand
build.env.Append(LIBPATH = ['/usr/local/lib'])
build.env.Append(CPPPATH = ['/usr/local/include'])
#Non-standard libpaths for fink and certain (most?) darwin ports
build.env.Append(LIBPATH = ['/sw/lib'])
build.env.Append(CPPPATH = ['/sw/include'])
#Non-standard libpaths for darwin ports
build.env.Append(LIBPATH = ['/opt/local/lib'])
build.env.Append(CPPPATH = ['/opt/local/include'])
elif build.platform_is_bsd:
build.env.Append(CPPDEFINES='__BSD__')
build.env.Append(CPPPATH=['/usr/include',
'/usr/local/include',
'/usr/X11R6/include/'])
build.env.Append(LIBPATH=['/usr/lib/',
'/usr/local/lib',
'/usr/X11R6/lib'])
build.env.Append(LIBS='pthread')
# why do we need to do this on OpenBSD and not on Linux? if we
# don't then CheckLib("vorbisfile") fails
build.env.Append(LIBS=['ogg', 'vorbis'])
# Define for things that would like to special case UNIX (Linux or BSD)
if build.platform_is_bsd or build.platform_is_linux:
build.env.Append(CPPDEFINES='__UNIX__')
# Add the src/ directory to the include path
build.env.Append(CPPPATH = ['.'])
# Set up flags for config/track listing files
if build.platform_is_linux or \
build.platform_is_bsd:
mixxx_files = [
('SETTINGS_PATH','.mixxx/'),
('BPMSCHEME_FILE','mixxxbpmscheme.xml'),
('SETTINGS_FILE', 'mixxx.cfg'),
('TRACK_FILE', 'mixxxtrack.xml')]
elif build.platform_is_osx:
mixxx_files = [
('SETTINGS_PATH','Library/Application Support/Mixxx/'),
('BPMSCHEME_FILE','mixxxbpmscheme.xml'),
('SETTINGS_FILE', 'mixxx.cfg'),
('TRACK_FILE', 'mixxxtrack.xml')]
elif build.platform_is_windows:
mixxx_files = [
('SETTINGS_PATH','Local Settings/Application Data/Mixxx/'),
('BPMSCHEME_FILE', 'mixxxbpmscheme.xml'),
('SETTINGS_FILE', 'mixxx.cfg'),
('TRACK_FILE', 'mixxxtrack.xml')]
# Escape the filenames so they don't end up getting screwed up in the
# shell.
mixxx_files = [(k, r'\"%s\"' % v) for k,v in mixxx_files]
build.env.Append(CPPDEFINES=mixxx_files)
# Say where to find resources on Unix. TODO(XXX) replace this with a
# RESOURCE_PATH that covers Win and OSX too:
if build.platform_is_linux or build.platform_is_bsd:
share_path = os.path.join(SCons.ARGUMENTS.get('prefix', '/usr/local'), 'share/mixxx')
build.env.Append(CPPDEFINES=('UNIX_SHARE_PATH', r'\"%s\"' % share_path))
def depends(self, build):
return [SoundTouch, KissFFT, ReplayGain, PortAudio, PortMIDI, Qt,
FidLib, SndFile, FLAC, OggVorbis, OpenGL, TagLib,]
def post_dependency_check_configure(self, build, conf):
"""Sets up additional things in the Environment that must happen
after the Configure checks run."""
if build.platform_is_windows:
if build.toolchain_is_msvs:
build.env.Append(LINKFLAGS = ['/nodefaultlib:LIBCMT.lib',
'/nodefaultlib:LIBCMTd.lib',
'/entry:mainCRTStartup'])
# Makes the program not launch a shell first
build.env.Append(LINKFLAGS = '/subsystem:windows')
build.env.Append(LINKFLAGS = '/manifest') #Force MSVS to generate a manifest (MSVC2010)
elif build.toolchain_is_gnu:
# Makes the program not launch a shell first
build.env.Append(LINKFLAGS = '--subsystem,windows')
build.env.Append(LINKFLAGS = '-mwindows')
|