summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2026-02-06 14:42:29 +0900
committerNobuyoshi Nakada <nobu.nakada@gmail.com>2026-02-12 19:20:50 +0900
commitc46fe31138d2a76c6121c444135f5cb97e782ec7 (patch)
tree83d5d5138aaced5bf9f9b05fbda38fa01fdfc29f
parent2d159fbbb6e3a123654a6a60b12654eedfcefd9d (diff)
[Bug #21862] Extract -D/-U options only for dtrace
A workaround for GH-12563#issuecomment-3691590489.
-rw-r--r--configure.ac3
-rw-r--r--template/Makefile.in12
2 files changed, 12 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 2d9ccf1442..31b90fb664 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4342,8 +4342,7 @@ AS_IF([test -n "${LIBS}"], [
MAINFLAGS=`echo " $MAINLIBS " | sed "s|$libspat"'||;s/^ *//;s/ *$//'`
])
LIBRUBYARG_STATIC="${LIBRUBYARG_STATIC} \$(MAINLIBS)"
-CPPFLAGS="$CPPFLAGS "'$(DEFS)'
-test -z "$CPPFLAGS" || CPPFLAGS="$CPPFLAGS "; CPPFLAGS="$CPPFLAGS"'${cppflags}'
+CPPFLAGS="$CPPFLAGS "'$(DEFS) ${cppflags}'
AS_IF([test -n "${cflags+set}"], [
cflagspat=`eval echo '"'"${cflags}"'"' | sed 's/[[][|.*]]/\\&/g;s/^ */ /;s/^ *$/ /'`
CFLAGS=`echo " $CFLAGS " | sed "s|$cflagspat"'|${cflags}|;s/^ *//;s/ *$//'`
diff --git a/template/Makefile.in b/template/Makefile.in
index 0b7b50e3aa..8e93efc310 100644
--- a/template/Makefile.in
+++ b/template/Makefile.in
@@ -514,7 +514,17 @@ _PREFIXED_SYMBOL = TOKEN_PASTE($(SYMBOL_PREFIX),name)
.d.h:
@$(ECHO) translating probes $<
- $(Q) $(DTRACE) -o $@.tmp -h -C $(INCFLAGS) $(CPPFLAGS) -s $<
+ $(Q) $(DTRACE) -o $@.tmp -h -C $(INCFLAGS) `echo "$(CPPFLAGS)" | \
+ sed -e "s/^/\n/" \
+ -e ": loop" \
+ -e " s/\n\(\('[^']*'\|[^ ']*\)*\)/\1\n/" \
+ -e " /^\(-[DU]\|'-[DU]\).*/P" \
+ -e " s/^..*\n/\n/" \
+ -e " T" \
+ -e " s/\n */\n/" \
+ -e "t loop" \
+ -e "s/.*//" \
+ ` -s $<
$(Q) sed -e 's/RUBY_/RUBY_DTRACE_/g' -e 's/PROBES_H_TMP/RUBY_PROBES_H/' -e 's/(char \*/(const char */g' -e 's/, char \*/, const char */g' $@.tmp > $@
$(Q) $(RM) $@.tmp