2 # This script set linux specific flags (GNU GCC)
7 print "Reading linux configuration script"
9 # Set release/debug flags
10 if env.get('RELEASE'):
11 env.AppendUnique(CCFLAGS = ['-Os'])
12 env.AppendUnique(CPPDEFINES = ['NDEBUG'])
14 env.AppendUnique(CCFLAGS = ['-g'])
16 if env.get('LOGGING'):
17 env.AppendUnique(CPPDEFINES = ['-DTB_LOG'])
19 env.AppendUnique(CPPDEFINES = ['WITH_POSIX', '__linux__'])
20 env.AppendUnique(CFLAGS = ['-std=gnu99'])
21 env.AppendUnique(CCFLAGS = ['-Wall', '-Wextra', '-fPIC'])
22 env.AppendUnique(LINKFLAGS = ['-ldl', '-lpthread'])
24 if env.get('TARGET_OS') == 'tizen':
25 env.AppendUnique(CCFLAGS = ['-D__TIZEN__', '-DSLP_SDK_LOG', '-D_GNU_SOURCE', '-DTIZEN_DEBUG_ENABLE'])
26 env.ParseConfig("pkg-config dlog --cflags --libs")
29 target_arch = env.get('TARGET_ARCH')
30 if target_arch in ['x86']:
31 env.AppendUnique(CCFLAGS = ['-m32'])
32 env.AppendUnique(LINKFLAGS = ['-m32'])
33 elif target_arch in ['x86_64']:
34 env.AppendUnique(CCFLAGS = ['-m64'])
35 env.AppendUnique(LINKFLAGS = ['-m64'])
36 elif target_arch in ['arm'] or target_arch.find('v5') > 0:
37 env.AppendUnique(CPPFLAGS = ['-march=armv5te'])
38 elif target_arch.find('v7a-hard') > 0:
39 env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
40 env.AppendUnique(CPPFLAGS = ['-mfloat-abi=hard'])
41 env.AppendUnique(CCFLAGS = ['-mfloat-abi=hard'])
42 env.AppendUnique(LINKFLAGS = ['-mfloat-abi=hard'])
43 elif target_arch.find('v7a') > 0:
44 env.AppendUnique(CPPFLAGS = ['-march=armv7-a'])
45 elif target_arch.find('arm64') >= 0:
46 env.AppendUnique(CPPFLAGS = ['-march=armv8-a'])