All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] configure.ac: Add --without-libudev option to avoid automagic dep
@ 2020-08-23 16:47 James Le Cuirot
  2020-08-24  8:51 ` Hans Verkuil
  0 siblings, 1 reply; 4+ messages in thread
From: James Le Cuirot @ 2020-08-23 16:47 UTC (permalink / raw)
  To: linux-media; +Cc: James Le Cuirot

Signed-off-by: James Le Cuirot <chewi@gentoo.org>
---
 configure.ac | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/configure.ac b/configure.ac
index d9f43ab5..e6134d08 100644
--- a/configure.ac
+++ b/configure.ac
@@ -291,16 +291,23 @@ else
    AC_MSG_WARN(ALSA library not available)
 fi
 
-PKG_CHECK_MODULES(libudev, libudev, have_libudev=yes, have_libudev=no)
-if test "x$have_libudev" = "xyes"; then
-	AC_DEFINE([HAVE_LIBUDEV], [], [Use libudev])
-	LIBUDEV_CFLAGS="$libudev_CFLAGS"
-	LIBUDEV_LIBS="$libudev_LIBS"
-	AC_SUBST(LIBUDEV_CFLAGS)
-	AC_SUBST(LIBUDEV_LIBS)
-else
-   AC_MSG_WARN(udev library not available)
-fi
+AC_ARG_WITH([libudev],
+            AS_HELP_STRING([--without-libudev], [Do not use udev library]),
+            [],
+            [with_libudev=yes])
+
+have_libudev=no
+
+AS_IF([test "x$with_libudev" != xno -o "x$enable_libdvbv5" != xno],
+      [PKG_CHECK_MODULES(libudev, libudev, have_libudev=yes, [])
+       AS_IF([test "x$have_libudev" = xyes],
+             [AC_DEFINE([HAVE_LIBUDEV], [], [Use libudev])
+              LIBUDEV_CFLAGS="$libudev_CFLAGS"
+              LIBUDEV_LIBS="$libudev_LIBS"
+              AC_SUBST(LIBUDEV_CFLAGS)
+              AC_SUBST(LIBUDEV_LIBS)],
+             AC_MSG_WARN(udev library not available)
+            )])
 
 AC_SUBST([JPEG_LIBS])
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] configure.ac: Add --without-libudev option to avoid automagic dep
  2020-08-23 16:47 [PATCH] configure.ac: Add --without-libudev option to avoid automagic dep James Le Cuirot
@ 2020-08-24  8:51 ` Hans Verkuil
  2020-08-24 21:50   ` [PATCH v2] " James Le Cuirot
  2020-08-24 22:28   ` [PATCH] " Rosen Penev
  0 siblings, 2 replies; 4+ messages in thread
From: Hans Verkuil @ 2020-08-24  8:51 UTC (permalink / raw)
  To: James Le Cuirot, linux-media

Hi James,

Can you elaborate a bit more in the commit log text? It's not clear to
me what you mean with 'avoid automagic dep' or why you want to avoid it.

Regards,

	Hans

On 23/08/2020 18:47, James Le Cuirot wrote:
> Signed-off-by: James Le Cuirot <chewi@gentoo.org>
> ---
>  configure.ac | 27 +++++++++++++++++----------
>  1 file changed, 17 insertions(+), 10 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index d9f43ab5..e6134d08 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -291,16 +291,23 @@ else
>     AC_MSG_WARN(ALSA library not available)
>  fi
>  
> -PKG_CHECK_MODULES(libudev, libudev, have_libudev=yes, have_libudev=no)
> -if test "x$have_libudev" = "xyes"; then
> -	AC_DEFINE([HAVE_LIBUDEV], [], [Use libudev])
> -	LIBUDEV_CFLAGS="$libudev_CFLAGS"
> -	LIBUDEV_LIBS="$libudev_LIBS"
> -	AC_SUBST(LIBUDEV_CFLAGS)
> -	AC_SUBST(LIBUDEV_LIBS)
> -else
> -   AC_MSG_WARN(udev library not available)
> -fi
> +AC_ARG_WITH([libudev],
> +            AS_HELP_STRING([--without-libudev], [Do not use udev library]),
> +            [],
> +            [with_libudev=yes])
> +
> +have_libudev=no
> +
> +AS_IF([test "x$with_libudev" != xno -o "x$enable_libdvbv5" != xno],
> +      [PKG_CHECK_MODULES(libudev, libudev, have_libudev=yes, [])
> +       AS_IF([test "x$have_libudev" = xyes],
> +             [AC_DEFINE([HAVE_LIBUDEV], [], [Use libudev])
> +              LIBUDEV_CFLAGS="$libudev_CFLAGS"
> +              LIBUDEV_LIBS="$libudev_LIBS"
> +              AC_SUBST(LIBUDEV_CFLAGS)
> +              AC_SUBST(LIBUDEV_LIBS)],
> +             AC_MSG_WARN(udev library not available)
> +            )])
>  
>  AC_SUBST([JPEG_LIBS])
>  
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] configure.ac: Add --without-libudev option to avoid automagic dep
  2020-08-24  8:51 ` Hans Verkuil
@ 2020-08-24 21:50   ` James Le Cuirot
  2020-08-24 22:28   ` [PATCH] " Rosen Penev
  1 sibling, 0 replies; 4+ messages in thread
From: James Le Cuirot @ 2020-08-24 21:50 UTC (permalink / raw)
  To: linux-media; +Cc: James Le Cuirot

configure currently checks for and links against libudev
unconditionally, If this was unwanted and the library is removed then
this can leave v4l-utils broken. This is a problem for distributions,
especially Gentoo Linux where it affects end users. libudev is
unlikely to be removed entirely but the 32-bit library may be removed
from a 64-bit system, breaking a 32-bit build of v4l-utils.

Signed-off-by: James Le Cuirot <chewi@gentoo.org>
---
 configure.ac | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/configure.ac b/configure.ac
index d9f43ab5..e6134d08 100644
--- a/configure.ac
+++ b/configure.ac
@@ -291,16 +291,23 @@ else
    AC_MSG_WARN(ALSA library not available)
 fi
 
-PKG_CHECK_MODULES(libudev, libudev, have_libudev=yes, have_libudev=no)
-if test "x$have_libudev" = "xyes"; then
-	AC_DEFINE([HAVE_LIBUDEV], [], [Use libudev])
-	LIBUDEV_CFLAGS="$libudev_CFLAGS"
-	LIBUDEV_LIBS="$libudev_LIBS"
-	AC_SUBST(LIBUDEV_CFLAGS)
-	AC_SUBST(LIBUDEV_LIBS)
-else
-   AC_MSG_WARN(udev library not available)
-fi
+AC_ARG_WITH([libudev],
+            AS_HELP_STRING([--without-libudev], [Do not use udev library]),
+            [],
+            [with_libudev=yes])
+
+have_libudev=no
+
+AS_IF([test "x$with_libudev" != xno -o "x$enable_libdvbv5" != xno],
+      [PKG_CHECK_MODULES(libudev, libudev, have_libudev=yes, [])
+       AS_IF([test "x$have_libudev" = xyes],
+             [AC_DEFINE([HAVE_LIBUDEV], [], [Use libudev])
+              LIBUDEV_CFLAGS="$libudev_CFLAGS"
+              LIBUDEV_LIBS="$libudev_LIBS"
+              AC_SUBST(LIBUDEV_CFLAGS)
+              AC_SUBST(LIBUDEV_LIBS)],
+             AC_MSG_WARN(udev library not available)
+            )])
 
 AC_SUBST([JPEG_LIBS])
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] configure.ac: Add --without-libudev option to avoid automagic dep
  2020-08-24  8:51 ` Hans Verkuil
  2020-08-24 21:50   ` [PATCH v2] " James Le Cuirot
@ 2020-08-24 22:28   ` Rosen Penev
  1 sibling, 0 replies; 4+ messages in thread
