[PATCH RFC vmmouse] Fetch the udev dir from udev.pc instead of guessing based on prefix

Peter Hutterer peter.hutterer at who-t.net
Sat Aug 4 00:18:49 PDT 2012


Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
This technically changes behaviour since before building into a prefix of
/foo would install the rules in /foo/udev/rules.d. For such setups, I think
it'd be better to set up the udev pkgconfig file correctly. The exception
here is make distcheck though - which would break with this patch.

I vaguely remember there being some autotools magic to work around this, but
I can't seem to find it. Gaetan?

 configure.ac |   17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

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],
-- 
1.7.10.4



More information about the xorg-devel mailing list