summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--configure.in20
2 files changed, 10 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index e3df4f7370..6deeaf1831 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Tue Feb 17 17:00:49 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * configure.in (MAJOR, MINOR, TEENY): uses RUBY_VERSION_*.
+
Tue Feb 17 12:53:51 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* string.c (get_arg_pat): no second parameter.
diff --git a/configure.in b/configure.in
index 3ecdfacc3d..5416ba634b 100644
--- a/configure.in
+++ b/configure.in
@@ -44,20 +44,12 @@ fi
GNU_LD=$rb_cv_prog_gnu_ld
AC_SUBST(GNU_LD)])
-unset GREP_OPTIONS
-rb_version=`grep 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)