diff options
author | Andrew Cagney <cagney@redhat.com> | 1997-11-24 06:50:12 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 1997-11-24 06:50:12 +0000 |
commit | f7b8c9ce46cd96bb86beddc9e33663a556702c61 (patch) | |
tree | 849a16ca5921a0b2a647b234e91023af49605a81 /gdb/configure.in | |
parent | d14573e31eb6c22006d00de0be5336cfbc69257a (diff) | |
download | gdb-f7b8c9ce46cd96bb86beddc9e33663a556702c61.zip gdb-f7b8c9ce46cd96bb86beddc9e33663a556702c61.tar.gz gdb-f7b8c9ce46cd96bb86beddc9e33663a556702c61.tar.bz2 |
Improve GDB support for FreeBSD host/target.
To configure.in: make PRINTF_HAS_LONG_LONG check more pedantic; check
that SCANF_HAS_LONG_DOUBLE instead of assuming PRINTF_HAS_LONG_DOUBLE
implies it; document.
Diffstat (limited to 'gdb/configure.in')
-rw-r--r-- | gdb/configure.in | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/gdb/configure.in b/gdb/configure.in index e573c5e..429a5dc 100644 --- a/gdb/configure.in +++ b/gdb/configure.in @@ -119,10 +119,14 @@ AC_MSG_CHECKING(for long long support in printf) AC_CACHE_VAL(gdb_cv_printf_has_long_long, [AC_TRY_RUN([ int main () { - char buf[16]; - long long l = 0x12345; - sprintf (buf, "%llx", l); - return (strcmp ("12345", buf)); + char buf[32]; + long long l = 0; + l = (l << 16) + 0x0123; + l = (l << 16) + 0x4567; + l = (l << 16) + 0x89ab; + l = (l << 16) + 0xcdef; + sprintf (buf, "0x%016llx", l); + return (strcmp ("0x0123456789abcdef", buf)); }], gdb_cv_printf_has_long_long=yes, gdb_cv_printf_has_long_long=no, @@ -164,6 +168,25 @@ if test $gdb_cv_printf_has_long_double = yes; then fi AC_MSG_RESULT($gdb_cv_printf_has_long_double) +dnl See if the compiler and runtime support scanning long doubles + +AC_MSG_CHECKING(for long double support in scanf) +AC_CACHE_VAL(gdb_cv_scanf_has_long_double, +[AC_TRY_RUN([ +int main () { + char *buf = "3.141592653"; + long double f = 0; + sscanf (buf, "%Lg", &f); + return !(f > 3.14159 && f < 3.14160); +}], +gdb_cv_scanf_has_long_double=yes, +gdb_cv_scanf_has_long_double=no, +gdb_cv_scanf_has_long_double=no)]) +if test $gdb_cv_scanf_has_long_double = yes; then + AC_DEFINE(SCANF_HAS_LONG_DOUBLE) +fi +AC_MSG_RESULT($gdb_cv_scanf_has_long_double) + AC_FUNC_MMAP BFD_NEED_DECLARATION(malloc) |