* config/pa/xm-linux.h: Do not include "floatformat.h".
(HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT)
(HOST_LONG_DOUBLE_FORMAT): Delete macros.
* config/i386/xm-i386.h: Do not include "floatformat.h".
(HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT)
(HOST_LONG_DOUBLE_FORMAT): Delete macros.
* doublest.c (HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT)
(HOST_LONG_DOUBLE_FORMAT): Delete macros. Use
GDB_HOST_FLOAT_FORMAT, GDB_HOST_DOUBLE_FORMAT and
GDB_HOST_LONG_DOUBLE_FORMAT instead.
* configure.in (GDB_HOST_FLOAT_FORMAT, GDB_HOST_DOUBLE_FORMAT)
(GDB_HOST_LONG_DOUBLE_FORMAT): Define.
* configure, config.in: Regenerate.
* configure.host (gdb_host_float_format, gdb_host_double_format)
(gdb_host_long_double_format): Set according to the host.
+2004-07-29 Andrew Cagney <cagney@gnu.org>
+
+ * config/pa/xm-linux.h: Do not include "floatformat.h".
+ (HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT)
+ (HOST_LONG_DOUBLE_FORMAT): Delete macros.
+ * config/i386/xm-i386.h: Do not include "floatformat.h".
+ (HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT)
+ (HOST_LONG_DOUBLE_FORMAT): Delete macros.
+ * doublest.c (HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT)
+ (HOST_LONG_DOUBLE_FORMAT): Delete macros. Use
+ GDB_HOST_FLOAT_FORMAT, GDB_HOST_DOUBLE_FORMAT and
+ GDB_HOST_LONG_DOUBLE_FORMAT instead.
+ * configure.in (GDB_HOST_FLOAT_FORMAT, GDB_HOST_DOUBLE_FORMAT)
+ (GDB_HOST_LONG_DOUBLE_FORMAT): Define.
+ * configure, config.in: Regenerate.
+ * configure.host (gdb_host_float_format, gdb_host_double_format)
+ (gdb_host_long_double_format): Set according to the host.
+
2004-07-29 Andrew Cagney <cagney@gnu.org>
* Makefile.in (CONFIG_CLEAN): Delete duplicate definition.
/* Define if we can use the tkill syscall. */
#undef HAVE_TKILL_SYSCALL
+/* Host float floatformat */
+#undef GDB_HOST_FLOAT_FORMAT
+
+/* Host double floatformat */
+#undef GDB_HOST_DOUBLE_FORMAT
+
+/* Host long double floatformat */
+#undef GDB_HOST_LONG_DOUBLE_FORMAT
+
/* Define to the default OS ABI for this configuration. */
#undef GDB_OSABI_DEFAULT
#ifndef XM_I386_H
#define XM_I386_H
-#include "floatformat.h"
-
-#define HOST_FLOAT_FORMAT &floatformat_ieee_single_little
-#define HOST_DOUBLE_FORMAT &floatformat_ieee_double_little
-#define HOST_LONG_DOUBLE_FORMAT &floatformat_i387_ext
-
#endif /* xm-i386.h */
#ifndef XM_HPPA_LINUX_H
#define XM_HPPA_LINUX_H
-#include "floatformat.h"
-
-#define HOST_FLOAT_FORMAT &floatformat_ieee_single_big
-#define HOST_DOUBLE_FORMAT &floatformat_ieee_double_big
-#define HOST_LONG_DOUBLE_FORMAT &floatformat_ieee_double_big
-
#endif /* xm-linux.h */
+# List of host floatformats.
+cat >> confdefs.h <<EOF
+#define GDB_HOST_FLOAT_FORMAT $gdb_host_float_format
+EOF
+
+cat >> confdefs.h <<EOF
+#define GDB_HOST_DOUBLE_FORMAT $gdb_host_double_format
+EOF
+
+cat >> confdefs.h <<EOF
+#define GDB_HOST_LONG_DOUBLE_FORMAT $gdb_host_long_double_format
+EOF
+
+
# target_subdir is used by the testsuite to find the target libraries.
target_subdir=
if test "${host}" != "${target}"; then
# We only build gdbserver automatically if host and target are the same.
if test "x$target" = "x$host"; then
echo $ac_n "checking whether gdbserver is supported on this host""... $ac_c" 1>&6
-echo "configure:10640: checking whether gdbserver is supported on this host" >&5
+echo "configure:10654: checking whether gdbserver is supported on this host" >&5
if test "x$build_gdbserver" = xyes; then
configdirs="$configdirs gdbserver"
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:10704: checking for Cygwin environment" >&5
+echo "configure:10718: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 10709 "configure"
+#line 10723 "configure"
#include "confdefs.h"
int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:10720: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10734: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
CYGWIN=
test "$ac_cv_cygwin" = yes && CYGWIN=yes
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:10737: checking for mingw32 environment" >&5
+echo "configure:10751: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 10742 "configure"
+#line 10756 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:10749: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10763: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:10768: checking for executable suffix" >&5
+echo "configure:10782: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:10778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:10792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
- *.c | *.C | *.o | *.obj | *.ilk | *.pdb) ;;
+ *.c | *.o | *.obj | *.ilk | *.pdb) ;;
*) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
esac
done
echo $ac_n "checking for iconv""... $ac_c" 1>&6
-echo "configure:10820: checking for iconv" >&5
+echo "configure:10834: checking for iconv" >&5
if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
cat > conftest.$ac_ext <<EOF
-#line 10828 "configure"
+#line 10842 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:10838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_func_iconv=yes
else
am_save_LIBS="$LIBS"
LIBS="$LIBS -liconv"
cat > conftest.$ac_ext <<EOF
-#line 10850 "configure"
+#line 10864 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:10860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_lib_iconv=yes
am_cv_func_iconv=yes
EOF
echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
-echo "configure:10881: checking for iconv declaration" >&5
+echo "configure:10895: checking for iconv declaration" >&5
if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 10887 "configure"
+#line 10901 "configure"
#include "confdefs.h"
#include <stdlib.h>
; return 0; }
EOF
-if { (eval echo configure:10906: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10920: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
am_cv_proto_iconv_arg1=""
else
# invoked from the autoconf generated configure script.
# This file sets the following shell variables:
-# gdb_host_cpu generic name of host's CPU
-# gdb_host name of GDB host definition to use
+# gdb_host_cpu generic name of host's CPU
+# gdb_host name of GDB host definition to use
+# gdb_host_float_format host's float floatformat, or 0
+# gdb_host_double_format host's double floatformat, or 0
+# gdb_host_long_double_format host's long double floatformat, or 0
# Map host cpu into the config cpu subdirectory name.
# The default is $host_cpu.
m32r*-*-linux*) gdb_host=linux ;;
esac
+
+
+
+# Map the host/cpu onto the floatformat correspondong to C's "float",
+# "double" and "long double" types.
+
+case "${host}" in
+i[34567]86-*-*)
+ gdb_host_float_format="&floatformat_ieee_single_little"
+ gdb_host_double_format="&floatformat_ieee_double_little"
+ gdb_host_long_double_format="&floatformat_i387_ext"
+ ;;
+hppa*-*-linux*)
+ gdb_host_float_format="&floatformat_ieee_single_big"
+ gdb_host_double_format="&floatformat_ieee_double_big"
+ gdb_host_long_double_format="&floatformat_ieee_double_big"
+ ;;
+*)
+ gdb_host_float_format=0
+ gdb_host_double_format=0
+ gdb_host_long_double_format=0
+ ;;
+esac
AC_SUBST(CONFIG_INSTALL)
AC_SUBST(CONFIG_UNINSTALL)
+# List of host floatformats.
+AC_DEFINE_UNQUOTED(GDB_HOST_FLOAT_FORMAT,$gdb_host_float_format,[Host float floatformat])
+AC_DEFINE_UNQUOTED(GDB_HOST_DOUBLE_FORMAT,$gdb_host_double_format,[Host double floatformat])
+AC_DEFINE_UNQUOTED(GDB_HOST_LONG_DOUBLE_FORMAT,$gdb_host_long_double_format,[Host long double floatformat])
+
# target_subdir is used by the testsuite to find the target libraries.
target_subdir=
if test "${host}" != "${target}"; then
{
result |= (unsigned long)*(data + cur_byte) << cur_bitshift;
cur_bitshift += FLOATFORMAT_CHAR_BIT;
- if (order == floatformat_little || order == floatformat_littlebyte_bigword)
- ++cur_byte;
- else
- --cur_byte;
+ switch (order)
+ {
+ case floatformat_little:
+ ++cur_byte;
+ break;
+ case floatformat_big:
+ --cur_byte;
+ break;
+ case floatformat_littlebyte_bigword:
+ break;
+ }
}
if (len < sizeof(result) * FLOATFORMAT_CHAR_BIT)
/* Mask out bits which are not part of the field */
increase precision as necessary. Otherwise, we call the conversion
routine and let it do the dirty work. */
-#ifndef HOST_FLOAT_FORMAT
-#define HOST_FLOAT_FORMAT 0
-#endif
-#ifndef HOST_DOUBLE_FORMAT
-#define HOST_DOUBLE_FORMAT 0
-#endif
-#ifndef HOST_LONG_DOUBLE_FORMAT
-#define HOST_LONG_DOUBLE_FORMAT 0
-#endif
-
-static const struct floatformat *host_float_format = HOST_FLOAT_FORMAT;
-static const struct floatformat *host_double_format = HOST_DOUBLE_FORMAT;
-static const struct floatformat *host_long_double_format = HOST_LONG_DOUBLE_FORMAT;
+static const struct floatformat *host_float_format = GDB_HOST_FLOAT_FORMAT;
+static const struct floatformat *host_double_format = GDB_HOST_DOUBLE_FORMAT;
+static const struct floatformat *host_long_double_format = GDB_HOST_LONG_DOUBLE_FORMAT;
void
floatformat_to_doublest (const struct floatformat *fmt,