dri_inteface: add define for checking presence of drm.h
authorGeorge Sapountzis <gsapountzis@gmail.com>
Fri, 19 Mar 2010 00:38:09 +0000 (02:38 +0200)
committerGeorge Sapountzis <gsapountzis@gmail.com>
Sun, 21 Mar 2010 11:21:45 +0000 (13:21 +0200)
__NOT_HAVE_DRM_H is a like a feature, defined by default on specific platforms
and allows to be defined externally as well.

__NOT_HAVE_DRM_H should only be used by xserver and mesa swrast_dri drivers

include/GL/internal/dri_interface.h
src/mesa/drivers/dri/swrast/Makefile

index 1d4e82e154a4dd93a8b90f2ac0b91979dacff937..aa56eb45d798cfaa1b1cf0d9a247bc68e2320665 100644 (file)
 #define DRI_INTERFACE_H
 
 /* For archs with no drm.h */
-#if !defined(__APPLE__) && !defined(__CYGWIN__) && !defined(__GNU__)
+#if defined(__APPLE__) || defined(__CYGWIN__) || defined(__GNU__)
+#ifndef __NOT_HAVE_DRM_H
+#define __NOT_HAVE_DRM_H
+#endif
+#endif
+
+#ifndef __NOT_HAVE_DRM_H
 #include <drm.h>
 #else
 typedef unsigned int drm_context_t;
index cc59eefdb2dbf5bd4c84c66d1402d8b5c9b4eba8..aeefece4402e5c7118f92c03e2c5f5981d9b4002 100644 (file)
@@ -5,6 +5,8 @@ include $(TOP)/configs/current
 
 LIBNAME = swrast_dri.so
 
+DRIVER_DEFINES = -D__NOT_HAVE_DRM_H
+
 DRIVER_SOURCES = \
        swrast.c \
        swrast_span.c