diff options
author | Thierry Reding <treding@nvidia.com> | 2014-02-19 11:32:12 +0100 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2014-07-09 11:44:57 +0200 |
commit | d09a629792b3906feb14f785306fdd0c184eb275 (patch) | |
tree | 57de51116439891d08f90aad01a6a40c030a4c98 | |
parent | 919420677d02a8cfd30e3be56b017e38c4c8dccf (diff) |
Install OutputClass xorg.conf.d snippet
Newer versions of the X server allow matching DDX modules to kernel
drivers using an OutputClass configuration snippet. Install such a
snippet that help autoload this driver when the DRM device's driver
is the Tegra DRM driver.
Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r-- | Makefile.am | 30 | ||||
-rw-r--r-- | configure.ac | 21 | ||||
-rw-r--r-- | opentegra.conf | 5 |
3 files changed, 56 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am index d184700..2f4eba7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,6 +22,11 @@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = src man +if HAVE_OUTPUTCLASS +sysconfig_DATA = \ + opentegra.conf +endif + INSTALL: $(INSTALL_CMD) @@ -30,6 +35,31 @@ ChangeLog: dist-hook: ChangeLog INSTALL +EXTRA_DIST = \ + opentegra.conf + +# +# This is needed to work around some weird behaviour in make distcheck. What +# distcheck will try to do is run something like the following: +# +# $ ./configure --prefix=$(distdir)/_inst +# $ make install +# +# However that will fail to install the opentegra.org file because the path +# where it is to be installed is retrieved from the xorg-server.pc file's +# sysconfigdir variable. Unfortunately that already has the ${prefix} value +# expanded, so make distcheck will effectively try to install this file into +# /usr/share/X11/xorg.conf.d, which will fail if run as normal user. +# +# We outsmart automake by overriding sysconfigdir on the configure command- +# line, using ${datarootdir} as prefix so that the file ends up installed +# somewhere below the prefix set by distcheck. Note that it's possible that +# the path will not be what the X.Org X server was configured with, but the +# workaround here is only used for sanity checking the distribution tarball +# anyway, therefore the file will never be used, so the exact location does +# not matter. +# +AM_DISTCHECK_CONFIGURE_FLAGS = sysconfigdir=\$${datarootdir}/X11/xorg.conf.d MAINTAINERCLEANFILES = ChangeLog INSTALL .PHONY: ChangeLog INSTALL diff --git a/configure.ac b/configure.ac index a7bd0c0..518a44c 100644 --- a/configure.ac +++ b/configure.ac @@ -77,6 +77,27 @@ if test x"$udev" = xyes; then AC_DEFINE(HAVE_UDEV,1,[Enable udev-based monitor hotplug detection]) fi +AC_MSG_CHECKING([for OutputClass support in the X.Org X server]) +AC_PREPROC_IFELSE( + [AC_LANG_PROGRAM([ + #include <xorg/xorg-server.h> + #include <xorg/xorgVersion.h> + ], [ + #if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,15,99,904,0) + # error xorg.conf OutputClass support requires 1.15.99.904 + #endif + ])], [have_outputclass=yes], [have_outputclass=no]) +AC_MSG_RESULT([$have_outputclass]) + +if test "x$have_outputclass" = "xyes"; then + AC_MSG_CHECKING([for X.Org X server sysconfigdir variable]) + PKG_CHECK_VAR([sysconfigdir], [xorg-server], [sysconfigdir]) + AC_MSG_RESULT([$sysconfigdir]) + AC_SUBST([sysconfigdir]) +fi + +AM_CONDITIONAL([HAVE_OUTPUTCLASS], [test "x$have_outputclass" = "xyes"]) + SAVE_CFLAGS=$CFLAGS SAVE_LIBS=$LIBS CFLAGS=$DRM_CFLAGS diff --git a/opentegra.conf b/opentegra.conf new file mode 100644 index 0000000..aa28a99 --- /dev/null +++ b/opentegra.conf @@ -0,0 +1,5 @@ +Section "OutputClass" + Identifier "NVIDIA Tegra open-source driver" + MatchDriver "tegra" + Driver "opentegra" +EndSection |