From 6980bf408cd23d0f9ba7c56921a72b41d8686edd Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 21 Jun 2017 04:34:25 +0000 Subject: 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- configure.in | 4 +++- gc.c | 4 ++++ ruby.c | 2 ++ win32/Makefile.sub | 3 +++ win32/setup.mak | 3 +++ 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 8566f394c6..e30ae6c9c9 100644 --- a/configure.in +++ b/configure.in @@ -840,7 +840,8 @@ AS_IF([test x"${RPATHFLAG}" = x], [ ]) 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], [ 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"]) diff --git a/gc.c b/gc.c index 556189b889..da2bc2a059 100644 --- a/gc.c +++ b/gc.c @@ -221,8 +221,12 @@ static ruby_gc_params_t gc_params = { * 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 diff --git a/ruby.c b/ruby.c index c9dd782285..b2b2c690ff 100644 --- a/ruby.c +++ b/ruby.c @@ -865,7 +865,9 @@ debug_option(const char *str, int len, void *arg) 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); } diff --git a/win32/Makefile.sub b/win32/Makefile.sub index 386fcbfd69..ed89832f0e 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -113,6 +113,9 @@ ARCH = $(MACHINE) !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- diff --git a/win32/setup.mak b/win32/setup.mak index 91f8123868..151274781b 100644 --- a/win32/setup.mak +++ b/win32/setup.mak @@ -155,6 +155,9 @@ echo RUBY_PROGRAM_VERSION = %ruby_version:""=% echo MAJOR = %major% echo MINOR = %minor% echo TEENY = %teeny% +#if defined RUBY_PATCHLEVEL && RUBY_PATCHLEVEL < 0 +echo RUBY_DEVEL = yes +#endif del %0 & exit << -- cgit v1.2.3