aboutsummaryrefslogtreecommitdiff
path: root/gdb/configure.ac
diff options
context:
space:
mode:
authorLuis Machado <luisgpm@br.ibm.com>2007-11-05 11:32:31 +0000
committerLuis Machado <luisgpm@br.ibm.com>2007-11-05 11:32:31 +0000
commit1a619819d6cb85f66a81d3ca146a960c679edfa4 (patch)
treed79458b9191b3ac748a1108187608fbf3a01262a /gdb/configure.ac
parent9a5e27bd964ba53c203b2c4fe1df4be7f07cb37d (diff)
downloadgdb-1a619819d6cb85f66a81d3ca146a960c679edfa4.zip
gdb-1a619819d6cb85f66a81d3ca146a960c679edfa4.tar.gz
gdb-1a619819d6cb85f66a81d3ca146a960c679edfa4.tar.bz2
* printcmd.c: (printf_command): Add support for new DFP
modifiers %H, %D and %DD. * configure.ac: Add check for DECFLOAT printf support. * configure: Regenerated. * doc/gdb.texinfo: Update printf command's description. * testsuite/gdb.base/printcmds.exp: New function test_printf_with_dfp.
Diffstat (limited to 'gdb/configure.ac')
-rw-r--r--gdb/configure.ac19
1 files changed, 19 insertions, 0 deletions
diff --git a/gdb/configure.ac b/gdb/configure.ac
index eab68b0..d20329c 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -928,6 +928,25 @@ if test $gdb_cv_printf_has_long_long = yes; then
[Define to 1 if the "%ll" format works to print long longs.])
fi
+# Check if the compiler and runtime support printing decfloats.
+
+AC_CACHE_CHECK([for decfloat support in printf],
+ gdb_cv_printf_has_decfloat,
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
+[[char buf[64];
+ _Decimal32 d32 = 1.2345df;
+ _Decimal64 d64 = 1.2345dd;
+ _Decimal128 d128 = 1.2345dl;
+ sprintf (buf, "Decimal32: %H\nDecimal64: %D\nDecimal128: %DD", d32, d64, d128);
+ return (strcmp ("Decimal32: 1.2345\nDecimal64: 1.2345\nDecimal128: 1.2345", buf));]])],
+ gdb_cv_printf_has_decfloat=yes,
+ gdb_cv_printf_has_decfloat=no,
+ gdb_cv_printf_has_decfloat=no)])
+if test $gdb_cv_printf_has_decfloat = yes; then
+ AC_DEFINE(PRINTF_HAS_DECFLOAT, 1,
+ [Define to 1 if the "%H, %D and %DD" formats work to print decfloats.])
+fi
+
# Check if the compiler supports the `long double' type. We can't use
# AC_C_LONG_DOUBLE because that one does additional checks on the
# constants defined in <float.h> that fail on some systems,