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:
parent
a2c7fdc709
commit
1fbd605da8
3 changed files with 16 additions and 16 deletions
|
@ -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>
|
||||
|
||||
* array.c (rb_ary_uniq): gets rid of copying.
|
||||
|
|
20
configure.in
20
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)
|
||||
|
|
|
@ -101,6 +101,8 @@ File.foreach "config.status" do |line|
|
|||
has_version = true
|
||||
when "PATCHLEVEL"
|
||||
has_patchlevel = true
|
||||
when "ruby_version"
|
||||
version = val[/\A"(.*)"\z/, 1]
|
||||
end
|
||||
end
|
||||
# break if /^CEOF/
|
||||
|
@ -108,14 +110,14 @@ end
|
|||
|
||||
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 " DESTDIR = ", (drive ? "TOPDIR && TOPDIR[/\\A[a-z]:/i] || " : ""), "'' unless defined? DESTDIR\n"
|
||||
print " CONFIG = {}\n"
|
||||
print " CONFIG[\"DESTDIR\"] = DESTDIR\n"
|
||||
|
||||
unless has_version
|
||||
RUBY_VERSION.scan(/(\d+)\.(\d+)\.(\d+)/) {
|
||||
version.scan(/(\d+)\.(\d+)(?:\.(\d+))?/) {
|
||||
print " CONFIG[\"MAJOR\"] = \"" + $1 + "\"\n"
|
||||
print " CONFIG[\"MINOR\"] = \"" + $2 + "\"\n"
|
||||
print " CONFIG[\"TEENY\"] = \"" + $3 + "\"\n"
|
||||
|
|
Loading…
Reference in a new issue