Reapply r57092 "configure.in: repeated checks"

Needs DTRACE_OBJ when "$rb_cv_prog_dtrace_g" = rebuild, too.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-12-17 07:48:57 +00:00
parent 860b42cf5a
commit 6f40689356

View File

@ -3990,45 +3990,42 @@ AC_ARG_ENABLE(dtrace,
[enable DTrace for tracing inside ruby. enabled by default on systems having dtrace]), [enable DTrace for tracing inside ruby. enabled by default on systems having dtrace]),
[enable_dtrace=$enableval], [enable_dtrace=auto]) [enable_dtrace=$enableval], [enable_dtrace=auto])
if test "${enable_dtrace}" = "auto"; then
if test x"$DTRACE" != x -a x"$cross_compiling" != xyes; then
RUBY_DTRACE_AVAILABLE()
enable_dtrace=$rb_cv_dtrace_available
else
enable_dtrace=no
fi
fi
LIBRUBY_A_OBJS='$(OBJS)' LIBRUBY_A_OBJS='$(OBJS)'
DTRACE_REBUILD= DTRACE_REBUILD=
if test "${enable_dtrace}" = "yes"; then AS_CASE(["${enable_dtrace}"],
if test -z "$DTRACE"; then [yes|auto], [
AC_MSG_ERROR([dtrace(1) is missing]) RUBY_DTRACE_AVAILABLE()
elif test "$cross_compiling" = yes; then ], [
AC_MSG_ERROR([--enable-dtrace, however, cross compiling]) rb_cv_dtrace_available=no
else ])
RUBY_DTRACE_AVAILABLE() AS_IF([test "${enable_dtrace}" = yes], [dnl
enable_dtrace=$rb_cv_dtrace_available AS_IF([test -z "$DTRACE"], [dnl
if test "${enable_dtrace}" = "no"; then AC_MSG_ERROR([dtrace(1) is missing])
AC_MSG_ERROR([--enable-dtrace, however, USDT is not available]) ], [test "$cross_compiling" = yes], [dnl
fi AC_MSG_ERROR([--enable-dtrace, however, cross compiling])
RUBY_DTRACE_POSTPROCESS() ], [test "${rb_cv_dtrace_available}" = "no"], [dnl
if test "$rb_cv_prog_dtrace_g" != 'no'; then AC_MSG_ERROR([--enable-dtrace, however, USDT is not available])
DTRACE_OBJ='probes.$(OBJEXT)' ])
fi ])
if test "$rb_cv_prog_dtrace_g" = 'rebuild'; then AS_CASE([$rb_cv_dtrace_available],
DTRACE_REBUILD=yes [yes*], [dnl
LIBRUBY_A_OBJS='$(DTRACE_GLOMMED_OBJ)' RUBY_DTRACE_POSTPROCESS()
fi AS_IF([test "$rb_cv_prog_dtrace_g" != no], [dnl
AS_CASE("${target_os}", [freebsd*], [ DTRACE_OBJ='probes.$(OBJEXT)'
# FreeBSD's dtrace requires libelf ])
LIBS="-lelf $LIBS" AS_IF([test "$rb_cv_prog_dtrace_g" = rebuild], [dnl
]) DTRACE_REBUILD=yes
fi LIBRUBY_A_OBJS='$(DTRACE_GLOMMED_OBJ)'
])
AS_CASE("${target_os}", [freebsd*], [dnl
# FreeBSD's dtrace requires libelf
LIBS="-lelf $LIBS"
])
DTRACE_EXT=d DTRACE_EXT=d
else ], [dnl
enable_dtrace=no
DTRACE_EXT=dmyh DTRACE_EXT=dmyh
fi ])
AC_SUBST(DTRACE_EXT) AC_SUBST(DTRACE_EXT)
AC_SUBST(DTRACE_OBJ) AC_SUBST(DTRACE_OBJ)
AC_SUBST(DTRACE_REBUILD) AC_SUBST(DTRACE_REBUILD)