Switch Ruby support check to use AC_CACHE_CHECK.

Originally committed to SVN as r2134.
This commit is contained in:
Amar Takhar 2008-03-24 03:43:53 +00:00
parent faff96d0f6
commit f7288d0e95

View file

@ -592,7 +592,6 @@ if test -z "$perl_disabled"; then
# AC_DEFINE(WITH_PERLCONSOLE, 1, [Enable PERL Console support (for debugging purposes)])
if test "$PERL_BIN" != "no"; then
AC_CACHE_CHECK(
[checking for perl version >= 5.004], [with_perl],
[if $PERL_BIN -e 'require 5.004'; then with_perl="yes"; else with_perl="no"; fi])
@ -649,14 +648,14 @@ if test -z "$ruby_disabled"; then
RUBY_BIN="$WITH_RUBY_BIN"
fi
if test "$RUBY_BIN" != "no"; then
AC_MSG_CHECKING([checking for ruby version >= 1.8])
if $RUBY_BIN -r rbconfig -e 'if Config::CONFIG@<:@"ruby_version"@:>@.to_f >= 1.8 then exit(0) else exit(1) end' ; then
AC_MSG_RESULT([yes])
with_ruby=yes
with_automation="yes"
AC_DEFINE(WITH_RUBY, 1, [Enable RUBY Automation.])
if test "$RUBY_BIN" != "no"; then
AC_CACHE_CHECK(
[checking for ruby version >= 1.8], [with_ruby],
[if $RUBY_BIN -r rbconfig -e 'if Config::CONFIG@<:@"ruby_version"@:>@.to_f >= 1.8 then exit(0) else exit(1) end'; then
with_ruby="yes"; else with_ruby="no"; fi])
if test "$with_ruby" = "yes"; then
AC_MSG_CHECKING([checking $RUBY_BIN -r rbconfig archdir, cflags])
RUBY_CFLAGS=`$RUBY_BIN -r rbconfig -e "printf(\"-I%s %s\", Config::CONFIG@<:@'archdir'@:>@, Config::CONFIG@<:@'CFLAGS'@:>@)"`
AC_MSG_RESULT([$RUBY_CFLAGS])
@ -664,14 +663,15 @@ if test -z "$ruby_disabled"; then
AC_MSG_CHECKING([checking $RUBY_BIN rbconfig libs])
RUBY_LDFLAGS=`$RUBY_BIN -r rbconfig -e "print Config::CONFIG@<:@'LIBRUBYARG'@:>@"`
AC_MSG_RESULT([$RUBY_LDFLAGS])
else
AC_MSG_RESULT([yes])
with_ruby=no
fi
fi
fi
if test "$with_ruby" = "yes"; then
with_automation="yes"
AC_DEFINE(WITH_RUBY, 1, [Enable RUBY Automation.])
fi
AC_SUBST(RUBY_CFLAGS)
AC_SUBST(RUBY_LDFLAGS)
AM_CONDITIONAL([HAVE_AUTO4_RUBY], [test "$with_ruby" != "no"])