Changeset 1437

Show
Ignore:
Timestamp:
11/16/08 15:11:26 (15 years ago)
Author:
arnonym
Message:

Forward-port r1421 and r1428

Files:

Legend:

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

    r1395 r1437  
    155155        context.Message( "Checking for the python module '" + module + "' " ) 
    156156        ret = True 
    157         try: 
    158                 imp.find_module( module ) 
    159         except ImportError: 
    160                 ret = False 
     157        path = None 
     158        while module.count(".") > 0 and ret: 
     159                thismod = module.split(".")[0] 
     160                try: 
     161                        modinfo = imp.find_module( thismod, path ) 
     162                except ImportError: 
     163                        ret = False 
     164                else: 
     165                        newmod = imp.load_module( thismod, modinfo[0], modinfo[1], modinfo[2] ) 
     166                        path = newmod.__path__ 
     167                module = ".".join( module.split(".")[1:] ) 
     168        if ret: 
     169                try: 
     170                        imp.find_module( module ) 
     171                except ImportError: 
     172                        ret = False 
    161173        context.Result( ret ) 
    162174        return ret 
     
    280292 
    281293        # PyQT checks 
    282         build_mixer = False 
    283         if conf.CheckForApp( "which pyuic" ) and conf.CheckForPyModule( 'dbus' ) and conf.CheckForPyModule( 'qt' ): 
     294        build_mixer = False 
     295        if conf.CheckForApp( 'which pyuic4' ) and conf.CheckForPyModule( 'dbus' ) and conf.CheckForPyModule( 'PyQt4' ) and conf.CheckForPyModule( 'dbus.mainloop.qt' ): 
     296                env['PYUIC4'] = True 
     297                build_mixer = True 
     298         
     299        if conf.CheckForApp( 'which pyuic' ) and conf.CheckForPyModule( 'dbus' ) and conf.CheckForPyModule( 'qt' ): 
    284300                env['PYUIC'] = True 
    285301                build_mixer = True 
    286302         
    287                 if conf.CheckForApp( "xdg-desktop-menu --help" ): 
    288                         env['XDG_TOOLS'] = True 
    289                 else: 
    290                         print """ 
    291         I couldn't find the program 'xdg-desktop-menu'. Together with xdg-icon-resource 
    292         this is needed to add the fancy entry to your menu. But the mixer will be installed, you can start it by executing "ffadomixer". 
    293         """ 
    294         elif conf.CheckForApp( "which pyuic4" ) and conf.CheckForPyModule( 'dbus' ) and conf.CheckForPyModule( 'PyQt4' ): 
    295                 env['PYUIC4'] = True 
    296                 build_mixer = True 
     303        if conf.CheckForApp( 'xdg-desktop-menu --help' ): 
     304                env['XDG_TOOLS'] = True 
     305        else: 
     306                print """ 
     307I couldn't find the program 'xdg-desktop-menu'. Together with xdg-icon-resource 
     308this is needed to add the fancy entry to your menu. But the mixer will be installed, you can start it by executing "ffado-mixer". 
     309""" 
    297310         
    298311                if conf.CheckForApp( "xdg-desktop-menu --help" ): 
     
    585598        Default( 'tests' ) 
    586599 
     600if not env.has_key( 'DESTDIR' ): 
     601        env.Execute( env.Action( "rm -f %s/ffadomixer" % env['bindir'] ) ) 
     602 
    587603# 
    588604# Deal with the DESTDIR vs. xdg-tools conflict (which is basicely that the