Commit 8173471f authored by José Fonseca's avatar José Fonseca

scons: Move all env setup to scons/gallium.py

parent 41750107
...@@ -80,27 +80,6 @@ env.Append(CPPPATH = [ ...@@ -80,27 +80,6 @@ env.Append(CPPPATH = [
if env['msvc']: if env['msvc']:
env.Append(CPPPATH = ['#include/c99']) 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 # for debugging
#print env.Dump() #print env.Dump()
......
...@@ -279,6 +279,18 @@ def generate(env): ...@@ -279,6 +279,18 @@ def generate(env):
cppdefines += ['NDEBUG'] cppdefines += ['NDEBUG']
if env['build'] == 'profile': if env['build'] == 'profile':
cppdefines += ['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': if platform == 'windows':
cppdefines += [ cppdefines += [
'WIN32', 'WIN32',
...@@ -405,6 +417,8 @@ def generate(env): ...@@ -405,6 +417,8 @@ def generate(env):
ccflags += ['-m64'] ccflags += ['-m64']
if platform == 'darwin': if platform == 'darwin':
ccflags += ['-fno-common'] ccflags += ['-fno-common']
if env['platform'] != 'windows':
ccflags += ['-fvisibility=hidden']
# See also: # See also:
# - http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html # - http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
ccflags += [ ccflags += [
...@@ -597,7 +611,10 @@ def generate(env): ...@@ -597,7 +611,10 @@ def generate(env):
env['LINK'] = env['CXX'] env['LINK'] = env['CXX']
# Default libs # Default libs
env.Append(LIBS = []) libs = []
if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
libs += ['m', 'pthread', 'dl']
env.Append(LIBS = libs)
# Load tools # Load tools
env.Tool('lex') env.Tool('lex')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment