core: replace Config by RbConfig for detection of Ruby to avoid deprecation warnings
This commit is contained in:
parent
385602e1e5
commit
3ec981877a
@ -38,27 +38,27 @@ FIND_PROGRAM(RUBY_EXECUTABLE
|
||||
|
||||
IF(RUBY_EXECUTABLE)
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "puts Config::CONFIG['rubyhdrdir'] || Config::CONFIG['archdir']"
|
||||
COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG['rubyhdrdir'] || RbConfig::CONFIG['archdir']"
|
||||
OUTPUT_VARIABLE RUBY_ARCH_DIR
|
||||
)
|
||||
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "puts Config::CONFIG['arch']"
|
||||
COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG['arch']"
|
||||
OUTPUT_VARIABLE RUBY_ARCH
|
||||
)
|
||||
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "puts Config::CONFIG['libdir']"
|
||||
COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG['libdir']"
|
||||
OUTPUT_VARIABLE RUBY_POSSIBLE_LIB_PATH
|
||||
)
|
||||
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "puts Config::CONFIG['rubylibdir']"
|
||||
COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG['rubylibdir']"
|
||||
OUTPUT_VARIABLE RUBY_RUBY_LIB_PATH
|
||||
)
|
||||
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "puts Config::CONFIG['ruby_version']"
|
||||
COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG['ruby_version']"
|
||||
OUTPUT_VARIABLE RUBY_VERSION
|
||||
)
|
||||
|
||||
|
10
configure.in
10
configure.in
@ -532,7 +532,7 @@ if test "x$enable_ruby" = "xyes" ; then
|
||||
enable_ruby="no"
|
||||
not_found="$not_found ruby"
|
||||
else
|
||||
RUBY_VERSION=`$RUBY -rrbconfig -e "puts Config::CONFIG[['ruby_version']]"`
|
||||
RUBY_VERSION=`$RUBY -rrbconfig -e "puts RbConfig::CONFIG[['ruby_version']]"`
|
||||
if test "$RUBY_VERSION" = "1.9.0"; then
|
||||
AC_MSG_WARN([
|
||||
*** Ruby header files have been found, but they're of the version 1.9.0.
|
||||
@ -542,11 +542,11 @@ if test "x$enable_ruby" = "xyes" ; then
|
||||
enable_ruby="no"
|
||||
not_found="$not_found ruby"
|
||||
else
|
||||
RUBY_INCLUDE=`$RUBY -rrbconfig -e "puts Config::CONFIG[['rubyhdrdir']] || Config::CONFIG[['archdir']]"`
|
||||
RUBY_ARCH=`$RUBY -rrbconfig -e 'print Config::CONFIG[["arch"]]'`
|
||||
RUBY_INCLUDE=`$RUBY -rrbconfig -e "puts RbConfig::CONFIG[['rubyhdrdir']] || RbConfig::CONFIG[['archdir']]"`
|
||||
RUBY_ARCH=`$RUBY -rrbconfig -e 'print RbConfig::CONFIG[["arch"]]'`
|
||||
AC_MSG_CHECKING(for Ruby header files)
|
||||
if test -d "$RUBY_INCLUDE/"; then
|
||||
M_RUBY_VERSION=`$RUBY -rrbconfig -e "puts Config::CONFIG[['ruby_version']].gsub(/\./, '')[[0,3]]"`
|
||||
M_RUBY_VERSION=`$RUBY -rrbconfig -e "puts RbConfig::CONFIG[['ruby_version']].gsub(/\./, '')[[0,3]]"`
|
||||
RUBY_CFLAGS="-I$RUBY_INCLUDE/ -I$RUBY_INCLUDE/$RUBY_ARCH -DRUBY_VERSION=$M_RUBY_VERSION"
|
||||
else
|
||||
AC_MSG_WARN([
|
||||
@ -557,7 +557,7 @@ if test "x$enable_ruby" = "xyes" ; then
|
||||
not_found="$not_found ruby"
|
||||
fi
|
||||
AC_MSG_RESULT(found)
|
||||
RUBY_LFLAGS=`$RUBY -rrbconfig -e "puts Config::CONFIG[['LIBRUBYARG_SHARED']]"`
|
||||
RUBY_LFLAGS=`$RUBY -rrbconfig -e "puts RbConfig::CONFIG[['LIBRUBYARG_SHARED']]"`
|
||||
fi
|
||||
fi
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user