aboutsummaryrefslogtreecommitdiffstats
path: root/SConstruct
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2009-03-02 16:57:31 -0500
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2009-03-02 16:57:31 -0500
commit1cf9e8f4da7133d657b369adf5b38bed1dd02834 (patch)
tree05ac88ec55c4a8601944c6b99a8f65571493ef05 /SConstruct
parent3c5dae7026bc20c0ba7e6d50cce7260b14fc50ab (diff)
parent964538f8db84c91504acda143aab91d3e20e06e2 (diff)
Merge branch 'master' of ssh://cvs/cvs/proj/litmus/repo/liblitmus2008
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct19
1 files changed, 14 insertions, 5 deletions
diff --git a/SConstruct b/SConstruct
index 2d2de7f..ca401b0 100644
--- a/SConstruct
+++ b/SConstruct
@@ -28,15 +28,21 @@ def CheckASMLink(context):
28 28
29# ##################################################################### 29# #####################################################################
30# Build configuration. 30# Build configuration.
31from os import uname 31from os import uname, environ
32 32
33# sanity check 33# sanity check
34(os, _, _, _, arch) = uname() 34(ostype, _, _, _, arch) = uname()
35if os != 'Linux': 35if ostype != 'Linux':
36 print 'Error: Building liblitmus is only supported on Linux.' 36 print 'Error: Building liblitmus is only supported on Linux.'
37 Exit(1) 37 Exit(1)
38 38
39if arch not in ('sparc64', 'i686'): 39# override arch if ARCH is set in environment or command line
40if 'ARCH' in ARGUMENTS:
41 arch = ARGUMENTS['ARCH']
42elif 'ARCH' in environ:
43 arch = environ['ARCH']
44
45if not GetOption('clean') and arch not in ('sparc64', 'i686', 'x86', 'i386'):
40 print 'Error: Building liblitmus is only supported on i686 and sparc64.' 46 print 'Error: Building liblitmus is only supported on i686 and sparc64.'
41 Exit(1) 47 Exit(1)
42 48
@@ -51,6 +57,10 @@ if arch == 'sparc64':
51 v9 = Split('-mcpu=v9 -m64') 57 v9 = Split('-mcpu=v9 -m64')
52 env.Append(CCFLAGS = v9, LINKFLAGS = v9) 58 env.Append(CCFLAGS = v9, LINKFLAGS = v9)
53 59
60if arch in ('i386', 'x86', 'i686'):
61 x86flags = Split('-m32')
62 env.Append(CCFLAGS = x86flags, LINKFLAGS = x86flags)
63
54# Check compile environment 64# Check compile environment
55if not env.GetOption('clean'): 65if not env.GetOption('clean'):
56 # Check for kernel headers. 66 # Check for kernel headers.
@@ -90,7 +100,6 @@ rtm.Append(LIBS = ['m'])
90mtrt = rt.Clone() 100mtrt = rt.Clone()
91mtrt.Append(LINKFLAGS = '-pthread') 101mtrt.Append(LINKFLAGS = '-pthread')
92 102
93
94# ##################################################################### 103# #####################################################################
95# Targets: liblitmus libst 104# Targets: liblitmus libst
96# All the files in src/ are part of the library. 105# All the files in src/ are part of the library.