summaryrefslogtreecommitdiffstats
path: root/gl/m4/locale-zh.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/locale-zh.m4')
-rw-r--r--gl/m4/locale-zh.m463
1 files changed, 22 insertions, 41 deletions
diff --git a/gl/m4/locale-zh.m4 b/gl/m4/locale-zh.m4
index ba7f9c5..36a5f1d 100644
--- a/gl/m4/locale-zh.m4
+++ b/gl/m4/locale-zh.m4
@@ -1,4 +1,4 @@
1# locale-zh.m4 serial 5 1# locale-zh.m4 serial 6
2dnl Copyright (C) 2003, 2005-2009 Free Software Foundation, Inc. 2dnl Copyright (C) 2003, 2005-2009 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -12,25 +12,7 @@ AC_DEFUN([gt_LOCALE_ZH_CN],
12 AC_REQUIRE([AC_CANONICAL_HOST]) 12 AC_REQUIRE([AC_CANONICAL_HOST])
13 AC_REQUIRE([AM_LANGINFO_CODESET]) 13 AC_REQUIRE([AM_LANGINFO_CODESET])
14 AC_CACHE_CHECK([for a transitional chinese locale], [gt_cv_locale_zh_CN], [ 14 AC_CACHE_CHECK([for a transitional chinese locale], [gt_cv_locale_zh_CN], [
15 macosx= 15 AC_LANG_CONFTEST([AC_LANG_SOURCE([
16changequote(,)dnl
17 case "$host_os" in
18 darwin[56]*) ;;
19 darwin*) macosx=yes;;
20 esac
21changequote([,])dnl
22 if test -n "$macosx"; then
23 # On Darwin 7 (MacOS X), the libc supports some locales in non-UTF-8
24 # encodings, but the kernel does not support them. The documentation
25 # says:
26 # "... all code that calls BSD system routines should ensure
27 # that the const *char parameters of these routines are in UTF-8
28 # encoding. All BSD system functions expect their string
29 # parameters to be in UTF-8 encoding and nothing else."
30 # See the comments in config.charset. Therefore we bypass the test.
31 gt_cv_locale_zh_CN=none
32 else
33 AC_LANG_CONFTEST([AC_LANG_SOURCE([
34changequote(,)dnl 16changequote(,)dnl
35#include <locale.h> 17#include <locale.h>
36#include <stdlib.h> 18#include <stdlib.h>
@@ -80,31 +62,30 @@ int main ()
80 return 0; 62 return 0;
81} 63}
82changequote([,])dnl 64changequote([,])dnl
83 ])]) 65 ])])
84 if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then 66 if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
85 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because 67 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
86 # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the 68 # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
87 # configure script would override the LC_ALL setting. Likewise for 69 # configure script would override the LC_ALL setting. Likewise for
88 # LC_CTYPE, which is also set at the beginning of the configure script. 70 # LC_CTYPE, which is also set at the beginning of the configure script.
89 # Test for the locale name without encoding suffix. 71 # Test for the locale name without encoding suffix.
90 if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 72 if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
91 gt_cv_locale_zh_CN=zh_CN 73 gt_cv_locale_zh_CN=zh_CN
74 else
75 # Test for the locale name with explicit encoding suffix.
76 if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
77 gt_cv_locale_zh_CN=zh_CN.GB18030
92 else 78 else
93 # Test for the locale name with explicit encoding suffix. 79 # None found.
94 if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 80 gt_cv_locale_zh_CN=none
95 gt_cv_locale_zh_CN=zh_CN.GB18030
96 else
97 # None found.
98 gt_cv_locale_zh_CN=none
99 fi
100 fi 81 fi
101 else
102 # If there was a link error, due to mblen(), the system is so old that
103 # it certainly doesn't have a chinese locale.
104 gt_cv_locale_zh_CN=none
105 fi 82 fi
106 rm -fr conftest* 83 else
84 # If there was a link error, due to mblen(), the system is so old that
85 # it certainly doesn't have a chinese locale.
86 gt_cv_locale_zh_CN=none
107 fi 87 fi
88 rm -fr conftest*
108 ]) 89 ])
109 LOCALE_ZH_CN=$gt_cv_locale_zh_CN 90 LOCALE_ZH_CN=$gt_cv_locale_zh_CN
110 AC_SUBST([LOCALE_ZH_CN]) 91 AC_SUBST([LOCALE_ZH_CN])