Fix Ruby detection when .pc file is ruby-1.9

pull/1/head
Timothy Pearson 12 years ago
parent 2f6e9c735f
commit 10fc891a7e

@ -10,15 +10,17 @@ else
AC_MSG_CHECKING(for ruby dirs)
if test -n "$PKGCONFIG"; then
RUBY_VERSION=`$PKGCONFIG ruby --modversion 2>/dev/null`
if test -z "$RUBY_VERSION"; then
if test -n "$RUBY_VERSION"; then
RUBY_CFLAGS=`$PKGCONFIG ruby --cflags`
else
RUBY_VERSION=`$PKGCONFIG ruby-1.9 --modversion 2>/dev/null`
RUBY_CFLAGS=`$PKGCONFIG ruby-1.9 --cflags`
fi
if test -n "$RUBY_VERSION"; then
RUBY_ARCHDIR=`ruby -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"archdir"@:>@)'`
RUBY_SITEARCHDIR=`ruby -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"sitearchdir"@:>@)'`
RUBY_SITEDIR=`ruby -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"sitelibdir"@:>@)'`
RUBY_RUBYLIBDIR=`ruby -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"rubylibdir"@:>@)'`
RUBY_CFLAGS=`$PKGCONFIG ruby --cflags`
AC_DEFINE_UNQUOTED(HAVE_RUBY_1_9, 1, [Defines if your system has Ruby 1.9.x])
fi
fi

@ -10,8 +10,11 @@ else
AC_MSG_CHECKING(for ruby dirs)
if test -n "$PKGCONFIG"; then
RUBY_VERSION=`$PKGCONFIG ruby --modversion 2>/dev/null`
if test -z "$RUBY_VERSION"; then
if test -n "$RUBY_VERSION"; then
RUBY_CFLAGS=`$PKGCONFIG ruby --cflags`
else
RUBY_VERSION=`$PKGCONFIG ruby-1.9 --modversion 2>/dev/null`
RUBY_CFLAGS=`$PKGCONFIG ruby-1.9 --cflags`
fi
if test -n "$RUBY_VERSION"; then
RUBY_ARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"archdir"@:>@)'`
@ -20,7 +23,6 @@ else
RUBY_RUBYLIBDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"rubylibdir"@:>@)'`
RUBY_LIBDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"libdir"@:>@)'`
RUBY_LIBRUBYARG=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"LIBRUBYARG_SHARED"@:>@)'`
RUBY_CFLAGS=`$PKGCONFIG ruby --cflags`
AC_DEFINE_UNQUOTED(HAVE_RUBY_1_9, 1, [Defines if your system has Ruby 1.9.x])
fi
fi

Loading…
Cancel
Save