From: Rosen Penev @ 2020-08-24 22:28 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: James Le Cuirot, Linux Media Mailing List

On Mon, Aug 24, 2020 at 2:29 AM Hans Verkuil <hverkuil@xs4all.nl> wrote:
>
> Hi James,
>
> Can you elaborate a bit more in the commit log text? It's not clear to
> me what you mean with 'avoid automagic dep' or why you want to avoid it.
Something similar is done with OpenWrt to avoid picking up the host
libudev: https://github.com/openwrt/packages/blob/master/libs/libv4l/patches/010-remove-libudev-check.patch
>
> Regards,
>
>         Hans
>
> On 23/08/2020 18:47, James Le Cuirot wrote:
> > Signed-off-by: James Le Cuirot <chewi@gentoo.org>
> > ---
> >  configure.ac | 27 +++++++++++++++++----------
> >  1 file changed, 17 insertions(+), 10 deletions(-)
> >
> > diff --git a/configure.ac b/configure.ac
> > index d9f43ab5..e6134d08 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -291,16 +291,23 @@ else
> >     AC_MSG_WARN(ALSA library not available)
> >  fi
> >
> > -PKG_CHECK_MODULES(libudev, libudev, have_libudev=yes, have_libudev=no)
> > -if test "x$have_libudev" = "xyes"; then
> > -     AC_DEFINE([HAVE_LIBUDEV], [], [Use libudev])
> > -     LIBUDEV_CFLAGS="$libudev_CFLAGS"
> > -     LIBUDEV_LIBS="$libudev_LIBS"
> > -     AC_SUBST(LIBUDEV_CFLAGS)
> > -     AC_SUBST(LIBUDEV_LIBS)
> > -else
> > -   AC_MSG_WARN(udev library not available)
> > -fi
> > +AC_ARG_WITH([libudev],
> > +            AS_HELP_STRING([--without-libudev], [Do not use udev library]),
> > +            [],
> > +            [with_libudev=yes])
> > +
> > +have_libudev=no
> > +
> > +AS_IF([test "x$with_libudev" != xno -o "x$enable_libdvbv5" != xno],
> > +      [PKG_CHECK_MODULES(libudev, libudev, have_libudev=yes, [])
> > +       AS_IF([test "x$have_libudev" = xyes],
> > +             [AC_DEFINE([HAVE_LIBUDEV], [], [Use libudev])
> > +              LIBUDEV_CFLAGS="$libudev_CFLAGS"
> > +              LIBUDEV_LIBS="$libudev_LIBS"
> > +              AC_SUBST(LIBUDEV_CFLAGS)
> > +              AC_SUBST(LIBUDEV_LIBS)],
> > +             AC_MSG_WARN(udev library not available)
> > +            )])
> >
> >  AC_SUBST([JPEG_LIBS])
> >
> >
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-24 22:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-23 16:47 [PATCH] configure.ac: Add --without-libudev option to avoid automagic dep James Le Cuirot
2020-08-24  8:51 ` Hans Verkuil
2020-08-24 21:50   ` [PATCH v2] " James Le Cuirot
2020-08-24 22:28   ` [PATCH] " Rosen Penev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.