Ticket #278: SConstruct.compile_flags-2.0branch.patch
| File SConstruct.compile_flags-2.0branch.patch, 3.3 kB (added by arnonym, 2 years ago) |
|---|
-
SConstruct
old new 1 1 #! /usr/bin/python 2 2 # -*- coding: utf-8 -*- 3 3 # 4 # Copyright (C) 2007 -2008Arnold Krille5 # Copyright (C) 2007 -2008 Pieter Palmers4 # Copyright (C) 2007, 2008, 2010 Arnold Krille 5 # Copyright (C) 2007, 2008 Pieter Palmers 6 6 # Copyright (C) 2008 Jonathan Woithe 7 7 # 8 8 # This file is part of FFADO … … 61 61 this is on by default. 62 62 If you just want to use ffado with jack without the tools, you can disable this.\ 63 63 """, True ), 64 BoolOption( "BUILD_STATIC_TOOLS", "Build a statically linked version of the FFADO tools.", False ), 65 EnumOption('DIST_TARGET', 'Build target for cross compiling packagers', 'auto', allowed_values=('auto', 'i386', 'i686', 'x86_64', 'powerpc', 'powerpc64', 'none' ), ignorecase=2), 66 BoolOption( "ENABLE_OPTIMIZATIONS", "Enable optimizations and the use of processor specific extentions (MMX/SSE/...).", False ), 64 BoolOption( "BUILD_STATIC_TOOLS", "Build a statically linked version of the FFADO tools.", False ), 65 EnumOption('DIST_TARGET', 'Build target for cross compiling packagers', 'auto', allowed_values=('auto', 'i386', 'i686', 'x86_64', 'powerpc', 'powerpc64', 'none' ), ignorecase=2), 66 BoolOption( "ENABLE_OPTIMIZATIONS", "Enable optimizations and the use of processor specific extentions (MMX/SSE/...).", False ), 67 BoolOption( "PEDANTIC", "Enable -Werror and more pedantic options during compile.", False ), 68 ( "COMPILE_FLAGS", "Add additional flags to the environment.\nOnly meant for distributors and gentoo-users who want to over-optimize their built.\n Using this is not supported by the ffado-devs!" ), 67 69 68 70 ) 69 71 70 72 ## Load the builders in config 71 73 buildenv=os.environ 72 vars_to_check = [73 'PATH',74 'PKG_CONFIG_PATH',75 'LD_LIBRARY_PATH',76 'XDG_CONFIG_DIRS',77 'XDG_DATA_DIRS',78 'HOME',79 'CC',80 'CFLAGS',81 'CCFLAGS',82 'CXX',83 'CXXFLAGS',84 'CPPFLAGS',85 ]86 for var in vars_to_check:87 if os.environ.has_key(var):88 buildenv[var]=os.environ[var]89 else:90 buildenv[var]=''91 74 92 75 env = Environment( tools=['default','scanreplace','pyuic','pyuic4','dbus','doxygen','pkgconfig'], toolpath=['admin'], ENV = buildenv, options=opts ) 93 76 94 if os.environ.has_key('LDFLAGS'): 95 env.MergeFlags = os.environ['LDFLAGS'] 77 if env.has_key('COMPILE_FLAGS') and len(env['COMPILE_FLAGS']) > 0: 78 print ''' 79 * Usage of additional flags is not supported by the ffado-devs. 80 * Use at own risk! 81 * 82 * Currentl value is '%s' 83 ''' % env['COMPILE_FLAGS'] 84 env.MergeFlags(env['COMPILE_FLAGS']) 96 85 97 # grab OS CFLAGS / CCFLAGS98 env['OS_CFLAGS']=[]99 if os.environ.has_key('CFLAGS'):100 env['OS_CFLAGS'] = os.environ['CFLAGS']101 env.MergeFlags( os.environ['CFLAGS'] )102 env['OS_CCFLAGS']=[]103 if os.environ.has_key('CCFLAGS'):104 env['OS_CCFLAGS'] = os.environ['CCFLAGS']105 env.MergeFlags( os.environ['CCFLAGS'] )106 107 86 Help( """ 108 87 For building ffado you can set different options as listed below. You have to 109 88 specify them only once, scons will save the last value you used and re-use … … 459 438 print "Doing a 32-bit build" 460 439 env.MergeFlags( "-m32" ) 461 440 462 if needs_fPIC or '-fPIC' in env['OS_CFLAGS'] or "-fPIC" in env['OS_CCFLAGS']:441 if needs_fPIC or ( env.has_key('COMPILE_FLAGS') and '-fPIC' in env['COMPILE_FLAGS'] ): 463 442 env.MergeFlags( "-fPIC" ) 464 443 465 444 # end of processor-specific section
