PATCH: add --enable-decimal-float configure option

Ben Elliston bje@au1.ibm.com
Mon Dec 19 12:56:00 GMT 2005


This patch adds an --enable-decimal-float option to gcc/configure.  On
PowerPC GNU/Linux systems, --disable-decimal-float can be used to
disable the support (which is enabled by default).  On other systems,
the --enable option must be explicitly used to enable the extension.

This patch is a prerequisite for some patches I will soon be posting
to add target support for powerpc*-*-linux* and ?86*-*-linux*.
Although this patch will make the functionality incomplete if a user
were to try and use it, it will only be this way for a short while.  I
thought it was sensible to post this patch before posting the backend
patches which depend on it.

Tested with a bootstrap on i686-linux and powerpc-linux using all
combinations of --{enable,disable}-decimal-float, and with an
unsupported target (leading to the configure error shown below).
Documentation changes were tested with a `make info dvi'.

I've omitted the diffs for generated files, although I've inspected
them to make sure they were generated with the right version of
autoconf.

Okay for the trunk?

2005-12-19  Janis Johnson  <janis187@us.ibm.com>
            Ben Elliston  <bje@au.ibm.com>

        * configure.ac: Enable C extension for decimal float if invoked
        with --enable-decimal-float.
        * doc/install.texi (Configuration): Document it.
        * configure, config.in: Regenerate.

Index: configure.ac
===================================================================
--- configure.ac        (revision 108783)
+++ configure.ac        (working copy)
@@ -639,6 +639,38 @@ AC_ARG_ENABLE(__cxa_atexit,
 [  --enable-__cxa_atexit   enable __cxa_atexit for C++],
 [], [])
 
+# Enable C extension for decimal float if target supports it.
+AC_ARG_ENABLE(decimal-float,
+[  --enable-decimal-float  enable decimal float extension to C],
+[
+  if test x$enablevar = xyes ; then
+    case $target in
+    powerpc*-*-linux* | ?86*-*-linux*)
+      ;;
+    *)
+      AC_MSG_WARN(decimal float is not supported for this target, ignored)
+      enable_decimal_float=no
+      ;;
+    esac
+  fi
+],
+[
+  case $target in
+  powerpc*-*-linux*)
+    enable_decimal_float=yes
+    ;;
+  *)
+    enable_decimal_float=no
+    ;;
+  esac
+])
+
+AC_SUBST(enable_decimal_float)
+
+dfp=`if test $enable_decimal_float = yes; then echo 1; else echo 0; fi`
+AC_DEFINE_UNQUOTED(ENABLE_DECIMAL_FLOAT, $dfp,
+[Define to 1 to enable decimal float extension to C.])
+
 # Enable threads
 # Pass with no value to take the default
 # Pass with a value to specify a thread package

Index: install.texi
===================================================================
--- install.texi        (revision 108783)
+++ install.texi        (working copy)
@@ -1212,6 +1212,14 @@ error message.
 All support for systems which have been obsoleted in one release of GCC
 is removed entirely in the next major release, unless someone steps
 forward to maintain the port.
+
+@item --enable-decimal-float
+@itemx --disable-decimal-float
+Enable (or disable) support for the C decimal floating point
+extension.  This is enabled by default only on PowerPC GNU/Linux
+systems.  Other systems may also support it, but require the user to
+specifically enable it.
+
 @end table
 
 @subheading Cross-Compiler-Specific Options



More information about the Gcc-patches mailing list