patch-SConstruct 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. $OpenBSD: patch-SConstruct,v 1.1.1.1 2013/06/07 03:41:44 bentley Exp $
  2. --- SConstruct.orig Sat May 8 03:41:20 2010
  3. +++ SConstruct Sat Jun 1 11:12:50 2013
  4. @@ -207,8 +207,6 @@ else:
  5. # Set libpath for real
  6. libpath = [archlib, archlib + '/X11', '/usr/X11R6/lib']
  7. - ccflags += ' -march=' + arch
  8. -
  9. env.Append(LINKFLAGS = '`pkg-config --libs-only-L x11`')
  10. if (debug >= 4):
  11. ccflags += ' -g -pg -O3' # profiling
  12. @@ -220,7 +218,6 @@ else:
  13. env.Append(CPPDEFINES = ['DEBUG'])
  14. elif (debug == 1):
  15. # same as debug==0 but with DEBUG defined to make logging work (and probably other stuff)
  16. - ccflags += ' -g -O2'
  17. env.Append(CPPDEFINES = ['DEBUG'])
  18. elif (debug == -1):
  19. ccflags += ' -g -O3 -mfpmath=sse -mmmx -msse -m3dnow'
  20. @@ -258,18 +255,18 @@ else:
  21. env.Append(CCFLAGS = ccflags)
  22. # check for broken libGL, ignore undefined symbols then
  23. - if (checkconf == True and os.system('grep glBindProgram /usr/include/GL/gl*.h > /dev/null') == 0):
  24. + if (checkconf == True and os.system('grep glBindProgram ${X11BASE}/include/GL/gl*.h > /dev/null') == 0):
  25. gllibdirs = ['/usr/X11R6/lib/', '/usr/lib/', '/usr/local/lib/']
  26. gllibdir = ''
  27. for i in gllibdirs:
  28. - if (os.system('test -f '+i+'libGL.so') == 0):
  29. + if (os.system('test -f '+i+'libGL.so*') == 0):
  30. gllibdir = i
  31. break
  32. if (gllibdir == ''):
  33. print 'ERROR: no libGL.so detected!'
  34. else:
  35. print 'Found GL library "'+gllibdir+'libGL.so"'
  36. - if (os.system('grep glBindProgram '+gllibdir+'libGL.so > /dev/null') != 0):
  37. + if (os.system('grep glBindProgram '+gllibdir+'libGL.so* > /dev/null') != 0):
  38. print 'GL headers declare glBindProgram, but libGL.so has no such symbol! Ignoring all undefined symbols...'
  39. # I'm not sure which option will hopefully fix the problem... so i use both...
  40. env.Append(LINKFLAGS = '--unresolved-symbols=ignore-all')
  41. @@ -289,6 +286,12 @@ target_dir = '#build' + os.sep + build_dir
  42. source_base_dir = 'src'
  43. libpath = libpath + [target_dir]
  44. env.Append(LIBPATH = libpath)
  45. +env.Append(LIBPATH = '${LOCALBASE}/lib')
  46. +env.Append(CPPPATH = ['${X11BASE}/include', '${X11BASE}/include/GL'])
  47. +env.Replace(CC = os.environ['CC'])
  48. +env.Replace(CXX = os.environ['CXX'])
  49. +env.Replace(CFLAGS = os.environ['CFLAGS'])
  50. +env.Replace(CXXFLAGS = os.environ['CXXFLAGS'])
  51. ################ configure
  52. if(checkconf == True):