bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] maintainer-makefile: check for i18n setup


From: Jim Meyering
Subject: Re: [PATCH] maintainer-makefile: check for i18n setup
Date: Fri, 12 Nov 2010 08:26:41 +0100

Eric Blake wrote:
> * top/maint.mk (sc_bindtextdomain): Check for evidence that _()
> will likely work.
>
> I recently debugged a situation in libvirt where a program had
> not set up the i18n framework, therefore calls to _() were doing
> nothing.  If this rule had been in place, I would have quickly
> detected that main() was not properly initializing gettext
> during 'make syntax-check'.
>
> I noticed that this gives several false positives for coreutils,
> for example on #ifdef'd test code in lib/euidaccess-stat.c,
> but such files can easily be avoided by listing them in
> .x-sc_bindtextdomain.  Also, for a package that does not yet
> use gettext, it's easy enough to entirely skip this test via
> a cfg.mk entry.
...
> +
> +     maintainer-makefile: check for i18n setup
> +     * top/maint.mk (sc_bindtextdomain): Check for evidence that _()
> +     will likely work.
...
> +# Ensure that each .c file containing a "main" function also
> +# calls bindtextdomain.
> +sc_bindtextdomain:
> +     @require='bindtextdomain *\('                                   \
> +     in_vc_files='\.c$$'                                             \
> +     containing='\<main *('                                          \
> +     halt='the above files do not call bindtextdomain'               \
> +       $(_sc_search_regexp)

I was going to suggest making the 'require'd regexp
configurable, in case someone wraps initialization
code like that in a helper function.  Then they
could require their initialization function instead.

But this might count as pre-optimization.
I.e., perhaps no gnulib-using client does that.
At worst, we can wait until someone who does such
a thing complains about their false positives.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]