[前][次][番号順一覧][スレッド一覧]

ruby-changes:41242

From: nobu <ko1@a...>
Date: Sat, 26 Dec 2015 01:24:56 +0900 (JST)
Subject: [ruby-changes:41242] nobu:r53314 (trunk): program version from API version

nobu	2015-12-26 01:24:43 +0900 (Sat, 26 Dec 2015)

  New Revision: 53314

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53314

  Log:
    program version from API version
    
    * configure.in, version.h (RUBY_PROGRAM_VERSION): extract version
      numbers from API version in include/ruby/version.h except for
      TEENY, to save matz job next year.
    * win32/setup.mak (-version-): use program version.

  Modified files:
    trunk/ChangeLog
    trunk/Makefile.in
    trunk/common.mk
    trunk/configure.in
    trunk/version.h
    trunk/win32/setup.mak
Index: configure.in
===================================================================
--- configure.in	(revision 53313)
+++ configure.in	(revision 53314)
@@ -225,6 +225,7 @@ GNU_LD=$rb_cv_prog_gnu_ld https://github.com/ruby/ruby/blob/trunk/configure.in#L225
 AC_SUBST(GNU_LD)])
 
 eval `sed -n 's/^#define RUBY_API_VERSION_\([A-Z][A-Z_0-9]*\) \([0-9][0-9]*\)/\1=\2/p' $srcdir/include/ruby/version.h`
