From f7288d0e95fc8bcc9a46f6ad9bfa47c43a786645 Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Mon, 24 Mar 2008 03:43:53 +0000 Subject: [PATCH] Switch Ruby support check to use AC_CACHE_CHECK. Originally committed to SVN as r2134. --- configure.in | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/configure.in b/configure.in index 3200b7e1c..eb2dc5266 100644 --- a/configure.in +++ b/configure.in @@ -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"])