Skip to content

Commit

Permalink
Fixed problem with toolchain.py
Browse files Browse the repository at this point in the history
on mac with xcode 5 compiler has dropped looked for string
'Free Software Foundation'
Added elif that looks for strings 'Apple LLVM' and 'clang'
and returns as it did before, seems to work
  • Loading branch information
chick committed Dec 6, 2013
1 parent 57cb56e commit c63cda6
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 c63cda6

Please sign in to comment.