diff --git a/plugins/erlang/uwsgiplugin.py b/plugins/erlang/uwsgiplugin.py index 2797e4a6..7b6a0d12 100644 --- a/plugins/erlang/uwsgiplugin.py +++ b/plugins/erlang/uwsgiplugin.py @@ -1,7 +1,15 @@ +import os NAME='erlang' -CFLAGS = [] -LDFLAGS = [] + +ERLANGPATH = os.environ.get('UWSGICONFIG_ERLANGPATH', 'erl') + +includedir = os.popen(ERLANGPATH + " -noshell -noinput -eval \"io:format('~s~n', [code:lib_dir(erl_interface, include)])\" -s erlang halt").read().rstrip() +libpath = os.popen(ERLANGPATH + " -noshell -noinput -eval \"io:format('~s~n', [code:lib_dir(erl_interface, lib)])\" -s erlang halt").read().rstrip() + +CFLAGS = [ '-I' + includedir ] +LDFLAGS = [ '-L' + libpath ] + LIBS = ['-lei'] GCC_LIST = ['erlang']