aboutsummaryrefslogtreecommitdiff
path: root/libquadmath/configure
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-02-16 14:54:30 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2011-02-16 14:54:30 +0100
commitd2995f218548fb6e506348377bf150c69dd231a6 (patch)
treef3947cffa865d6825f1d64a027010b829f2e6182 /libquadmath/configure
parent5037599a7442f3b528905f13221c8affa5a9f20e (diff)
downloadgcc-d2995f218548fb6e506348377bf150c69dd231a6.zip
gcc-d2995f218548fb6e506348377bf150c69dd231a6.tar.gz
gcc-d2995f218548fb6e506348377bf150c69dd231a6.tar.bz2
quadmath-printf.c: Also check __GLIBC__ when checking whether workarounds for printf hook handling...
* printf/quadmath-printf.c: Also check __GLIBC__ when checking whether workarounds for printf hook handling should be added. * configure.ac: Check for locale.h too. (USE_LOCALE_SUPPORT): Remove check. (USE_NL_LANGINFO, USE_NL_LANGINFO_WC, USE_LOCALECONV): New checks. (USE_I18_NUMBER_H): Check also for _NL_CTYPE_MB_CUR_MAX. * printf/printf_fphex.c (__quadmath_printf_fphex): Use nl_langinfo or localeconv for narrow version and nl_langinfo if USE_NL_LANGINFO_WC for wide version. * printf/quadmath-printf.h: Include locale.h if HAVE_LOCALE_H. * printf/printf_fp.c (USE_I18N_NUMBER_H): Don't define to 0. (__quadmath_printf_fp): Use nl_langinfo or localeconv for narrow version and nl_langinfo if USE_NL_LANGINFO_WC for wide version. Guard nl_langinfo (_NL_CTYPE_MB_CUR_MAX) use with USE_I18N_NUMBER_H #ifdef. * configure: Regenerated. * config.h.in: Regenerated. From-SVN: r170211
Diffstat (limited to 'libquadmath/configure')
-rwxr-xr-xlibquadmath/configure87
1 files changed, 77 insertions, 10 deletions
diff --git a/libquadmath/configure b/libquadmath/configure
index 47021ff..612d56c 100755
--- a/libquadmath/configure
+++ b/libquadmath/configure
@@ -11922,7 +11922,7 @@ esac
-for ac_header in fenv.h langinfo.h wchar.h wctype.h limits.h ctype.h printf.h errno.h
+for ac_header in fenv.h langinfo.h locale.h wchar.h wctype.h limits.h ctype.h printf.h errno.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -12577,8 +12577,8 @@ fi
# Check for whether locale support for quadmath_snprintf or Q printf hooks
# should be provided.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether locale support for quadmath_snprintf should be added" >&5
-$as_echo_n "checking whether locale support for quadmath_snprintf should be added... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether nl_langinfo should be used" >&5
+$as_echo_n "checking whether nl_langinfo should be used... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <langinfo.h>
@@ -12593,11 +12593,40 @@ s = nl_langinfo (GROUPING);
s = nl_langinfo (MON_GROUPING);
s = nl_langinfo (THOUSANDS_SEP);
s = nl_langinfo (MON_THOUSANDS_SEP);
+(void) s;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ quadmath_use_nl_langinfo=yes
+else
+ quadmath_use_nl_langinfo=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $quadmath_use_nl_langinfo" >&5
+$as_echo "$quadmath_use_nl_langinfo" >&6; }
+if test x$quadmath_use_nl_langinfo = xyes; then
+
+$as_echo "#define USE_NL_LANGINFO 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether nl_langinfo should be used for wide char locale info" >&5
+$as_echo_n "checking whether nl_langinfo should be used for wide char locale info... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <langinfo.h>
+int
+main ()
+{
+
+const char *s;
s = nl_langinfo (_NL_NUMERIC_DECIMAL_POINT_WC);
s = nl_langinfo (_NL_MONETARY_DECIMAL_POINT_WC);
s = nl_langinfo (_NL_NUMERIC_THOUSANDS_SEP_WC);
s = nl_langinfo (_NL_MONETARY_THOUSANDS_SEP_WC);
-s = nl_langinfo (_NL_CTYPE_MB_CUR_MAX);
(void) s;
;
@@ -12605,16 +12634,53 @@ s = nl_langinfo (_NL_CTYPE_MB_CUR_MAX);
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- quadmath_use_locale_support=yes
+ quadmath_use_nl_langinfo_wc=yes
else
- quadmath_use_locale_support=no
+ quadmath_use_nl_langinfo_wc=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $quadmath_use_locale_support" >&5
-$as_echo "$quadmath_use_locale_support" >&6; }
-if test x$quadmath_use_locale_support = xyes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $quadmath_use_nl_langinfo_wc" >&5
+$as_echo "$quadmath_use_nl_langinfo_wc" >&6; }
+if test x$quadmath_use_nl_langinfo_wc = xyes; then
-$as_echo "#define USE_LOCALE_SUPPORT 1" >>confdefs.h
+$as_echo "#define USE_NL_LANGINFO_WC 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localeconv should be used" >&5
+$as_echo_n "checking whether localeconv should be used... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <locale.h>
+int
+main ()
+{
+
+const struct lconv *l = localeconv ();
+const char *s;
+s = l->decimal_point;
+s = l->mon_decimal_point;
+s = l->grouping;
+s = l->mon_grouping;
+s = l->thousands_sep;
+s = l->mon_thousands_sep;
+(void) s;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ quadmath_use_localeconv=yes
+else
+ quadmath_use_localeconv=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $quadmath_use_localeconv" >&5
+$as_echo "$quadmath_use_localeconv" >&6; }
+if test x$quadmath_use_localeconv = xyes; then
+
+$as_echo "#define USE_LOCALECONV 1" >>confdefs.h
fi
@@ -12642,6 +12708,7 @@ memset (&state, '\0', sizeof (state));
wcrtomb (decimal, wdecimal, &state);
s = nl_langinfo (_NL_CTYPE_OUTDIGIT0_MB);
s = nl_langinfo (_NL_CTYPE_OUTDIGIT0_WC);
+s = nl_langinfo (_NL_CTYPE_MB_CUR_MAX);
(void) s;
;