Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShigeki Ohtsu <ohtsu@iij.ad.jp>2012-02-27 15:32:13 +0400
committerisaacs <i@izs.me>2012-02-28 00:02:25 +0400
commit82ad1f87fa99b420a97cc9bfae727fce0b1bf8a4 (patch)
tree0f33f632e37e0af87c8732b614ba93c0cdb39b9d /configure
parent0e7dad3f6ee283904a34b08bfb5db38db8a89169 (diff)
Fix #2830 for the old gcc bug on SmartOS
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure15
1 files changed, 13 insertions, 2 deletions
diff --git a/configure b/configure
index 537757ea665..71409467d94 100755
--- a/configure
+++ b/configure
@@ -1,10 +1,10 @@
#!/usr/bin/env python
-
import optparse
import os
import pprint
import subprocess
import sys
+from distutils.version import StrictVersion
root_dir = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(root_dir, 'deps', 'v8', 'tools'))
@@ -200,6 +200,17 @@ def host_arch():
def target_arch():
return host_arch()
+def gcc_optimize_level():
+ cc = ['gcc']
+ cmd = cc + [ '-dumpversion' ]
+ p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ p.stdin.write('\n')
+ out = p.communicate()[0]
+ gcc_version = (str(out).split('\n'))[0]
+ if StrictVersion(gcc_version) >= '4.6.1':
+ return '-O3'
+ else:
+ return '-O'
def configure_node(o):
# TODO add gdb
@@ -214,7 +225,7 @@ def configure_node(o):
# TODO move to node.gyp
if sys.platform == 'sunos5':
o['variables']['visibility'] = '' # FIXME -fvisibility=hidden, should be a gcc check
-
+ o['variables']['gcc_optimize_level'] = gcc_optimize_level() # For bug fix of #2830
def configure_libz(o):
o['variables']['node_shared_zlib'] = b(options.shared_zlib)