AC_DEFUN([gt_LOCALE_FR],
[
AC_CACHE_CHECK([for a traditional french locale], gt_cv_locale_fr, [
changequote(,) cat <<EOF > conftest.$ac_ext
struct tm t;
char buf[16];
int main () {
/* Check whether the given locale name is recognized by the system. */
if (setlocale (LC_ALL, "") == NULL) return 1;
/* Check whether in the abbreviation of the second month, the second
character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
one byte long. This excludes the UTF-8 encoding. */
t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
return 0;
}
EOF
changequote([,]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
if (LC_ALL=fr_FR ./conftest; exit) 2>/dev/null; then
gt_cv_locale_fr=fr_FR
else
if (LC_ALL=fr_FR.ISO-8859-1 ./conftest; exit) 2>/dev/null; then
gt_cv_locale_fr=fr_FR.ISO-8859-1
else
if (LC_ALL=fr_FR.ISO8859-1 ./conftest; exit) 2>/dev/null; then
gt_cv_locale_fr=fr_FR.ISO8859-1
else
if (LC_ALL=fr_FR.iso88591 ./conftest; exit) 2>/dev/null; then
gt_cv_locale_fr=fr_FR.iso88591
else
if (LC_ALL=fr ./conftest; exit) 2>/dev/null; then
gt_cv_locale_fr=fr
else
if test -f /usr/share/locale/fr_FR.ISO8859-1/LC_CTYPE; then
gt_cv_locale_fr=fr_FR.ISO8859-1
else
gt_cv_locale_fr=fr_FR
fi
fi
fi
fi
fi
fi
fi
rm -fr conftest*
])
LOCALE_FR=$gt_cv_locale_fr
AC_SUBST([LOCALE_FR])
])