[PATCH][UPower] build: detect udev rules dir

Dan Nicholson dbn.lists at gmail.com
Wed Mar 20 07:00:15 PDT 2013


On Mar 19, 2013 5:31 AM, "Tom Gundersen" <teg at jklm.no> wrote:
>
> Udev rules may live in either /lib/udev/rules.d or /usr/lib/udev/rules.d
depending on the distro.
> Remove the heuristic for deciding the dir, use pkgconfig to detect the
location and allow it to be
> set manually.
> ---
>  configure.ac      | 12 +++++-------
>  rules/Makefile.am |  1 -
>  2 files changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 56db585..c03e8e8 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -82,13 +82,11 @@ AM_CONDITIONAL(MAN_PAGES_ENABLED, test
x$enable_man_pages = xyes)
>
>  GTK_DOC_CHECK([1.11],[--flavour no-tmpl])
>
> -# udev rules go in /lib, not /usr/lib
> -if test "$prefix" = "/usr" -o "$prefix" = "/usr/local" ; then
> -  slashlibdir=/lib
> -else
> -  slashlibdir=$prefix/lib
> -fi
> -AC_SUBST(slashlibdir)
> +AC_ARG_WITH([udevdir],
> +            AS_HELP_STRING([--with-udevrulesdir=DIR], [Directory for
udev rules]),
> +            [],
> +            [with_udevrulesdir=$($PKG_CONFIG --variable=udevdir
udev)"/rules.d"])
> +AC_SUBST([udevrulesdir], [$with_udevrulesdir])

Did you test that the manual setting actually worked? You're passing
udevdir to AC_ARG_WITH, which will cause autoconf to set with_udevdir.
That's not what you're using for the actual setting (with_udevrulesdir). I
think if you change it to [udevrulesdir] it will work.

Also, it might be a good idea to be defensive and check that pkg-config
returned anything useful. That's pretty unlikely at that point, though.

Otherwise, this seems good to me.

Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/devkit-devel/attachments/20130320/192cc6e1/attachment.html>


More information about the devkit-devel mailing list