Changeset 1491

Show
Ignore:
Timestamp:
11/30/08 13:43:16 (12 years ago)
Author:
arnonym
Message:

multiple things:

  • use MergeFlags? instead of Append(Unique)
  • Add an PEDANTIC option to add -Werror to the flags
  • Execute the mixer-checks on clean, so the mixers actually get uninstalled
  • Remove the "HAVE_ALSA" thing. "ALSA_FLAGS" is enough to check for
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/SConstruct

    r1479 r1491  
    8383    EnumOption('DIST_TARGET', 'Build target for cross compiling packagers', 'auto', allowed_values=('auto', 'i386', 'i686', 'x86_64', 'powerpc', 'powerpc64', 'none' ), ignorecase=2), 
    8484    BoolOption( "ENABLE_OPTIMIZATIONS", "Enable optimizations and the use of processor specific extentions (MMX/SSE/...).", False ), 
     85        BoolOption( "PEDANTIC", "Enable -Werror and more pedantic options during compile.", False ), 
    8586 
    8687        ) 
     
    271272        env.Replace(CFLAGS=oldcf) 
    272273 
    273        
    274        # Optional checks follow: 
    275        
    276  
    277        # PyQT checks 
    278        build_mixer = False 
    279        if conf.CheckForApp( 'which pyuic4' ) and conf.CheckForPyModule( 'dbus' ) and conf.CheckForPyModule( 'PyQt4' ) and conf.CheckForPyModule( 'dbus.mainloop.qt' ): 
    280                env['PYUIC4'] = True 
    281                build_mixer = True 
    282          
    283        if conf.CheckForApp( 'which pyuic' ) and conf.CheckForPyModule( 'dbus' ) and conf.CheckForPyModule( 'qt' ): 
    284                env['PYUIC'] = True 
    285                build_mixer = True 
    286          
    287        if conf.CheckForApp( 'xdg-desktop-menu --help' ): 
    288                env['XDG_TOOLS'] = True 
    289        else: 
    290                print """ 
     274
     275# Optional checks follow: 
     276
     277 
     278# PyQT checks 
     279build_mixer = False 
     280if conf.CheckForApp( 'which pyuic4' ) and conf.CheckForPyModule( 'dbus' ) and conf.CheckForPyModule( 'PyQt4' ) and conf.CheckForPyModule( 'dbus.mainloop.qt' ): 
     281        env['PYUIC4'] = True 
     282        build_mixer = True 
     283 
     284if conf.CheckForApp( 'which pyuic' ) and conf.CheckForPyModule( 'dbus' ) and conf.CheckForPyModule( 'qt' ): 
     285        env['PYUIC'] = True 
     286        build_mixer = True 
     287 
     288if conf.CheckForApp( 'xdg-desktop-menu --help' ): 
     289        env['XDG_TOOLS'] = True 
     290else: 
     291        print """ 
    291292I couldn't find the program 'xdg-desktop-menu'. Together with xdg-icon-resource 
    292293this is needed to add the fancy entry to your menu. But the mixer will be installed, you can start it by executing "ffado-mixer". 
    293294""" 
    294          
    295                if conf.CheckForApp( "xdg-desktop-menu --help" ): 
    296                        env['XDG_TOOLS'] = True 
    297                else: 
    298                        print """ 
    299        I couldn't find the program 'xdg-desktop-menu'. Together with xdg-icon-resource 
    300        this is needed to add the fancy entry to your menu. But the mixer will be installed, you can start it by executing "ffadomixer". 
    301        """ 
    302          
    303        if not build_mixer
    304                print """ 
    305        I couldn't find all the prerequisites ('pyuic' / 'pyuic4' and the python-modules 'dbus' and 
    306        'qt', the packages could be named like dbus-python and PyQt) to build the mixer. 
    307        Therefor the mixer won't get installed. 
    308        """ 
     295 
     296if conf.CheckForApp( "xdg-desktop-menu --help" ): 
     297        env['XDG_TOOLS'] = True 
     298else: 
     299        print """ 
     300I couldn't find the program 'xdg-desktop-menu'. Together with xdg-icon-resource 
     301this is needed to add the fancy entry to your menu. But the mixer will be installed, you can start it by executing "ffadomixer". 
     302""" 
     303 
     304if not build_mixer and not env.GetOption('clean')
     305        print """ 
     306I couldn't find all the prerequisites ('pyuic' / 'pyuic4' and the python-modules 'dbus' and 
     307'qt', the packages could be named like dbus-python and PyQt) to build the mixer. 
     308Therefor the mixer won't get installed. 
     309""" 
    309310 
    310311# ALSA checks 
     
    312313name2 = pkg.replace("+","").replace(".","").replace("-","").upper() 
    313314env['%s_FLAGS' % name2] = conf.GetPKGFlags( pkg, '1.0.0' ) 
    314 if env['%s_FLAGS'%name2] == 0: 
    315         env['HAVE_ALSA'] = False 
    316         print " ALSA not found, not building ALSA plugin." 
    317 else: 
    318         env['HAVE_ALSA'] = True 
    319         print " ALSA found, building ALSA plugin." 
    320315 
    321316 
     
    326321if env['DEBUG']: 
    327322        print "Doing a DEBUG build" 
    328         # -Werror could be added to, which would force the devs to really remove all the warnings :-) 
    329         env.AppendUnique( CCFLAGS=["-DDEBUG","-Wall","-g"] ) 
    330         env.AppendUnique( CFLAGS=["-DDEBUG","-Wall","-g"] ) 
    331 else: 
    332         env.AppendUnique( CCFLAGS=["-O2","-DNDEBUG"] ) 
    333         env.AppendUnique( CFLAGS=["-O2","-DNDEBUG"] ) 
     323        env.MergeFlags( "-DDEBUG -Wall -g" ) 
     324else: 
     325        env.MergeFlags( "-O2 -DNDEBUG" ) 
    334326 
    335327if env['PROFILE']: 
    336328        print "Doing a PROFILE build" 
    337         # -Werror could be added to, which would force the devs to really remove all the warnings :-) 
    338         env.AppendUnique( CCFLAGS=["-Wall","-g"] ) 
    339         env.AppendUnique( CFLAGS=["-Wall","-g"] ) 
     329        env.MergeFlags( "-Wall -g" ) 
     330 
     331if env['PEDANTIC']: 
     332        env.MergeFlags( "-Werror" ) 
    340333 
    341334 
     
    344337# this is true for DBUS >= 0.96 or so. Since we require >= 1.0 it is 
    345338# always true 
    346 env.AppendUnique( CCFLAGS=["-DDBUS_HAS_THREADS_INIT_DEFAULT"]
     339env.MergeFlags( "-DDBUS_HAS_THREADS_INIT_DEFAULT"
    347340 
    348341if env['ENABLE_ALL']: 
     
    492485    if env['DIST_TARGET'] == "powerpc64": 
    493486        print "Doing a 64-bit PowerPC build" 
    494         env.AppendUnique( CCFLAGS=["-m64"] ) 
    495         env.AppendUnique( CFLAGS=["-m64"] ) 
     487        env.MergeFlags( "-m64" ) 
    496488    elif env['DIST_TARGET'] == "x86_64": 
    497489        print "Doing a 64-bit x86 build" 
    498         env.AppendUnique( CCFLAGS=["-m64"] ) 
    499         env.AppendUnique( CFLAGS=["-m64"] ) 
     490        env.MergeFlags( "-m64" ) 
    500491        needs_fPIC = True 
    501492    else: 
    502493        print "Doing a 32-bit build" 
    503         env.AppendUnique( CCFLAGS=["-m32"] ) 
    504         env.AppendUnique( CFLAGS=["-m32"] ) 
    505  
    506 if needs_fPIC or '-fPIC' in env['OS_CFLAGS']: 
    507     env.AppendUnique( CFLAGS=["-fPIC"] ) 
    508 if needs_fPIC or '-fPIC' in env['OS_CCFLAGS']: 
    509     env.AppendUnique( CCFLAGS=["-fPIC"] ) 
     494        env.MergeFlags( "-m32" ) 
     495 
     496if needs_fPIC or '-fPIC' in env['OS_CFLAGS'] or "-fPIC" in env['OS_CCFLAGS']: 
     497    env.MergeFlags( "-fPIC" ) 
    510498 
    511499# end of processor-specific section 
    512500if env['ENABLE_OPTIMIZATIONS']: 
    513501    opt_flags.extend (["-fomit-frame-pointer","-ffast-math","-funroll-loops"]) 
    514     env.AppendUnique( CCFLAGS=opt_flags ) 
    515     env.AppendUnique( CFLAGS=opt_flags ) 
     502    env.MergeFlags( opt_flags ) 
    516503    print "Doing an optimized build..." 
    517504 
  • trunk/libffado/support/alsa/SConscript

    r1240 r1491  
    3434env.PrependUnique( LIBS=["ffado"] ) 
    3535 
    36 if not env.GetOption( "clean" ): 
    37     env.MergeFlags( env["ALSA_FLAGS"] ) 
    38     env.MergeFlags( "-DPIC" ) 
     36#if not env.GetOption( "clean" ): 
     37env.MergeFlags( env["ALSA_FLAGS"] ) 
     38env.MergeFlags( "-DPIC" ) 
    3939 
    4040sources = ["alsa_plugin.cpp"] 
    4141 
    42 if env['HAVE_ALSA']: 
     42if env['ALSA_FLAGS']: 
    4343    alsaplugin = env.SharedLibrary( "asound_module_pcm_ffado", sources )