Changeset 3678

Show
Ignore:
Timestamp:
28/11/08 17:54:49 (6 weeks ago)
Author:
dmeyer
Message:

improvde imlib2 checks

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/display/setup.py

    r3540 r3678  
    4242    print 'kaa.base not installed' 
    4343    sys.exit(1) 
     44 
     45# check disable parameter 
     46disable = [] 
     47for arg in sys.argv[:]: 
     48    if arg.startswith('--disable-'): 
     49        disable.append(arg[10:]) 
     50        sys.argv.remove(arg) 
    4451 
    4552# config file 
     
    9198        config.define('HAVE_X11_COMPOSITE') 
    9299        x11.add_library('XComposite') 
    93          
     100 
    94101    features = { 'with': [], 'without': [] } 
    95102    imlib2 = get_library('imlib2') 
    96     if imlib2 and imlib2.compile(['<Imlib2.h>'], 'imlib_context_set_display(NULL);'): 
     103    if 'imlib2-x11' in disable or 'imlib2' in disable: 
     104        features['without'].append('imlib2') 
     105    elif imlib2 and imlib2.compile(['<Imlib2.h>'], 'imlib_context_set_display(NULL);'): 
    97106        config.define('USE_IMLIB2_X11') 
    98107        x11.add_library('imlib2') 
    99108        features['with'].append('imlib2') 
    100     else: 
    101         features['without'].append('imlib2') 
    102  
     109    elif imlib2: 
     110        print 
     111        print 'Imlib2 was compiled without X11 support. Therefore Imlib2 for the' 
     112        print 'kaa.display.X11 module is disabled. Please re-compile imlib2 with X11' 
     113        print 'support or add --disable-imlib2-x11 to the setup.py parameter' 
     114        print 
     115        sys.exit(1) 
     116    else: 
     117        print 
     118        print 'Imlib2 not found. Therefore Imlib2 for the kaa.display.X11 module is' 
     119        print 'disabled. Please install imlib2 or add --disable-imlib2 to the setup.py' 
     120        print 'parameter.' 
     121        print 
     122        sys.exit(1) 
    103123    if evas and evas.compile(['<Evas.h>', '<Evas_Engine_Software_X11.h>']): 
    104124        features['with'].append('evas') 
     
    123143 
    124144 
    125 if get_library('imlib2'): 
    126  
     145if get_library('imlib2') and not 'imlib2' in disable: 
    127146    # the framebuffer so module 
    128     fb = Extension('kaa.display._FBmodule',  
    129                    [ 'src/fb.c', 'src/common.c']) 
     147    fb = Extension('kaa.display._FBmodule', [ 'src/fb.c', 'src/common.c']) 
    130148    fb.add_library('imlib2') 
    131149    if evas and evas.compile(['<Evas.h>', '<Evas_Engine_FB.h>']): 
     
    156174 
    157175 
    158 if pygame and get_library('sdl') and get_library('imlib2'): 
     176if pygame and get_library('sdl') and get_library('imlib2') and not 'imlib2' in disable: 
    159177 
    160178    # pygame module