mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-08-29 12:43:56 +00:00
support gcc < 4
This commit is contained in:
+27
-13
@@ -63,16 +63,37 @@ GCC = os.environ.get('CC', sysconfig.get_config_var('CC'))
|
||||
if not GCC:
|
||||
GCC = 'gcc'
|
||||
|
||||
|
||||
def spcall(cmd):
|
||||
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
|
||||
|
||||
if p.wait() == 0:
|
||||
return p.stdout.read().rstrip().decode()
|
||||
else:
|
||||
return None
|
||||
|
||||
def spcall2(cmd):
|
||||
p = subprocess.Popen(cmd, shell=True, stderr=subprocess.PIPE)
|
||||
|
||||
if p.wait() == 0:
|
||||
return p.stderr.read().rstrip().decode()
|
||||
else:
|
||||
return None
|
||||
|
||||
gcc_version = str(spcall2("%s -v" % GCC)).split('\n')[-1].split()[2]
|
||||
|
||||
gcc_major = int(gcc_version.split('.')[0])
|
||||
|
||||
|
||||
gcc_list = ['utils', 'pyutils', 'protocol', 'socket', 'logging', 'wsgi_handlers', 'wsgi_headers', 'uwsgi_handlers', 'plugins', 'uwsgi']
|
||||
|
||||
# large file support
|
||||
try:
|
||||
cflags = ['-O2', '-fno-strict-aliasing', '-Wall', '-Werror', '-Wextra', '-Wno-unused-parameter', '-Wno-missing-field-initializers', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64'] + os.environ.get("CFLAGS", "").split()
|
||||
except:
|
||||
print("You need python headers to build uWSGI.")
|
||||
sys.exit(1)
|
||||
cflags = ['-O2', '-fno-strict-aliasing', '-Wall', '-Werror', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64'] + os.environ.get("CFLAGS", "").split()
|
||||
|
||||
if gcc_major >= 4:
|
||||
cflags = cflags + [ '-Wextra', '-Wno-unused-parameter', '-Wno-missing-field-initializers' ]
|
||||
|
||||
cflags = cflags + ['-I' + sysconfig.get_python_inc(), '-I' + sysconfig.get_python_inc(plat_specific=True) ]
|
||||
|
||||
ldflags = os.environ.get("LDFLAGS", "").split()
|
||||
libs = ['-lpthread', '-rdynamic'] + sysconfig.get_config_var('LIBS').split() + sysconfig.get_config_var('SYSLIBS').split()
|
||||
if not sysconfig.get_config_var('Py_ENABLE_SHARED'):
|
||||
@@ -90,13 +111,6 @@ def depends_on(what, dep):
|
||||
print("%s needs %s support." % (what, d))
|
||||
sys.exit(1)
|
||||
|
||||
def spcall(cmd):
|
||||
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
|
||||
|
||||
if p.wait() == 0:
|
||||
return p.stdout.read().rstrip().decode()
|
||||
else:
|
||||
return None
|
||||
|
||||
def add_o(x):
|
||||
if x == 'uwsgi':
|
||||
|
||||
Reference in New Issue
Block a user