[enable_ruby=yes])
AS_IF([test "x$enable_ruby" != "xno"],
[
- AC_CHECK_LIB([ruby],[ruby_init],[HAVE_LIBRUBY=1],[HAVE_LIBRUBY=0])
+ 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"])
TESTS_ENVIRONMENT = \
LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
LIBGUESTFS_PATH=$(top_builddir)/appliance \
- TMPDIR=$(top_builddir)
+ TMPDIR=$(top_builddir) \
+ RUBY=$(RUBY)
all: $(generator_built)
- 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)
# 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)\"; mkdir -p @builddir@/ext/guestfs; cd @builddir@/ext/guestfs; ruby #{EXT_CONF} --with-_guestfs-include=$top_srcdir/src --with-_guestfs-lib=$top_builddir/src/.libs"
+ unless sh "top_srcdir=$(pwd)/@top_srcdir@; top_builddir=$(pwd)/@top_builddir@; export ARCHFLAGS=\"-arch $(uname -m)\"; mkdir -p @builddir@/ext/guestfs; cd @builddir@/ext/guestfs; @RUBY@ #{EXT_CONF} --with-_guestfs-include=$top_srcdir/src --with-_guestfs-lib=$top_builddir/src/.libs"
$stderr.puts "Failed to run extconf"
break
end
set -e
-ruby -I${srcdir}/lib -Iext/guestfs ${srcdir}/bindtests.rb > bindtests.tmp
+$RUBY -I${srcdir}/lib -Iext/guestfs ${srcdir}/bindtests.rb > bindtests.tmp
diff -u ${srcdir}/../bindtests bindtests.tmp
# 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