RDOC = $(RDIR)/doc.i
RWRAP = $(RDIR)/classes_wrap.cpp
ROBJ = $(RWRAP:.cpp=.o)
-REXT = $(RDIR)/sigrok.so
+REXT = $(RDIR)/sigrok.$(RUBY_DLEXT)
$(RDOC): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
$(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py ruby $(CPPXMLDOC) > $@
ruby-build: $(REXT)
ruby-install: $(REXT)
- $(INSTALL) -d $(prefix)/$(RBSIGROK_EXTDIR)
- $(INSTALL) $< $(prefix)/$(RBSIGROK_EXTDIR)
+ $(INSTALL) -d $(DESTDIR)$(prefix)/$(RBSIGROK_EXTDIR)
+ $(INSTALL) $< $(DESTDIR)$(prefix)/$(RBSIGROK_EXTDIR)
ruby-clean:
-$(AM_V_at)rm -fr $(RDIR)/doc
[sr_ruby_missing=],
[sr_ruby_missing='C++ bindings'])
-AX_RUBY_EXT
+AC_PATH_PROGS(RUBY, ["${RUBY-ruby}"], [])
+AS_IF([test "x$RUBY" != x],
+ AC_MSG_CHECKING([for Ruby version])
+ [RUBY_VERSION=`$RUBY -e 'puts RUBY_VERSION'`]
+ AC_MSG_RESULT([$RUBY_VERSION])
+ [RUBY_DLEXT=`$RUBY -rrbconfig -e 'puts RbConfig::CONFIG[["DLEXT"]]'`]
+ AC_SUBST(RUBY_DLEXT))
AS_IF([test "x$RUBY" = x],
- [SR_APPEND([sr_ruby_missing], [', '], ['Ruby'])])
+ [SR_APPEND([sr_ruby_missing], [', '], [Ruby])])
# Extract major and minor version number of the Ruby interpreter.
sr_rbmajor=${RUBY_VERSION%%.*}
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)
####################
## Java bindings ##