diff options
| author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2009-03-02 16:57:31 -0500 |
|---|---|---|
| committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2009-03-02 16:57:31 -0500 |
| commit | 1cf9e8f4da7133d657b369adf5b38bed1dd02834 (patch) | |
| tree | 05ac88ec55c4a8601944c6b99a8f65571493ef05 /SConstruct | |
| parent | 3c5dae7026bc20c0ba7e6d50cce7260b14fc50ab (diff) | |
| parent | 964538f8db84c91504acda143aab91d3e20e06e2 (diff) | |
Merge branch 'master' of ssh://cvs/cvs/proj/litmus/repo/liblitmus2008
Diffstat (limited to 'SConstruct')
| -rw-r--r-- | SConstruct | 19 |
1 files changed, 14 insertions, 5 deletions
| @@ -28,15 +28,21 @@ def CheckASMLink(context): | |||
| 28 | 28 | ||
| 29 | # ##################################################################### | 29 | # ##################################################################### |
| 30 | # Build configuration. | 30 | # Build configuration. |
| 31 | from os import uname | 31 | from os import uname, environ |
| 32 | 32 | ||
| 33 | # sanity check | 33 | # sanity check |
| 34 | (os, _, _, _, arch) = uname() | 34 | (ostype, _, _, _, arch) = uname() |
| 35 | if os != 'Linux': | 35 | if 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 | ||
| 39 | if arch not in ('sparc64', 'i686'): | 39 | # override arch if ARCH is set in environment or command line |
| 40 | if 'ARCH' in ARGUMENTS: | ||
| 41 | arch = ARGUMENTS['ARCH'] | ||
| 42 | elif 'ARCH' in environ: | ||
| 43 | arch = environ['ARCH'] | ||
| 44 | |||
| 45 | if 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 | ||
| 60 | if 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 |
| 55 | if not env.GetOption('clean'): | 65 | if not env.GetOption('clean'): |
| 56 | # Check for kernel headers. | 66 | # Check for kernel headers. |
| @@ -90,7 +100,6 @@ rtm.Append(LIBS = ['m']) | |||
| 90 | mtrt = rt.Clone() | 100 | mtrt = rt.Clone() |
| 91 | mtrt.Append(LINKFLAGS = '-pthread') | 101 | mtrt.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. |
