summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2010-08-18 11:34:49 +0200
committerThomas Hellstrom <thellstrom@vmware.com>2010-08-18 12:07:01 +0200
commitf51ca2cb756dcd541a27f0326496f0aadab3f214 (patch)
treedc47151addc3c189162b04b6eeb8f74023f7da26
parent2e6eca3e7bb19ea69db2cc367c9704c7d657db79 (diff)
Make the driver build and run without libdrm.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
-rw-r--r--configure.ac5
-rw-r--r--src/Makefile.am4
-rw-r--r--src/vmwaremodule.c11
3 files changed, 16 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index f88d376..52335e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -65,7 +65,10 @@ XORG_DRIVER_CHECK_EXT(XV, videoproto)
# Obtain compiler/linker options for the driver dependencies
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.1 xproto fontsproto $REQUIRED_MODULES])
-PKG_CHECK_MODULES(DRM, [libdrm])
+PKG_CHECK_MODULES(LIBDRM,
+ [libdrm],
+ [AC_DEFINE([HAVE_LIBDRM], 1, [Has libdrm])],
+ [echo "Will not try support for 3D or kernel modesetting."])
PKG_CHECK_EXISTS([xorg-server >= 1.1.0],
[AC_DEFINE([HAVE_XORG_SERVER_1_1_0], 1,
diff --git a/src/Makefile.am b/src/Makefile.am
index 0b74eca..7c972cf 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -54,8 +54,8 @@ vmwlegacy_drv_la_SOURCES = \
vmware_drv_la_LTLIBRARIES = vmware_drv.la
vmware_drv_la_LDFLAGS = -module -avoid-version
-vmware_drv_la_CFLAGS = @XORG_CFLAGS@ @DRM_CFLAGS@
-vmware_drv_la_LIBADD = @DRM_LIBS@
+vmware_drv_la_CFLAGS = @XORG_CFLAGS@ @LIBDRM_CFLAGS@
+vmware_drv_la_LIBADD = @LIBDRM_LIBS@
vmware_drv_ladir = @moduledir@/drivers
vmware_drv_la_SOURCES = \
diff --git a/src/vmwaremodule.c b/src/vmwaremodule.c
index 9cc180a..b6c3adf 100644
--- a/src/vmwaremodule.c
+++ b/src/vmwaremodule.c
@@ -25,12 +25,15 @@
#include <xorg-server.h>
#include <xf86.h>
-#include <xf86drm.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+#ifdef HAVE_LIBDRM
+#include <xf86drm.h>
+#endif
+
/*
* Defines and exported module info.
*/
@@ -80,6 +83,7 @@ extern XF86ModuleData *VMWGFX_MODULE_DATA;
static Bool
vmware_check_kernel_module()
{
+#ifdef HAVE_LIBDRM
/* Super simple way of knowing if the kernel driver is loaded */
int ret = drmOpen(VMWGFX_MODULE_NAME, NULL);
if (ret < 0) {
@@ -96,11 +100,15 @@ vmware_check_kernel_module()
drmClose(ret);
return TRUE;
+#else
+ return FALSE;
+#endif /* HAVE_LIBDRM */
}
static Bool
vmware_check_vmwgfx_driver(int matched, pointer opts)
{
+#ifdef HAVE_LIBDRM
int major; int minor;
pointer module;
CARD32 version;
@@ -140,6 +148,7 @@ vmware_check_vmwgfx_driver(int matched, pointer opts)
err:
/* XXX We should drop the reference on the module here */
+#endif /* HAVE_LIBDRM */
return FALSE;
}