aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClay McClure2012-02-25 22:48:59 -0500
committerAdam Vandenberg2012-02-25 22:08:02 -0800
commit5a9db90adb7088bbe489c98e535c791180211492 (patch)
treed84d5347c15aac1f93796b263c1ee9929e32b468
parent855be1ec350c466f18e668ac76546fb55ea95d92 (diff)
downloadhomebrew-5a9db90adb7088bbe489c98e535c791180211492.tar.bz2
Python requires -fwrapv for Decimal division
According to: http://stackoverflow.com/questions/7590137/dividing-decimals-yields-invalid-results-in-python-2-5-to-2-7 the Python interpreter must be built with -fwrapv for proper Decimal division. To test: python -c "from decimal import Decimal; print Decimal(4) / Decimal(2)" If built with -fwrapv, this yields 2. Closes #10487. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
-rw-r--r--Library/Formula/python.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Formula/python.rb b/Library/Formula/python.rb
index e4fa7f00d..748943f2d 100644
--- a/Library/Formula/python.rb
+++ b/Library/Formula/python.rb
@@ -40,6 +40,10 @@ class Python < Formula
skip_clean ['bin', 'lib']
def install
+ # Python requires -fwrapv for proper Decimal division
+ # See: http://stackoverflow.com/questions/7590137/dividing-decimals-yields-invalid-results-in-python-2-5-to-2-7
+ ENV.append_to_cflags "-fwrapv"
+
if build_framework? and ARGV.include? "--static"
onoe "Cannot specify both framework and static."
exit 99