Changeset 1334

Show
Ignore:
Timestamp:
09/23/08 02:32:11 (12 years ago)
Author:
ppalmers
Message:

re #156: detect -fPIC from OS CFLAGS/CCFLAGS

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/libffado-2.0/SConstruct

    r1331 r1334  
    104104if os.environ.has_key('CXX'): 
    105105        env['CXX'] = os.environ['CXX'] 
     106 
     107# grab OS CFLAGS / CCFLAGS 
     108env['OS_CFLAGS']=[] 
     109if os.environ.has_key('CFLAGS'): 
     110        env['OS_CFLAGS'] = os.environ['CFLAGS'] 
     111env['OS_CCFLAGS']=[] 
     112if os.environ.has_key('CCFLAGS'): 
     113        env['OS_CCFLAGS'] = os.environ['CCFLAGS'] 
    106114 
    107115Help( """ 
     
    390398config = config_guess.split ("-") 
    391399 
     400needs_fPIC = False 
     401 
    392402# Autodetect 
    393403if env['DIST_TARGET'] == 'auto': 
     
    478488    elif env['DIST_TARGET'] == "x86_64": 
    479489        print "Doing a 64-bit x86 build" 
    480         env.AppendUnique( CCFLAGS=["-m64","-fPIC"] ) 
    481         env.AppendUnique( CFLAGS=["-m64","-fPIC"] ) 
     490        env.AppendUnique( CCFLAGS=["-m64"] ) 
     491        env.AppendUnique( CFLAGS=["-m64"] ) 
     492        needs_fPIC = True 
    482493    else: 
    483494        print "Doing a 32-bit build" 
    484495        env.AppendUnique( CCFLAGS=["-m32"] ) 
    485496        env.AppendUnique( CFLAGS=["-m32"] ) 
     497 
     498if needs_fPIC or '-fPIC' in env['OS_CFLAGS']: 
     499    env.AppendUnique( CFLAGS=["-fPIC"] ) 
     500if needs_fPIC or '-fPIC' in env['OS_CCFLAGS']: 
     501    env.AppendUnique( CCFLAGS=["-fPIC"] ) 
     502 
    486503 
    487504# end of processor-specific section