The attached patch fixes configure.ac to avoid building the Ruby plugins if
Ruby's version number could not be detected. Presently if weechat's configure
script is run on a system with Ruby 2.0.0, configure will detect ruby headers
and enable ruby plugins, but compilation will fail since RUBY_VERSION is
Thanks for the patch.
If I understand your patch (especially the error displayed), it means that
WeeChat would not work at all with Ruby 2.0 ? But it's supposed to work fine:
I tested Ruby 2.0 some months ago, but I compiled with cmake, which is the
recommended way to compile WeeChat (anyway "configure" must be fixed if there
is a problem).
So I'm not sure this is the good fix, maybe configure.ac should be fixed to
work fine with Ruby 2.0, no?
I'm attaching an alternative patch that just changes the #if tests from
RUBY_VERSION to use RUBY_API_VERSION_MAJOR and RUBY_API_VERSION_MINOR. From
some Google results I think these symbols are defined in 1.9, but I've only
tested against Ruby 2.
It would probably be nicer to do this in CMake and define a single variable.
Andrew's patch works for Ruby 2 and 1.9. If his patch is applied, the patch
I'm now attaching could be used to remove the RUBY_VERSION define code from
configure.ac, since it would no longer be needed.