1 # Copyright (C) 2010-2022 Free Software Foundation, Inc.
3 # This file is part of GCC.
5 # GCC is free software; you can redistribute it and/or modify it under
6 # the terms of the GNU General Public License as published by the Free
7 # Software Foundation; either version 3, or (at your option) any
10 # GCC is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
13 # License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with GCC; see the file COPYING3. If not see
17 # <http://www.gnu.org/licenses/>.
19 dnl @synopsis GCC_AC_ENABLE_DECIMAL_FLOAT([target triplet])
21 dnl Enable C extension for decimal float if target supports it.
23 dnl @author Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
25 AC_DEFUN([GCC_AC_ENABLE_DECIMAL_FLOAT],
27 AC_ARG_ENABLE(decimal-float,
28 [ --enable-decimal-float={no,yes,bid,dpd}
29 enable decimal float extension to C. Selecting 'bid'
30 or 'dpd' choses which decimal floating point format
33 case $enable_decimal_float in
34 yes | no | bid | dpd) default_decimal_float=$enable_decimal_float ;;
35 *) AC_MSG_ERROR(['$enable_decimal_float' is an invalid value for --enable-decimal-float.
36 Valid choices are 'yes', 'bid', 'dpd', and 'no'.]) ;;
42 powerpc*-*-linux* | i?86*-*-linux* | x86_64*-*-linux* | s390*-*-linux* | \
43 i?86*-*-elfiamcu | i?86*-*-gnu* | x86_64*-*-gnu* | \
44 i?86*-*-mingw* | x86_64*-*-mingw* | \
45 i?86*-*-cygwin* | x86_64*-*-cygwin*)
46 enable_decimal_float=yes
49 AC_MSG_WARN([decimal float is not supported for this target, ignored])
50 enable_decimal_float=no
55 # x86's use BID format instead of DPD
56 case x$enable_decimal_float in
59 aarch64* | i?86*-*-* | x86_64*-*-*)
60 enable_decimal_float=bid
63 enable_decimal_float=dpd
66 default_decimal_float=$enable_decimal_float
69 # ENABLE_DECIMAL_FLOAT is set to 0. But we have to have proper
70 # dependency on libdecnumber.
71 default_decimal_float=dpd
74 AC_SUBST(enable_decimal_float)