mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-10-03 23:48:22 +00:00
backported python plugin new build system (heroku friendly)
This commit is contained in:
@@ -2,9 +2,16 @@ import os,sys
|
||||
|
||||
from distutils import sysconfig
|
||||
|
||||
def get_python_version():
|
||||
version = sysconfig.get_config_var('VERSION')
|
||||
try:
|
||||
version = version + sys.abiflags
|
||||
except:
|
||||
pass
|
||||
return version
|
||||
|
||||
NAME='python'
|
||||
GCC_LIST = ['python_plugin', 'pyutils', 'pyloader', 'wsgi_handlers', 'wsgi_headers', 'wsgi_subhandler', 'web3_subhandler', 'pump_subhandler', 'gil', 'uwsgi_pymodule', 'profiler', 'symimporter', 'tracebacker']
|
||||
#OBJ_LIST = ['/usr/lib/libpython2.6.a']
|
||||
|
||||
CFLAGS = ['-I' + sysconfig.get_python_inc(), '-I' + sysconfig.get_python_inc(plat_specific=True) ]
|
||||
|
||||
@@ -15,8 +22,18 @@ LDFLAGS = []
|
||||
|
||||
if not 'UWSGI_PYTHON_NOLIB' in os.environ:
|
||||
LIBS = sysconfig.get_config_var('LIBS').split() + sysconfig.get_config_var('SYSLIBS').split()
|
||||
# check if it is a non-shared build (but please, add --enable-shared to your python's ./configure script)
|
||||
if not sysconfig.get_config_var('Py_ENABLE_SHARED'):
|
||||
LIBS.append('-L' + sysconfig.get_config_var('LIBPL'))
|
||||
libdir = sysconfig.get_config_var('LIBPL')
|
||||
# libdir does not exists, try to get it from the venv
|
||||
if not os.path.exists(libdir):
|
||||
libdir = '%s/lib/python%s/config' % (sys.prefix, get_python_version())
|
||||
libpath = '%s/%s' % (libdir, sysconfig.get_config_var('LDLIBRARY'))
|
||||
if not os.path.exists(libpath):
|
||||
libpath = '%s/%s' % (libdir, sysconfig.get_config_var('LIBRARY'))
|
||||
if not os.path.exists(libpath):
|
||||
libpath = '%s/libpython%s.a' % (libdir, get_python_version())
|
||||
LIBS.append(libpath)
|
||||
else:
|
||||
try:
|
||||
LDFLAGS.append("-L%s" % sysconfig.get_config_var('LIBDIR'))
|
||||
@@ -25,16 +42,6 @@ if not 'UWSGI_PYTHON_NOLIB' in os.environ:
|
||||
LDFLAGS.append("-L%s/lib" % sysconfig.PREFIX)
|
||||
os.environ['LD_RUN_PATH'] = "%s/lib" % sysconfig.PREFIX
|
||||
|
||||
|
||||
version = sysconfig.get_config_var('VERSION')
|
||||
try:
|
||||
version = version + sys.abiflags
|
||||
except:
|
||||
pass
|
||||
LIBS.append('-lpython' + version)
|
||||
LIBS.append('-lpython%s' % get_python_version())
|
||||
else:
|
||||
LIBS = []
|
||||
|
||||
#if str(PYLIB_PATH) != '':
|
||||
# libs.insert(0,'-L' + PYLIB_PATH)
|
||||
# os.environ['LD_RUN_PATH'] = PYLIB_PATH
|
||||
|
||||
Reference in New Issue
Block a user