mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-06 05:31:44 +00:00
Fix GCC on Darwin for Python 3.
distutils.sysconfig.get_config_var('CC') returns the compiler used to
build Python, which may be not installed on the system where uWSGI is
being built.
In my case, I grabbed Python 3.3.2 from python.org: it was apparently
compiled with 'gcc-4.2', but my system only has 'gcc' (symlink) and
'llvm-gcc-4.2'. This change tries to detect this situation (only on
Darwin) and sets GCC to 'llvm-' + compiler returned by sysconfig.
This commit is contained in:
+6
-5
@@ -476,6 +476,8 @@ def open_profile(filename):
|
||||
class uConf(object):
|
||||
|
||||
def __init__(self, filename, mute=False):
|
||||
global GCC
|
||||
|
||||
self.config = ConfigParser.ConfigParser()
|
||||
if not mute:
|
||||
print("using profile: %s" % filename)
|
||||
@@ -528,11 +530,10 @@ class uConf(object):
|
||||
if uwsgi_os == 'GNU':
|
||||
self.cflags.append('-D__HURD__')
|
||||
|
||||
try:
|
||||
gcc_version = str(spcall("%s -dumpversion" % GCC))
|
||||
except:
|
||||
print("*** you need a c compiler to build uWSGI ***")
|
||||
sys.exit(1)
|
||||
gcc_version = spcall("%s -dumpversion" % GCC)
|
||||
if not gcc_version and GCC.startswith('gcc') and uwsgi_os == 'Darwin':
|
||||
GCC = 'llvm-' + GCC
|
||||
gcc_version = spcall("%s -dumpversion" % GCC)
|
||||
|
||||
try:
|
||||
add_it = False
|
||||
|
||||
Reference in New Issue
Block a user