ruby-changes:41405
From: nobu <ko1@a...>
Date: Sat, 9 Jan 2016 10:44:39 +0900 (JST)
Subject: [ruby-changes:41405] nobu:r53477 (trunk): RUBY_PROGRAM_VERSION from RUBY_VERSION
nobu 2016-01-09 10:44:56 +0900 (Sat, 09 Jan 2016) New Revision: 53477 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53477 Log: RUBY_PROGRAM_VERSION from RUBY_VERSION * configure.in, win32/setup.mak: extract RUBY_PROGRAM_VERSION from RUBY_VERSION in version.h instead of RUBY_API_VERSION numbers in include/ruby/version.h, and cut it into version numbers. Modified files: trunk/ChangeLog trunk/Makefile.in trunk/configure.in trunk/win32/Makefile.sub trunk/win32/setup.mak Index: Makefile.in =================================================================== --- Makefile.in (revision 53476) +++ Makefile.in (revision 53477) @@ -122,6 +122,7 @@ BOOTSTRAPRUBY = @BOOTSTRAPRUBY@ https://github.com/ruby/ruby/blob/trunk/Makefile.in#L122 MAJOR= @MAJOR@ MINOR= @MINOR@ TEENY= @TEENY@ +RUBY_PROGRAM_VERSION = @RUBY_PROGRAM_VERSION@ LIBRUBY_A = @LIBRUBY_A@ LIBRUBY_SO = @LIBRUBY_SO@ Index: ChangeLog =================================================================== --- ChangeLog (revision 53476) +++ ChangeLog (revision 53477) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sat Jan 9 10:44:33 2016 Nobuyoshi Nakada <nobu@r...> + + * configure.in, win32/setup.mak: extract RUBY_PROGRAM_VERSION from + RUBY_VERSION in version.h instead of RUBY_API_VERSION numbers in + include/ruby/version.h, and cut it into version numbers. + Sat Jan 9 07:13:33 2016 Koichi Sasada <ko1@a...> * gc.c: rename PAGE_* to HEAP_PAGE_* because PAGE_SIZE is used Index: configure.in =================================================================== --- configure.in (revision 53476) +++ configure.in (revision 53477) @@ -224,7 +224,10 @@ fi https://github.com/ruby/ruby/blob/trunk/configure.in#L224 GNU_LD=$rb_cv_prog_gnu_ld 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` +RUBY_PROGRAM_VERSION=`sed -n 's/^#define RUBY_VERSION "\(.*\)"/\1/p' $srcdir/version.h` +MAJOR=`echo $RUBY_PROGRAM_VERSION | cut -d. -f1` +MINOR=`echo $RUBY_PROGRAM_VERSION | cut -d. -f2` +TEENY=`echo $RUBY_PROGRAM_VERSION | cut -d. -f3` 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 +236,6 @@ done https://github.com/ruby/ruby/blob/trunk/configure.in#L236 AC_SUBST(MAJOR) AC_SUBST(MINOR) AC_SUBST(TEENY) -RUBY_PROGRAM_VERSION=`sed -n 's/^#define RUBY_VERSION "\(.*\)"/\1/p' $srcdir/version.h` AC_SUBST(RUBY_PROGRAM_VERSION) RUBY_PATCHLEVEL=`sed -n 's/^#define RUBY_PATCHLEVEL //p' $srcdir/version.h` AC_DEFINE(CANONICALIZATION_FOR_MATHN) Index: win32/Makefile.sub =================================================================== --- win32/Makefile.sub (revision 53476) +++ win32/Makefile.sub (revision 53477) @@ -24,6 +24,10 @@ LARGEFILE_SUPPORT = 1 https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L24 win_srcdir = $(srcdir)/win32 !endif +!if exist(verconf.mk) +! include verconf.mk +!endif + #### Start of system configuration section. #### !if defined(pathlist) @@ -424,9 +428,6 @@ PRELUDE_C = prelude.c https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L428 RBCONFIG = ./.rbconfig.time !include $(srcdir)/common.mk -!if exist(verconf.mk) -! include verconf.mk -!endif !ifdef SCRIPTPROGRAMS !else if [echo>scriptbin.mk SCRIPTPROGRAMS = \] @@ -926,7 +927,7 @@ s,@sitearchincludedir@,$${includedir}/$$ https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L927 s,@arch@,$(ARCH)-$(PLATFORM),;t t s,@sitearch@,$(ARCH)-$(RT),;t t s,@ruby_version@,$(ruby_version),;t t -s,@RUBY_PROGRAM_VERSION@,$(ruby_version),;t t +s,@RUBY_PROGRAM_VERSION@,$(RUBY_PROGRAM_VERSION),;t t s,@rubylibprefix@,$${prefix}/lib/$${RUBY_BASE_NAME},;t t s,@rubyarchdir@,$${rubylibdir}/$${arch},;t t s,@rubylibdir@,$${rubylibprefix}/$${ruby_version},;t t Index: win32/setup.mak =================================================================== --- win32/setup.mak (revision 53476) +++ win32/setup.mak (revision 53477) @@ -118,12 +118,6 @@ int main(void) {return (EnumProcesses(NU https://github.com/ruby/ruby/blob/trunk/win32/setup.mak#L118 -version-: nul verconf.mk @$(APPEND) @$(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 MSC_VER = _MSC_VER << @@ -135,8 +129,19 @@ verconf.mk: nul https://github.com/ruby/ruby/blob/trunk/win32/setup.mak#L129 #define STRINGIZE(x) STRINGIZE0(x) #include "version.h" for %%I in (RUBY_RELEASE_DATE) do set ruby_release_date=%%~I +for %%I in (RUBY_VERSION) do set ruby_version=%%~I +for /f "delims=. tokens=1-3" %%I in (RUBY_VERSION) do ( + set major=%%I + set minor=%%J + set teeny=%%K +) #undef RUBY_RELEASE_DATE +#undef RUBY_PROGRAM_VERSION echo RUBY_RELEASE_DATE = %ruby_release_date:""=% +echo RUBY_PROGRAM_VERSION = %ruby_version:""=% +echo MAJOR = %major% +echo MINOR = %minor% +echo TEENY = %teeny% del %0 & exit << -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/