summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-05 05:26:22 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-05 05:26:22 +0000
commit1fbd605da88c62a3a4d31ea3baf687ba9128e722 (patch)
tree9b72143ea3e9a20630fa60684624152932fe5618 /configure.in
parenta2c7fdc70939e9c8a57a560aec786f3a7303f378 (diff)
* configure.in (MAJOR, MINOR, TEENY): uses RUBY_VERSION_*.
* mkconfig.rb (prefix): uses ruby_version in config.status. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in20
1 files changed, 6 insertions, 14 deletions
diff --git a/configure.in b/configure.in
index aba01602fd..2210ac53b4 100644
--- a/configure.in
+++ b/configure.in
@@ -63,20 +63,12 @@ fi
GNU_LD=$rb_cv_prog_gnu_ld
AC_SUBST(GNU_LD)])
-unset GREP_OPTIONS
-rb_version=`grep '^#define RUBY_VERSION ' $srcdir/version.h`
-MAJOR=`expr "$rb_version" : '#define RUBY_VERSION "\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*"'`
-MINOR=`expr "$rb_version" : '#define RUBY_VERSION "[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*"'`
-TEENY=`expr "$rb_version" : '#define RUBY_VERSION "[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\)"'`
-if test "$MAJOR" = ""; then
- AC_MSG_ERROR(could not determine MAJOR number from version.h)
-fi
-if test "$MINOR" = ""; then
- AC_MSG_ERROR(could not determine MINOR number from version.h)
-fi
-if test "$TEENY" = ""; then
- AC_MSG_ERROR(could not determine TEENY number from version.h)
-fi
+eval `sed -n 's/^#define RUBY_VERSION_\([A-Z][A-Z_0-9]*\) \([0-9][0-9]*\)/\1=\2/p' $srcdir/version.h`
+for v in MAJOR MINOR TEENY; do
+ if eval "test \"\$$v\" = ''"; then
+ AC_MSG_ERROR(could not determine $v number from version.h)
+ fi
+done
AC_SUBST(MAJOR)
AC_SUBST(MINOR)
AC_SUBST(TEENY)