Skip to content

Commit

Permalink
Merge pull request #8 from chick/xcode5_problem
Browse files Browse the repository at this point in the history
Fixed problem with toolchain.py
  • Loading branch information
inducer committed Dec 6, 2013
2 parents 57cb56e + c63cda6 commit dc7c071
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -11,3 +11,4 @@ setuptools*tar.gz
setuptools.pth
distribute*egg
distribute*tar.gz
.idea
13 changes: 13 additions & 0 deletions codepy/toolchain.py
Expand Up @@ -428,6 +428,19 @@ def guess_toolchain():
if sys.maxint == 0x7fffffff:
kwargs["cflags"].extend(['-arch', 'i386'])

return GCCToolchain(**kwargs)
elif "Apple LLVM" in version and "clang" in version:
if "-Wstrict-prototypes" in kwargs["cflags"]:
kwargs["cflags"].remove("-Wstrict-prototypes")
if "darwin" in version:
# Are we running in 32-bit mode?
# The python interpreter may have been compiled as a Fat binary
# So we need to check explicitly how we're running
# And update the cflags accordingly
import sys
if sys.maxint == 0x7fffffff:
kwargs["cflags"].extend(['-arch', 'i386'])

return GCCToolchain(**kwargs)
else:
raise ToolchainGuessError("unknown compiler")
Expand Down

0 comments on commit dc7c071

Please sign in to comment.