[PATCH libevdev v1] fix program_invocation_short_name undeclared

Peter Hutterer peter.hutterer at who-t.net
Mon Mar 23 18:33:15 PDT 2015


On Mon, Mar 23, 2015 at 09:15:30PM +0100, Peter Seiderer wrote:
> Hello Peter,
> 
> On Fri, Mar 20, 2015 at 10:27:24AM +1000, Peter Hutterer wrote:
> > On Fri, Mar 20, 2015 at 12:23:14AM +0100, Peter Seiderer wrote:
> > > Add fallback in case program_invocation_short_name is undeclared,
> > > e.g. in case of some uclibc configurations.
> > > 
> > > See [1] for a detailed buildroot failure description.
> > > 
> > > [1] http://lists.busybox.net/pipermail/buildroot/2015-March/122715.html
> > > 
> > > Signed-off-by: Peter Seiderer <ps.report at gmx.net>
> > > ---
> > 
> > question: does uclibc ignore _GNU_SOURCE or does it honour it but not expose
> > the program_invocation_short_name?
> > 
> 
> Its a uclibc feature that support for program_invocation_... could be disabled
> completly. This is the case with the toolchain of the original buildroot
> failure, see [1], and will be fixed/changed for this toolchain in the next release...
> 
> > I'd say the latter is a bug in uclibc, if the former a basename(argv[0])
> > would be simpler than all those extra ifdefs for what is pretty unimportant
> > functionality.
> > 
> 
> No bug..., its a feature ;-)
> 
> Leave libevdev/evtest as is or should I provide a patch using basename(argv[0])
> just to support endemic toolchains?

if you are fixing it anyway for your toolchain I'd prefer to leave it
as-is, at least until it becomes a more widespread problem.

I'm all for being tolerant of different environments, but removing
program_invocation_short_name seems like a self-inflicted wound :)

Cheers,
   Peter

> [1] http://lists.busybox.net/pipermail/buildroot/2015-March/122855.html
> 
> > Cheers,
> >    Peter
> > 
> > >  configure.ac                   | 8 ++++++++
> > >  tools/libevdev-tweak-device.c  | 4 ++++
> > >  tools/mouse-dpi-tool.c         | 4 ++++
> > >  tools/touchpad-edge-detector.c | 4 ++++
> > >  4 files changed, 20 insertions(+)
> > > 
> > > diff --git a/configure.ac b/configure.ac
> > > index 59c691b..e8abcc1 100644
> > > --- a/configure.ac
> > > +++ b/configure.ac
> > > @@ -144,6 +144,14 @@ fi
> > >  
> > >  AM_CONDITIONAL(ENABLE_STATIC_SYMBOL_LEAKS_TEST, [test "x$static_symbol_leaks_test" = "xyes"])
> > >  
> > > +AC_MSG_CHECKING([for program_invocation_short_name])
> > > +AC_TRY_COMPILE([#define _GNU_SOURCE
> > > +           #include <errno.h>],
> > > +   [strlen(program_invocation_short_name)],
> > > +   AC_DEFINE(HAVE_PROGRAM_INVOCATION_SHORT_NAME, 1,
> > > +           [Defined if program_invocation_short_name is defined])
> > > +   AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
> > > +
> > >  AC_CONFIG_FILES([Makefile
> > >              libevdev/Makefile
> > >              doc/Makefile
> > > diff --git a/tools/libevdev-tweak-device.c b/tools/libevdev-tweak-device.c
> > > index f2031c2..3dacb4e 100644
> > > --- a/tools/libevdev-tweak-device.c
> > > +++ b/tools/libevdev-tweak-device.c
> > > @@ -36,6 +36,10 @@
> > >  
> > >  #include "libevdev.h"
> > >  
> > > +#ifndef HAVE_PROGRAM_INVOCATION_SHORT_NAME
> > > +static char *program_invocation_short_name = "libevdev-tweak-device";
> > > +#endif
> > > +
> > >  static unsigned int changes; /* bitmask of changes */
> > >  static struct input_absinfo absinfo;
> > >  static int axis;
> > > diff --git a/tools/mouse-dpi-tool.c b/tools/mouse-dpi-tool.c
> > > index be30a4d..4e396b2 100644
> > > --- a/tools/mouse-dpi-tool.c
> > > +++ b/tools/mouse-dpi-tool.c
> > > @@ -41,6 +41,10 @@
> > >  #define min(a, b) (((a) < (b)) ? (a) : (b))
> > >  #define max(a, b) (((a) > (b)) ? (a) : (b))
> > >  
> > > +#ifndef HAVE_PROGRAM_INVOCATION_SHORT_NAME
> > > +static char *program_invocation_short_name = "mouse-dpi-tool";
> > > +#endif
> > > +
> > >  struct measurements {
> > >     int distance;
> > >     double frequency;
> > > diff --git a/tools/touchpad-edge-detector.c b/tools/touchpad-edge-detector.c
> > > index e5420cf..12e1127 100644
> > > --- a/tools/touchpad-edge-detector.c
> > > +++ b/tools/touchpad-edge-detector.c
> > > @@ -41,6 +41,10 @@
> > >  #define min(a, b) (((a) < (b)) ? (a) : (b))
> > >  #define max(a, b) (((a) > (b)) ? (a) : (b))
> > >  
> > > +#ifndef HAVE_PROGRAM_INVOCATION_SHORT_NAME
> > > +static char *program_invocation_short_name = "touchpad-edge-detector";
> > > +#endif
> > > +
> > >  static int
> > >  usage(void) {
> > >     printf("Usage: %s /dev/input/event0\n", program_invocation_short_name);
> > > -- 
> > > 2.1.4
> > > 


More information about the Input-tools mailing list