summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2012-12-02 03:01:17 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2012-12-02 03:01:20 +0100
commite5649d4b3d0271c6fc248ac12ff73b6b253a91b7 (patch)
tree946100e19757f14f99df8a1301dcfc53331796be /tools
parent22965da799e843525a1146ca37306dc4c740ffc1 (diff)
downloadnodejs-e5649d4b3d0271c6fc248ac12ff73b6b253a91b7.tar.gz
nodejs-e5649d4b3d0271c6fc248ac12ff73b6b253a91b7.tar.bz2
nodejs-e5649d4b3d0271c6fc248ac12ff73b6b253a91b7.zip
tools: fix platform detection on freebsd, sunos
This is a back-port of upstream gyp commit r1482.
Diffstat (limited to 'tools')
-rw-r--r--tools/gyp/pylib/gyp/common.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/tools/gyp/pylib/gyp/common.py b/tools/gyp/pylib/gyp/common.py
index 6144d2fe7..6962684e1 100644
--- a/tools/gyp/pylib/gyp/common.py
+++ b/tools/gyp/pylib/gyp/common.py
@@ -361,13 +361,18 @@ def GetFlavor(params):
'cygwin': 'win',
'win32': 'win',
'darwin': 'mac',
- 'sunos5': 'solaris',
- 'freebsd7': 'freebsd',
- 'freebsd8': 'freebsd',
- 'freebsd9': 'freebsd',
}
- flavor = flavors.get(sys.platform, 'linux')
- return params.get('flavor', flavor)
+
+ if 'flavor' in params:
+ return params['flavor']
+ if sys.platform in flavors:
+ return flavors[sys.platform]
+ if sys.platform.startswith('sunos'):
+ return 'solaris'
+ if sys.platform.startswith('freebsd'):
+ return 'freebsd'
+
+ return 'linux'
def CopyTool(flavor, out_path):