~ubuntu-branches/ubuntu/quantal/mesa-demos/quantal

« back to all changes in this revision

Viewing changes to common.py

  • Committer: Bazaar Package Importer
  • Author(s): Christopher James Halse Rogers, Robert Hooker, Christopher James Halse Rogers
  • Date: 2010-09-27 16:18:27 UTC
  • Revision ID: james.westby@ubuntu.com-20100927161827-x40djzmvy8xtdfb0
Tags: 8.0.1-0ubuntu1
[ Robert Hooker ]
* Initial debian packaging of mesa demos now that they are split out
  of the mesa source. (LP: #648401)
[ Christopher James Halse Rogers]
* Add debian/watch
* Split package drops the glxgears_is_not_a_benchmark patch.  Not printing
  the FPS of glxgears isn't really important enough to patch out.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#######################################################################
 
2
# Common SCons code
 
3
 
 
4
import os
 
5
import os.path
 
6
import subprocess
 
7
import sys
 
8
import platform as _platform
 
9
 
 
10
 
 
11
#######################################################################
 
12
# Defaults
 
13
 
 
14
_platform_map = {
 
15
        'linux2': 'linux',
 
16
        'win32': 'windows',
 
17
}
 
18
 
 
19
default_platform = sys.platform
 
20
default_platform = _platform_map.get(default_platform, default_platform)
 
21
 
 
22
_machine_map = {
 
23
        'x86': 'x86',
 
24
        'i386': 'x86',
 
25
        'i486': 'x86',
 
26
        'i586': 'x86',
 
27
        'i686': 'x86',
 
28
        'ppc' : 'ppc',
 
29
        'x86_64': 'x86_64',
 
30
}
 
31
if 'PROCESSOR_ARCHITECTURE' in os.environ:
 
32
        default_machine = os.environ['PROCESSOR_ARCHITECTURE']
 
33
else:
 
34
        default_machine = _platform.machine()
 
35
default_machine = _machine_map.get(default_machine, 'generic')
 
36
 
 
37
if default_platform in ('linux', 'freebsd'):
 
38
        default_dri = 'yes'
 
39
elif default_platform in ('winddk', 'windows', 'wince', 'darwin'):
 
40
        default_dri = 'no'
 
41
else:
 
42
        default_dri = 'no'
 
43
 
 
44
 
 
45
#######################################################################
 
46
# Common options
 
47
 
 
48
def AddOptions(opts):
 
49
        try:
 
50
                from SCons.Variables.BoolVariable import BoolVariable as BoolOption
 
51
        except ImportError:
 
52
                from SCons.Options.BoolOption import BoolOption
 
53
        try:
 
54
                from SCons.Variables.EnumVariable import EnumVariable as EnumOption
 
55
        except ImportError:
 
56
                from SCons.Options.EnumOption import EnumOption
 
57
        opts.Add(BoolOption('debug', 'debug build', 'yes'))
 
58
        opts.Add(BoolOption('profile', 'profile build', 'no'))
 
59
        opts.Add(BoolOption('quiet', 'quiet command lines', 'yes'))
 
60
        opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine,
 
61
                                                                                         allowed_values=('generic', 'ppc', 'x86', 'x86_64')))
 
62
        opts.Add(EnumOption('platform', 'target platform', default_platform,
 
63
                                                                                         allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'embedded', 'cygwin')))
 
64
        opts.Add('toolchain', 'compiler toolchain', 'default')