configure: replace buggy AX_RUBY_EXT by a proper implementation

This actually allows to get the proper DLEXT expected by Ruby on
the target system.
This commit is contained in:
Aurelien Jacobs 2016-01-28 22:48:44 +01:00
parent e469259a57
commit e922790220
2 changed files with 11 additions and 6 deletions

View File

@ -660,7 +660,7 @@ RDIR = bindings/ruby
RDOC = $(RDIR)/doc.i RDOC = $(RDIR)/doc.i
RWRAP = $(RDIR)/classes_wrap.cpp RWRAP = $(RDIR)/classes_wrap.cpp
ROBJ = $(RWRAP:.cpp=.o) ROBJ = $(RWRAP:.cpp=.o)
REXT = $(RDIR)/sigrok.so REXT = $(RDIR)/sigrok.$(RUBY_DLEXT)
$(RDOC): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC) $(RDOC): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
$(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py ruby $(CPPXMLDOC) > $@ $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py ruby $(CPPXMLDOC) > $@
@ -683,8 +683,8 @@ $(REXT): $(ROBJ) @ORDER@ bindings/cxx/libsigrokcxx.la
ruby-build: $(REXT) ruby-build: $(REXT)
ruby-install: $(REXT) ruby-install: $(REXT)
$(INSTALL) -d $(prefix)/$(RBSIGROK_EXTDIR) $(INSTALL) -d $(DESTDIR)$(prefix)/$(RBSIGROK_EXTDIR)
$(INSTALL) $< $(prefix)/$(RBSIGROK_EXTDIR) $(INSTALL) $< $(DESTDIR)$(prefix)/$(RBSIGROK_EXTDIR)
ruby-clean: ruby-clean:
-$(AM_V_at)rm -fr $(RDIR)/doc -$(AM_V_at)rm -fr $(RDIR)/doc

View File

@ -403,10 +403,16 @@ AS_IF([test "x$BINDINGS_CXX" = xyes],
[sr_ruby_missing=], [sr_ruby_missing=],
[sr_ruby_missing='C++ bindings']) [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], 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. # Extract major and minor version number of the Ruby interpreter.
sr_rbmajor=${RUBY_VERSION%%.*} sr_rbmajor=${RUBY_VERSION%%.*}
@ -430,7 +436,6 @@ AS_IF([test "x$SWIG" = x],
AS_IF([test -z "$sr_ruby_missing"], AS_IF([test -z "$sr_ruby_missing"],
[BINDINGS_RUBY=$enable_ruby], [BINDINGS_RUBY=no]) [BINDINGS_RUBY=$enable_ruby], [BINDINGS_RUBY=no])
AM_CONDITIONAL([BINDINGS_RUBY], [test "x$BINDINGS_RUBY" = xyes]) AM_CONDITIONAL([BINDINGS_RUBY], [test "x$BINDINGS_RUBY" = xyes])
# AC_SUBST(RUBY_EXT_DLEXT, $RUBY_EXT_DLEXT)
#################### ####################
## Java bindings ## ## Java bindings ##