AC_CHECK_PROG(RUBY, ruby, ruby)

if test -z "$RUBY"; then
  DO_NOT_COMPILE="$DO_NOT_COMPILE korundum"
else
  AC_MSG_CHECKING(for ruby dirs)
  RUBY_ARCHDIR=`ruby -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"archdir"@:>@)'`
  RUBY_SITEARCHDIR=`ruby -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitearchdir"@:>@)'`
  RUBY_SITEDIR=`ruby -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitelibdir"@:>@)'`
  RUBY_RUBYLIBDIR=`ruby -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"rubylibdir"@:>@)'`
  AC_MSG_RESULT([archdir $RUBY_ARCHDIR, sitearchdir $RUBY_SITEARCHDIR, sitedir $RUBY_SITEDIR])
  AC_SUBST(RUBY_ARCHDIR)
  AC_SUBST(RUBY_SITEARCHDIR)
  AC_SUBST(RUBY_RUBYLIBDIR)
  AC_SUBST(RUBY_SITEDIR)
fi

