aboutsummaryrefslogtreecommitdiff
path: root/math/gsl
diff options
context:
space:
mode:
authorBrendan Fabeny <bf@FreeBSD.org>2014-03-03 12:06:38 +0000
committerBrendan Fabeny <bf@FreeBSD.org>2014-03-03 12:06:38 +0000
commit6eb2d4a67aa71638103002f7003f0bc95314f251 (patch)
tree6322e7e1b07e4fe4f055976e4bf4b4f36dfd93c8 /math/gsl
parent471edab51ff6c86bd295ed60c4d7da4c33496111 (diff)
downloadports-6eb2d4a67aa71638103002f7003f0bc95314f251.tar.gz
ports-6eb2d4a67aa71638103002f7003f0bc95314f251.zip
Attempt to fix the build on powerpc* by the same means used on Darwin and GNU/Linux
PR: 179857 Submitted by: jhibbits, nwhitehorn
Notes
Notes: svn path=/head/; revision=346884
Diffstat (limited to 'math/gsl')
-rw-r--r--math/gsl/Makefile8
-rw-r--r--math/gsl/files/patch-ieee-utils-fp-freebsd.c66
2 files changed, 67 insertions, 7 deletions
diff --git a/math/gsl/Makefile b/math/gsl/Makefile
index 0ca3f2fd9076..b7402e829c56 100644
--- a/math/gsl/Makefile
+++ b/math/gsl/Makefile
@@ -30,10 +30,4 @@ check regression-test test: build
@cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${CORELIMIT} ${MAKE_CMD} \
${MAKE_ARGS} check
-.include <bsd.port.pre.mk>
-
-.if ${ARCH} == "powerpc"
-BROKEN= Does not compile on powerpc
-.endif
-
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/math/gsl/files/patch-ieee-utils-fp-freebsd.c b/math/gsl/files/patch-ieee-utils-fp-freebsd.c
new file mode 100644
index 000000000000..671e26364286
--- /dev/null
+++ b/math/gsl/files/patch-ieee-utils-fp-freebsd.c
@@ -0,0 +1,66 @@
+--- 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 ;