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)
16 RUBYLIBDIR=`($rubybin -rmkmf -e 'print Config::CONFIG[["libdir"]]') 2> /dev/null`
17 if test -d "$RUBYLIBDIR"; then
18 AC_MSG_RESULT([$RUBYLIBDIR])
20 AC_MSG_RESULT(not found)
21 AC_MSG_ERROR(Ruby library path not found)
24 AC_MSG_CHECKING(for Ruby extension path)
26 RUBYDIR=`($rubybin -rmkmf -e 'print Config::CONFIG[["archdir"]]') 2> /dev/null`
27 if test -d "$RUBYDIR"; then
28 AC_MSG_RESULT([$RUBYDIR])
30 AC_MSG_RESULT(not found)
31 AC_MSG_ERROR(Ruby extension path not found)
34 AC_MSG_CHECKING(for Ruby site library path)
35 RUBYSITEDIR=`($rubybin -rmkmf -e 'print Config::CONFIG[["sitearchdir"]]') 2> /dev/null`
36 if test -d "$RUBYSITEDIR"; then
37 AC_MSG_RESULT([$RUBYSITEDIR])
39 AC_MSG_RESULT(not found)
40 AC_MSG_ERROR(Ruby site extension path not found)