summaryrefslogtreecommitdiffstats
path: root/libquadmath/configure.ac
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-02-14 15:34:44 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-02-14 15:34:44 +0000
commit0c0fb0a6d9c870bcae9849df9cfbcf26c750759a (patch)
treea69f03ba3c677008fe5633e1a0886cffc77d95b8 /libquadmath/configure.ac
parente11f718628de9d660a6721a4cd02c72e1fbbb600 (diff)
downloadppe42-gcc-0c0fb0a6d9c870bcae9849df9cfbcf26c750759a.tar.gz
ppe42-gcc-0c0fb0a6d9c870bcae9849df9cfbcf26c750759a.zip
PR fortran/47642
* libquadmath.texi (quadmath_snprintf): Document. (quadmath_flt128tostr): Remove. * Makefile.am (libquadmath_la_SOURCES): Add printf/*.c. Remove quadmath_io.c, gdtoa/gdtoa.c, gdtoa/g__fmt.c, gdtoa/g_Qfmt.c, gdtoa/dmisc.c and gdtoa/ulp.c. * quadmath.h (quadmath_snprintf): New prototype. (quadmath_flt128tostr): Remove. * quadmath_weak.h (quadmath_snprintf): Add. (quadmath_flt128tostr): Remove. * configure.ac: New AC_CHECK_HEADERS headers: langinfo.h, wchar.h, wctype.h, limits.h, ctype.h, printf.h, errno.h. (AC_USE_SYSTEM_EXTENSIONS): Add. (HAVE_HIDDEN_VISIBILITY, HAVE_PRINTF_HOOKS, USE_LOCALE_SUPPORT, USE_I18N_NUMBER_H): New checks. * quadmath.map (QUADMATH_1.0): Add quadmath_snprintf. Remove quadmath_flt128tostr. * printf/printf_fphex.c: New file. * printf/_itowa.h: New file. * printf/mul_n.c: New file. * printf/quadmath-printf.h: New file. * printf/submul_1.c: New file. * printf/quadmath-printf.c: New file. * printf/gmp-impl.h: New file. * printf/lshift.c: New file. * printf/fpioconst.h: New file. * printf/add_n.c: New file. * printf/cmp.c: New file. * printf/sub_n.c: New file. * printf/mul.c: New file. * printf/divrem.c: New file. * printf/addmul_1.c: New file. * printf/printf_fp.c: New file. * printf/_itoa.h: New file. * printf/fpioconst.c: New file. * printf/_i18n_number.h: New file. * printf/flt1282mpn.c: New file. * printf/rshift.c: New file. * printf/mul_1.c: New file. * quadmath_io.c: Removed. * gdtoa/gdtoa.c: Removed. * gdtoa/g__fmt.c: Removed. * gdtoa/g_Qfmt.c: Removed. * gdtoa/dmisc.c: Removed. * gdtoa/ulp.c: Removed. * config.h.in: Regenerated. * configure: Regenerated. * Makefile.in: Regenerated. * io/write_float.def (DTOAQ): Use quadmath_snprintf instead of quadmath_flt128tostr. * io/transfer128.c (tmp2): Initialize to quadmath_snprintf instead of quadmath_flt128tostr. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170135 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libquadmath/configure.ac')
-rw-r--r--libquadmath/configure.ac83
1 files changed, 82 insertions, 1 deletions
diff --git a/libquadmath/configure.ac b/libquadmath/configure.ac
index 0bc2315a6b2..4bde6ed50fa 100644
--- a/libquadmath/configure.ac
+++ b/libquadmath/configure.ac
@@ -42,6 +42,8 @@ AC_MSG_RESULT($version_specific_libs)
GCC_NO_EXECUTABLES
+AC_USE_SYSTEM_EXTENSIONS
+
# See if makeinfo has been installed and is modern enough
# that we can use it.
ACX_CHECK_PROG_VER([MAKEINFO], [makeinfo], [--version],
@@ -110,7 +112,7 @@ esac
AC_SUBST(toolexecdir)
AC_SUBST(toolexeclibdir)
-AC_CHECK_HEADERS(fenv.h)
+AC_CHECK_HEADERS(fenv.h langinfo.h wchar.h wctype.h limits.h ctype.h printf.h errno.h)
# If available, sqrtl and cbrtl speed up the calculation -
# but they are not required
@@ -146,6 +148,16 @@ else
fi
fi
+# Check for hidden visibility (copied from libssp).
+AC_MSG_CHECKING([whether hidden visibility is supported])
+AC_TRY_COMPILE([
+void __attribute__((visibility ("hidden"))) bar (void) {}],,
+[quadmath_hidden=yes],[quadmath_hidden=no])
+AC_MSG_RESULT($quadmath_hidden)
+if test x$quadmath_hidden = xyes; then
+ AC_DEFINE([HAVE_HIDDEN_VISIBILITY],[1],[__attribute__((visibility ("hidden"))) supported])
+fi
+
# Check for symbol versioning (copied from libssp).
AC_MSG_CHECKING([whether symbol versioning is supported])
if test x$gcc_no_link = xyes; then
@@ -213,6 +225,75 @@ AC_CACHE_CHECK([whether __float128 is supported], [libquad_cv_have_float128],
])])
AM_CONDITIONAL(BUILD_LIBQUADMATH, [test "x$libquad_cv_have_float128" = xyes])
+# Check for printf hook support.
+AC_MSG_CHECKING([whether printf hooks are supported])
+AC_TRY_COMPILE([
+#include <printf.h>
+#include <stdarg.h>
+#include <stdlib.h>
+extern void flt128_va (void *, va_list *);
+extern int flt128_ais (const struct printf_info *, size_t, int *, int *);
+extern int flt128_printf_fp (FILE *, const struct printf_info *, const void *const *);
+],[
+int pa_flt128 = register_printf_type (flt128_va);
+int mod_Q = register_printf_modifier (L"Q");
+int res = register_printf_specifier ('f', flt128_printf_fp, flt128_ais);
+],
+[quadmath_printf_hooks=yes],[quadmath_printf_hooks=no])
+AC_MSG_RESULT($quadmath_printf_hooks)
+if test x$quadmath_printf_hooks = xyes; then
+ AC_DEFINE([HAVE_PRINTF_HOOKS],[1],[GNU C Library stype printf hooks supported])
+fi
+
+# Check for whether locale support for quadmath_snprintf or Q printf hooks
+# should be provided.
+AC_MSG_CHECKING([whether locale support for quadmath_snprintf should be added])
+AC_TRY_COMPILE([#include <langinfo.h>],[
+const char *s;
+s = nl_langinfo (DECIMAL_POINT);
+s = nl_langinfo (MON_DECIMAL_POINT);
+s = nl_langinfo (GROUPING);
+s = nl_langinfo (MON_GROUPING);
+s = nl_langinfo (THOUSANDS_SEP);
+s = nl_langinfo (MON_THOUSANDS_SEP);
+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;
+],
+[quadmath_use_locale_support=yes],[quadmath_use_locale_support=no])
+AC_MSG_RESULT($quadmath_use_locale_support)
+if test x$quadmath_use_locale_support = xyes; then
+ AC_DEFINE([USE_LOCALE_SUPPORT],[1],[whether nl_langinfo is sufficiently supported])
+fi
+
+# Check for whether i18n number rewriting support for quadmath_snprintf
+# or Q printf hooks should be provided.
+AC_MSG_CHECKING([whether i18n number rewriting support for quadmath_snprintf should be added])
+AC_TRY_COMPILE([#include <langinfo.h>
+#include <limits.h>
+#include <string.h>
+#include <wchar.h>
+#include <wctype.h>],[
+const char *s;
+char decimal[MB_LEN_MAX];
+wctrans_t map = wctrans ("to_outpunct");
+wint_t wdecimal = towctrans (L'.', map);
+mbstate_t state;
+memset (&state, '\0', sizeof (state));
+wcrtomb (decimal, wdecimal, &state);
+s = nl_langinfo (_NL_CTYPE_OUTDIGIT0_MB);
+s = nl_langinfo (_NL_CTYPE_OUTDIGIT0_WC);
+(void) s;
+],
+[quadmath_use_i18n_number_h=yes],[quadmath_use_i18n_number_h=no])
+AC_MSG_RESULT($quadmath_use_i18n_number_h)
+if test x$quadmath_use_i18n_number_h = xyes; then
+ AC_DEFINE([USE_I18N_NUMBER_H],[1],[whether i18n number rewriting can be supported])
+fi
+
AC_CACHE_SAVE
if test ${multilib} = yes; then
OpenPOWER on IntegriCloud