autoconf
[Top][All Lists]
Advanced

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

Bug in NLS nuisances section


From: Brent Goodrick
Subject: Bug in NLS nuisances section
Date: Mon, 24 Feb 2003 22:18:18 -0800

Hi Tom,

A wild guess: perhaps that when the autoconf manual is saying:

     However, some older, nonstandard systems (notably SCO) break if
     locale environment variables are set to `C', so when running on
     these systems Autoconf-generated scripts unset the variables
     instead.

They should have said that the SCO bourne shell implementation emits
an error if a script tries to set or export those special variables? I
could say either way, as I don't run SCO.  Looks like that code is
trying to test for those error "emissions" no?  If that is true, then
I would figure that the polarity is wrong, meaning that the "test -n"
should be changed to a "test -z" (portability?).

Changing that -n to a -z in your test script on my Linux box forces it
into the "if" block, of course.  But that means editing your autoconf
distribution that you use locally, which probably isn't the
"workaround" you were looking for. ;)

Good Luck!
Brent

>>>>> "Tom" == Tom Epperly <address@hidden> writes:

Tom> According to the autoconf documentation (section 10.7 Special Shell
Tom> Variables), this section of code is supposed to set the locale related
Tom> environment variables to "C" on standard POSIX systems and 
Tom> unset them on nonstandard systems (e.g., SCO).

Tom> # NLS nuisances.
Tom> for as_var in \
Tom>   LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
Tom>   LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
Tom>   LC_TELEPHONE LC_TIME
Tom> do
Tom>   if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
Tom>     eval $as_var=C; export $as_var
Tom>   else
Tom>     $as_unset $as_var
Tom>   fi
Tom> done

Tom> However, my testing shows that it's taking the "else branch" on every
Tom> system I can find. For example GNU/Linux, Solaris and AIX. Some
Tom> platforms (such as AIX as noted previously) require LANG to be set. For
Tom> testing purposes, I used this modified version of the script above:

Tom> #!/bin/sh
Tom> as_unset=unset
Tom> # NLS nuisances.
Tom> for as_var in \
Tom>   LANG LANGUAGE LC_ADDRESS LC_ALL
Tom> do
Tom>   if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
Tom>     eval $as_var=C; export $as_var
Tom>     echo "Taking if: $as_var"
Tom>   else
Tom>     $as_unset $as_var
Tom>     echo "Taking else: $as_var"
Tom>   fi
Tom> done

Tom> Here are some example runs:

Tom> sh-2.05b$ uname -a ; LANG=C LC_ALL=C /tmp/testlc
Tom> Linux driftcreek 2.4.20 #11 Tue Jan 21 08:44:00 PST 2003 i686 unknown
Tom> unknown GNU/Linux
Tom> Taking else: LANG
Tom> Taking else: LANGUAGE
Tom> Taking else: LC_ADDRESS
Tom> Taking else: LC_ALL
Tom> $ uname -a; LANG=C LC_ALL=C /tmp/testlc
Tom> SunOS germain 5.7 Generic_106541-14 sun4u sparc SUNW,Ultra-5_10
Tom> Taking else: LANG
Tom> Taking else: LANGUAGE
Tom> Taking else: LC_ADDRESS
Tom> Taking else: LC_ALL

Tom> $ uname -a; LANG=C LC_ALL=C ./testlc
Tom> AIX aix2 1 5
Tom> Taking else: LANG
Tom> Taking else: LANGUAGE
Tom> Taking else: LC_ADDRESS
Tom> Taking else: LC_ALL

Tom> If you have suggestions for a work around, I would love to hear them.

Tom> Tom

Tom> -- 
Tom> Tom Epperly                              ph: 925-424-3159
Tom> Components Project Leader               fax: 925-424-2477
Tom> Lawrence Livermore National Laboratory  address@hidden
Tom> http://www.llnl.gov/CASC/people/epperly/







reply via email to

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