Mercurial > hg > mercurial-crew
comparison setup.py @ 16187:82ce91a9fd94 stable
setup: handle output from Apple's Xcode 4.3 better (issue3277)
Apparently, it prints nothing at all if the user installed only the
command-line tools. In that case, don't try to parse the empty output
-- just assume they have Xcode >= 4.
author | Greg Ward <greg@gerg.ca> |
---|---|
date | Mon, 27 Feb 2012 08:54:26 -0500 |
parents | 9926aab3d0b5 |
children | 5536770b3c88 |
comparison
equal
deleted
inserted
replaced
16179:be6ac2ecc7f8 | 16187:82ce91a9fd94 |
---|---|
450 setupversion = version.split('+', 1)[0] | 450 setupversion = version.split('+', 1)[0] |
451 | 451 |
452 if sys.platform == 'darwin' and os.path.exists('/usr/bin/xcodebuild'): | 452 if sys.platform == 'darwin' and os.path.exists('/usr/bin/xcodebuild'): |
453 # XCode 4.0 dropped support for ppc architecture, which is hardcoded in | 453 # XCode 4.0 dropped support for ppc architecture, which is hardcoded in |
454 # distutils.sysconfig | 454 # distutils.sysconfig |
455 version = runcmd(['/usr/bin/xcodebuild', '-version'], {})[0].splitlines()[0] | 455 version = runcmd(['/usr/bin/xcodebuild', '-version'], {})[0].splitlines() |
456 # Also parse only first digit, because 3.2.1 can't be parsed nicely | 456 if version: |
457 if (version.startswith('Xcode') and | 457 version = version.splitlines()[0] |
458 StrictVersion(version.split()[1]) >= StrictVersion('4.0')): | 458 xcode4 = (version.startswith('Xcode') and |
459 StrictVersion(version.split()[1]) >= StrictVersion('4.0')) | |
460 else: | |
461 # xcodebuild returns empty on OS X Lion with XCode 4.3 not | |
462 # installed, but instead with only command-line tools. Assume | |
463 # that only happens on >= Lion, thus no PPC support. | |
464 xcode4 = True | |
465 | |
466 if xcode4: | |
459 os.environ['ARCHFLAGS'] = '' | 467 os.environ['ARCHFLAGS'] = '' |
460 | 468 |
461 setup(name='mercurial', | 469 setup(name='mercurial', |
462 version=setupversion, | 470 version=setupversion, |
463 author='Matt Mackall', | 471 author='Matt Mackall', |