From dea98eb792b5a0637ff2067d9bfe2f666f01423e Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Tue, 26 Jan 2010 20:58:11 +0000 Subject: [PATCH] support an 'embedded' platform target which turns off most parts of the build. --- SConstruct | 13 ++++++-- common.py | 3 +- progs/SConscript | 71 +++++++++++++++++++++--------------------- src/SConscript | 5 +-- src/gallium/SConscript | 7 +++-- 5 files changed, 54 insertions(+), 45 deletions(-) diff --git a/SConstruct b/SConstruct index 3a40244d887..3b8a9e0341e 100644 --- a/SConstruct +++ b/SConstruct @@ -38,6 +38,9 @@ if common.default_platform in ('linux', 'freebsd', 'darwin'): elif common.default_platform in ('winddk',): default_drivers = 'softpipe,svga,i915,i965,trace,identity' default_winsys = 'all' +elif common.default_platform in ('embedded',): + default_drivers = 'softpipe,llvmpipe' + default_winsys = 'xlib' else: default_drivers = 'all' default_winsys = 'all' @@ -83,7 +86,7 @@ platform = env['platform'] # derived options x86 = machine == 'x86' ppc = machine == 'ppc' -gcc = platform in ('linux', 'freebsd', 'darwin') +gcc = platform in ('linux', 'freebsd', 'darwin', 'embedded') msvc = platform in ('windows', 'winddk') Export([ @@ -114,7 +117,7 @@ if env['msvc']: # Posix -if platform in ('posix', 'linux', 'freebsd', 'darwin'): +if platform in ('posix', 'linux', 'freebsd', 'darwin', 'embedded'): env.Append(CPPDEFINES = [ '_POSIX_SOURCE', ('_POSIX_C_SOURCE', '199309L'), @@ -132,9 +135,13 @@ if platform in ('posix', 'linux', 'freebsd', 'darwin'): env.Append(LIBS = [ 'm', 'pthread', - 'expat', 'dl', ]) + if platform != 'embedded': + env.Append(LIBS = [ + 'expat', + ]) + # DRI diff --git a/common.py b/common.py index 101fc558f40..928a4496f78 100644 --- a/common.py +++ b/common.py @@ -59,9 +59,8 @@ def AddOptions(opts): opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine, allowed_values=('generic', 'ppc', 'x86', 'x86_64'))) opts.Add(EnumOption('platform', 'target platform', default_platform, - allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin'))) + allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'embedded'))) opts.Add(EnumOption('toolchain', 'compiler toolchain', 'default', allowed_values=('default', 'crossmingw', 'winsdk', 'winddk'))) opts.Add(BoolOption('llvm', 'use LLVM', 'no')) opts.Add(BoolOption('dri', 'build DRI drivers', default_dri)) - diff --git a/progs/SConscript b/progs/SConscript index 3b180d00bc2..66a1745271d 100644 --- a/progs/SConscript +++ b/progs/SConscript @@ -15,38 +15,39 @@ if progs_env['platform'] == 'windows': 'gdi32', ]) -# OpenGL -if progs_env['platform'] == 'windows': - progs_env.Prepend(LIBS = ['glu32', 'opengl32']) -else: - progs_env.Prepend(LIBS = ['GLU', 'GL']) - -# Glut -progs_env.Prepend(LIBS = [glut]) - -# GLEW -progs_env.Prepend(LIBS = [glew]) - -progs_env.Prepend(CPPPATH = [ - '#progs/util', -]) - -progs_env.Prepend(LIBS = [ - util, -]) - -Export('progs_env') - -SConscript([ - 'demos/SConscript', - 'glsl/SConscript', - 'redbook/SConscript', - 'samples/SConscript', - 'tests/SConscript', - 'trivial/SConscript', - 'vp/SConscript', - 'vpglsl/SConscript', - 'fp/SConscript', - 'wgl/SConscript', - 'perf/SConscript', -]) +if platform != 'embedded': + # OpenGL + if progs_env['platform'] == 'windows': + progs_env.Prepend(LIBS = ['glu32', 'opengl32']) + else: + progs_env.Prepend(LIBS = ['GLU', 'GL']) + + # Glut + progs_env.Prepend(LIBS = [glut]) + + # GLEW + progs_env.Prepend(LIBS = [glew]) + + progs_env.Prepend(CPPPATH = [ + '#progs/util', + ]) + + progs_env.Prepend(LIBS = [ + util, + ]) + + Export('progs_env') + + SConscript([ + 'demos/SConscript', + 'glsl/SConscript', + 'redbook/SConscript', + 'samples/SConscript', + 'tests/SConscript', + 'trivial/SConscript', + 'vp/SConscript', + 'vpglsl/SConscript', + 'fp/SConscript', + 'wgl/SConscript', + 'perf/SConscript', + ]) diff --git a/src/SConscript b/src/SConscript index 6083fcbec98..cd4896ada40 100644 --- a/src/SConscript +++ b/src/SConscript @@ -8,5 +8,6 @@ if 'mesa' in env['statetrackers']: SConscript('gallium/winsys/SConscript') -SConscript('glut/glx/SConscript') -SConscript('glew/SConscript') +if platform != 'embedded': + SConscript('glut/glx/SConscript') + SConscript('glew/SConscript') diff --git a/src/gallium/SConscript b/src/gallium/SConscript index eea32b1314b..d56c5c84617 100644 --- a/src/gallium/SConscript +++ b/src/gallium/SConscript @@ -8,9 +8,10 @@ for driver in env['drivers']: SConscript(os.path.join('drivers', driver, 'SConscript')) SConscript('state_trackers/python/SConscript') -SConscript('state_trackers/glx/xlib/SConscript') -SConscript('state_trackers/dri/SConscript') -SConscript('state_trackers/xorg/SConscript') +if platform != 'embedded': + SConscript('state_trackers/glx/xlib/SConscript') + SConscript('state_trackers/dri/SConscript') + SConscript('state_trackers/xorg/SConscript') if platform == 'windows': SConscript('state_trackers/wgl/SConscript') -- 2.30.2