From dba73cebb527bb36a3d17d67b1e8e1892852b240 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Sun, 5 Aug 2012 08:12:15 +1000 Subject: Fetch the udev dir from udev.pc instead of guessing based on prefix Reviewed-by: Gaetan Nadon Reviewed-by: Jakob Bornecrantz Signed-off-by: Peter Hutterer Signed-off-by: Jakob Bornecrantz --- Makefile.am | 3 ++- configure.ac | 17 ++++------------- tools/Makefile.am | 1 - 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/Makefile.am b/Makefile.am index f1ad5af..ce2d86c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,7 +19,8 @@ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # Ensure xorg.conf.d snippets are installed below $(prefix) for distcheck -DISTCHECK_CONFIGURE_FLAGS = --with-xorg-conf-dir='$${datadir}/X11/xorg.conf.d' +DISTCHECK_CONFIGURE_FLAGS = --with-xorg-conf-dir='$${datadir}/X11/xorg.conf.d' \ + --with-udev-rules-dir='$${libdir}/udev/rules.d' SUBDIRS = shared src tools fdi man MAINTAINERCLEANFILES = ChangeLog INSTALL diff --git a/configure.ac b/configure.ac index d2fb0b6..2e1e021 100644 --- a/configure.ac +++ b/configure.ac @@ -92,19 +92,10 @@ AC_ARG_WITH(hal-fdi-dir, HAL_FDI_DIR=${halfdidir} AC_SUBST(HAL_FDI_DIR) -case $host_os in - linux*) - if test "x$prefix" = "xNONE" -o "x$prefix" = "x/usr" -o "x$prefix" = "x/usr/local" ; then - slashlibdir=/lib - else - slashlibdir=$prefix/lib - fi - UDEV_RULES_DIR=$slashlibdir/udev/rules.d - ;; - *) - UDEV_RULES_DIR=no - ;; -esac + +PKG_CHECK_MODULES(UDEV, udev, + [UDEV_RULES_DIR="`$PKG_CONFIG --variable=udevdir udev`/rules.d"], + [UDEV_RULES_DIR=no]) AC_ARG_WITH(udev-rules-dir, AC_HELP_STRING([--with-udev-rules-dir=DIR], diff --git a/tools/Makefile.am b/tools/Makefile.am index 23493cd..ea7ba66 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -43,7 +43,6 @@ dist_conf_DATA = 50-vmmouse.conf endif if HAS_UDEV_RULES_DIR - udevdir=$(UDEV_RULES_DIR) udev_DATA = 69-xorg-vmmouse.rules -- cgit v1.2.3