dfp.m4 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. dnl @synopsis GCC_AC_ENABLE_DECIMAL_FLOAT([target triplet])
  2. dnl
  3. dnl Enable C extension for decimal float if target supports it.
  4. dnl
  5. dnl @author Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
  6. AC_DEFUN([GCC_AC_ENABLE_DECIMAL_FLOAT],
  7. [
  8. AC_ARG_ENABLE(decimal-float,
  9. [ --enable-decimal-float={no,yes,bid,dpd}
  10. enable decimal float extension to C. Selecting 'bid'
  11. or 'dpd' choses which decimal floating point format
  12. to use],
  13. [
  14. case $enable_decimal_float in
  15. yes | no | bid | dpd) default_decimal_float=$enable_decimal_float ;;
  16. *) AC_MSG_ERROR(['$enable_decimal_float' is an invalid value for --enable-decimal-float.
  17. Valid choices are 'yes', 'bid', 'dpd', and 'no'.]) ;;
  18. esac
  19. ],
  20. [
  21. case $1 in
  22. powerpc*-*-linux* | i?86*-*-linux* | x86_64*-*-linux* | s390*-*-linux* | \
  23. i?86*-*-gnu* | \
  24. i?86*-*-mingw* | x86_64*-*-mingw* | \
  25. i?86*-*-cygwin* | x86_64*-*-cygwin*)
  26. enable_decimal_float=yes
  27. ;;
  28. *)
  29. AC_MSG_WARN([decimal float is not supported for this target, ignored])
  30. enable_decimal_float=no
  31. ;;
  32. esac
  33. ])
  34. # x86's use BID format instead of DPD
  35. case x$enable_decimal_float in
  36. xyes)
  37. case $1 in
  38. i?86*-*-* | x86_64*-*-*)
  39. enable_decimal_float=bid
  40. ;;
  41. *)
  42. enable_decimal_float=dpd
  43. ;;
  44. esac
  45. default_decimal_float=$enable_decimal_float
  46. ;;
  47. xno)
  48. # ENABLE_DECIMAL_FLOAT is set to 0. But we have to have proper
  49. # dependency on libdecnumber.
  50. default_decimal_float=dpd
  51. ;;
  52. esac
  53. AC_SUBST(enable_decimal_float)
  54. ])