summaryrefslogtreecommitdiff
path: root/libkms
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2014-09-07 17:54:39 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2014-09-28 17:09:34 +0100
commitf3fd11beaa70b0624ab1d6c7d8e25c65eea942ac (patch)
tree45ba3d2286daac712e1e55e72585c0037ddd64c8 /libkms
parentbe7d29717239f1b5230dffecf7060b57fcbab20a (diff)
libkms: build the intel backend only when needed
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Diffstat (limited to 'libkms')
-rw-r--r--libkms/Makefile.am5
-rw-r--r--libkms/linux.c16
2 files changed, 15 insertions, 6 deletions
diff --git a/libkms/Makefile.am b/libkms/Makefile.am
index 449a73ba..dae44e96 100644
--- a/libkms/Makefile.am
+++ b/libkms/Makefile.am
@@ -15,7 +15,6 @@ libkms_la_LIBADD = ../libdrm.la
libkms_la_SOURCES = \
internal.h \
linux.c \
- intel.c \
dumb.c \
api.c
@@ -23,6 +22,10 @@ if HAVE_VMWGFX
libkms_la_SOURCES += vmwgfx.c
endif
+if HAVE_INTEL
+libkms_la_SOURCES += intel.c
+endif
+
if HAVE_NOUVEAU
libkms_la_SOURCES += nouveau.c
endif
diff --git a/libkms/linux.c b/libkms/linux.c
index 17e1d588..77a0bbe9 100644
--- a/libkms/linux.c
+++ b/libkms/linux.c
@@ -103,25 +103,31 @@ linux_from_sysfs(int fd, struct kms_driver **out)
if (ret)
return ret;
+#ifdef HAVE_INTEL
if (!strcmp(name, "intel"))
ret = intel_create(fd, out);
+ else
+#endif
#ifdef HAVE_VMWGFX
- else if (!strcmp(name, "vmwgfx"))
+ if (!strcmp(name, "vmwgfx"))
ret = vmwgfx_create(fd, out);
+ else
#endif
#ifdef HAVE_NOUVEAU
- else if (!strcmp(name, "nouveau"))
+ if (!strcmp(name, "nouveau"))
ret = nouveau_create(fd, out);
+ else
#endif
#ifdef HAVE_RADEON
- else if (!strcmp(name, "radeon"))
+ if (!strcmp(name, "radeon"))
ret = radeon_create(fd, out);
+ else
#endif
#ifdef HAVE_EXYNOS
- else if (!strcmp(name, "exynos"))
+ if (!strcmp(name, "exynos"))
ret = exynos_create(fd, out);
-#endif
else
+#endif
ret = -ENOSYS;
free(name);