+#####################
+## Ruby bindings ##
+#####################
+
+AS_IF([test "x$BINDINGS_CXX" = xyes],
+ [sr_ruby_missing=],
+ [sr_ruby_missing='C++ bindings'])
+
+AX_RUBY_EXT
+
+AS_IF([test "x$RUBY" = x],
+ [SR_APPEND([sr_ruby_missing], [', '], ['Ruby'])])
+
+# Extract major and minor version number of the Ruby interpreter.
+sr_rbmajor=${RUBY_VERSION%%.*}
+sr_rbminor=${RUBY_VERSION#*.}
+sr_rbminor=${sr_rbminor%%.*}
+
+# The Ruby bindings need Ruby development files.
+SR_PKG_CHECK([ruby_dev], [SR_PKGLIBS_RUBY],
+ [ruby],
+ [ruby-$sr_rbmajor.$sr_rbminor])
+
+AS_IF([test "x$sr_have_ruby_dev" != xyes],
+ [SR_APPEND([sr_ruby_missing], [', '], [Headers])])
+
+# The Ruby bindings use SWIG to generate code.
+AS_IF([test "x$SWIG" = x],
+ [SR_APPEND([sr_ruby_missing], [', '], [SWIG])])
+
+AS_IF([test -z "$sr_ruby_missing"],
+ [BINDINGS_RUBY=$enable_ruby], [BINDINGS_RUBY=no])
+AM_CONDITIONAL([BINDINGS_RUBY], [test "x$BINDINGS_RUBY" = xyes])
+# AC_SUBST(RUBY_EXT_DLEXT, $RUBY_EXT_DLEXT)
+