+eval `sed -n 's/^#define RUBY_PROGRAM_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)
@@ -233,7 +234,7 @@ done https://github.com/ruby/ruby/blob/trunk/configure.in#L234
 AC_SUBST(MAJOR)
 AC_SUBST(MINOR)
 AC_SUBST(TEENY)
-RUBY_PROGRAM_VERSION=`sed -n 's/^#define RUBY_VERSION "\(.*\)"/\1/p' $srcdir/version.h`
+RUBY_PROGRAM_VERSION=$MAJOR.$MINOR.$TEENY
 AC_SUBST(RUBY_PROGRAM_VERSION)
 RUBY_PATCHLEVEL=`sed -n 's/^#define RUBY_PATCHLEVEL //p' $srcdir/version.h`
 AC_DEFINE(CANONICALIZATION_FOR_MATHN)
@@ -4409,7 +4410,12 @@ AC_CONFIG_FILES(Makefile, [ https://github.com/ruby/ruby/blob/trunk/configure.in#L4410
 		["git svn"], [VCSUP='$(VCS) rebase $(GITSVNREBASEOPTIONS)'],
 		[git],       [VCSUP='$(VCS) pull $(GITPULLOPTIONS)'],
 		[VCSUP='$(VCS)'])
+	# MAJOR and MINOR are public and come from include/ruby/version.h by reconfig
+	echo MAJOR = $MAJOR
+	echo MINOR = $MINOR
+	# TEENY is private and come from version.h
 	sed -n \
+	    -e '[s/^@%:@define RUBY_PROGRAM_VERSION_\([A-Z]*\) \([0-9][0-9]*\)/\1 = \2/p]' \
 	    -e '[/^@%:@define \(RUBY_RELEASE_[A-Z]*\) \([0-9][0-9]*\)/]{' \
 	    -e   's//\1 = \2/' \
 	    -e   '[s/ \([0-9]\)$/ 0\1/]' \
@@ -4437,7 +4443,7 @@ AC_CONFIG_FILES(Makefile, [ https://github.com/ruby/ruby/blob/trunk/configure.in#L4443
 	echo 'ruby: $(PROGRAM);' >> $tmpmk
 	test "$tmpmk" = "$tmpgmk" || rm -f "$tmpgmk"
     fi && mv -f $tmpmk Makefile],
-[EXEEXT='$EXEEXT' gnumake='$gnumake'])
+[EXEEXT='$EXEEXT' MAJOR='$MAJOR' MINOR='$MINOR' gnumake='$gnumake'])
 
 AC_ARG_WITH([ruby-pc],
 	    AC_HELP_STRING([--with-ruby-pc=FILENAME], [pc file basename]),
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 53313)
+++ ChangeLog	(revision 53314)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Dec 26 01:24:40 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* configure.in, version.h (RUBY_PROGRAM_VERSION): extract version
+	  numbers from API version in include/ruby/version.h except for
+	  TEENY, to save matz job next year.
+
+	* win32/setup.mak (-version-): use program version.
+
 Fri Dec 25 22:43:26 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* configure.in: extract RUBY_RELEASE_DAY at generating Makefile.
Index: common.mk
===================================================================
--- common.mk	(revision 53313)
+++ common.mk	(revision 53314)
@@ -13,6 +13,7 @@ ECHO = @$(ECHO0) https://github.com/ruby/ruby/blob/trunk/common.mk#L13
 
 UNICODE_VERSION = 8.0.0
 
+RUBY_PROGRAM_VERSION = $(MAJOR).$(MINOR).$(TEENY)
 RUBY_RELEASE_DATE = $(RUBY_RELEASE_YEAR)-$(RUBY_RELEASE_MONTH)-$(RUBY_RELEASE_DAY)
 RUBYLIB       = $(PATH_SEPARATOR)
 RUBYOPT       = -
Index: win32/setup.mak
===================================================================
--- win32/setup.mak	(revision 53313)
+++ win32/setup.mak	(revision 53314)
@@ -120,10 +120,9 @@ int main(void) {return (EnumProcesses(NU https://github.com/ruby/ruby/blob/trunk/win32/setup.mak#L120
 	@$(CPP) -I$(srcdir) -I$(srcdir)/include <<"Creating $(MAKEFILE)" | findstr "=" >>$(MAKEFILE)
 #define RUBY_REVISION 0
 #include "version.h"
-MAJOR = RUBY_API_VERSION_MAJOR
-MINOR = RUBY_API_VERSION_MINOR
-TEENY = RUBY_API_VERSION_TEENY
-RUBY_PROGRAM_VERSION = RUBY_VERSION
+MAJOR = RUBY_PROGRAM_VERSION_MAJOR
+MINOR = RUBY_PROGRAM_VERSION_MINOR
+TEENY = RUBY_PROGRAM_VERSION_TEENY
 MSC_VER = _MSC_VER
 <<
 
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 53313)
+++ Makefile.in	(revision 53314)
@@ -89,7 +89,6 @@ BUILTIN_TRANSOBJS = @BUILTIN_TRANSOBJS@ https://github.com/ruby/ruby/blob/trunk/Makefile.in#L89
 POSTLINK = @POSTLINK@
 
 RUBY_BASE_NAME=@RUBY_BASE_NAME@
-RUBY_PROGRAM_VERSION=@RUBY_PROGRAM_VERSION@
 RUBY_INSTALL_NAME=@RUBY_INSTALL_NAME@
 RUBY_SO_NAME=@RUBY_SO_NAME@
 EXEEXT = @EXEEXT@
@@ -118,10 +117,6 @@ BOOTSTRAPRUBY = @BOOTSTRAPRUBY@ https://github.com/ruby/ruby/blob/trunk/Makefile.in#L117
 
 #### End of system configuration section. ####
 
-MAJOR=	@MAJOR@
-MINOR=	@MINOR@
-TEENY=	@TEENY@
-
 LIBRUBY_A     = @LIBRUBY_A@
 LIBRUBY_SO    = @LIBRUBY_SO@
 LIBRUBY_ALIASES= @LIBRUBY_ALIASES@
Index: version.h
===================================================================
--- version.h	(revision 53313)
+++ version.h	(revision 53314)
@@ -1,4 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/version.h#L1
-#define RUBY_VERSION "2.4.0"
+#define RUBY_PROGRAM_VERSION_MAJOR RUBY_API_VERSION_MAJOR
+#define RUBY_PROGRAM_VERSION_MINOR RUBY_API_VERSION_MINOR
+#define RUBY_PROGRAM_VERSION_TEENY 0
+
+#define RUBY_BUILD_VERSION_STR_2(v) STRINGIZE(v##_MAJOR)"."STRINGIZE(v##_MINOR)
+#define RUBY_BUILD_VERSION_STR_3(v) RUBY_BUILD_VERSION_STR_2(v)"."STRINGIZE(v##_TEENY)
+
+#define RUBY_PROGRAM_VERSION RUBY_BUILD_VERSION_STR_3(RUBY_PROGRAM_VERSION)
+#define RUBY_VERSION RUBY_PROGRAM_VERSION
 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
 #define RUBY_PATCHLEVEL -1
 
@@ -25,11 +33,13 @@ https://github.com/ruby/ruby/blob/trunk/version.h#L33
 #define RUBY_RELEASE_DAY_STR STRINGIZE(RUBY_RELEASE_DAY)
 #endif
 
+#define RUBY_LIB_VERSION_2 RUBY_BUILD_VERSION_STR_2(RUBY_API_VERSION)
+#define RUBY_LIB_VERSION_3 RUBY_BUILD_VERSION_STR_3(RUBY_API_VERSION)
 #if !defined RUBY_LIB_VERSION && defined RUBY_LIB_VERSION_STYLE
 # if RUBY_LIB_VERSION_STYLE == 3
-#   define RUBY_LIB_VERSION STRINGIZE(RUBY_API_VERSION_MAJOR)"."STRINGIZE(RUBY_API_VERSION_MINOR)"."STRINGIZE(RUBY_API_VERSION_TEENY)
+#   define RUBY_LIB_VERSION RUBY_LIB_VERSION_3
 # elif RUBY_LIB_VERSION_STYLE == 2
-#   define RUBY_LIB_VERSION STRINGIZE(RUBY_API_VERSION_MAJOR)"."STRINGIZE(RUBY_API_VERSION_MINOR)
+#   define RUBY_LIB_VERSION RUBY_LIB_VERSION_2
 # endif
 #endif
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]