summaryrefslogtreecommitdiffstats
path: root/gl/m4/wcrtomb.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/wcrtomb.m4')
-rw-r--r--gl/m4/wcrtomb.m475
1 files changed, 38 insertions, 37 deletions
diff --git a/gl/m4/wcrtomb.m4 b/gl/m4/wcrtomb.m4
index cb7d9263..6a2d772a 100644
--- a/gl/m4/wcrtomb.m4
+++ b/gl/m4/wcrtomb.m4
@@ -1,5 +1,5 @@
1# wcrtomb.m4 serial 4 1# wcrtomb.m4 serial 5
2dnl Copyright (C) 2008-2009 Free Software Foundation, Inc. 2dnl Copyright (C) 2008-2010 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,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -10,37 +10,37 @@ AC_DEFUN([gl_FUNC_WCRTOMB],
10 10
11 AC_REQUIRE([AC_TYPE_MBSTATE_T]) 11 AC_REQUIRE([AC_TYPE_MBSTATE_T])
12 gl_MBSTATE_T_BROKEN 12 gl_MBSTATE_T_BROKEN
13 if test $REPLACE_MBSTATE_T = 1; then 13
14 REPLACE_WCRTOMB=1
15 fi
16 AC_CHECK_FUNCS_ONCE([wcrtomb]) 14 AC_CHECK_FUNCS_ONCE([wcrtomb])
17 if test $ac_cv_func_wcrtomb = no; then 15 if test $ac_cv_func_wcrtomb = no; then
18 HAVE_WCRTOMB=0 16 HAVE_WCRTOMB=0
19 fi 17 else
20 if test $HAVE_WCRTOMB != 0 && test $REPLACE_WCRTOMB != 1; then 18 if test $REPLACE_MBSTATE_T = 1; then
21 dnl On AIX 4.3, OSF/1 5.1 and Solaris 10, wcrtomb (NULL, 0, NULL) sometimes 19 REPLACE_WCRTOMB=1
22 dnl returns 0 instead of 1. 20 else
23 AC_REQUIRE([AC_PROG_CC]) 21 dnl On AIX 4.3, OSF/1 5.1 and Solaris 10, wcrtomb (NULL, 0, NULL) sometimes
24 AC_REQUIRE([gt_LOCALE_FR]) 22 dnl returns 0 instead of 1.
25 AC_REQUIRE([gt_LOCALE_FR_UTF8]) 23 AC_REQUIRE([AC_PROG_CC])
26 AC_REQUIRE([gt_LOCALE_JA]) 24 AC_REQUIRE([gt_LOCALE_FR])
27 AC_REQUIRE([gt_LOCALE_ZH_CN]) 25 AC_REQUIRE([gt_LOCALE_FR_UTF8])
28 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles 26 AC_REQUIRE([gt_LOCALE_JA])
29 AC_CACHE_CHECK([whether wcrtomb return value is correct], 27 AC_REQUIRE([gt_LOCALE_ZH_CN])
30 [gl_cv_func_wcrtomb_retval], 28 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
31 [ 29 AC_CACHE_CHECK([whether wcrtomb return value is correct],
32 dnl Initial guess, used when cross-compiling or when no suitable locale 30 [gl_cv_func_wcrtomb_retval],
33 dnl is present. 31 [
32 dnl Initial guess, used when cross-compiling or when no suitable locale
33 dnl is present.
34changequote(,)dnl 34changequote(,)dnl
35 case "$host_os" in 35 case "$host_os" in
36 # Guess no on AIX 4, OSF/1 and Solaris. 36 # Guess no on AIX 4, OSF/1 and Solaris.
37 aix4* | osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;; 37 aix4* | osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;;
38 # Guess yes otherwise. 38 # Guess yes otherwise.
39 *) gl_cv_func_wcrtomb_retval="guessing yes" ;; 39 *) gl_cv_func_wcrtomb_retval="guessing yes" ;;
40 esac 40 esac
41changequote([,])dnl 41changequote([,])dnl
42 if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then 42 if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
43 AC_TRY_RUN([ 43 AC_TRY_RUN([
44#include <locale.h> 44#include <locale.h>
45#include <stdio.h> 45#include <stdio.h>
46#include <string.h> 46#include <string.h>
@@ -69,15 +69,16 @@ int main ()
69 } 69 }
70 return 0; 70 return 0;
71}], 71}],
72 [gl_cv_func_wcrtomb_retval=yes], 72 [gl_cv_func_wcrtomb_retval=yes],
73 [gl_cv_func_wcrtomb_retval=no], 73 [gl_cv_func_wcrtomb_retval=no],
74 [:]) 74 [:])
75 fi 75 fi
76 ]) 76 ])
77 case "$gl_cv_func_wcrtomb_retval" in 77 case "$gl_cv_func_wcrtomb_retval" in
78 *yes) ;; 78 *yes) ;;
79 *) REPLACE_WCRTOMB=1 ;; 79 *) REPLACE_WCRTOMB=1 ;;
80 esac 80 esac
81 fi
81 fi 82 fi
82 if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then 83 if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then
83 gl_REPLACE_WCHAR_H 84 gl_REPLACE_WCHAR_H