scons: add support for MAJOR_IN_{MKDEV,SYSMACROS}
[mesa.git] / scons / gallium.py
index 21197c8d0d12bda8d3f48e98a4b1d348cc8bd3e5..79b9406a975ba8362e6eaf73a71852218737bf72 100755 (executable)
@@ -378,6 +378,14 @@ def generate(env):
         if check_header(env, 'sys/shm.h'):
             cppdefines += ['HAVE_SYS_SHM_H']
 
+        #FIXME: we should really be checking for the major()/minor()
+        # functions/macros in these headers, but check_functions()'s
+        # SConf.CheckFunc() doesn't seem to support macros.
+        if check_header(env, 'sys/mkdev.h'):
+            cppdefines += ['MAJOR_IN_MKDEV']
+        if check_header(env, 'sys/sysmacros.h'):
+            cppdefines += ['MAJOR_IN_SYSMACROS']
+
     if platform == 'windows':
         cppdefines += [
             'WIN32',