summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Bornecrantz <jakob@vmware.com>2010-01-05 20:55:02 +0100
committerJakob Bornecrantz <jakob@vmware.com>2010-01-05 21:06:13 +0100
commit5dbc1b333b85695735dc5b484372758b9979b693 (patch)
treef846acb10f12def5fcfa12601c1d562188cbdfd1
parentdfbaffea07ba785d5a2d5493282f416488e217cc (diff)
libkms: Make vmwgfx optional
-rw-r--r--configure.ac3
-rw-r--r--libkms/Makefile.am7
-rw-r--r--libkms/api.c5
3 files changed, 13 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index b9573145..9bad81a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -147,6 +147,9 @@ fi
AM_CONDITIONAL(HAVE_LIBKMS, [test "x$LIBKMS" = xyes])
AM_CONDITIONAL(HAVE_VMWGFX, [test "x$VMWGFX" = xyes])
+if test "x$VMWGFX" = xyes; then
+ AC_DEFINE(HAVE_VMWGFX, 1, [Have vmwgfx kernel headers])
+fi
AM_CONDITIONAL(HAVE_NOUVEAU, [test "x$NOUVEAU" = xyes])
diff --git a/libkms/Makefile.am b/libkms/Makefile.am
index d65d6012..62d154b8 100644
--- a/libkms/Makefile.am
+++ b/libkms/Makefile.am
@@ -8,8 +8,11 @@ libkms_la_LDFLAGS = -version-number 1:0:0 -no-undefined
libkms_la_LIBADD =
libkms_la_SOURCES = \
- api.c \
- vmwgfx.c
+ api.c
+
+if HAVE_VMWGFX
+libkms_la_SOURCES += vmwgfx.c
+endif
libkmsincludedir = ${includedir}/libkms
libkmsinclude_HEADERS = libkms.h
diff --git a/libkms/api.c b/libkms/api.c
index 6f899c41..478fa38c 100644
--- a/libkms/api.c
+++ b/libkms/api.c
@@ -26,6 +26,7 @@
**************************************************************************/
+#include "config.h"
#include <errno.h>
#include <stdlib.h>
#include <string.h>
@@ -33,7 +34,11 @@
int kms_create(int fd, struct kms_driver **out)
{
+#ifdef HAVE_VMWGFX
return vmwgfx_create(fd, out);
+#else
+ return -ENOSYS;
+#endif
}
int kms_get_prop(struct kms_driver *kms, unsigned key, unsigned *out)