diff mbox

[05/18] libkms: build the intel backend only when needed

Message ID 1410125413-19465-6-git-send-email-emil.l.velikov@gmail.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Emil Velikov Sept. 7, 2014, 9:30 p.m. UTC
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
---
 configure.ac       |  3 +++
 libkms/Makefile.am |  5 ++++-
 libkms/linux.c     | 16 +++++++++++-----
 3 files changed, 18 insertions(+), 6 deletions(-)

Comments

Jakob Bornecrantz Sept. 8, 2014, 10:11 a.m. UTC | #1
On Sun, Sep 7, 2014 at 11:30 PM, Emil Velikov <emil.l.velikov@gmail.com> wrote:
> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
> ---
>  configure.ac       |  3 +++
>  libkms/Makefile.am |  5 ++++-
>  libkms/linux.c     | 16 +++++++++++-----
>  3 files changed, 18 insertions(+), 6 deletions(-)

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>

Cheers, Jakob.

>
> diff --git a/configure.ac b/configure.ac
> index 484084f..f1d3451 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -270,6 +270,9 @@ fi
>  AM_CONDITIONAL(HAVE_LIBKMS, [test "x$LIBKMS" = 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])
>  if test "x$VMWGFX" = xyes; then
> diff --git a/libkms/Makefile.am b/libkms/Makefile.am
> index 449a73b..dae44e9 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 17e1d58..77a0bbe 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);
> --
> 2.0.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index 484084f..f1d3451 100644
--- a/configure.ac
+++ b/configure.ac
@@ -270,6 +270,9 @@  fi
 AM_CONDITIONAL(HAVE_LIBKMS, [test "x$LIBKMS" = 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])
 if test "x$VMWGFX" = xyes; then
diff --git a/libkms/Makefile.am b/libkms/Makefile.am
index 449a73b..dae44e9 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 17e1d58..77a0bbe 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);