1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
nobu 2009-02-05 05:26:22 +00:00
parent a2c7fdc709
commit 1fbd605da8
3 changed files with 16 additions and 16 deletions

View file

@ -1,3 +1,9 @@
Thu Feb 5 14:26:16 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (MAJOR, MINOR, TEENY): uses RUBY_VERSION_*.
* mkconfig.rb (prefix): uses ruby_version in config.status.
Thu Feb 5 12:24:18 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> Thu Feb 5 12:24:18 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* array.c (rb_ary_uniq): gets rid of copying. * array.c (rb_ary_uniq): gets rid of copying.

View file

@ -63,20 +63,12 @@ fi
GNU_LD=$rb_cv_prog_gnu_ld GNU_LD=$rb_cv_prog_gnu_ld
AC_SUBST(GNU_LD)]) AC_SUBST(GNU_LD)])
unset GREP_OPTIONS eval `sed -n 's/^#define RUBY_VERSION_\([A-Z][A-Z_0-9]*\) \([0-9][0-9]*\)/\1=\2/p' $srcdir/version.h`
rb_version=`grep '^#define RUBY_VERSION ' $srcdir/version.h` for v in MAJOR MINOR TEENY; do
MAJOR=`expr "$rb_version" : '#define RUBY_VERSION "\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*"'` if eval "test \"\$$v\" = ''"; then
MINOR=`expr "$rb_version" : '#define RUBY_VERSION "[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*"'` AC_MSG_ERROR(could not determine $v number from version.h)
TEENY=`expr "$rb_version" : '#define RUBY_VERSION "[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\)"'` fi
if test "$MAJOR" = ""; then done
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
AC_SUBST(MAJOR) AC_SUBST(MAJOR)
AC_SUBST(MINOR) AC_SUBST(MINOR)
AC_SUBST(TEENY) AC_SUBST(TEENY)

View file

@ -101,6 +101,8 @@ File.foreach "config.status" do |line|
has_version = true has_version = true
when "PATCHLEVEL" when "PATCHLEVEL"
has_patchlevel = true has_patchlevel = true
when "ruby_version"
version = val[/\A"(.*)"\z/, 1]
end end
end end
# break if /^CEOF/ # break if /^CEOF/
@ -108,14 +110,14 @@ end
drive = File::PATH_SEPARATOR == ';' drive = File::PATH_SEPARATOR == ';'
prefix = '/lib/ruby/' + RUBY_VERSION + '/' + RUBY_PLATFORM prefix = "/lib/ruby/#{version}/#{RUBY_PLATFORM}"
print " TOPDIR = File.dirname(__FILE__).chomp!(#{prefix.dump})\n" print " TOPDIR = File.dirname(__FILE__).chomp!(#{prefix.dump})\n"
print " DESTDIR = ", (drive ? "TOPDIR && TOPDIR[/\\A[a-z]:/i] || " : ""), "'' unless defined? DESTDIR\n" print " DESTDIR = ", (drive ? "TOPDIR && TOPDIR[/\\A[a-z]:/i] || " : ""), "'' unless defined? DESTDIR\n"
print " CONFIG = {}\n" print " CONFIG = {}\n"
print " CONFIG[\"DESTDIR\"] = DESTDIR\n" print " CONFIG[\"DESTDIR\"] = DESTDIR\n"
unless has_version unless has_version
RUBY_VERSION.scan(/(\d+)\.(\d+)\.(\d+)/) { version.scan(/(\d+)\.(\d+)(?:\.(\d+))?/) {
print " CONFIG[\"MAJOR\"] = \"" + $1 + "\"\n" print " CONFIG[\"MAJOR\"] = \"" + $1 + "\"\n"
print " CONFIG[\"MINOR\"] = \"" + $2 + "\"\n" print " CONFIG[\"MINOR\"] = \"" + $2 + "\"\n"
print " CONFIG[\"TEENY\"] = \"" + $3 + "\"\n" print " CONFIG[\"TEENY\"] = \"" + $3 + "\"\n"