From: Tobias Brunner Date: Thu, 8 Nov 2012 15:20:41 +0000 (+0100) Subject: Fixed search for ruby.h in ./configure for newer Ruby releases X-Git-Tag: 5.0.2dr4~114 X-Git-Url: https://git.strongswan.org/?p=strongswan.git;a=commitdiff_plain;h=5057df5b73c8547ce4cc8ce2197081b83cf297da Fixed search for ruby.h in ./configure for newer Ruby releases --- diff --git a/configure.in b/configure.in index 6fecf8c..c00a478 100644 --- a/configure.in +++ b/configure.in @@ -644,24 +644,25 @@ if test x$dumm = xtrue; then AC_CHECK_PROGS(RUBY, ruby) AC_MSG_CHECKING([for Ruby header files]) if test -n "$RUBY"; then - RUBYDIR=`($RUBY -rmkmf -e 'print Config::CONFIG[["archdir"]] || $archdir') 2>/dev/null` - if test -n "$RUBYDIR"; then - dirs="$RUBYDIR" - RUBYINCLUDE=none - for i in $dirs; do - if test -r $i/ruby.h; then - AC_MSG_RESULT([$i]) - RUBYINCLUDE="-I$i" - break; - fi - done - if test x"$RUBYINCLUDE" = xnone; then - AC_MSG_ERROR([ruby.h not found]) + RUBYINCLUDE= + RUBYDIR=`($RUBY -r rbconfig -e 'print RbConfig::CONFIG[["rubyhdrdir"]] || ""') 2>/dev/null` + if test -n "$RUBYDIR" -a -r "$RUBYDIR/ruby.h"; then + RUBYARCH=`($RUBY -r rbconfig -e 'print RbConfig::CONFIG[["arch"]] || ""') 2>/dev/null` + if test -n "$RUBYARCH"; then + AC_MSG_RESULT([$RUBYDIR]) + RUBYINCLUDE="-I$RUBYDIR -I$RUBYDIR/$RUBYARCH" fi - AC_SUBST(RUBYINCLUDE) else - AC_MSG_ERROR([unable to determine ruby configuration]) + RUBYDIR=`($RUBY -r rbconfig -e 'print RbConfig::CONFIG[["archdir"]] || ""') 2>/dev/null` + if test -n "$RUBYDIR" -a -r "$RUBYDIR/ruby.h"; then + AC_MSG_RESULT([$RUBYDIR]) + RUBYINCLUDE="-I$RUBYDIR" + fi + fi + if test -z "$RUBYINCLUDE"; then + AC_MSG_ERROR([ruby.h not found]) fi + AC_SUBST(RUBYINCLUDE) else AC_MSG_ERROR([don't know how to run ruby]) fi