1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Reapply r57093,r57094,r57097 "dtrace build fixes on FreeBSD"

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-12-17 07:48:58 +00:00
parent 6f40689356
commit c49060b1d9
2 changed files with 15 additions and 12 deletions

View file

@ -174,7 +174,7 @@ OBJDUMP = @OBJDUMP@
OBJCOPY = @OBJCOPY@ OBJCOPY = @OBJCOPY@
VCS = @VCS@ VCS = @VCS@
VCSUP = @VCSUP@ VCSUP = @VCSUP@
DTRACE = @DTRACE@ DTRACE = @DTRACE@ @DTRACE_OPT@
DTRACE_EXT = @DTRACE_EXT@ DTRACE_EXT = @DTRACE_EXT@
DTRACE_OBJ = @DTRACE_OBJ@ DTRACE_OBJ = @DTRACE_OBJ@
DTRACE_REBUILD= @DTRACE_REBUILD@ DTRACE_REBUILD= @DTRACE_REBUILD@

View file

@ -640,18 +640,20 @@ AC_DEFUN([RUBY_DTRACE_AVAILABLE],
[AC_CACHE_CHECK(whether dtrace USDT is available, rb_cv_dtrace_available, [AC_CACHE_CHECK(whether dtrace USDT is available, rb_cv_dtrace_available,
[ [
echo "provider conftest{ probe fire(); };" > conftest_provider.d 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 rb_cv_dtrace_available=no
AC_TRY_COMPILE([@%:@include "conftest_provider.h"], [CONFTEST_FIRE();], [ 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 # DTrace is available on the system
rb_cv_dtrace_available=yes rb_cv_dtrace_available=yes${rb_dtrace_opt:+"(opt)"}
], [rb_cv_dtrace_available=no]) break
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
rm -f conftest.[co] conftest_provider.[dho] 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], AC_DEFUN([RUBY_DTRACE_POSTPROCESS],
@ -664,13 +666,13 @@ AC_DEFUN([RUBY_DTRACE_POSTPROCESS],
probe fire(); probe fire();
}; };
_PROBES _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 }; then
AC_TRY_COMPILE([@%:@include "conftest_provider.h"], [CONFTEST_FIRE();], [ AC_TRY_COMPILE([@%:@include "conftest_provider.h"], [CONFTEST_FIRE();], [
if { if {
cp -p conftest.${ac_objext} conftest.${ac_objext}.save && 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 }; then
if cmp -s conftest.o conftest.${ac_objext}.save; then if cmp -s conftest.o conftest.${ac_objext}.save; then
@ -4029,6 +4031,7 @@ AS_CASE([$rb_cv_dtrace_available],
AC_SUBST(DTRACE_EXT) AC_SUBST(DTRACE_EXT)
AC_SUBST(DTRACE_OBJ) AC_SUBST(DTRACE_OBJ)
AC_SUBST(DTRACE_REBUILD) AC_SUBST(DTRACE_REBUILD)
AC_SUBST(DTRACE_OPT)
AC_SUBST(LIBRUBY_A_OBJS) AC_SUBST(LIBRUBY_A_OBJS)
RUBY_SETJMP_TYPE RUBY_SETJMP_TYPE