ruby-changes:47016
From: nobu <ko1@a...>
Date: Wed, 21 Jun 2017 13:34:32 +0900 (JST)
Subject: [ruby-changes:47016] nobu:r59131 (trunk): RUBY_DEVEL flag
nobu 2017-06-21 13:34:25 +0900 (Wed, 21 Jun 2017) New Revision: 59131 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59131 Log: RUBY_DEVEL flag * configure.in: define RUBY_DEVEL only in the trunk. * gc.c: enable runtime rgengc debug if RUBY_DEVEL * ruby.c (debug_option): enable RUBY_DEBUG in --debug option only if RUBY_DEVEL. Modified files: trunk/configure.in trunk/gc.c trunk/ruby.c trunk/win32/Makefile.sub trunk/win32/setup.mak Index: configure.in =================================================================== --- configure.in (revision 59130) +++ configure.in (revision 59131) @@ -840,7 +840,8 @@ AS_IF([test x"${RPATHFLAG}" = x], [ https://github.com/ruby/ruby/blob/trunk/configure.in#L840 ]) AS_CASE([$RUBY_PATCHLEVEL], [-*], - [particular_werror_flags=yes], [particular_werror_flags=no]) + [RUBY_DEVEL=yes], [RUBY_DEVEL=no]) +particular_werror_flags=$RUBY_DEVEL AC_ARG_ENABLE(werror, AS_HELP_STRING([--disable-werror], [don't make warnings into errors @@ -1019,6 +1020,7 @@ AS_IF([test "$GCC" = yes], [ https://github.com/ruby/ruby/blob/trunk/configure.in#L1020 test "${debugflags+set}" || {RUBY_TRY_CFLAGS(-g3, [debugflags=-g3])} ]) test $ac_cv_prog_cc_g = yes && : ${debugflags=-g} +AS_IF([test "x$RUBY_DEVEL" = xyes], [debugflags="$debugflags -DRUBY_DEVEL=1"]) AS_IF([test "$GCC" = ""], [ AS_CASE(["$target_os"],[aix*],[warnflags="$warnflags -qinfo=por" rb_cv_warnflags="$rb_cv_warnflags -qinfo=por"]) Index: gc.c =================================================================== --- gc.c (revision 59130) +++ gc.c (revision 59131) @@ -221,8 +221,12 @@ static ruby_gc_params_t gc_params = { https://github.com/ruby/ruby/blob/trunk/gc.c#L221 * 5: sweep */ #ifndef RGENGC_DEBUG +#ifdef RUBY_DEVEL +#define RGENGC_DEBUG -1 +#else #define RGENGC_DEBUG 0 #endif +#endif #if RGENGC_DEBUG < 0 #undef RGENGC_DEBUG #define RGENGC_DEBUG ruby_rgengc_debug Index: win32/Makefile.sub =================================================================== --- win32/Makefile.sub (revision 59130) +++ win32/Makefile.sub (revision 59131) @@ -113,6 +113,9 @@ ARCH = $(MACHINE) https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L113 !if !defined(DEBUGFLAGS) DEBUGFLAGS = -Zi !endif +!if "$(RUBY_DEVEL)" == "yes" +DEBUGFLAGS = $(DEBUGFLAGS) -DRUBY_DEVEL=1 +!endif !if !defined(OPTFLAGS) !if $(MSC_VER) < 1400 OPTFLAGS = -O2b2xg- Index: win32/setup.mak =================================================================== --- win32/setup.mak (revision 59130) +++ win32/setup.mak (revision 59131) @@ -155,6 +155,9 @@ echo RUBY_PROGRAM_VERSION = %ruby_versio https://github.com/ruby/ruby/blob/trunk/win32/setup.mak#L155 echo MAJOR = %major% echo MINOR = %minor% echo TEENY = %teeny% +#if defined RUBY_PATCHLEVEL && RUBY_PATCHLEVEL < 0 +echo RUBY_DEVEL = yes +#endif del %0 & exit << Index: ruby.c =================================================================== --- ruby.c (revision 59130) +++ ruby.c (revision 59131) @@ -865,7 +865,9 @@ debug_option(const char *str, int len, v https://github.com/ruby/ruby/blob/trunk/ruby.c#L865 static const char list[] = EACH_DEBUG_FEATURES(LITERAL_NAME_ELEMENT, ", "); #define SET_WHEN_DEBUG(bit) SET_WHEN(#bit, DEBUG_BIT(bit), str, len) EACH_DEBUG_FEATURES(SET_WHEN_DEBUG, ;); +#ifdef RUBY_DEVEL if (ruby_patchlevel < 0 && ruby_env_debug_option(str, len, 0)) return; +#endif rb_warn("unknown argument for --debug: `%.*s'", len, str); rb_warn("debug features are [%.*s].", (int)strlen(list), list); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/