libkms: Make vmwgfx optional
authorJakob Bornecrantz <jakob@vmware.com>
Tue, 5 Jan 2010 19:55:02 +0000 (20:55 +0100)
committerJakob Bornecrantz <jakob@vmware.com>
Tue, 5 Jan 2010 20:06:13 +0000 (21:06 +0100)
configure.ac
libkms/Makefile.am
libkms/api.c

index b957314..9bad81a 100644 (file)
@@ -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])
 
index d65d601..62d154b 100644 (file)
@@ -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
index 6f899c4..478fa38 100644 (file)
@@ -26,6 +26,7 @@
  **************************************************************************/
 
 
+#include "config.h"
 #include <errno.h>
 #include <stdlib.h>
 #include <string.h>
 
 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)