[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] fix Ruby 1.9 deprecation warning for Config, use RbConfig

From: Andreas Stieger <andreas.stieger_at_gmx.de>
Date: Sat, 12 May 2012 00:20:35 +0100

Hello,

[[[
 fix Ruby 1.9 deprecation warning for Config, use RbConfig
 * configure.ac
   replace Config with RbConfig
 * build/ac-macros/swig.m4
  replace Config with RbConfig
]]]

The configure script reads the Ruby major and minor version to reject
configuring swig bindings for Ruby 1.9. It does this by accessing
Config::CONFIG which is deprecated in that release.

ruby -rrbconfig -e 'print Config::CONFIG.fetch(%q(MAJOR))'
ruby -rrbconfig -e 'print Config::CONFIG.fetch(%q(MINOR))'

So instead of meaningful message we get:

checking for Ruby major version... -e:1: Use RbConfig instead of
obsolete and deprecated Config.
checking for Ruby minor version... -e:1: Use RbConfig instead of
obsolete and deprecated Config.

The same warning is triggered when trying to configure SWIG_RB_COMPILE
and SWIG_RB_LINK, although that is moot as these are useless with Ruby
1.9 anyway for now. The following works with at least Ruby 1.8:

ruby -rrbconfig -e 'print Config::RbCONFIG.fetch(%q(MAJOR))'
ruby -rrbconfig -e 'print Config::RbCONFIG.fetch(%q(MINOR))'

This was found during work on the openSUSE package. Please review,
especially concerning backwards compatibility with Ruby versions older
than 1.8.

Andreas

  • text/x-patch attachment: stored
Received on 2012-05-12 01:21:11 CEST

This is an archived mail posted to the Subversion Dev mailing list.