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', |