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>
main
Emil Velikov 2014-09-07 17:54:39 +01:00
parent be7d297172
commit f3fd11beaa
3 changed files with 18 additions and 6 deletions

View File

@ -270,6 +270,9 @@ fi
AM_CONDITIONAL(HAVE_LIBKMS, [test "x$LIBKMS" = xyes]) AM_CONDITIONAL(HAVE_LIBKMS, [test "x$LIBKMS" = xyes])
AM_CONDITIONAL(HAVE_INTEL, [test "x$INTEL" = xyes]) AM_CONDITIONAL(HAVE_INTEL, [test "x$INTEL" = xyes])
if test "x$INTEL" = xyes; then
AC_DEFINE(HAVE_INTEL, 1, [Have intel support])
fi
AM_CONDITIONAL(HAVE_VMWGFX, [test "x$VMWGFX" = xyes]) AM_CONDITIONAL(HAVE_VMWGFX, [test "x$VMWGFX" = xyes])
if test "x$VMWGFX" = xyes; then if test "x$VMWGFX" = xyes; then

View File

@ -15,7 +15,6 @@ libkms_la_LIBADD = ../libdrm.la
libkms_la_SOURCES = \ libkms_la_SOURCES = \
internal.h \ internal.h \
linux.c \ linux.c \
intel.c \
dumb.c \ dumb.c \
api.c api.c
@ -23,6 +22,10 @@ if HAVE_VMWGFX
libkms_la_SOURCES += vmwgfx.c libkms_la_SOURCES += vmwgfx.c
endif endif
if HAVE_INTEL
libkms_la_SOURCES += intel.c
endif
if HAVE_NOUVEAU if HAVE_NOUVEAU
libkms_la_SOURCES += nouveau.c libkms_la_SOURCES += nouveau.c
endif endif

View File

@ -103,25 +103,31 @@ linux_from_sysfs(int fd, struct kms_driver **out)
if (ret) if (ret)
return ret; return ret;
#ifdef HAVE_INTEL
if (!strcmp(name, "intel")) if (!strcmp(name, "intel"))
ret = intel_create(fd, out); ret = intel_create(fd, out);
else
#endif
#ifdef HAVE_VMWGFX #ifdef HAVE_VMWGFX
else if (!strcmp(name, "vmwgfx")) if (!strcmp(name, "vmwgfx"))
ret = vmwgfx_create(fd, out); ret = vmwgfx_create(fd, out);
else
#endif #endif
#ifdef HAVE_NOUVEAU #ifdef HAVE_NOUVEAU
else if (!strcmp(name, "nouveau")) if (!strcmp(name, "nouveau"))
ret = nouveau_create(fd, out); ret = nouveau_create(fd, out);
else
#endif #endif
#ifdef HAVE_RADEON #ifdef HAVE_RADEON
else if (!strcmp(name, "radeon")) if (!strcmp(name, "radeon"))
ret = radeon_create(fd, out); ret = radeon_create(fd, out);
else
#endif #endif
#ifdef HAVE_EXYNOS #ifdef HAVE_EXYNOS
else if (!strcmp(name, "exynos")) if (!strcmp(name, "exynos"))
ret = exynos_create(fd, out); ret = exynos_create(fd, out);
#endif
else else
#endif
ret = -ENOSYS; ret = -ENOSYS;
free(name); free(name);