diff -ur hivex-1.3.3.old/configure.ac hivex-1.3.3/configure.ac --- hivex-1.3.3.old/configure.ac 2011-11-29 11:05:56.000000000 +0000 +++ hivex-1.3.3/configure.ac 2012-02-07 13:48:53.513912218 +0000 @@ -312,8 +312,19 @@ [test "x$PYTHON" != "xno" && test "x$PYTHON_INCLUDEDIR" != "x" && test "x$PYTHON_INSTALLDIR" != "x"]) dnl Check for Ruby and rake (optional, for Ruby bindings). -AC_CHECK_LIB([ruby],[ruby_init],[HAVE_LIBRUBY=1],[HAVE_LIBRUBY=0]) -AC_CHECK_PROG([RAKE],[rake],[rake],[no]) +AC_ARG_ENABLE([ruby], + AS_HELP_STRING([--disable-ruby], [Disable Ruby language bindings]), + [], + [enable_ruby=yes]) +AS_IF([test "x$enable_ruby" != "xno"], + [ + AC_CHECK_PROG([RUBY],[ruby],[ruby],[no]) + AC_CHECK_PROG([RAKE],[rake],[rake],[no]) + AC_CHECK_LIB([ruby],[ruby_init],[HAVE_LIBRUBY=1],[HAVE_LIBRUBY=0]) + AC_SUBST(RAKE) + ]) +AM_CONDITIONAL([HAVE_RUBY], + [test "x$RAKE" != "xno" && test -n "$HAVE_LIBRUBY"]) AM_CONDITIONAL([HAVE_RUBY], [test "x$RAKE" != "xno" && test -n "$HAVE_LIBRUBY"]) diff -ur hivex-1.3.3.old/generator/generator.ml hivex-1.3.3/generator/generator.ml --- hivex-1.3.3.old/generator/generator.ml 2011-11-19 16:44:04.000000000 +0000 +++ hivex-1.3.3/generator/generator.ml 2012-02-07 13:48:53.518912298 +0000 @@ -3265,6 +3265,14 @@ #define RARRAY_LEN(r) (RARRAY((r))->len) #endif +#ifndef RSTRING_LEN +#define RSTRING_LEN(r) (RSTRING((r))->len) +#endif + +#ifndef RSTRING_PTR +#define RSTRING_PTR(r) (RSTRING((r))->ptr) +#endif + static VALUE m_hivex; /* hivex module */ static VALUE c_hivex; /* hive_h handle */ static VALUE e_Error; /* used for all errors */ @@ -3287,8 +3295,8 @@ val->key = StringValueCStr (key); val->t = NUM2ULL (type); - val->len = RSTRING (value)->len; - val->value = RSTRING (value)->ptr; + val->len = RSTRING_LEN (value); + val->value = RSTRING_PTR (value); } static hive_set_value * diff -ur hivex-1.3.3.old/ruby/Makefile.am hivex-1.3.3/ruby/Makefile.am --- hivex-1.3.3.old/ruby/Makefile.am 2011-08-15 10:34:07.000000000 +0100 +++ hivex-1.3.3/ruby/Makefile.am 2012-02-07 13:48:53.529912474 +0000 @@ -40,14 +40,15 @@ TESTS = run-ruby-tests TESTS_ENVIRONMENT = \ - LD_LIBRARY_PATH=$(top_builddir)/src/.libs + LD_LIBRARY_PATH=$(top_builddir)/src/.libs \ + RUBY=$(RUBY) RAKE=$(RAKE) all: - rake build - rake rdoc + $(RAKE) build + $(RAKE) rdoc -RUBY_SITELIB := $(shell ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']") -RUBY_SITEARCH := $(shell ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']") +RUBY_SITELIB := $(shell $(RUBY) -rrbconfig -e "puts Config::CONFIG['sitelibdir']") +RUBY_SITEARCH := $(shell $(RUBY) -rrbconfig -e "puts Config::CONFIG['sitearchdir']") install: $(MKDIR_P) $(DESTDIR)$(RUBY_SITELIB) diff -ur hivex-1.3.3.old/ruby/Rakefile.in hivex-1.3.3/ruby/Rakefile.in --- hivex-1.3.3.old/ruby/Rakefile.in 2011-11-29 10:56:28.000000000 +0000 +++ hivex-1.3.3/ruby/Rakefile.in 2012-02-07 13:49:40.887674923 +0000 @@ -38,7 +38,7 @@ # Build locally file MAKEFILE => EXT_CONF do |t| - unless sh "top_srcdir=$(pwd)/@top_srcdir@; top_builddir=$(pwd)/@top_builddir@; export ARCHFLAGS=\"-arch $(uname -m)\"; cd #{File::dirname(EXT_CONF)}; ruby #{File::basename(EXT_CONF)} --with-_hivex-include=$top_srcdir/lib --with-_hivex-lib=$top_builddir/lib/.libs" + unless sh "top_srcdir=$(pwd)/@top_srcdir@; top_builddir=$(pwd)/@top_builddir@; export ARCHFLAGS=\"-arch $(uname -m)\"; cd #{File::dirname(EXT_CONF)}; @RUBY@ #{File::basename(EXT_CONF)} --with-_hivex-include=$top_srcdir/lib --with-_hivex-lib=$top_builddir/lib/.libs" $stderr.puts "Failed to run extconf" break end diff -ur hivex-1.3.3.old/ruby/run-ruby-tests hivex-1.3.3/ruby/run-ruby-tests --- hivex-1.3.3.old/ruby/run-ruby-tests 2011-08-15 11:07:46.000000000 +0100 +++ hivex-1.3.3/ruby/run-ruby-tests 2012-02-07 13:48:53.532912524 +0000 @@ -24,6 +24,6 @@ # is bound to fail because they all use a single test image file). for f in tests/tc_*.rb; do - echo rake test "$@" TEST="$f" - rake test "$@" TEST="$f" + echo $RAKE test "$@" TEST="$f" + $RAKE test "$@" TEST="$f" done