From c068610a7df370af94fd6177598a35c4425a75f9 Mon Sep 17 00:00:00 2001 From: Jose Fonseca Date: Mon, 18 Apr 2016 11:41:11 +0100 Subject: scons: Move fallback HAVE_* definitions to headers. These were being defined in SCons, but it's not practical: - we actually need to include Gallium headers from external source trees, with completely disjoint build infrastructure, and it's unsustainable to replicate the HAVE_xxx checks or even hard-coded defines across everywhere. - checking compiler version via command line doesn't really work due to Clang essentially being like a cameleon which can fake either GCC or MSVC There's no change for autoconf. Reviewed-by: Roland Scheidegger Reviewed-by: Brian Paul --- scons/gallium.py | 48 +++++------------------------------------------- 1 file changed, 5 insertions(+), 43 deletions(-) (limited to 'scons/gallium.py') diff --git a/scons/gallium.py b/scons/gallium.py index dd29c75..1a81962 100755 --- a/scons/gallium.py +++ b/scons/gallium.py @@ -171,16 +171,6 @@ def generate(env): # Allow override compiler and specify additional flags from environment if os.environ.has_key('CC'): env['CC'] = os.environ['CC'] - # Update CCVERSION to match - pipe = SCons.Action._subproc(env, [env['CC'], '--version'], - stdin = 'devnull', - stderr = 'devnull', - stdout = subprocess.PIPE) - if pipe.wait() == 0: - line = pipe.stdout.readline() - match = re.search(r'[0-9]+(\.[0-9]+)+', line) - if match: - env['CCVERSION'] = match.group(0) if os.environ.has_key('CFLAGS'): env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS']) if os.environ.has_key('CXX'): @@ -299,7 +289,11 @@ def generate(env): # C preprocessor options cppdefines = [] - cppdefines += ['__STDC_LIMIT_MACROS', '__STDC_CONSTANT_MACROS'] + cppdefines += [ + '__STDC_LIMIT_MACROS', + '__STDC_CONSTANT_MACROS', + 'HAVE_NO_AUTOCONF', + ] if env['build'] in ('debug', 'checked'): cppdefines += ['DEBUG'] else: @@ -314,8 +308,6 @@ def generate(env): '_BSD_SOURCE', '_GNU_SOURCE', '_DEFAULT_SOURCE', - 'HAVE_PTHREAD', - 'HAVE_POSIX_MEMALIGN', ] if env['platform'] == 'darwin': cppdefines += [ @@ -336,11 +328,6 @@ def generate(env): if env['platform'] in ('linux', 'darwin'): cppdefines += ['HAVE_XLOCALE_H'] - if env['platform'] == 'haiku': - cppdefines += [ - 'HAVE_PTHREAD', - 'HAVE_POSIX_MEMALIGN' - ] if platform == 'windows': cppdefines += [ 'WIN32', @@ -374,26 +361,6 @@ def generate(env): print 'warning: Floating-point textures enabled.' print 'warning: Please consult docs/patents.txt with your lawyer before building Mesa.' cppdefines += ['TEXTURE_FLOAT_ENABLED'] - if gcc_compat: - ccversion = env['CCVERSION'] - cppdefines += [ - 'HAVE___BUILTIN_EXPECT', - 'HAVE___BUILTIN_FFS', - 'HAVE___BUILTIN_FFSLL', - 'HAVE_FUNC_ATTRIBUTE_FLATTEN', - 'HAVE_FUNC_ATTRIBUTE_UNUSED', - # GCC 3.0 - 'HAVE_FUNC_ATTRIBUTE_FORMAT', - 'HAVE_FUNC_ATTRIBUTE_PACKED', - # GCC 3.4 - 'HAVE___BUILTIN_CTZ', - 'HAVE___BUILTIN_POPCOUNT', - 'HAVE___BUILTIN_POPCOUNTLL', - 'HAVE___BUILTIN_CLZ', - 'HAVE___BUILTIN_CLZLL', - ] - if distutils.version.LooseVersion(ccversion) >= distutils.version.LooseVersion('4.5'): - cppdefines += ['HAVE___BUILTIN_UNREACHABLE'] env.Append(CPPDEFINES = cppdefines) # C compiler options @@ -401,13 +368,8 @@ def generate(env): cxxflags = [] # C++ ccflags = [] # C & C++ if gcc_compat: - ccversion = env['CCVERSION'] if env['build'] == 'debug': ccflags += ['-O0'] - elif env['gcc'] and ccversion.startswith('4.2.'): - # gcc 4.2.x optimizer is broken - print "warning: gcc 4.2.x optimizer is broken -- disabling optimizations" - ccflags += ['-O0'] else: ccflags += ['-O3'] if env['gcc']: -- cgit v1.1