ruby-changes:45020
From: nobu <ko1@a...>
Date: Fri, 16 Dec 2016 21:16:45 +0900 (JST)
Subject: [ruby-changes:45020] nobu:r57093 (trunk): dtrace build fixes on FreeBSD
nobu 2016-12-16 21:16:33 +0900 (Fri, 16 Dec 2016) New Revision: 57093 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57093 Log: dtrace build fixes on FreeBSD * configure.in (RUBY_DTRACE_AVAILABLE, RUBY_DTRACE_POSTPROCESS): incorporate dtrace build fix on FreeBSD, dtrace needs -xnolibs in a jail. [ruby-core:78676] [Bug #13041] Modified files: trunk/Makefile.in trunk/configure.in Index: Makefile.in =================================================================== --- Makefile.in (revision 57092) +++ Makefile.in (revision 57093) @@ -174,7 +174,7 @@ OBJDUMP = @OBJDUMP@ https://github.com/ruby/ruby/blob/trunk/Makefile.in#L174 OBJCOPY = @OBJCOPY@ VCS = @VCS@ VCSUP = @VCSUP@ -DTRACE = @DTRACE@ +DTRACE = @DTRACE@ @DTRACE_OPT@ DTRACE_EXT = @DTRACE_EXT@ DTRACE_OBJ = @DTRACE_OBJ@ DTRACE_REBUILD= @DTRACE_REBUILD@ Index: configure.in =================================================================== --- configure.in (revision 57092) +++ configure.in (revision 57093) @@ -640,18 +640,20 @@ AC_DEFUN([RUBY_DTRACE_AVAILABLE], https://github.com/ruby/ruby/blob/trunk/configure.in#L640 [AC_CACHE_CHECK(whether dtrace USDT is available, rb_cv_dtrace_available, [ echo "provider conftest{ probe fire(); };" > conftest_provider.d - if $DTRACE -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null; then - AC_TRY_COMPILE([@%:@include "conftest_provider.h"], [CONFTEST_FIRE();], [ + rb_cv_dtrace_available=no + AS_FOR(opt, rb_dtrace_opt, ["" "-xnolibs"], [dnl + AS_IF([$DTRACE opt -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null], + [], [continue]) + AC_TRY_COMPILE([@%:@include "conftest_provider.h"], [CONFTEST_FIRE();], + [], [continue]) # DTrace is available on the system - rb_cv_dtrace_available=yes - ], [rb_cv_dtrace_available=no]) - else - # DTrace is not available while dtrace command exists - # for example FreeBSD 8 or FreeBSD 9 without DTrace build option - rb_cv_dtrace_available=no - fi + rb_cv_dtrace_available=yes${rb_dtrace_opt:+"(opt)"} + break + ]) rm -f conftest.[co] conftest_provider.[dho] ]) +AS_CASE(["$rb_cv_dtrace_available"], ["yes("*")"], + [DTRACE_OPT=`expr "$rb_cv_dtrace_available" : "yes(\(.*\))"`]) ]) AC_DEFUN([RUBY_DTRACE_POSTPROCESS], @@ -664,13 +666,13 @@ AC_DEFUN([RUBY_DTRACE_POSTPROCESS], https://github.com/ruby/ruby/blob/trunk/configure.in#L666 probe fire(); }; _PROBES - $DTRACE -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null && + $DTRACE ${DTRACE_OPT} -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null && : }; then AC_TRY_COMPILE([@%:@include "conftest_provider.h"], [CONFTEST_FIRE();], [ if { cp -p conftest.${ac_objext} conftest.${ac_objext}.save && - $DTRACE -G -s conftest_provider.d conftest.${ac_objext} 2>/dev/null && + $DTRACE ${DTRACE_OPT} -G -s conftest_provider.d conftest.${ac_objext} 2>/dev/null && : }; then if cmp -s conftest.o conftest.${ac_objext}.save; then @@ -4032,6 +4034,7 @@ AS_CASE([$rb_cv_dtrace_available], https://github.com/ruby/ruby/blob/trunk/configure.in#L4034 AC_SUBST(DTRACE_EXT) AC_SUBST(DTRACE_OBJ) AC_SUBST(DTRACE_REBUILD) +AC_SUBST(DTRACE_OPT) AC_SUBST(LIBRUBY_A_OBJS) RUBY_SETJMP_TYPE -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/