summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucian Muresan <lucianm@users.sourceforge.net>2011-02-01 14:05:45 -0500
committerRay Strode <rstrode@redhat.com>2011-02-01 14:33:23 -0500
commit22a1273bb2c9dc0d3188b8ed11b0c97bfca6d3ef (patch)
tree5a2056621284babe9d0ddd2d261026bc4c4150cc
parentf8874cb4b0725f605dc710cc845e6b5ff52ad539 (diff)
drm: reduce minimum build requirements
This patch adds the respective configure options to make it possible to disable libdrm_intel, libdrm_radeon, libdrm_nouveau, and libkms independently from each other. https://bugs.freedesktop.org/show_bug.cgi?id=29804
-rw-r--r--configure.ac160
-rwxr-xr-xscripts/plymouth-populate-initrd.in2
-rw-r--r--src/plugins/renderers/Makefile.am3
-rw-r--r--src/plugins/renderers/drm/Makefile.am27
-rw-r--r--src/plugins/renderers/drm/plugin.c20
5 files changed, 168 insertions, 44 deletions
diff --git a/configure.ac b/configure.ac
index 5bcf38a6..2209df1a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -56,59 +56,159 @@ PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.12.0 ])
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
-PKG_CHECK_MODULES(DRM, [libdrm libdrm_intel libdrm_radeon libdrm_nouveau])
-
-OLD_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS $DRM_CFLAGS"
-AC_MSG_CHECKING([if i915_drm.h, radeon_drm.h and nouveau_drm.h are in include path])
-AC_COMPILE_IFELSE(AC_LANG_PROGRAM(
-[[
- #include <stdint.h>
- #include <stdlib.h>
- #include "i915_drm.h"
- #include "radeon_drm.h"
- #include "nouveau_drm.h"
-]],[[]]),[found_drm_kernel_headers=yes],[found_drm_kernel_headers=no])
-
-if test "$found_drm_kernel_headers" = "yes"; then
- AC_MSG_RESULT([yes])
-else
- AC_MSG_RESULT([no])
- AC_MSG_CHECKING([if we can find them anyway])
-
- MORE_DRM_CFLAGS="-I`$PKG_CONFIG --variable includedir libdrm`/drm"
- CFLAGS="$CFLAGS $MORE_DRM_CFLAGS"
+AC_ARG_ENABLE(libdrm_intel, AS_HELP_STRING([--enable-libdrm_intel],[enable building with libdrm_intel support]),enable_libdrm_intel=$enableval,enable_libdrm_intel=yes)
+AM_CONDITIONAL(ENABLE_LIBDRM_INTEL, [test "$enable_libdrm_intel" = yes])
+
+if test x$enable_libdrm_intel = xyes; then
+ PKG_CHECK_MODULES(DRM_INTEL, [libdrm libdrm_intel])
+ OLD_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $DRM_INTEL_CFLAGS"
+ AC_MSG_CHECKING([if i915_drm.h is in include path])
AC_COMPILE_IFELSE(AC_LANG_PROGRAM(
[[
#include <stdint.h>
#include <stdlib.h>
#include "i915_drm.h"
+ ]],[[]]),[found_drm_intel_kernel_headers=yes],[found_drm_intel_kernel_headers=no])
+
+ if test "$found_drm_intel_kernel_headers" = "yes"; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_CHECKING([if we can find them anyway])
+
+ MORE_DRM_CFLAGS="-I`$PKG_CONFIG --variable includedir libdrm`/drm"
+ CFLAGS="$CFLAGS $MORE_DRM_CFLAGS"
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM(
+ [[
+ #include <stdint.h>
+ #include <stdlib.h>
+ #include "i915_drm.h"
+ ]],[[]]),[found_drm_intel_kernel_headers=yes],[found_drm_intel_kernel_headers=no])
+
+ if test "$found_drm_intel_kernel_headers" = "yes"; then
+ AC_MSG_RESULT([yes])
+ DRM_INTEL_CFLAGS="$DRM_INTEL_CFLAGS $MORE_DRM_CFLAGS"
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([Could not find i915_drm.h])
+ fi
+ fi
+
+ AC_SUBST(DRM_INTEL_CFLAGS)
+ AC_SUBST(DRM_INTEL_LIBS)
+ AC_DEFINE(PLY_ENABLE_LIBDRM_INTEL, 1, [Enable support for libdrm_intel driver])
+fi
+
+AC_ARG_ENABLE(libdrm_radeon, AS_HELP_STRING([--enable-libdrm_radeon],[enable building with libdrm_radeon support]),enable_libdrm_radeon=$enableval,enable_libdrm_radeon=yes)
+AM_CONDITIONAL(ENABLE_LIBDRM_RADEON, [test "$enable_libdrm_radeon" = yes])
+
+if test x$enable_libdrm_radeon = xyes; then
+ PKG_CHECK_MODULES(DRM_RADEON, [libdrm libdrm_radeon])
+ OLD_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $DRM_RADEON_CFLAGS"
+ AC_MSG_CHECKING([if radeon_drm.h is in include path])
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM(
+ [[
+ #include <stdint.h>
+ #include <stdlib.h>
#include "radeon_drm.h"
+ ]],[[]]),[found_drm_radeon_kernel_headers=yes],[found_drm_radeon_kernel_headers=no])
+
+ if test "$found_drm_radeon_kernel_headers" = "yes"; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_CHECKING([if we can find them anyway])
+
+ MORE_DRM_CFLAGS="-I`$PKG_CONFIG --variable includedir libdrm`/drm"
+ CFLAGS="$CFLAGS $MORE_DRM_RADEON_CFLAGS"
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM(
+ [[
+ #include <stdint.h>
+ #include <stdlib.h>
+ #include "radeon_drm.h"
+ ]],[[]]),[found_drm_radeon_kernel_headers=yes],[found_drm_radeon_kernel_headers=no])
+
+ if test "$found_drm_radeon_kernel_headers" = "yes"; then
+ AC_MSG_RESULT([yes])
+ DRM_RADEON_CFLAGS="$DRM_RADEON_CFLAGS $MORE_DRM_CFLAGS"
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([Could not find radeon_drm.h])
+ fi
+ fi
+
+ AC_SUBST(DRM_RADEON_CFLAGS)
+ AC_SUBST(DRM_RADEON_LIBS)
+ AC_DEFINE(PLY_ENABLE_LIBDRM_RADEON, 1, [Enable support for libdrm_radeon driver])
+fi
+
+AC_ARG_ENABLE(libdrm_nouveau, AS_HELP_STRING([--enable-libdrm_nouveau],[enable building with libdrm_nouveau support]),enable_libdrm_nouveau=$enableval,enable_libdrm_nouveau=yes)
+AM_CONDITIONAL(ENABLE_LIBDRM_NOUVEAU, [test "$enable_libdrm_nouveau" = yes])
+
+if test x$enable_libdrm_nouveau = xyes; then
+ PKG_CHECK_MODULES(DRM_NOUVEAU, [libdrm libdrm_nouveau])
+ OLD_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $DRM_NOUVEAU_CFLAGS"
+ AC_MSG_CHECKING([if nouveau_drm.h is in include path])
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM(
+ [[
+ #include <stdint.h>
+ #include <stdlib.h>
#include "nouveau_drm.h"
- ]],[[]]),[found_drm_kernel_headers=yes],[found_drm_kernel_headers=no])
+ ]],[[]]),[found_drm_nouveau_kernel_headers=yes],[found_drm_nouveau_kernel_headers=no])
- if test "$found_drm_kernel_headers" = "yes"; then
+ if test "$found_drm_nouveau_kernel_headers" = "yes"; then
AC_MSG_RESULT([yes])
- DRM_CFLAGS="$DRM_CFLAGS $MORE_DRM_CFLAGS"
else
AC_MSG_RESULT([no])
- AC_MSG_ERROR([Could not find i915_drm.h, radeon_drm.h and/or nouveau_drm.h])
+ AC_MSG_CHECKING([if we can find them anyway])
+
+ MORE_DRM_CFLAGS="-I`$PKG_CONFIG --variable includedir libdrm`/drm"
+ CFLAGS="$CFLAGS $MORE_DRM_CFLAGS"
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM(
+ [[
+ #include <stdint.h>
+ #include <stdlib.h>
+ #include "nouveau_drm.h"
+ ]],[[]]),[found_drm_nouveau_kernel_headers=yes],[found_drm_nouveau_kernel_headers=no])
+
+ if test "$found_drm_nouveau_kernel_headers" = "yes"; then
+ AC_MSG_RESULT([yes])
+ DRM_NOUVEAU_CFLAGS="$DRM_NOUVEAU_CFLAGS $MORE_DRM_CFLAGS"
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([Could not find nouveau_drm.h])
+ fi
fi
+
+ AC_SUBST(DRM_NOUVEAU_CFLAGS)
+ AC_SUBST(DRM_NOUVEAU_LIBS)
+ AC_DEFINE(PLY_ENABLE_LIBDRM_NOUVEAU, 1, [Enable support for libdrm_nouveau driver])
fi
-CFLAGS="$OLD_CFLAGS"
-AC_SUBST(DRM_CFLAGS)
-AC_SUBST(DRM_LIBS)
AC_ARG_ENABLE(libkms, AS_HELP_STRING([--enable-libkms],[enable building with libkms support]),enable_libkms=$enableval,enable_libkms=yes)
AM_CONDITIONAL(ENABLE_LIBKMS, [test "$enable_libkms" = yes])
if test x$enable_libkms = xyes; then
- PKG_CHECK_MODULES(LIBKMS, [libkms])
+ PKG_CHECK_MODULES(LIBKMS, [libdrm libkms])
AC_SUBST(LIBKMS_CFLAGS)
AC_SUBST(LIBKMS_LIBS)
AC_DEFINE(PLY_ENABLE_LIBKMS, 1, [Enable support for libkms abstraction over drm drivers])
fi
+DRM_CFLAGS="$DRM_INTEL_CFLAGS $DRM_RADEON_CFLAGS $DRM_NOUVEAU_CFLAGS $LIBKMS_CFLAG"
+DRM_LIBS="$DRM_INTEL_LIBS $DRM_RADEON_LIBS $DRM_NOUVEAU_LIBS $LIBKMS_LIBS"
+AC_SUBST(DRM_CFLAGS)
+AC_SUBST(DRM_LIBS)
+
+AM_CONDITIONAL(ENABLE_DRM_RENDERER,
+ [test x$enable_libdrm_intel = xyes \
+ -o x$enable_libdrm_radeon = xyes \
+ -o x$enable_libdrm_nouveau = xyes \
+ -o x$enable_libkms = xyes])
+
AC_ARG_ENABLE(tracing, AS_HELP_STRING([--enable-tracing],[enable verbose tracing code]),enable_tracing=$enableval,enable_tracing=yes)
if test x$enable_tracing = xyes; then
diff --git a/scripts/plymouth-populate-initrd.in b/scripts/plymouth-populate-initrd.in
index 4c0168f0..6a689073 100755
--- a/scripts/plymouth-populate-initrd.in
+++ b/scripts/plymouth-populate-initrd.in
@@ -99,7 +99,7 @@ fi
inst ${PLYMOUTH_PLUGIN_PATH}/${PLYMOUTH_MODULE_NAME}.so $INITRDDIR
-inst ${PLYMOUTH_PLUGIN_PATH}/renderers/drm.so $INITRDDIR
+[ -f "${PLYMOUTH_PLUGIN_PATH}/renderers/drm.so" ] && inst ${PLYMOUTH_PLUGIN_PATH}/renderers/drm.so $INITRDDIR
inst ${PLYMOUTH_PLUGIN_PATH}/renderers/frame-buffer.so $INITRDDIR
if [ -d ${PLYMOUTH_DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME} ]; then
diff --git a/src/plugins/renderers/Makefile.am b/src/plugins/renderers/Makefile.am
index 5a449a79..a81f48dc 100644
--- a/src/plugins/renderers/Makefile.am
+++ b/src/plugins/renderers/Makefile.am
@@ -1,2 +1,3 @@
-SUBDIRS = frame-buffer drm x11
+SUBDIRS = frame-buffer x11 drm
+
MAINTAINERCLEANFILES = Makefile.in
diff --git a/src/plugins/renderers/drm/Makefile.am b/src/plugins/renderers/drm/Makefile.am
index 7d2ef600..8434d0ec 100644
--- a/src/plugins/renderers/drm/Makefile.am
+++ b/src/plugins/renderers/drm/Makefile.am
@@ -1,3 +1,4 @@
+if ENABLE_DRM_RENDERER
INCLUDES = -I$(top_srcdir) \
-I$(srcdir)/../../../libply \
-I$(srcdir)/../../../libply-splash-core \
@@ -16,19 +17,29 @@ drm_la_LIBADD = $(PLYMOUTH_LIBS) $(DRM_LIBS) \
../../../libply/libply.la \
../../../libply-splash-core/libply-splash-core.la
drm_la_SOURCES = $(srcdir)/plugin.c \
- $(srcdir)/ply-renderer-driver.h \
- $(srcdir)/ply-renderer-i915-driver.h \
- $(srcdir)/ply-renderer-i915-driver.c \
- $(srcdir)/ply-renderer-radeon-driver.h \
- $(srcdir)/ply-renderer-radeon-driver.c \
- $(srcdir)/ply-renderer-nouveau-driver.h \
- $(srcdir)/ply-renderer-nouveau-driver.c
+ $(srcdir)/ply-renderer-driver.h
+if ENABLE_LIBDRM_INTEL
+drm_la_SOURCES += $(srcdir)/ply-renderer-i915-driver.h \
+ $(srcdir)/ply-renderer-i915-driver.c
+endif
+
+if ENABLE_LIBDRM_RADEON
+drm_la_SOURCES += $(srcdir)/ply-renderer-radeon-driver.h \
+ $(srcdir)/ply-renderer-radeon-driver.c
+endif
+
+if ENABLE_LIBDRM_NOUVEAU
+drm_la_SOURCES += $(srcdir)/ply-renderer-nouveau-driver.h \
+ $(srcdir)/ply-renderer-nouveau-driver.c
+endif
if ENABLE_LIBKMS
drm_la_LIBADD += $(LIBKMS_LIBS)
drm_la_CFLAGS += $(LIBKMS_CFLAGS)
drm_la_SOURCES += $(srcdir)/ply-renderer-libkms-driver.h \
- $(srcdir)/ply-renderer-libkms-driver.c
+ $(srcdir)/ply-renderer-libkms-driver.c
+endif
+
endif
MAINTAINERCLEANFILES = Makefile.in
diff --git a/src/plugins/renderers/drm/plugin.c b/src/plugins/renderers/drm/plugin.c
index 29b19524..6b852bab 100644
--- a/src/plugins/renderers/drm/plugin.c
+++ b/src/plugins/renderers/drm/plugin.c
@@ -59,9 +59,15 @@
#include "ply-renderer.h"
#include "ply-renderer-plugin.h"
#include "ply-renderer-driver.h"
+#ifdef PLY_ENABLE_LIBDRM_INTEL
#include "ply-renderer-i915-driver.h"
+#endif
+#ifdef PLY_ENABLE_LIBDRM_RADEON
#include "ply-renderer-radeon-driver.h"
+#endif
+#ifdef PLY_ENABLE_LIBDRM_NOUVEAU
#include "ply-renderer-nouveau-driver.h"
+#endif
#ifdef PLY_ENABLE_LIBKMS
#include "ply-renderer-libkms-driver.h"
@@ -501,22 +507,28 @@ load_driver (ply_renderer_backend_t *backend)
free (driver_name);
return false;
}
-
- if (strcmp (driver_name, "i915") == 0)
+ backend->driver_interface = NULL;
+#ifdef PLY_ENABLE_LIBDRM_INTEL
+ if (backend->driver_interface == NULL && strcmp (driver_name, "i915") == 0)
{
backend->driver_interface = ply_renderer_i915_driver_get_interface ();
backend->driver_supports_mapping_console = true;
}
- else if (strcmp (driver_name, "radeon") == 0)
+#endif
+#ifdef PLY_ENABLE_LIBDRM_RADEON
+ if (backend->driver_interface == NULL && strcmp (driver_name, "radeon") == 0)
{
backend->driver_interface = ply_renderer_radeon_driver_get_interface ();
backend->driver_supports_mapping_console = false;
}
- else if (strcmp (driver_name, "nouveau") == 0)
+#endif
+#ifdef PLY_ENABLE_LIBDRM_NOUVEAU
+ if (backend->driver_interface == NULL && strcmp (driver_name, "nouveau") == 0)
{
backend->driver_interface = ply_renderer_nouveau_driver_get_interface ();
backend->driver_supports_mapping_console = false;
}
+#endif
free (driver_name);