SConscript(
'src/glsl/SConscript',
- variant_dir = env['build'] + '/host',
+ variant_dir = os.path.join(env['build'], 'host'),
duplicate = 0, # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
exports={'env':host_env},
)
variant_dir = env['build'],
duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
)
+
+SConscript(
+ 'progs/SConscript',
+ variant_dir = os.path.join('progs', env['build']),
+ duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
+)
by -debug for debug builds.
</p>
-<p>
-The sample programs are built seperately. To build them do
-<pre>
- scons -C progs
-</pre>
-And the build output will be placed in progs/build/...
-</p>
-
<p>
To build Mesa with SCons for Windows on Linux using the MinGW crosscompiler toolchain do
</p>
<pre>
scons platform=windows toolchain=crossmingw machine=x86 statetrackers=mesa drivers=softpipe,trace winsys=gdi
- scons -C progs platform=windows toolchain=crossmingw machine=x86 -k
</pre>
<p>
This will create:
SConscript([
'util/SConscript',
+])
+
+Import('*')
+
+progs_env = env.Clone()
+
+if progs_env['platform'] == 'windows':
+ progs_env.Append(CPPDEFINES = ['NOMINMAX'])
+ progs_env.Prepend(LIBS = [
+ 'winmm',
+ 'kernel32',
+ 'user32',
+ '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',
+++ /dev/null
-import os
-import os.path
-import sys
-
-env = Environment(
- tools = ['generic'],
- toolpath = ['../scons'],
- ENV = os.environ,
-)
-
-
-# Use Mesa's headers and libs
-if 1:
- build_topdir = 'build'
- build_subdir = env['platform']
- if env['machine'] != 'generic':
- build_subdir += '-' + env['machine']
- if env['debug']:
- build_subdir += "-debug"
- if env['profile']:
- build_subdir += "-profile"
- build_dir = os.path.join(build_topdir, build_subdir)
-
- env.Append(CPPDEFINES = ['GLEW_STATIC'])
- env.Append(CPPPATH = ['#../include'])
- env.Append(LIBPATH = [
- '#../' + build_dir + '/glew/',
- '#../' + build_dir + '/glut/glx',
- ])
-
-
-conf = Configure(env)
-
-# OpenGL
-if env['platform'] == 'windows':
- env.Prepend(LIBS = ['glu32', 'opengl32'])
-else:
- env.Prepend(LIBS = ['GLU', 'GL'])
-
-# Glut
-env['GLUT'] = False
-if conf.CheckCHeader('GL/glut.h'):
- if env['platform'] == 'windows':
- env['GLUT_LIB'] = 'glut32'
- else:
- env['GLUT_LIB'] = 'glut'
- env['GLUT'] = True
-
-# GLEW
-env['GLEW'] = False
-if conf.CheckCHeader('GL/glew.h'):
- env['GLEW_LIB'] = 'glew'
- env['GLEW'] = True
- env.Prepend(LIBS = ['glew'])
-
-conf.Finish()
-
-
-Export('env')
-
-SConscript(
- 'SConscript',
- build_dir = env['build'],
- duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
-)
Import('*')
-if not env['GLUT']:
- Return()
-
-env = env.Clone()
-
-env.Prepend(CPPPATH = [
- '../util',
-])
-
-env.Prepend(LIBS = [
- util,
- '$GLUT_LIB'
-])
-
-if env['platform'] == 'windows':
- env.Append(CPPDEFINES = ['NOMINMAX'])
- env.Prepend(LIBS = ['winmm'])
-
progs = [
- 'arbfplight',
- 'arbfslight',
- 'arbocclude',
- 'bounce',
- 'clearspd',
- 'copypix',
- 'cubemap',
- 'drawpix',
- 'engine',
- 'fbo_firecube',
- 'fire',
- 'fogcoord',
- 'fplight',
- 'fslight',
- 'gamma',
- 'gearbox',
- 'gears',
- 'geartrain',
- 'glinfo',
- 'gloss',
- 'gltestperf',
- 'ipers',
- 'isosurf',
- 'lodbias',
- 'morph3d',
- 'multiarb',
- 'paltex',
- 'pointblast',
- 'ray',
- 'readpix',
- 'reflect',
- 'renormal',
- 'shadowtex',
- 'singlebuffer',
- 'spectex',
- 'spriteblast',
- 'stex3d',
- 'teapot',
- 'terrain',
- 'tessdemo',
- 'texcyl',
- 'texenv',
- 'textures',
- 'trispd',
- 'tunnel',
- 'tunnel2',
- 'vao_demo',
- 'winpos',
- 'dinoshade',
- 'fbotexture',
- 'projtex',
+ 'arbfplight',
+ 'arbfslight',
+ 'arbocclude',
+ 'bounce',
+ 'clearspd',
+ 'copypix',
+ 'cubemap',
+ 'drawpix',
+ 'engine',
+ 'fbo_firecube',
+ 'fire',
+ 'fogcoord',
+ 'fplight',
+ 'fslight',
+ 'gamma',
+ 'gearbox',
+ 'gears',
+ 'geartrain',
+ 'glinfo',
+ 'gloss',
+ 'gltestperf',
+ 'ipers',
+ 'isosurf',
+ 'lodbias',
+ 'morph3d',
+ 'multiarb',
+ 'paltex',
+ 'pointblast',
+ 'ray',
+ 'readpix',
+ 'reflect',
+ 'renormal',
+ 'shadowtex',
+ 'singlebuffer',
+ 'spectex',
+ 'spriteblast',
+ 'stex3d',
+ 'teapot',
+ 'terrain',
+ 'tessdemo',
+ 'texcyl',
+ 'texenv',
+ 'textures',
+ 'trispd',
+ 'tunnel',
+ 'tunnel2',
+ 'vao_demo',
+ 'winpos',
+ 'dinoshade',
+ 'fbotexture',
+ 'projtex',
]
for prog in progs:
- env.Program(
+ progs_env.Program(
target = prog,
source = prog + '.c',
)
-env.Program(
+progs_env.Program(
target = 'rain',
source = [
'rain.cxx',
-Import('env')
-
-if not env['GLUT']:
- Return()
-
-env = env.Clone()
-
-env.Prepend(CPPPATH = [
- '../util',
-])
-
-env.Prepend(LIBS = ['$GLUT_LIB'])
+Import('*')
progs = [
'fp-tri',
]
for prog in progs:
- env.Program(
+ progs_env.Program(
target = prog,
source = [prog + '.c'],
)
Import('*')
-if not env['GLUT']:
- Return()
-
-env = env.Clone()
-
-env.Prepend(CPPPATH = [
- '../util',
-])
-
-env.Prepend(LIBS = [
- util,
- '$GLUT_LIB'
-])
-
-if env['platform'] == 'windows':
- env.Append(CPPDEFINES = ['NOMINMAX'])
- env.Prepend(LIBS = ['winmm'])
-
progs = [
'array',
'bitmap',
]
for prog in progs:
- env.Program(
+ progs_env.Program(
target = prog,
source = prog + '.c',
)
-Import('env')
-
-if not env['GLUT']:
- Return()
-
-env = env.Clone()
-
-env.Prepend(LIBS = ['$GLUT_LIB'])
+Import('*')
progs = [
'copytex',
]
for prog in progs:
- env.Program(
+ progs_env.Program(
target = prog,
source = [
prog + '.c',
Import('*')
-if not env['GLUT']:
- Return()
-
-env = env.Clone()
-
-env.Prepend(CPPPATH = [
- '../util',
-])
-
-env.Prepend(LIBS = [
- util,
- '$GLUT_LIB'
-])
-
-if env['platform'] == 'windows':
- env.Append(CPPDEFINES = ['NOMINMAX'])
- env.Prepend(LIBS = ['winmm'])
-
progs = [
'aaindex',
'aapoly',
]
for prog in progs:
- env.Program(
+ progs_env.Program(
target = prog,
source = prog + '.c',
)
Import('*')
-if not env['GLUT']:
- Return()
-
-env = env.Clone()
-
-env.Prepend(CPPPATH = [
- '../util',
-])
-
-env.Prepend(LIBS = [
- util,
- '$GLUT_LIB'
-])
-
-if env['platform'] == 'windows':
- env.Append(CPPDEFINES = ['NOMINMAX'])
- env.Prepend(LIBS = ['winmm'])
-
progs = [
'accum',
'bitmap1',
]
for prog in progs:
- env.Program(
+ progs_env.Program(
target = prog,
source = prog + '.c',
)
Import('*')
-if not env['GLUT']:
- Return()
-
-env = env.Clone()
-
-env.Prepend(CPPPATH = [
- '../util',
-])
-
-env.Prepend(LIBS = [
- util,
- '$GLUT_LIB'
-])
-
-if env['platform'] == 'windows':
- env.Append(CPPDEFINES = ['NOMINMAX'])
- env.Prepend(LIBS = ['winmm'])
-
linux_progs = [
'api_speed',
]
]
for prog in progs:
- env.Program(
+ progs_env.Program(
target = prog,
source = prog + '.c',
)
-Import('env')
-
-if not env['GLUT']:
- Return()
-
-env = env.Clone()
-
-env.Prepend(LIBS = ['$GLUT_LIB'])
+Import('*')
progs = [
'clear-fbo-tex',
]
for prog in progs:
- prog = env.Program(
+ prog = progs_env.Program(
target = prog,
source = prog + '.c',
)
-Import('env')
+Import('*')
-if not env['GLUT']:
- Return()
-
-env = env.Clone()
-
-env.Prepend(LIBS = ['$GLUT_LIB'])
-
-env.Program(
+progs_env.Program(
target = 'vp-tris',
source = ['vp-tris.c'],
)
-Import('env')
+Import('*')
-if not env['GLUT']:
- Return()
-
-env = env.Clone()
-
-env.Prepend(LIBS = ['$GLUT_LIB'])
-
-env.Program(
+progs_env.Program(
target = 'vp-tris',
source = ['vp-tris.c'],
)
Import('*')
-if env['platform'] != 'windows':
+if progs_env['platform'] != 'windows':
Return()
-env = env.Clone()
-
-env.Append(LIBS = [
- 'kernel32',
- 'user32',
- 'gdi32',
-])
-
progs = [
'sharedtex_mt',
'wglthreads',
]
for prog in progs:
- env.Program(
+ progs_env.Program(
target = prog,
source = prog + '/' + prog + '.c',
)
-env.Program('wglinfo', ['wglinfo.c'])
+progs_env.Program('wglinfo', ['wglinfo.c'])
env.Append(CPPDEFINES = [
'GLEW_BUILD',
- 'GLEW_STATIC',
+ #'GLEW_STATIC',
#'GLEW_MX', # Multiple Rendering Contexts support
])
'#/include',
])
-glew = env.StaticLibrary(
- target = 'glew',
- source = [
- 'glew.c',
- ],
-)
-
-env = env.Clone()
-
if env['platform'] == 'windows':
env.PrependUnique(LIBS = [
'glu32',
'GL',
'X11',
])
+
+if env['platform'] == 'windows':
+ target = 'glew'
+else:
+ target = 'GLEW'
+
+glew = env.SharedLibrary(
+ target = target,
+ source = [
+ 'glew.c',
+ ],
+)
+
+if env['platform'] == 'windows':
+ glew = env.FindIxes(glew, 'LIBPREFIX', 'LIBSUFFIX')
+
+env = env.Clone()
+
env.Prepend(LIBS = [glew])
env.Program(
target = 'visualinfo',
source = ['visualinfo.c'],
)
+
+Export('glew')
env = env.Clone()
-if env['platform'] != 'windows':
- Return()
-
-target = 'glut32'
-
env.Replace(CPPDEFINES = [
'BUILD_GLUT32',
'GLUT_BUILDING_LIB',
'#/include',
])
-env.PrependUnique(LIBS = [
- 'winmm',
- 'gdi32',
- 'user32',
- 'opengl32',
- 'glu32',
-])
-
sources = [
'glut_bitmap.c',
'glut_bwidth.c',
'glut_warp.c',
'glut_win.c',
'glut_winmisc.c',
-
- 'win32_glx.c',
- 'win32_menu.c',
- 'win32_util.c',
- 'win32_winproc.c',
- 'win32_x11.c',
'glut_8x13.c',
'glut_9x15.c',
'glut_roman.c',
'glut_tr10.c',
'glut_tr24.c',
-
- 'glut.def',
]
-env.SharedLibrary(
+if env['platform'] == 'windows':
+ env.PrependUnique(LIBS = [
+ 'winmm',
+ 'gdi32',
+ 'user32',
+ 'opengl32',
+ 'glu32',
+ ])
+ target = 'glut32'
+ sources += [
+ 'win32_glx.c',
+ 'win32_menu.c',
+ 'win32_util.c',
+ 'win32_winproc.c',
+ 'win32_x11.c',
+ 'glut.def',
+ ]
+else:
+ env.PrependUnique(LIBS = [
+ 'GLU',
+ 'GL',
+ 'X11',
+ 'Xext',
+ 'Xmu',
+ 'Xi',
+ ])
+ target = 'glut'
+ sources += [
+ 'glut_fcb.c',
+ 'glut_menu.c',
+ 'glut_menu2.c',
+ 'glut_glxext.c',
+ 'layerutil.c',
+ ]
+
+
+glut = env.SharedLibrary(
target = target,
source = sources,
)
+
+env.InstallSharedLibrary(glut, version=(3, 7, 1))
+
+if env['platform'] == 'windows':
+ glut = env.FindIxes(glut, 'LIBPREFIX', 'LIBSUFFIX')
+
+Export('glut')