Changeset 1150

Show
Ignore:
Timestamp:
05/09/08 11:29:07 (16 years ago)
Author:
holin
Message:

initial powerpc support for the build system

Files:

Legend:

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

    r1130 r1150  
    342342    elif re.search("i[0-5]86", config[config_cpu]) != None: 
    343343        env['DIST_TARGET'] = 'i386' 
     344    elif re.search("powerpc", config[config_cpu]) != None: 
     345        env['DIST_TARGET'] = 'powerpc' 
    344346    else: 
    345347        env['DIST_TARGET'] = 'i686' 
    346348    print "Detected DIST_TARGET = " + env['DIST_TARGET'] 
    347349 
    348 if ((re.search ("i[0-9]86", config[config_cpu]) != None) or (re.search ("x86_64", config[config_cpu]) != None)): 
     350if ((re.search ("i[0-9]86", config[config_cpu]) != None) or (re.search ("x86_64", config[config_cpu]) != None) or (re.search ("powerpc", config[config_cpu]) != None)): 
    349351     
    350352    build_host_supports_sse = 0 
     
    354356    if config[config_kernel] == 'linux' : 
    355357         
    356         if env['DIST_TARGET'] != 'i386'
     358        if (env['DIST_TARGET'] == 'i686') or (env['DIST_TARGET'] == 'x86_64')
    357359             
    358360            flag_line = os.popen ("cat /proc/cpuinfo | grep '^flags'").read()[:-1] 
     
    375377                opt_flags.append ("-march=i686") 
    376378 
     379        elif env['DIST_TARGET'] == 'powerpc': 
     380 
     381            cpu_line = os.popen ("cat /proc/cpuinfo | grep '^cpu'").read()[:-1] 
     382 
     383            ppc_type = cpu_line.split (": ")[1] 
     384            if re.search ("altivec", ppc_type) != None: 
     385                opt_flags.append ("-maltivec") 
     386                opt_flags.append ("-mabi=altivec") 
     387 
     388            ppc_type = ppc_type.split (",")[0] 
     389            if re.match ("74[0145][0578]A?", ppc_type) != None: 
     390                opt_flags.append ("-mcpu=7400") 
     391                opt_flags.append ("-mtune=7400") 
     392            elif re.match ("750", ppc_type) != None: 
     393                opt_flags.append ("-mcpu=750") 
     394                opt_flags.append ("-mtune=750") 
     395            elif re.match ("970([FG]X)?", ppc_type) != None: 
     396                opt_flags.append ("-mcpu=970") 
     397                opt_flags.append ("-mtune=970") 
     398            elif re.match ("Cell Broadband Engine", ppc_type) != None: 
     399                opt_flags.append ("-mcpu=cell") 
     400                opt_flags.append ("-mtune=cell") 
     401 
    377402    if ((env['DIST_TARGET'] == 'i686') or (env['DIST_TARGET'] == 'x86_64')) \ 
    378403       and build_host_supports_sse and env['ENABLE_OPTIMIZATIONS']: