mirror of
https://github.com/weechat/weechat.git
synced 2026-07-04 16:53:14 +02:00
ruby: add detection and fix compilation with Ruby 2.0 (patch #8209)
Now the search for Ruby is first performed with pkg-config and includes detection of Ruby 2.0. If not found, the old code for detection is used (for old distros or old Ruby versions). The specific test on Ruby 1.9.0 (to disable this version) has been removed (1.9.0 was a dev/unstable version from 2007, quite old now).
This commit is contained in:
@@ -23,8 +23,10 @@ weechat-ruby-api.h)
|
||||
SET_TARGET_PROPERTIES(ruby PROPERTIES PREFIX "")
|
||||
|
||||
IF(RUBY_FOUND)
|
||||
INCLUDE_DIRECTORIES(${RUBY_INCLUDE_PATH} ${RUBY_ARCH})
|
||||
TARGET_LINK_LIBRARIES(ruby ${RUBY_LIBRARY} weechat_plugins_scripts)
|
||||
INCLUDE_DIRECTORIES(${RUBY_INCLUDE_DIRS})
|
||||
SET(LINK_LIBS)
|
||||
LIST(APPEND LINK_LIBS ${RUBY_LDFLAGS})
|
||||
TARGET_LINK_LIBRARIES(ruby ${LINK_LIBS} ${RUBY_LIB} weechat_plugins_scripts)
|
||||
ENDIF(RUBY_FOUND)
|
||||
|
||||
INSTALL(TARGETS ruby LIBRARY DESTINATION ${LIBDIR}/plugins)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#undef _
|
||||
|
||||
#include <ruby.h>
|
||||
#if defined(RUBY_VERSION) && RUBY_VERSION >= 19
|
||||
#if (defined(RUBY_API_VERSION_MAJOR) && defined(RUBY_API_VERSION_MINOR)) && (RUBY_API_VERSION_MAJOR >= 2 || (RUBY_API_VERSION_MAJOR == 1 && RUBY_API_VERSION_MINOR >= 9))
|
||||
#include <ruby/encoding.h>
|
||||
#endif
|
||||
#ifdef HAVE_RUBY_VERSION_H
|
||||
@@ -1149,7 +1149,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
|
||||
/* init stdout/stderr buffer */
|
||||
ruby_buffer_output[0] = '\0';
|
||||
|
||||
#if defined(RUBY_VERSION) && RUBY_VERSION >= 19
|
||||
#if (defined(RUBY_API_VERSION_MAJOR) && defined(RUBY_API_VERSION_MINOR)) && (RUBY_API_VERSION_MAJOR >= 2 || (RUBY_API_VERSION_MAJOR == 1 && RUBY_API_VERSION_MINOR >= 9))
|
||||
RUBY_INIT_STACK;
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user