File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / libiconv / libcharset / tools / all-locales
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 22:57:48 2012 UTC (12 years, 10 months ago) by misho
Branches: libiconv, MAIN
CVS tags: v1_16p0, v1_14p0, v1_14, v1_13_1, HEAD
libiconv

#! /bin/sh
# Prints the list of all locale names, one per line.

locale -a
test $? = 0 && exit 0

host=`/bin/sh ../build-aux/config.guess`
host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`

case "$host_os" in
  sunos* | solaris*)
    cd /usr/lib/locale && ls -1
    ;;
  freebsd*)
    cd /usr/share/locale && ls -1
    ;;
  darwin* | openbsd*)
    echo C
    cd /usr/share/locale && ls -1 */LC_CTYPE | sed -e 's,/LC_CTYPE$,,'
    ;;
  *)
    echo "Don't know how to determine list of locales on $host_os" 1>&2
    exit 1
    ;;
esac

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>