From 8173471fc25f4c768cab54fa840fd4c53d1c3c0f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Fri, 17 Jun 2011 16:28:27 +0100 Subject: [PATCH] scons: Move all env setup to scons/gallium.py --- SConstruct | 21 --------------------- scons/gallium.py | 19 ++++++++++++++++++- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/SConstruct b/SConstruct index dc5fd776a71..104cc38aa63 100644 --- a/SConstruct +++ b/SConstruct @@ -80,27 +80,6 @@ env.Append(CPPPATH = [ if env['msvc']: env.Append(CPPPATH = ['#include/c99']) -# Posix -if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'): - env.Append(CPPDEFINES = [ - '_POSIX_SOURCE', - ('_POSIX_C_SOURCE', '199309L'), - '_SVID_SOURCE', - '_BSD_SOURCE', - '_GNU_SOURCE', - 'PTHREADS', - 'HAVE_POSIX_MEMALIGN', - ]) - if env['gcc']: - env.Append(CFLAGS = ['-fvisibility=hidden']) - if env['platform'] == 'darwin': - env.Append(CPPDEFINES = ['_DARWIN_C_SOURCE']) - env.Append(LIBS = [ - 'm', - 'pthread', - 'dl', - ]) - # for debugging #print env.Dump() diff --git a/scons/gallium.py b/scons/gallium.py index 57acfe032f2..9d08efdd10c 100755 --- a/scons/gallium.py +++ b/scons/gallium.py @@ -279,6 +279,18 @@ def generate(env): cppdefines += ['NDEBUG'] if env['build'] == 'profile': cppdefines += ['PROFILE'] + if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'): + cppdefines += [ + '_POSIX_SOURCE', + ('_POSIX_C_SOURCE', '199309L'), + '_SVID_SOURCE', + '_BSD_SOURCE', + '_GNU_SOURCE', + 'PTHREADS', + 'HAVE_POSIX_MEMALIGN', + ] + if env['platform'] == 'darwin': + cppdefines += ['_DARWIN_C_SOURCE'] if platform == 'windows': cppdefines += [ 'WIN32', @@ -405,6 +417,8 @@ def generate(env): ccflags += ['-m64'] if platform == 'darwin': ccflags += ['-fno-common'] + if env['platform'] != 'windows': + ccflags += ['-fvisibility=hidden'] # See also: # - http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html ccflags += [ @@ -597,7 +611,10 @@ def generate(env): env['LINK'] = env['CXX'] # Default libs - env.Append(LIBS = []) + libs = [] + if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'): + libs += ['m', 'pthread', 'dl'] + env.Append(LIBS = libs) # Load tools env.Tool('lex') -- 2.30.2