LOCAL_SRC_FILES := \
$(LOADER_C_FILES)
-# swrast only
-ifeq ($(MESA_GPU_DRIVERS),swrast)
-LOCAL_CFLAGS += -D__NOT_HAVE_DRM_H
-else
+ifneq ($(filter-out swrast,$(MESA_GPU_DRIVERS)),)
+LOCAL_CFLAGS += -DHAVE_LIBDRM
LOCAL_SHARED_LIBRARIES := libdrm
endif
#endif
#include "loader.h"
-#ifndef __NOT_HAVE_DRM_H
+#ifdef HAVE_LIBDRM
#include <xf86drm.h>
#endif
}
#endif
-#if !defined(__NOT_HAVE_DRM_H)
+#if defined(HAVE_LIBDRM)
/* for i915 */
#include <i915_drm.h>
/* for radeon */
if (sysfs_get_pci_id_for_fd(fd, vendor_id, chip_id))
return 1;
#endif
-#if !defined(__NOT_HAVE_DRM_H)
+#if HAVE_LIBDRM
if (drm_get_pci_id_for_fd(fd, vendor_id, chip_id))
return 1;
#endif
if (!loader_get_pci_id_for_fd(fd, &vendor_id, &chip_id)) {
-#ifndef __NOT_HAVE_DRM_H
+#if HAVE_LIBDRM
/* fallback to drmGetVersion(): */
drmVersionPtr version = drmGetVersion(fd);