]>
Commit | Line | Data |
---|---|---|
da6d834b CL |
1 | # Copyright (C) 2010-2022 Free Software Foundation, Inc. |
2 | ||
3 | # This file is part of GCC. | |
4 | ||
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 | |
8 | # later version. | |
9 | ||
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. | |
14 | ||
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/>. | |
18 | ||
3c39bca6 AK |
19 | dnl @synopsis GCC_AC_ENABLE_DECIMAL_FLOAT([target triplet]) |
20 | dnl | |
21 | dnl Enable C extension for decimal float if target supports it. | |
22 | dnl | |
23 | dnl @author Andreas Krebbel <Andreas.Krebbel@de.ibm.com> | |
24 | ||
25 | AC_DEFUN([GCC_AC_ENABLE_DECIMAL_FLOAT], | |
26 | [ | |
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 | |
31 | to use], | |
32 | [ | |
33 | case $enable_decimal_float in | |
cc0ae0ca | 34 | yes | no | bid | dpd) default_decimal_float=$enable_decimal_float ;; |
3c39bca6 AK |
35 | *) AC_MSG_ERROR(['$enable_decimal_float' is an invalid value for --enable-decimal-float. |
36 | Valid choices are 'yes', 'bid', 'dpd', and 'no'.]) ;; | |
37 | esac | |
38 | ], | |
39 | [ | |
40 | case $1 in | |
afd82c10 | 41 | aarch64* | \ |
996b42ef | 42 | powerpc*-*-linux* | i?86*-*-linux* | x86_64*-*-linux* | s390*-*-linux* | \ |
1c1d2d8c | 43 | i?86*-*-elfiamcu | i?86*-*-gnu* | x86_64*-*-gnu* | \ |
996b42ef | 44 | i?86*-*-mingw* | x86_64*-*-mingw* | \ |
8fecb561 | 45 | i?86*-*-cygwin* | x86_64*-*-cygwin*) |
3c39bca6 AK |
46 | enable_decimal_float=yes |
47 | ;; | |
48 | *) | |
84f47d20 | 49 | AC_MSG_WARN([decimal float is not supported for this target, ignored]) |
3c39bca6 AK |
50 | enable_decimal_float=no |
51 | ;; | |
52 | esac | |
53 | ]) | |
54 | ||
55 | # x86's use BID format instead of DPD | |
56 | case x$enable_decimal_float in | |
57 | xyes) | |
58 | case $1 in | |
afd82c10 | 59 | aarch64* | i?86*-*-* | x86_64*-*-*) |
3c39bca6 AK |
60 | enable_decimal_float=bid |
61 | ;; | |
62 | *) | |
63 | enable_decimal_float=dpd | |
64 | ;; | |
65 | esac | |
cc0ae0ca | 66 | default_decimal_float=$enable_decimal_float |
3c39bca6 AK |
67 | ;; |
68 | xno) | |
69 | # ENABLE_DECIMAL_FLOAT is set to 0. But we have to have proper | |
70 | # dependency on libdecnumber. | |
cc0ae0ca | 71 | default_decimal_float=dpd |
3c39bca6 AK |
72 | ;; |
73 | esac | |
74 | AC_SUBST(enable_decimal_float) | |
75 | ||
cc0ae0ca | 76 | ]) |