aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@koruna.cs.unc.edu>2009-03-25 20:52:40 -0400
committerBjoern B. Brandenburg <bbb@koruna.cs.unc.edu>2009-03-25 20:52:40 -0400
commit8ce85aaacafa0a46827f7799d051a20fac639ee9 (patch)
treed17c1421ba1d416dac444e6498995ddbc9fb2a9a
parent1cf9e8f4da7133d657b369adf5b38bed1dd02834 (diff)
cleanup the setting of architecture-dependent flags
This change moves all flags into the config section instead of hiding them below.
-rw-r--r--SConstruct29
1 files changed, 17 insertions, 12 deletions
diff --git a/SConstruct b/SConstruct
index ca401b0..ecb4b4f 100644
--- a/SConstruct
+++ b/SConstruct
@@ -6,6 +6,15 @@ LITMUS_KERNEL = '../litmus2008'
6# Internal configuration. 6# Internal configuration.
7DEBUG_FLAGS = '-Wall -g -Wdeclaration-after-statement' 7DEBUG_FLAGS = '-Wall -g -Wdeclaration-after-statement'
8API_FLAGS = '-D_XOPEN_SOURCE=600 -D_GNU_SOURCE' 8API_FLAGS = '-D_XOPEN_SOURCE=600 -D_GNU_SOURCE'
9X86_32_FLAGS = '-m32'
10X86_64_FLAGS = '-m64'
11V9_FLAGS = '-mcpu=v9 -m64'
12SUPPORTED_ARCHS = {
13 'sparc64' : V9_FLAGS,
14 'i686' : X86_32_FLAGS,
15 'i386' : X86_32_FLAGS,
16 'x86_64' : X86_64_FLAGS,
17}
9 18
10KERNEL_INCLUDE = '%s/include/' % LITMUS_KERNEL 19KERNEL_INCLUDE = '%s/include/' % LITMUS_KERNEL
11INCLUDE_DIRS = 'include/ ' + KERNEL_INCLUDE 20INCLUDE_DIRS = 'include/ ' + KERNEL_INCLUDE
@@ -42,27 +51,23 @@ if 'ARCH' in ARGUMENTS:
42elif 'ARCH' in environ: 51elif 'ARCH' in environ:
43 arch = environ['ARCH'] 52 arch = environ['ARCH']
44 53
45if not GetOption('clean') and arch not in ('sparc64', 'i686', 'x86', 'i386'): 54if arch not in SUPPORTED_ARCHS:
46 print 'Error: Building liblitmus is only supported on i686 and sparc64.' 55 print 'Error: Building ft_tools is only supported for the following', \
56 'architectures: %s.' % ', '.join(sorted(SUPPORTED_ARCHS))
47 Exit(1) 57 Exit(1)
58else:
59 arch_flags = Split(SUPPORTED_ARCHS[arch])
48 60
49env = Environment( 61env = Environment(
50 CC = 'gcc', 62 CC = 'gcc',
51 CPPPATH = Split(INCLUDE_DIRS), 63 CPPPATH = Split(INCLUDE_DIRS),
52 CCFLAGS = Split(DEBUG_FLAGS) + Split(API_FLAGS) 64 CCFLAGS = Split(DEBUG_FLAGS) + Split(API_FLAGS) + arch_flags,
65 LINKFLAGS = arch_flags,
53) 66)
54 67
55if arch == 'sparc64':
56 # build 64 bit sparc v9 binaries
57 v9 = Split('-mcpu=v9 -m64')
58 env.Append(CCFLAGS = v9, LINKFLAGS = v9)
59
60if arch in ('i386', 'x86', 'i686'):
61 x86flags = Split('-m32')
62 env.Append(CCFLAGS = x86flags, LINKFLAGS = x86flags)
63
64# Check compile environment 68# Check compile environment
65if not env.GetOption('clean'): 69if not env.GetOption('clean'):
70 print 'Building %s binaries.' % arch
66 # Check for kernel headers. 71 # Check for kernel headers.
67 conf = Configure(env, custom_tests = {'CheckASMLink' : CheckASMLink}) 72 conf = Configure(env, custom_tests = {'CheckASMLink' : CheckASMLink})
68 if not conf.CheckCHeader('litmus/rt_param.h'): 73 if not conf.CheckCHeader('litmus/rt_param.h'):