scons: Add X11 include path if X11 is available.
authorVinson Lee <vlee@freedesktop.org>
Mon, 19 Jan 2015 20:54:44 +0000 (12:54 -0800)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 22 Jan 2015 21:29:43 +0000 (21:29 +0000)
Mac OS X XQuartz places X11 headers at /opt/X11/include.

This patch fixes this Mac OS X SCons build error.

  Compiling src/gallium/state_trackers/glx/xlib/glx_api.c ...
In file included from src/gallium/state_trackers/glx/xlib/glx_api.c:34:
include/GL/glx.h:30:10: fatal error: 'X11/Xlib.h' file not found
         ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
scons/gallium.py

index 8e2090bc6786842b746e0dae9d8656a597a84cba..51955087125929bcfbd4dfd978129553e22e03db 100755 (executable)
@@ -624,6 +624,9 @@ def generate(env):
     env.PkgCheckModules('DRM', ['libdrm >= 2.4.38'])
     env.PkgCheckModules('UDEV', ['libudev >= 151'])
 
+    if env['x11']:
+        env.Append(CPPPATH = env['X11_CPPPATH'])
+
     env['dri'] = env['x11'] and env['drm']
 
     # for debugging