##
# This script set linux specific flags (GNU GCC)
#
##
import os
import SCons.Util

Import('env')

print "Reading linux configuration script"

# Set release/debug flags
if env.get('RELEASE'):
	env.AppendUnique(CPPDEFINES = ['NDEBUG'])

if env.get('LOGGING'):
    env.AppendUnique(CPPDEFINES = ['-DTB_LOG'])

env['CCFLAGS'] = SCons.Util.CLVar(os.environ.get('CFLAGS', ""))
env.AppendUnique(CPPDEFINES = ['WITH_POSIX', '__linux__'])
env.AppendUnique(CFLAGS = ['-std=gnu99'])
env.AppendUnique(CCFLAGS = ['-Wextra', '-fPIC'])
env.AppendUnique(LIBS = ['dl', 'pthread'])

env.AppendUnique(CCFLAGS = ['-D__TIZEN__', '-D_GNU_SOURCE', '-DTIZEN_DEBUG_ENABLE'])
env.ParseConfig("pkg-config dlog --cflags --libs")

# Set arch flags : It will be handled by Tizen build system.
