--- a/plugins/rack/uwsgiplugin.py +++ b/plugins/rack/uwsgiplugin.py @@ -10,13 +10,14 @@ rbconfig = 'Config' version = os.popen(RUBYPATH + " -e \"print RUBY_VERSION\"").read().rstrip() -v = version.split('.') GCC_LIST = ['rack_plugin', 'rack_api'] -if v[0] == '1' and v[1] == '9': +if version >= '1.9': CFLAGS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print RbConfig::CONFIG['CFLAGS']\"").read().rstrip().split() CFLAGS.append('-DRUBY19') + if version >= '2.0': + CFLAGS.append('-DRUBY20') CFLAGS.append('-Wno-unused-parameter') rbconfig = 'RbConfig' else: --- a/plugins/ruby19/uwsgiplugin.py +++ b/plugins/ruby19/uwsgiplugin.py @@ -10,13 +10,14 @@ rbconfig = 'Config' version = os.popen(RUBYPATH + " -e \"print RUBY_VERSION\"").read().rstrip() -v = version.split('.') GCC_LIST = ['../rack/rack_plugin', '../rack/rack_api'] -if v[0] == '1' and v[1] == '9': +if version >= '1.9': CFLAGS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print RbConfig::CONFIG['CFLAGS']\"").read().rstrip().split() CFLAGS.append('-DRUBY19') + if version >= '2.0': + CFLAGS.append('-DRUBY20') CFLAGS.append('-Wno-unused-parameter') rbconfig = 'RbConfig' else: --- a/plugins/rack/rack_plugin.c +++ b/plugins/rack/rack_plugin.c @@ -163,7 +163,9 @@ } #ifdef RUBY19 +#ifndef RUBY20 RUBY_GLOBAL_SETUP +#endif #endif VALUE uwsgi_require_file(VALUE arg) {