Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SConstruct 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import os
  2. import os.path
  3. import sys
  4. env = Environment(
  5. tools = ['generic'],
  6. toolpath = ['../scons'],
  7. ENV = os.environ,
  8. )
  9. # Use Mesa's headers and libs
  10. if 1:
  11. build_topdir = 'build'
  12. build_subdir = env['platform']
  13. if env['machine'] != 'generic':
  14. build_subdir += '-' + env['machine']
  15. if env['debug']:
  16. build_subdir += "-debug"
  17. if env['profile']:
  18. build_subdir += "-profile"
  19. build_dir = os.path.join(build_topdir, build_subdir)
  20. env.Append(CPPDEFINES = ['GLEW_STATIC'])
  21. env.Append(CPPPATH = ['#../include'])
  22. env.Append(LIBPATH = [
  23. '#../' + build_dir + '/glew/',
  24. '#../' + build_dir + '/glut/glx',
  25. ])
  26. conf = Configure(env)
  27. # OpenGL
  28. if env['platform'] == 'windows':
  29. env.Prepend(LIBS = ['glu32', 'opengl32'])
  30. else:
  31. env.Prepend(LIBS = ['GLU', 'GL'])
  32. # Glut
  33. env['GLUT'] = False
  34. if conf.CheckCHeader('GL/glut.h'):
  35. if env['platform'] == 'windows':
  36. env['GLUT_LIB'] = 'glut32'
  37. else:
  38. env['GLUT_LIB'] = 'glut'
  39. env['GLUT'] = True
  40. # GLEW
  41. env['GLEW'] = False
  42. if conf.CheckCHeader('GL/glew.h'):
  43. env['GLEW_LIB'] = 'glew'
  44. env['GLEW'] = True
  45. env.Prepend(LIBS = ['glew'])
  46. conf.Finish()
  47. Export('env')
  48. SConscript(
  49. 'SConscript',
  50. build_dir = env['build'],
  51. duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
  52. )