autoconf
[Top][All Lists]
Advanced

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

Bug in NLS nuisances section


From: Tom Epperly
Subject: Bug in NLS nuisances section
Date: 24 Feb 2003 11:29:41 -0800

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

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

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

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

Here are some example runs:

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

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

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

Tom

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





reply via email to

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