1 AC_DEFUN([AC_RUBY_EXT], [
2 AC_CHECK_PROG(RUBY, ruby)
5 [ --with-ruby=PATH Location of Ruby executable (default: autodetect)],
8 AC_CHECK_PROGS(rubybin, ruby)
10 rubyver=`$rubybin --version 2> /dev/null`
11 if test -z "$rubyver"; then
12 AC_MSG_ERROR([ruby binary not found!])
15 AC_MSG_CHECKING(for Ruby library path)
17 RUBYDIR=`($rubybin -rmkmf -e 'print Config::CONFIG[["archdir"]]') 2> /dev/null`
18 if test -d "$RUBYDIR"; then
19 AC_MSG_RESULT([$RUBYDIR])
21 AC_MSG_RESULT(not found)
22 AC_MSG_ERROR(Ruby library path not found)
25 AC_MSG_CHECKING(for Ruby site library path)
26 RUBYSITEDIR=`($rubybin -rmkmf -e 'print Config::CONFIG[["sitearchdir"]]') 2> /dev/null`
27 if test -d "$RUBYSITEDIR"; then
28 AC_MSG_RESULT([$RUBYSITEDIR])
30 AC_MSG_RESULT(not found)
31 AC_MSG_ERROR(Ruby site library path not found)