Files
uwsgi/plugins/lua/uwsgiplugin.py
T
Natanael Copa e20e43eee0 add support for pkg-config for lua
Allow select what pkg-config module to use with UWSGICONFIG_LUAPC but
let the old LUAINC/LUALIB and LUALIBPATH override the pkg-config
for backwards compatibility.
2013-06-24 14:35:31 +00:00

34 lines
726 B
Python

import os,sys
LUAINC = os.environ.get('UWSGICONFIG_LUAINC')
LUALIB = os.environ.get('UWSGICONFIG_LUALIB')
LUALIBPATH = os.environ.get('UWSGICONFIG_LUALIBPATH')
LUAPC = os.environ.get('UWSGICONFIG_LUAPC', 'lua5.1')
# we LUAINC/LUALIB/LUALIBPATH override the LUAPC for backwards compat
if LUAINC:
CFLAGS = ['-I%s' % LUAINC]
else:
try:
CFLAGS = os.popen('pkg-config --cflags %s' % LUAPC).read().rstrip().split()
except:
CFLAGS = ['-I/usr/include/lua5.1']
if LUALIB:
LIBS = ['-l%s' % LUALIB]
else:
try:
LIBS = os.popen('pkg-config --libs %s' % LUAPC).read().rstrip().split()
except:
LIBS = ['-llua5.1']
if LUALIBPATH:
LDFLAGS = ['-L%s' % LUALIBPATH]
else:
LDFLAGS = []
NAME='lua'
GCC_LIST = ['lua_plugin']