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

Gaetan Nadon memsize at videotron.ca
Sat Aug 4 05:58:57 PDT 2012


On 12-08-04 03:18 AM, Peter Hutterer wrote:
> 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?
Similar to:

    # Ensure xorg.conf.d snippets are installed below $(prefix) for
    distcheck
    DISTCHECK_CONFIGURE_FLAGS =
    --with-xorg-conf-dir='$${datadir}/X11/xorg.conf.d'

in the toplevel Makefile. This ensures that a writable directory is used
during the installation simulation done by 'make distcheck'. Assuming
--with-udev-rules-dir is the option to specify the location of rules.d,
this option can be added to DISTCHECK_CONFIGURE_FLAGS.
>
>  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],

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20120804/a2636ef0/attachment.html>


More information about the xorg-devel mailing list