Changeset 1503

Show
Ignore:
Timestamp:
12/07/08 10:24:30 (12 years ago)
Author:
arnonym
Message:

Backport the relevant changes of the trunk SConscript.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/libffado-2.0/SConstruct

    r1480 r1503  
    4040else: 
    4141        build_base='' 
    42  
    43 destdir = ARGUMENTS.get( 'DESTDIR', "" ) 
    4442 
    4543if not os.path.isdir( "cache" ): 
     
    269267        env.Replace(CFLAGS=oldcf) 
    270268 
    271        
    272        # Optional checks follow: 
    273        
    274  
    275        # PyQT checks 
    276        build_mixer = False 
    277        if conf.CheckForApp( 'which pyuic4' ) and conf.CheckForPyModule( 'dbus' ) and conf.CheckForPyModule( 'PyQt4' ) and conf.CheckForPyModule( 'dbus.mainloop.qt' ): 
    278                env['PYUIC4'] = True 
    279                build_mixer = True 
    280          
    281        if conf.CheckForApp( 'which pyuic' ) and conf.CheckForPyModule( 'dbus' ) and conf.CheckForPyModule( 'qt' ): 
    282                env['PYUIC'] = True 
    283                build_mixer = True 
    284          
    285        if conf.CheckForApp( 'xdg-desktop-menu --help' ): 
    286                env['XDG_TOOLS'] = True 
    287        else: 
    288                print """ 
     269
     270# Optional checks follow: 
     271
     272 
     273# PyQT checks 
     274build_mixer = False 
     275if conf.CheckForApp( 'which pyuic4' ) and conf.CheckForPyModule( 'dbus' ) and conf.CheckForPyModule( 'PyQt4' ) and conf.CheckForPyModule( 'dbus.mainloop.qt' ): 
     276        env['PYUIC4'] = True 
     277        build_mixer = True 
     278 
     279if conf.CheckForApp( 'which pyuic' ) and conf.CheckForPyModule( 'dbus' ) and conf.CheckForPyModule( 'qt' ): 
     280        env['PYUIC'] = True 
     281        build_mixer = True 
     282 
     283if conf.CheckForApp( 'xdg-desktop-menu --help' ): 
     284        env['XDG_TOOLS'] = True 
     285else: 
     286        print """ 
    289287I couldn't find the program 'xdg-desktop-menu'. Together with xdg-icon-resource 
    290288this is needed to add the fancy entry to your menu. But the mixer will be installed, you can start it by executing "ffado-mixer". 
    291289""" 
    292          
    293        if not build_mixer
    294                print """ 
    295        I couldn't find all the prerequisites ('pyuic' / 'pyuic4' and the python-modules 'dbus' and 
    296        'qt' / 'PyQt4', the packages could be named like dbus-python and PyQt) to build the mixer. 
    297        Therefor neither the qt3 nor the qt4 mixer will get installed. 
    298        """ 
     290 
     291if not build_mixer and not env.GetOption('clean')
     292        print """ 
     293I couldn't find all the prerequisites ('pyuic' / 'pyuic4' and the python-modules 'dbus' and 
     294'qt' / 'PyQt4', the packages could be named like dbus-python and PyQt) to build the mixer. 
     295Therefor neither the qt3 nor the qt4 mixer will get installed. 
     296""" 
    299297 
    300298config_guess = conf.ConfigGuess() 
     
    304302if env['DEBUG']: 
    305303        print "Doing a DEBUG build" 
    306         # -Werror could be added to, which would force the devs to really remove all the warnings :-) 
    307         env.AppendUnique( CCFLAGS=["-DDEBUG","-Wall","-g"] ) 
    308         env.AppendUnique( CFLAGS=["-DDEBUG","-Wall","-g"] ) 
    309 else: 
    310         env.AppendUnique( CCFLAGS=["-O2","-DNDEBUG"] ) 
    311         env.AppendUnique( CFLAGS=["-O2","-DNDEBUG"] ) 
     304        env.MergeFlags( "-DDEBUG -Wall -g" ) 
     305else: 
     306        env.MergeFlags( "-O2 -DNDEBUG" ) 
    312307 
    313308if env['PROFILE']: 
    314309        print "Doing a PROFILE build" 
    315         # -Werror could be added to, which would force the devs to really remove all the warnings :-) 
    316         env.AppendUnique( CCFLAGS=["-Wall","-g"] ) 
    317         env.AppendUnique( CFLAGS=["-Wall","-g"] ) 
     310        env.MergeFlags( "-Wall -g" ) 
    318311 
    319312 
     
    322315# this is true for DBUS >= 0.96 or so. Since we require >= 1.0 it is 
    323316# always true 
    324 env.AppendUnique( CCFLAGS=["-DDBUS_HAS_THREADS_INIT_DEFAULT"]
     317env.MergeFlags( "-DDBUS_HAS_THREADS_INIT_DEFAULT"
    325318 
    326319if env['ENABLE_ALL']: 
     
    343336 
    344337# 
     338# Get the DESTDIR (if wanted) from the commandline 
     339# 
     340env.destdir = ARGUMENTS.get( 'DESTDIR', "" ) 
     341 
     342# 
    345343# Uppercase variables are for usage in code, lowercase versions for usage in 
    346344# scons-files for installing. 
     
    350348env['INCLUDEDIR'] = Template( env['INCLUDEDIR'] ).safe_substitute( env ) 
    351349env['SHAREDIR'] = Template( env['SHAREDIR'] ).safe_substitute( env ) 
    352 env['bindir'] = Template( destdir + env['BINDIR'] ).safe_substitute( env ) 
    353 env['libdir'] = Template( destdir + env['LIBDIR'] ).safe_substitute( env ) 
    354 env['includedir'] = Template( destdir + env['INCLUDEDIR'] ).safe_substitute( env ) 
    355 env['sharedir'] = Template( destdir + env['SHAREDIR'] ).safe_substitute( env ) 
     350env['bindir'] = Template( env.destdir + env['BINDIR'] ).safe_substitute( env ) 
     351env['libdir'] = Template( env.destdir + env['LIBDIR'] ).safe_substitute( env ) 
     352env['includedir'] = Template( env.destdir + env['INCLUDEDIR'] ).safe_substitute( env ) 
     353env['sharedir'] = Template( env.destdir + env['SHAREDIR'] ).safe_substitute( env ) 
    356354 
    357355env.Command( target=env['sharedir'], source="", action=Mkdir( env['sharedir'] ) ) 
     
    463461    if env['DIST_TARGET'] == "powerpc64": 
    464462        print "Doing a 64-bit PowerPC build" 
    465         env.AppendUnique( CCFLAGS=["-m64"] ) 
    466         env.AppendUnique( CFLAGS=["-m64"] ) 
     463        env.MergeFlags( "-m64" ) 
    467464    elif env['DIST_TARGET'] == "x86_64": 
    468465        print "Doing a 64-bit x86 build" 
    469         env.AppendUnique( CCFLAGS=["-m64"] ) 
    470         env.AppendUnique( CFLAGS=["-m64"] ) 
     466        env.MergeFlags( "-m64" ) 
    471467        needs_fPIC = True 
    472468    else: 
    473469        print "Doing a 32-bit build" 
    474         env.AppendUnique( CCFLAGS=["-m32"] ) 
    475         env.AppendUnique( CFLAGS=["-m32"] ) 
    476  
    477 if needs_fPIC or '-fPIC' in env['OS_CFLAGS']: 
    478     env.AppendUnique( CFLAGS=["-fPIC"] ) 
    479 if needs_fPIC or '-fPIC' in env['OS_CCFLAGS']: 
    480     env.AppendUnique( CCFLAGS=["-fPIC"] ) 
     470        env.MergeFlags( "-m32" ) 
     471 
     472if needs_fPIC or '-fPIC' in env['OS_CFLAGS'] or "-fPIC" in env['OS_CCFLAGS']: 
     473    env.MergeFlags( "-fPIC" ) 
    481474 
    482475# end of processor-specific section 
    483476if env['ENABLE_OPTIMIZATIONS']: 
    484477    opt_flags.extend (["-fomit-frame-pointer","-ffast-math","-funroll-loops"]) 
    485     env.AppendUnique( CCFLAGS=opt_flags ) 
    486     env.AppendUnique( CFLAGS=opt_flags ) 
     478    env.MergeFlags( opt_flags ) 
    487479    print "Doing an optimized build..." 
    488480 
     
    551543# their own :-/ 
    552544# 
    553 if len(destdir) > 0: 
     545if len(env.destdir) > 0: 
    554546        if not len( ARGUMENTS.get( "WILL_DEAL_WITH_XDG_MYSELF", "" ) ) > 0: 
    555547                print """