Changeset 592

Show
Ignore:
Timestamp:
08/29/07 09:10:16 (14 years ago)
Author:
arnonym
Message:

Fix one of my todos and make the env-environment more clean.

Files:

Legend:

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

    r591 r592  
    2525 
    2626opts.AddOptions( 
    27         BoolOption( "DEBUG", """ 
     27        BoolOption( "DEBUG", """\ 
    2828Toggle debug-build. DEBUG means \"-g -Wall\" and more, otherwise we will use 
    29 \"-O2\" to optimise.""", True ), 
     29  \"-O2\" to optimise.""", True ), 
    3030        PathOption( "PREFIX", "The prefix where ffado will be installed to.", "/usr/local" ), 
    3131        BoolOption( "ENABLE_BEBOB", "Enable/Disable the bebob part.", True ), 
     
    3636        BoolOption( "ENABLE_RME", "Enable/Disable the RME part.", False ), 
    3737        BoolOption( "ENABLE_BOUNCE", "Enable/Disable the BOUNCE part.", False ), 
     38        BoolOption( "ENABLE_GENERICAVC", """\ 
     39Enable/Disable the the generic avc part (mainly used by apple). 
     40  Note that disabling this option might be overwritten by other devices needing 
     41  this code.""", False ), 
    3842        BoolOption( "ENABLE_ALL", "Enable/Disable support for all devices.", False ), 
    39         BoolOption( "BUILD_TESTS", """ 
     43        BoolOption( "BUILD_TESTS", """\ 
    4044Build the tests in their directory. As some contain quite some functionality, 
    41 this is on by default. 
    42 If you just want to use ffado with jack without the tools, you can disable this. 
     45  this is on by default. 
     46  If you just want to use ffado with jack without the tools, you can disable this.\ 
    4347""", True ), 
    4448        ) 
     
    153157        env['ENABLE_BOUNCE'] = True 
    154158 
     159if env['ENABLE_BEBOB'] or env['ENABLE_DICE'] or env['ENABLE_BOUNCE'] or env['ENABLE_FIREWORKS']: 
     160        env['ENABLE_GENERICAVC'] = True 
     161 
    155162if build_base: 
    156163        env['build_base']="#/"+build_base 
     
    164171externalenv = env.Copy() 
    165172Export( 'externalenv' ) 
    166  
    167 # 
    168 # TODO: Probably this should be in the src/SConscript... 
    169 # 
    170 if env['ENABLE_BEBOB']: 
    171         env.AppendUnique( CCFLAGS=["-DENABLE_BEBOB"] ) 
    172 if env['ENABLE_FIREWORKS']: 
    173         env.AppendUnique( CCFLAGS=["-DENABLE_FIREWORKS"] ) 
    174 if env['ENABLE_MOTU']: 
    175         env.AppendUnique( CCFLAGS=["-DENABLE_MOTU"] ) 
    176 if env['ENABLE_DICE']: 
    177         env.AppendUnique( CCFLAGS=["-DENABLE_DICE"] ) 
    178 if env['ENABLE_METRIC_HALO']: 
    179         env.AppendUnique( CCFLAGS=["-DENABLE_METRIC_HALO"] ) 
    180 if env['ENABLE_RME']: 
    181         env.AppendUnique( CCFLAGS=["-DENABLE_RME"] ) 
    182 if env['ENABLE_BOUNCE']: 
    183         env.AppendUnique( CCFLAGS=["-DENABLE_BOUNCE"] ) 
    184  
    185 # the GenericAVC code is used by these devices 
    186 if env['ENABLE_BEBOB'] or env['ENABLE_DICE'] or env['ENABLE_BOUNCE'] or env['ENABLE_FIREWORKS']: 
    187         env.AppendUnique( CCFLAGS=["-DENABLE_GENERICAVC"] ) 
    188173 
    189174# 
  • trunk/libffado/src/SConscript

    r587 r592  
    77env.AppendUnique( CPPPATH=["#/", "#/src"] ) 
    88 
    9 env1 = env.Copy() 
     9libenv = env.Copy() 
    1010 
    1111ffado_source = env.Split( '\ 
     
    136136source = ffado_source 
    137137if env['ENABLE_BEBOB']: 
     138        libenv.AppendUnique( CCFLAGS=["-DENABLE_BEBOB"] ) 
    138139        source += bebob_source 
    139140if env['ENABLE_FIREWORKS']: 
     141        libenv.AppendUnique( CCFLAGS=["-DENABLE_FIREWORKS"] ) 
    140142        source += fireworks_source 
    141143if env['ENABLE_MOTU']: 
     144        libenv.AppendUnique( CCFLAGS=["-DENABLE_MOTU"] ) 
    142145        source += motu_source 
    143146if env['ENABLE_DICE']: 
     147        libenv.AppendUnique( CCFLAGS=["-DENABLE_DICE"] ) 
    144148        source += dice_source 
    145149if env['ENABLE_METRIC_HALO']: 
     150        libenv.AppendUnique( CCFLAGS=["-DENABLE_METRIC_HALO"] ) 
    146151        source += metric_halo_source 
    147152if env['ENABLE_RME']: 
     153        libenv.AppendUnique( CCFLAGS=["-DENABLE_RME"] ) 
    148154        source += rme_source 
    149155if env['ENABLE_BOUNCE']: 
     156        libenv.AppendUnique( CCFLAGS=["-DENABLE_BOUNCE"] ) 
    150157        source += bounce_source 
    151158 
    152 if env['ENABLE_BEBOB'] or env['ENABLE_DICE'] or env['ENABLE_BOUNCE'] or env['ENABLE_FIREWORKS']: 
     159# The list of devices needing GENERICAVC is controlled in ../SConstruct 
     160if env['ENABLE_GENERICAVC']: 
     161        libenv.AppendUnique( CCFLAGS=["-DENABLE_GENERICAVC"] ) 
    153162        source += amdtp_source 
    154163        source += genericavc_source 
    155164 
    156 env1.MergeFlags( "-lrt" ) 
     165libenv.MergeFlags( "-lrt" ) 
    157166 
    158167#env1.AppendUnique( LINKFLAGS = env.Split("-Wl,-rpath $libdir -Wl,-soname -Wl,libffado.so.1 --version-info=1:0:0") ) 
    159 ffadolib = env1.SharedLibrary( "ffado", source ) 
     168ffadolib = libenv.SharedLibrary( "ffado", source ) 
    160169 
    161170# 
     
    164173if False: 
    165174        print "Trying to emulate libtools versioned install" 
    166         env1.Alias( "install", env1.InstallAs( os.path.join('$libdir','libffado.so.$LIBVERSION'), ffadolib ) ) 
    167         env1.Ignore( ffadolib, os.path.join('$libdir','libffado.so') ) 
     175        libenv.Alias( "install", libenv.InstallAs( os.path.join('$libdir','libffado.so.$LIBVERSION'), ffadolib ) ) 
     176        libenv.Ignore( ffadolib, os.path.join('$libdir','libffado.so') ) 
    168177        #env.Ignore( os.path.join('$libdir','libffado.so'), ffadolib ) 
    169178        #env.Ignore( os.path.join('$libdir','libffado.so.0'), "install" ) 
    170179 
    171         env1.Alias( "install", env1.Command( 
     180        libenv.Alias( "install", libenv.Command( 
    172181                target="$libdir/libffado.so", 
    173                 source=env1['libdir']+"/libffado.so.$LIBVERSION", 
     182                source=libenv['libdir']+"/libffado.so.$LIBVERSION", 
    174183                action="ln -s $SOURCE $TARGET" 
    175184                ) ) 
    176         env1.Alias( "install", env1.Command( 
    177                 target="$libdir/libffado.so.%s" % str(env1['LIBVERSION']).rsplit('.',1)[0], 
    178                 source=env1['libdir']+"/libffado.so.$LIBVERSION", 
     185        libenv.Alias( "install", libenv.Command( 
     186                target="$libdir/libffado.so.%s" % str(libenv['LIBVERSION']).rsplit('.',1)[0], 
     187                source=libenv['libdir']+"/libffado.so.$LIBVERSION", 
    179188                action="ln -s $SOURCE $TARGET" 
    180189                ) ) 
    181         env1.Alias( "install", env1.Command( 
    182                 target="$libdir/libffado.so.%s" % str(env1['LIBVERSION']).rsplit('.',2)[0], 
    183                 source=env1['libdir']+"/libffado.so.$LIBVERSION", 
     190        libenv.Alias( "install", libenv.Command( 
     191                target="$libdir/libffado.so.%s" % str(libenv['LIBVERSION']).rsplit('.',2)[0], 
     192                source=libenv['libdir']+"/libffado.so.$LIBVERSION", 
    184193                action="ln -s $SOURCE $TARGET" 
    185194                ) ) 
    186195else: 
    187196        print "Doing simple install" 
    188         env1.Alias( "install", env1.Install( "$libdir", ffadolib ) ) 
     197        libenv.Alias( "install", libenv.Install( "$libdir", ffadolib ) ) 
    189198 
    190199# 
     
    192201# 
    193202for data in bebob_pkgdata: 
    194         env1.Alias( "install", env1.Install( "$sharedir", data ) ) 
     203        libenv.Alias( "install", libenv.Install( "$sharedir", data ) ) 
    195204 
    196205# 
    197206# For the debugging apps 
    198207# 
    199 env2 = env.Copy() 
     208env2 = libenv.Copy() 
    200209env2.PrependUnique( LIBPATH=env['build_base']+"src" ) 
    201210env2.PrependUnique( LIBS="ffado" )