diff options
author | sbruno <sbruno@FreeBSD.org> | 2014-09-17 03:04:09 +0800 |
---|---|---|
committer | sbruno <sbruno@FreeBSD.org> | 2014-09-17 03:04:09 +0800 |
commit | f045e78f46acbb34ce2b6cec3c6098a0d98ef74a (patch) | |
tree | 61ba4302a38e1ccfd62546808cad615bf82ee156 /math | |
parent | d9b249ca71f980b69e3547651feea1fc798b4618 (diff) | |
download | freebsd-ports-gnome-f045e78f46acbb34ce2b6cec3c6098a0d98ef74a.tar.gz freebsd-ports-gnome-f045e78f46acbb34ce2b6cec3c6098a0d98ef74a.tar.zst freebsd-ports-gnome-f045e78f46acbb34ce2b6cec3c6098a0d98ef74a.zip |
Fix all non-x86 builds of math/gsl with a more general approach than the
specifically powerpc patch file.
Drop patch-ieee-utils-fp-freebsd.c alltogether and change the order
of #ifdefs in the setup to pull in fp-gnuc99.c instead of fp-freebsd.cc
Verified on redports for x86 builds and am bumping port revision.
Suggested by: nathanw
Phabric: https://reviews.freebsd.org/D787
Reviewed by: nathanw
Approved by: bdrewery (mentor)
Diffstat (limited to 'math')
-rw-r--r-- | math/gsl/Makefile | 2 | ||||
-rw-r--r-- | math/gsl/files/patch-ieee-utils-fp-freebsd.c | 66 | ||||
-rw-r--r-- | math/gsl/files/patch-ieee-utils__fp.c | 20 |
3 files changed, 21 insertions, 67 deletions
diff --git a/math/gsl/Makefile b/math/gsl/Makefile index 023e5322a94a..f222be242547 100644 --- a/math/gsl/Makefile +++ b/math/gsl/Makefile @@ -3,7 +3,7 @@ PORTNAME= gsl PORTVERSION= 1.16 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= math MASTER_SITES= GNU diff --git a/math/gsl/files/patch-ieee-utils-fp-freebsd.c b/math/gsl/files/patch-ieee-utils-fp-freebsd.c deleted file mode 100644 index 671e26364286..000000000000 --- a/math/gsl/files/patch-ieee-utils-fp-freebsd.c +++ /dev/null @@ -1,66 +0,0 @@ ---- ieee-utils/fp-freebsd.c.orig 2014-02-03 11:46:44.000000000 -0600 -+++ ieee-utils/fp-freebsd.c 2014-02-03 11:46:18.000000000 -0600 -@@ -24,10 +24,28 @@ - int - gsl_ieee_set_mode (int precision, int rounding, int exception_mask) - { -- fp_prec_t prec = 0 ; - fp_except_t mode = 0 ; - fp_rnd_t rnd = 0 ; - -+#ifdef __powerpc__ -+ switch (precision) -+ { -+ case GSL_IEEE_SINGLE_PRECISION: -+ GSL_ERROR ("powerpc only supports default precision rounding", GSL_EUNSUP) -+; -+ break ; -+ case GSL_IEEE_DOUBLE_PRECISION: -+ GSL_ERROR ("powerpc only supports default precision rounding", GSL_EUNSUP) -+; -+ break ; -+ case GSL_IEEE_EXTENDED_PRECISION: -+ GSL_ERROR ("powerpc only supports default precision rounding", GSL_EUNSUP) -+; -+ break ; -+ } -+#else -+ fp_prec_t prec = 0 ; -+ - switch (precision) - { - case GSL_IEEE_SINGLE_PRECISION: -@@ -43,6 +61,7 @@ - fpsetprec(prec); - break ; - } -+#endif - - switch (rounding) - { -@@ -69,13 +88,23 @@ - - /* Turn on all the exceptions apart from 'inexact' */ - -- mode = FP_X_INV | FP_X_DNML | FP_X_DZ | FP_X_OFL | FP_X_UFL ; -+ mode = FP_X_INV | FP_X_DZ | FP_X_OFL | FP_X_UFL ; - - if (exception_mask & GSL_IEEE_MASK_INVALID) - mode &= ~ FP_X_INV ; - - if (exception_mask & GSL_IEEE_MASK_DENORMALIZED) -- mode &= ~ FP_X_DNML ; -+ { -+ /* do nothing */ -+ } -+ else -+ { -+#ifdef __powerpc__ -+ GSL_ERROR ("powerpc does not support the denormalized operand exception. " "Use 'mask-denormalized' to work around this.", GSL_EUNSUP) ; -+#else -+ mode |= FP_X_DNML; -+#endif -+ } - - if (exception_mask & GSL_IEEE_MASK_DIVISION_BY_ZERO) - mode &= ~ FP_X_DZ ; diff --git a/math/gsl/files/patch-ieee-utils__fp.c b/math/gsl/files/patch-ieee-utils__fp.c new file mode 100644 index 000000000000..692a0112c195 --- /dev/null +++ b/math/gsl/files/patch-ieee-utils__fp.c @@ -0,0 +1,20 @@ +--- ieee-utils/fp.c.orig 2014-09-16 17:19:39 UTC ++++ ieee-utils/fp.c +@@ -22,6 +22,8 @@ + #include "fp-aix.c" + #elif HAVE_TRU64_IEEE_INTERFACE + #include "fp-tru64.c" ++#elif HAVE_DECL_FEENABLEEXCEPT || HAVE_DECL_FESETTRAPENABLE ++#include "fp-gnuc99.c" + #elif HAVE_FREEBSD_IEEE_INTERFACE + #include "fp-freebsd.c" + #elif HAVE_OS2EMX_IEEE_INTERFACE +@@ -43,8 +45,6 @@ + # else + # include "fp-darwin86.c" + #endif +-#elif HAVE_DECL_FEENABLEEXCEPT || HAVE_DECL_FESETTRAPENABLE +-#include "fp-gnuc99.c" + #else + #include "fp-unknown.c" + #endif |