Changeset 1641

Show
Ignore:
Timestamp:
08/30/09 12:08:49 (14 years ago)
Author:
arnonym
Message:

Unify tabs->space.

Remove the python stuff from the installs of the developers.

Compute the directory where to install the python modules.

Files:

Legend:

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

    r1638 r1641  
    3131from string import Template 
    3232import imp 
     33import distutils.sysconfig 
    3334 
    3435build_dir = ARGUMENTS.get('BUILDDIR', "") 
     
    5152 
    5253opts.AddOptions( 
    53        BoolOption( "DEBUG", """\ 
     54    BoolOption( "DEBUG", """\ 
    5455Toggle debug-build. DEBUG means \"-g -Wall\" and more, otherwise we will use 
    5556  \"-O2\" to optimize.""", True ), 
    56         BoolOption( "PROFILE", "Build with symbols and other profiling info", False ), 
    57         PathOption( "PREFIX", "The prefix where ffado will be installed to.", "/usr/local", PathOption.PathAccept ), 
    58         PathOption( "BINDIR", "Overwrite the directory where apps are installed to.", "$PREFIX/bin", PathOption.PathAccept ), 
    59         PathOption( "LIBDIR", "Overwrite the directory where libs are installed to.", "$PREFIX/lib", PathOption.PathAccept ), 
    60         PathOption( "INCLUDEDIR", "Overwrite the directory where headers are installed to.", "$PREFIX/include", PathOption.PathAccept ), 
    61         PathOption( "SHAREDIR", "Overwrite the directory where misc shared files are installed to.", "$PREFIX/share/libffado", PathOption.PathAccept ), 
    62         BoolOption( "ENABLE_BEBOB", "Enable/Disable support for the BeBoB platform.", True ), 
    63         BoolOption( "ENABLE_FIREWORKS", "Enable/Disable support for the ECHO Audio FireWorks platform.", True ), 
    64         BoolOption( "ENABLE_OXFORD", "Enable/Disable support for the Oxford Semiconductor FW platform.", True ), 
    65         BoolOption( "ENABLE_MOTU", "Enable/Disable support for the MOTU platform.", True ), 
    66         BoolOption( "ENABLE_DICE", "Enable/Disable support for the TCAT DICE platform.", True ), 
    67         BoolOption( "ENABLE_METRIC_HALO", "Enable/Disable support for the Metric Halo platform.", False ), 
    68         BoolOption( "ENABLE_RME", "Enable/Disable support for the RME platform.", False ), 
    69         BoolOption( "ENABLE_MAUDIO", "Enable/Disable support for the M-Audio custom BeBoB devices.", False ), 
    70         BoolOption( "ENABLE_BOUNCE", "Enable/Disable the BOUNCE device.", False ), 
    71         BoolOption( "ENABLE_GENERICAVC", """\ 
     57    BoolOption( "PROFILE", "Build with symbols and other profiling info", False ), 
     58    PathOption( "PREFIX", "The prefix where ffado will be installed to.", "/usr/local", PathOption.PathAccept ), 
     59    PathOption( "BINDIR", "Overwrite the directory where apps are installed to.", "$PREFIX/bin", PathOption.PathAccept ), 
     60    PathOption( "LIBDIR", "Overwrite the directory where libs are installed to.", "$PREFIX/lib", PathOption.PathAccept ), 
     61    PathOption( "INCLUDEDIR", "Overwrite the directory where headers are installed to.", "$PREFIX/include", PathOption.PathAccept ), 
     62    PathOption( "SHAREDIR", "Overwrite the directory where misc shared files are installed to.", "$PREFIX/share/libffado", PathOption.PathAccept ), 
     63    PathOption( "PYPKGDIR", "The directory where the python modules get installed.", 
     64        distutils.sysconfig.get_python_lib( prefix="$PREFIX" ), PathOption.PathAccept ), 
     65    BoolOption( "ENABLE_BEBOB", "Enable/Disable support for the BeBoB platform.", True ), 
     66    BoolOption( "ENABLE_FIREWORKS", "Enable/Disable support for the ECHO Audio FireWorks platform.", True ), 
     67    BoolOption( "ENABLE_OXFORD", "Enable/Disable support for the Oxford Semiconductor FW platform.", True ), 
     68    BoolOption( "ENABLE_MOTU", "Enable/Disable support for the MOTU platform.", True ), 
     69    BoolOption( "ENABLE_DICE", "Enable/Disable support for the TCAT DICE platform.", True ), 
     70    BoolOption( "ENABLE_METRIC_HALO", "Enable/Disable support for the Metric Halo platform.", False ), 
     71    BoolOption( "ENABLE_RME", "Enable/Disable support for the RME platform.", False ), 
     72    BoolOption( "ENABLE_MAUDIO", "Enable/Disable support for the M-Audio custom BeBoB devices.", False ), 
     73    BoolOption( "ENABLE_BOUNCE", "Enable/Disable the BOUNCE device.", False ), 
     74    BoolOption( "ENABLE_GENERICAVC", """\ 
    7275Enable/Disable the the generic avc part (mainly used by apple). 
    7376  Note that disabling this option might be overwritten by other devices needing 
    7477  this code.""", False ), 
    75        BoolOption( "ENABLE_ALL", "Enable/Disable support for all devices.", False ), 
    76        BoolOption( "SERIALIZE_USE_EXPAT", "Use libexpat for XML serialization.", False ), 
    77        BoolOption( "BUILD_TESTS", """\ 
     78    BoolOption( "ENABLE_ALL", "Enable/Disable support for all devices.", False ), 
     79    BoolOption( "SERIALIZE_USE_EXPAT", "Use libexpat for XML serialization.", False ), 
     80    BoolOption( "BUILD_TESTS", """\ 
    7881Build the tests in their directory. As some contain quite some functionality, 
    7982  this is on by default. 
     
    8386    EnumOption('DIST_TARGET', 'Build target for cross compiling packagers', 'auto', allowed_values=('auto', 'i386', 'i686', 'x86_64', 'powerpc', 'powerpc64', 'none' ), ignorecase=2), 
    8487    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 ), 
    86  
    87        
     88    BoolOption( "PEDANTIC", "Enable -Werror and more pedantic options during compile.", False ), 
     89 
     90   
    8891 
    8992## Load the builders in config 
    9093buildenv=os.environ 
    9194vars_to_check = [ 
    92        'PATH', 
    93        'PKG_CONFIG_PATH', 
    94        'LD_LIBRARY_PATH', 
    95        'XDG_CONFIG_DIRS', 
    96        'XDG_DATA_DIRS', 
    97        'HOME', 
    98        'CC', 
    99        'CFLAGS', 
    100        'CXX', 
    101        'CXXFLAGS', 
    102        'CPPFLAGS', 
     95    'PATH', 
     96    'PKG_CONFIG_PATH', 
     97    'LD_LIBRARY_PATH', 
     98    'XDG_CONFIG_DIRS', 
     99    'XDG_DATA_DIRS', 
     100    'HOME', 
     101    'CC', 
     102    'CFLAGS', 
     103    'CXX', 
     104    'CXXFLAGS', 
     105    'CPPFLAGS', 
    103106] 
    104107for var in vars_to_check: 
    105        if os.environ.has_key(var): 
    106                buildenv[var]=os.environ[var] 
    107        else: 
    108                buildenv[var]='' 
     108    if os.environ.has_key(var): 
     109        buildenv[var]=os.environ[var] 
     110    else: 
     111        buildenv[var]='' 
    109112 
    110113env = Environment( tools=['default','scanreplace','pyuic','pyuic4','dbus','doxygen','pkgconfig'], toolpath=['admin'], ENV = buildenv, options=opts ) 
    111114 
    112115if os.environ.has_key('LDFLAGS'): 
    113        env['LINKFLAGS'] = os.environ['LDFLAGS'] 
     116    env['LINKFLAGS'] = os.environ['LDFLAGS'] 
    114117 
    115118# grab OS CFLAGS / CCFLAGS 
    116119env['OS_CFLAGS']=[] 
    117120if os.environ.has_key('CFLAGS'): 
    118        env['OS_CFLAGS'] = os.environ['CFLAGS'] 
     121    env['OS_CFLAGS'] = os.environ['CFLAGS'] 
    119122env['OS_CCFLAGS']=[] 
    120123if os.environ.has_key('CCFLAGS'): 
    121        env['OS_CCFLAGS'] = os.environ['CCFLAGS'] 
     124    env['OS_CCFLAGS'] = os.environ['CCFLAGS'] 
    122125 
    123126Help( """ 
     
    136139# make sure the necessary dirs exist 
    137140if not os.path.isdir( "cache/" + build_base ): 
    138        os.makedirs( "cache/" + build_base ) 
     141    os.makedirs( "cache/" + build_base ) 
    139142if not os.path.isdir( 'cache/objects' ): 
    140        os.makedirs( 'cache/objects' ) 
     143    os.makedirs( 'cache/objects' ) 
    141144 
    142145CacheDir( 'cache/objects' ) 
     
    145148 
    146149def ConfigGuess( context ): 
    147        context.Message( "Trying to find the system triple: " ) 
    148        ret = os.popen( "admin/config.guess" ).read()[:-1] 
    149        context.Result( ret ) 
    150        return ret 
     150    context.Message( "Trying to find the system triple: " ) 
     151    ret = os.popen( "admin/config.guess" ).read()[:-1] 
     152    context.Result( ret ) 
     153    return ret 
    151154 
    152155def CheckForApp( context, app ): 
    153        context.Message( "Checking whether '" + app + "' executes " ) 
    154        ret = context.TryAction( app ) 
    155        context.Result( ret[0] ) 
    156        return ret[0] 
     156    context.Message( "Checking whether '" + app + "' executes " ) 
     157    ret = context.TryAction( app ) 
     158    context.Result( ret[0] ) 
     159    return ret[0] 
    157160 
    158161def CheckForPyModule( context, module ): 
    159        context.Message( "Checking for the python module '" + module + "' " ) 
    160        ret = context.TryAction( "python $SOURCE", "import %s" % module, ".py" ) 
    161        context.Result( ret[0] ) 
    162        return ret[0] 
     162    context.Message( "Checking for the python module '" + module + "' " ) 
     163    ret = context.TryAction( "python $SOURCE", "import %s" % module, ".py" ) 
     164    context.Result( ret[0] ) 
     165    return ret[0] 
    163166 
    164167def CompilerCheck( context ): 
    165        context.Message( "Checking for a working C-compiler " ) 
    166        ret = context.TryRun( """ 
     168    context.Message( "Checking for a working C-compiler " ) 
     169    ret = context.TryRun( """ 
    167170#include <stdlib.h> 
    168171 
    169172int main() { 
    170        printf( "Hello World!" ); 
    171        return 0; 
     173    printf( "Hello World!" ); 
     174    return 0; 
    172175}""", '.c' )[0] 
    173        context.Result( ret ) 
    174        if ret == 0: 
    175                return False; 
    176        context.Message( "Checking for a working C++-compiler " ) 
    177        ret = context.TryRun( """ 
     176    context.Result( ret ) 
     177    if ret == 0: 
     178        return False; 
     179    context.Message( "Checking for a working C++-compiler " ) 
     180    ret = context.TryRun( """ 
    178181#include <iostream> 
    179182 
    180183int main() { 
    181        std::cout << "Hello World!" << std::endl; 
    182        return 0; 
     184    std::cout << "Hello World!" << std::endl; 
     185    return 0; 
    183186}""", ".cpp" )[0] 
    184        context.Result( ret ) 
    185        return ret 
     187    context.Result( ret ) 
     188    return ret 
    186189 
    187190tests = { 
    188        "ConfigGuess" : ConfigGuess, 
    189        "CheckForApp" : CheckForApp, 
    190        "CheckForPyModule": CheckForPyModule, 
    191        "CompilerCheck" : CompilerCheck, 
     191    "ConfigGuess" : ConfigGuess, 
     192    "CheckForApp" : CheckForApp, 
     193    "CheckForPyModule": CheckForPyModule, 
     194    "CompilerCheck" : CompilerCheck, 
    192195} 
    193196tests.update( env['PKGCONFIG_TESTS'] ) 
     
    196199 
    197200conf = Configure( env, 
    198        custom_tests = tests, 
    199        conf_dir = "cache/" + build_base, 
    200        log_file = "cache/" + build_base + 'config.log' ) 
     201    custom_tests = tests, 
     202    conf_dir = "cache/" + build_base, 
     203    log_file = "cache/" + build_base + 'config.log' ) 
    201204 
    202205if env['SERIALIZE_USE_EXPAT']: 
    203        env['SERIALIZE_USE_EXPAT']=1 
    204 else: 
    205        env['SERIALIZE_USE_EXPAT']=0 
     206    env['SERIALIZE_USE_EXPAT']=1 
     207else: 
     208    env['SERIALIZE_USE_EXPAT']=0 
    206209 
    207210if env['ENABLE_BOUNCE'] or env['ENABLE_ALL']: 
    208        env['REQUIRE_LIBAVC']=1 
    209 else: 
    210        env['REQUIRE_LIBAVC']=0 
     211    env['REQUIRE_LIBAVC']=1 
     212else: 
     213    env['REQUIRE_LIBAVC']=0 
    211214 
    212215if not env.GetOption('clean'): 
    213        
    214        # Check for working gcc and g++ compilers and their environment. 
    215        
    216        if not conf.CompilerCheck(): 
    217                print "\nIt seems as if your system isn't even able to compile any C-/C++-programs. Probably you don't have gcc and g++ installed. Compiling a package from source without a working compiler is very hard to do, please install the needed packages.\nHint: on *ubuntu you need both gcc- and g++-packages installed, easiest solution is to install build-essential which depends on gcc and g++." 
    218                Exit( 1 ) 
    219  
    220        # Check for pkg-config before using pkg-config to check for other dependencies. 
    221        if not conf.CheckForPKGConfig(): 
    222                print "\nThe program 'pkg-config' could not be found.\nEither you have to install the corresponding package first or make sure that PATH points to the right directions." 
    223                Exit( 1 ) 
    224  
    225        
    226        # The following checks are for headers and libs and packages we need. 
    227        
    228        allpresent = 1; 
    229        # for DBUS C++ bindings 
    230        allpresent &= conf.CheckHeader( "expat.h" ) 
    231        allpresent &= conf.CheckLib( 'expat', 'XML_ExpatVersion', '#include <expat.h>' ) 
    232          
    233        pkgs = { 
    234                'libraw1394' : '1.3.0', 
    235                'libiec61883' : '1.1.0', 
    236                'dbus-1' : '1.0', 
    237                
    238  
    239        if env['REQUIRE_LIBAVC']: 
    240                pkgs['libavc1394'] = '0.5.3' 
    241  
    242        if not env['SERIALIZE_USE_EXPAT']: 
    243                pkgs['libxml++-2.6'] = '2.13.0' 
    244  
    245        for pkg in pkgs: 
    246                name2 = pkg.replace("+","").replace(".","").replace("-","").upper() 
    247                env['%s_FLAGS' % name2] = conf.GetPKGFlags( pkg, pkgs[pkg] ) 
    248                #print '%s_FLAGS' % name2 
    249                if env['%s_FLAGS'%name2] == 0: 
    250                        allpresent &= 0 
    251  
    252        if not allpresent: 
    253                print """ 
     216   
     217    # Check for working gcc and g++ compilers and their environment. 
     218   
     219    if not conf.CompilerCheck(): 
     220        print "\nIt seems as if your system isn't even able to compile any C-/C++-programs. Probably you don't have gcc and g++ installed. Compiling a package from source without a working compiler is very hard to do, please install the needed packages.\nHint: on *ubuntu you need both gcc- and g++-packages installed, easiest solution is to install build-essential which depends on gcc and g++." 
     221        Exit( 1 ) 
     222 
     223    # Check for pkg-config before using pkg-config to check for other dependencies. 
     224    if not conf.CheckForPKGConfig(): 
     225        print "\nThe program 'pkg-config' could not be found.\nEither you have to install the corresponding package first or make sure that PATH points to the right directions." 
     226        Exit( 1 ) 
     227 
     228   
     229    # The following checks are for headers and libs and packages we need. 
     230   
     231    allpresent = 1; 
     232    # for DBUS C++ bindings 
     233    allpresent &= conf.CheckHeader( "expat.h" ) 
     234    allpresent &= conf.CheckLib( 'expat', 'XML_ExpatVersion', '#include <expat.h>' ) 
     235     
     236    pkgs = { 
     237        'libraw1394' : '1.3.0', 
     238        'libiec61883' : '1.1.0', 
     239        'dbus-1' : '1.0', 
     240       
     241 
     242    if env['REQUIRE_LIBAVC']: 
     243        pkgs['libavc1394'] = '0.5.3' 
     244 
     245    if not env['SERIALIZE_USE_EXPAT']: 
     246        pkgs['libxml++-2.6'] = '2.13.0' 
     247 
     248    for pkg in pkgs: 
     249        name2 = pkg.replace("+","").replace(".","").replace("-","").upper() 
     250        env['%s_FLAGS' % name2] = conf.GetPKGFlags( pkg, pkgs[pkg] ) 
     251        #print '%s_FLAGS' % name2 
     252        if env['%s_FLAGS'%name2] == 0: 
     253            allpresent &= 0 
     254 
     255    if not allpresent: 
     256        print """ 
    254257(At least) One of the dependencies is missing. I can't go on without it, please 
    255258install the needed packages for each of the lines saying "no". 
     
    259262results above get rechecked. 
    260263""" 
    261                Exit( 1 ) 
    262  
    263        # Check for C99 lrint() and lrintf() functions used to convert from 
    264        # float to integer more efficiently via float_cast.h.  If not 
    265        # present the standard slower methods will be used instead.  This 
    266        # might not be the best way of testing for these but it's the only 
    267        # way which seems to work properly.  CheckFunc() fails due to 
    268        # argument count problems. 
    269        if env.has_key( 'CFLAGS' ): 
    270                oldcf = env['CFLAGS'] 
    271        else: 
    272                oldcf = "" 
    273        oldcf = env.Append(CFLAGS = '-std=c99') 
    274        if conf.CheckLibWithHeader( "m", "math.h", "c", "lrint(3.2);" ): 
    275                HAVE_LRINT = 1 
    276        else: 
    277                HAVE_LRINT = 0 
    278        if conf.CheckLibWithHeader( "m", "math.h", "c", "lrintf(3.2);" ): 
    279                HAVE_LRINTF = 1 
    280        else: 
    281                HAVE_LRINTF = 0 
    282        env['HAVE_LRINT'] = HAVE_LRINT; 
    283        env['HAVE_LRINTF'] = HAVE_LRINTF; 
    284        env.Replace(CFLAGS=oldcf) 
     264        Exit( 1 ) 
     265 
     266    # Check for C99 lrint() and lrintf() functions used to convert from 
     267    # float to integer more efficiently via float_cast.h.  If not 
     268    # present the standard slower methods will be used instead.  This 
     269    # might not be the best way of testing for these but it's the only 
     270    # way which seems to work properly.  CheckFunc() fails due to 
     271    # argument count problems. 
     272    if env.has_key( 'CFLAGS' ): 
     273        oldcf = env['CFLAGS'] 
     274    else: 
     275        oldcf = "" 
     276    oldcf = env.Append(CFLAGS = '-std=c99') 
     277    if conf.CheckLibWithHeader( "m", "math.h", "c", "lrint(3.2);" ): 
     278        HAVE_LRINT = 1 
     279    else: 
     280        HAVE_LRINT = 0 
     281    if conf.CheckLibWithHeader( "m", "math.h", "c", "lrintf(3.2);" ): 
     282        HAVE_LRINTF = 1 
     283    else: 
     284        HAVE_LRINTF = 0 
     285    env['HAVE_LRINT'] = HAVE_LRINT; 
     286    env['HAVE_LRINTF'] = HAVE_LRINTF; 
     287    env.Replace(CFLAGS=oldcf) 
    285288 
    286289# 
     
    291294build_mixer = False 
    292295if conf.CheckForApp( 'which pyuic4' ) and conf.CheckForPyModule( 'dbus' ) and conf.CheckForPyModule( 'PyQt4' ) and conf.CheckForPyModule( 'dbus.mainloop.qt' ): 
    293        env['PYUIC4'] = True 
    294        build_mixer = True 
     296    env['PYUIC4'] = True 
     297    build_mixer = True 
    295298 
    296299if conf.CheckForApp( 'xdg-desktop-menu --help' ): 
    297        env['XDG_TOOLS'] = True 
    298 else: 
    299        print """ 
     300    env['XDG_TOOLS'] = True 
     301else: 
     302    print """ 
    300303I couldn't find the program 'xdg-desktop-menu'. Together with xdg-icon-resource 
    301304this is needed to add the fancy entry to your menu. But if the mixer will be 
     
    304307 
    305308if not build_mixer and not env.GetOption('clean'): 
    306        print """ 
     309    print """ 
    307310I couldn't find all the prerequisites ('pyuic4' and the python-modules 'dbus' 
    308311and 'PyQt4', the packages could be named like dbus-python and PyQt) to build the 
     
    326329 
    327330if env['DEBUG']: 
    328        print "Doing a DEBUG build" 
    329        env.MergeFlags( "-DDEBUG -Wall -g" ) 
    330 else: 
    331        env.MergeFlags( "-O2 -DNDEBUG" ) 
     331    print "Doing a DEBUG build" 
     332    env.MergeFlags( "-DDEBUG -Wall -g" ) 
     333else: 
     334    env.MergeFlags( "-O2 -DNDEBUG" ) 
    332335 
    333336if env['PROFILE']: 
    334        print "Doing a PROFILE build" 
    335        env.MergeFlags( "-Wall -g" ) 
     337    print "Doing a PROFILE build" 
     338    env.MergeFlags( "-Wall -g" ) 
    336339 
    337340if env['PEDANTIC']: 
    338        env.MergeFlags( "-Werror" ) 
     341    env.MergeFlags( "-Werror" ) 
    339342 
    340343 
     
    346349 
    347350if env['ENABLE_ALL']: 
    348        env['ENABLE_BEBOB'] = True 
    349        env['ENABLE_FIREWORKS'] = True 
    350        env['ENABLE_OXFORD'] = True 
    351        env['ENABLE_MOTU'] = True 
    352        env['ENABLE_DICE'] = True 
    353        env['ENABLE_METRIC_HALO'] = True 
    354        env['ENABLE_RME'] = True 
    355        env['ENABLE_BOUNCE'] = True 
    356        env['ENABLE_MAUDIO'] = True 
     351    env['ENABLE_BEBOB'] = True 
     352    env['ENABLE_FIREWORKS'] = True 
     353    env['ENABLE_OXFORD'] = True 
     354    env['ENABLE_MOTU'] = True 
     355    env['ENABLE_DICE'] = True 
     356    env['ENABLE_METRIC_HALO'] = True 
     357    env['ENABLE_RME'] = True 
     358    env['ENABLE_BOUNCE'] = True 
     359    env['ENABLE_MAUDIO'] = True 
    357360 
    358361if env['ENABLE_BEBOB'] or env['ENABLE_DICE'] \ 
    359362   or env['ENABLE_BOUNCE'] or env['ENABLE_FIREWORKS'] \ 
    360363   or env['ENABLE_OXFORD'] or env['ENABLE_MAUDIO']: 
    361        env['ENABLE_GENERICAVC'] = True 
     364    env['ENABLE_GENERICAVC'] = True 
    362365 
    363366env['BUILD_STATIC_LIB'] = False 
     
    367370 
    368371if build_base: 
    369        env['build_base']="#/"+build_base 
    370 else: 
    371        env['build_base']="#/" 
     372    env['build_base']="#/"+build_base 
     373else: 
     374    env['build_base']="#/" 
    372375 
    373376# 
     
    384387env['INCLUDEDIR'] = Template( env['INCLUDEDIR'] ).safe_substitute( env ) 
    385388env['SHAREDIR'] = Template( env['SHAREDIR'] ).safe_substitute( env ) 
     389env['prefix'] = Template( env.destdir + env['PREFIX'] ).safe_substitute( env ) 
    386390env['bindir'] = Template( env.destdir + env['BINDIR'] ).safe_substitute( env ) 
    387391env['libdir'] = Template( env.destdir + env['LIBDIR'] ).safe_substitute( env ) 
    388392env['includedir'] = Template( env.destdir + env['INCLUDEDIR'] ).safe_substitute( env ) 
    389393env['sharedir'] = Template( env.destdir + env['SHAREDIR'] ).safe_substitute( env ) 
     394env['pypkgdir'] = Template( env.destdir + env['PYPKGDIR'] ).safe_substitute( env ) 
     395env['PYPKGDIR'] = Template( env['PYPKGDIR'] ).safe_substitute( env ) 
    390396 
    391397env.Command( target=env['sharedir'], source="", action=Mkdir( env['sharedir'] ) ) 
     
    395401env.Alias( "install", env['sharedir'] ) 
    396402env.Alias( "install", env['bindir'] ) 
     403env.Alias( "install", env['pypkgdir'] ) 
    397404 
    398405# 
     
    504511    else: 
    505512        print "Doing a 32-bit build" 
    506        env.MergeFlags( "-m32" ) 
     513    env.MergeFlags( "-m32" ) 
    507514 
    508515if needs_fPIC or '-fPIC' in env['OS_CFLAGS'] or "-fPIC" in env['OS_CCFLAGS']: 
     
    522529# try to circumvent localized versions 
    523530if len(env['REVISION']) >= 5 and env['REVISION'][0:6] == 'export': 
    524        env['REVISION'] = '' 
     531    env['REVISION'] = '' 
    525532 
    526533env['FFADO_API_VERSION']=FFADO_API_VERSION 
     
    566573subdirs=['external','src','libffado','support','doc'] 
    567574if env['BUILD_TESTS']: 
    568        subdirs.append('tests') 
     575    subdirs.append('tests') 
    569576 
    570577if build_base: 
    571        #env.SConscript( dirs=subdirs, exports="env", build_dir=build_base ) 
    572        builddirs = list() 
    573        for dir in subdirs: 
    574                builddirs.append( build_base + dir ) 
    575        env.SConscript( dirs=subdirs, exports="env", build_dir=builddirs ) 
    576 else: 
    577        env.SConscript( dirs=subdirs, exports="env" ) 
     578    #env.SConscript( dirs=subdirs, exports="env", build_dir=build_base ) 
     579    builddirs = list() 
     580    for dir in subdirs: 
     581        builddirs.append( build_base + dir ) 
     582    env.SConscript( dirs=subdirs, exports="env", build_dir=builddirs ) 
     583else: 
     584    env.SConscript( dirs=subdirs, exports="env" ) 
    578585 
    579586if 'debian' in COMMAND_LINE_TARGETS: 
    580        env.SConscript("deb/SConscript", exports="env") 
     587    env.SConscript("deb/SConscript", exports="env") 
    581588 
    582589# By default only src is built but all is cleaned 
     
    593600# 
    594601if len(env.destdir) > 0: 
    595        if not len( ARGUMENTS.get( "WILL_DEAL_WITH_XDG_MYSELF", "" ) ) > 0: 
    596                print """ 
     602    if not len( ARGUMENTS.get( "WILL_DEAL_WITH_XDG_MYSELF", "" ) ) > 0: 
     603        print """ 
    597604WARNING! 
    598605You are using the (packagers) option DESTDIR to install this package to a 
     
    605612else: 
    606613 
    607        def CleanAction( action ): 
    608                if env.GetOption( "clean" ): 
    609                        env.Execute( action ) 
    610  
    611        if env.has_key( 'XDG_TOOLS' ) and env.has_key( 'PYUIC4' ): 
    612                if not env.GetOption("clean"): 
    613                        action = "install" 
    614                else: 
    615                        action = "uninstall" 
    616                mixerdesktopaction = env.Action( "xdg-desktop-menu %s support/xdg/ffado.org-ffadomixer.desktop" % action ) 
    617                mixericonaction = env.Action( "xdg-icon-resource %s --size 64 --novendor --context apps support/xdg/hi64-apps-ffado.png ffado" % action ) 
    618                env.Command( "__xdgstuff1", None, mixerdesktopaction ) 
    619                env.Command( "__xdgstuff2", None, mixericonaction ) 
    620                env.Alias( "install", ["__xdgstuff1", "__xdgstuff2" ] ) 
    621                CleanAction( mixerdesktopaction ) 
    622                CleanAction( mixericonaction ) 
     614    def CleanAction( action ): 
     615        if env.GetOption( "clean" ): 
     616            env.Execute( action ) 
     617 
     618    if env.has_key( 'XDG_TOOLS' ) and env.has_key( 'PYUIC4' ): 
     619        if not env.GetOption("clean"): 
     620            action = "install" 
     621        else: 
     622            action = "uninstall" 
     623        mixerdesktopaction = env.Action( "xdg-desktop-menu %s support/xdg/ffado.org-ffadomixer.desktop" % action ) 
     624        mixericonaction = env.Action( "xdg-icon-resource %s --size 64 --novendor --context apps support/xdg/hi64-apps-ffado.png ffado" % action ) 
     625        env.Command( "__xdgstuff1", None, mixerdesktopaction ) 
     626        env.Command( "__xdgstuff2", None, mixericonaction ) 
     627        env.Alias( "install", ["__xdgstuff1", "__xdgstuff2" ] ) 
     628        CleanAction( mixerdesktopaction ) 
     629        CleanAction( mixericonaction ) 
    623630 
    624631# 
     
    635642# Another convinience target 
    636643if env.GetOption( "clean" ): 
    637        env.Execute( "rm cache/objects -Rf" ) 
     644    env.Execute( "rm cache/objects -Rf" ) 
    638645 
    639646# 
     
    647654    print "Removing the old qt3-mixer files from the installation..." 
    648655    shutil.rmtree( os.path.join( env['SHAREDIR'], 'python-qt3' ) ) 
    649  
    650  
    651 
    652 # vim: ts=4 ws=4 et 
     656if os.path.exists( os.path.join( env['SHAREDIR'], 'python' ) ): 
     657    print "Removing the old qt3-mixer files from the installation..." 
     658    shutil.rmtree( os.path.join( env['SHAREDIR'], 'python' ) ) 
     659 
     660 
     661
     662# vim: ts=4 sw=4 et