[FFmpeg-devel] [PATCH] configure's to_lower and to_upper fix on *bsd
Diego Biurrun
diego
Tue Feb 12 00:18:04 CET 2008
On Fri, Feb 08, 2008 at 01:46:21PM -0500, Rich Felker wrote:
> On Fri, Feb 08, 2008 at 04:02:26PM +0100, Pierre d'Herbemont wrote:
> >
> > here, on Mac OS X, (should be a BSD issue):
> > $ echo "hello z" | tr '[a-z]' '[A-Z]'
> > HELLO ]
> >
> > This cause configure to generate a bad crafted config.h. Here is a fix
> > for that, as suggested by the BSD tr's man page.
> >
> > --- configure (revision 11879)
> > +++ configure (working copy)
> > @@ -215,13 +215,12 @@
> > exit 1
> > }
> >
> > -# "tr '[a-z]' '[A-Z]'" is a workaround for Solaris tr not grokking
> > "tr a-z A-Z"
> > toupper(){
> > - echo "$@" | tr '[a-z]' '[A-Z]'
> > + echo "$@" | tr '[:lower:]' '[:upper:]'
> > }
> >
> > tolower(){
> > - echo "$@" | tr '[A-Z]' '[a-z]'
> > + echo "$@" | tr '[:upper:]' '[:lower:]'
>
> This is absolutely wrong. If the locale is Turkish then I will get
> mapped to ? rather than i. Instead use:
>
> tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
>
> It may also be possible to override the locale in this specific case
> as long as you know the contents of $@ will be ONLY ASCII but it's a
> bad practice in general so my solution is preferred, I think.
I have applied your solution.
I'm tempted to set
LC_ALL=C
in the beginning of configure similar to what MPlayer's configure does.
Diego
More information about the ffmpeg-devel
mailing list