f6ea51
Subject: [PATCH] Pass CFLAGS to dtrace
f6ea51
f6ea51
Signed-off-by: Petr Písař <ppisar@redhat.com>
f6ea51
---
f6ea51
 Makefile.SH | 8 +++++---
f6ea51
 cflags.SH   | 5 ++++-
f6ea51
 2 files changed, 9 insertions(+), 4 deletions(-)
f6ea51
f6ea51
diff --git a/Makefile.SH b/Makefile.SH
f6ea51
index 5fc6d1c..e89ad70 100755
f6ea51
--- a/Makefile.SH
f6ea51
+++ b/Makefile.SH
f6ea51
@@ -457,6 +457,8 @@ CCCMD    = sh $(shellflags) cflags "optimize='$(OPTIMIZE)'" $@
f6ea51
 
f6ea51
 CCCMDSRC = sh $(shellflags) cflags "optimize='$(OPTIMIZE)'" $<
f6ea51
 
f6ea51
+DTRACEFLAGS = sh $(shellflags) cflags "optimize='$(OPTIMIZE)'" $@
f6ea51
+
f6ea51
 CONFIGPM_FROM_CONFIG_SH = lib/Config.pm lib/Config_heavy.pl
f6ea51
 CONFIGPM = $(CONFIGPM_FROM_CONFIG_SH) lib/Config_git.pl
f6ea51
 
f6ea51
@@ -890,19 +892,19 @@ $(DTRACE_MINI_O): perldtrace.d $(miniperl_objs_nodt)
f6ea51
 	-rm -rf mpdtrace
f6ea51
 	mkdir mpdtrace
f6ea51
 	cp $(miniperl_objs_nodt) mpdtrace/
f6ea51
-	$(DTRACE) -G -s perldtrace.d -o $(DTRACE_MINI_O) $(miniperl_dtrace_objs)
f6ea51
+	CFLAGS="`$(DTRACEFLAGS)`" $(DTRACE) -G -s perldtrace.d -o $(DTRACE_MINI_O) $(miniperl_dtrace_objs)
f6ea51
 
f6ea51
 $(DTRACE_PERLLIB_O): perldtrace.d $(perllib_objs_nodt)
f6ea51
 	-rm -rf libpdtrace
f6ea51
 	mkdir libpdtrace
f6ea51
 	cp $(perllib_objs_nodt) libpdtrace/
f6ea51
-	$(DTRACE) -G -s perldtrace.d -o $(DTRACE_PERLLIB_O) $(perllib_dtrace_objs)
f6ea51
+	CFLAGS="`$(DTRACEFLAGS)`" $(DTRACE) -G -s perldtrace.d -o $(DTRACE_PERLLIB_O) $(perllib_dtrace_objs)
f6ea51
 
f6ea51
 $(DTRACE_MAIN_O): perldtrace.d perlmain$(OBJ_EXT)
f6ea51
 	-rm -rf maindtrace
f6ea51
 	mkdir maindtrace
f6ea51
 	cp perlmain$(OBJ_EXT) maindtrace/
f6ea51
-	$(DTRACE) -G -s perldtrace.d -o $(DTRACE_MAIN_O) $(perlmain_dtrace_objs) ||	      \
f6ea51
+	CFLAGS="`$(DTRACEFLAGS)`" $(DTRACE) -G -s perldtrace.d -o $(DTRACE_MAIN_O) $(perlmain_dtrace_objs) ||	      \
f6ea51
 	  ( $(ECHO) "No probes in perlmain$(OBJ_EXT), generating a dummy $(DTRACE_MAIN_O)" && \
f6ea51
 	    $(ECHO) >dtrace_main.c &&							      \
f6ea51
 	    `$(CCCMD)` $(PLDLFLAGS) dtrace_main.c &&					      \
f6ea51
diff --git a/cflags.SH b/cflags.SH
f6ea51
index 3af1e97..b845127 100755
f6ea51
--- a/cflags.SH
f6ea51
+++ b/cflags.SH
f6ea51
@@ -516,7 +516,10 @@ for file do
f6ea51
     esac
f6ea51
 
f6ea51
     # Can we perhaps use $ansi2knr here
f6ea51
-    echo "$cc -c -DPERL_CORE $ccflags $stdflags $optimize $warn $extra"
f6ea51
+    case "$file" in
f6ea51
+    dtrace_*) echo "$ccflags $stdflags $optimize $warn $extra";;
f6ea51
+    *) echo "$cc -c -DPERL_CORE $ccflags $stdflags $optimize $warn $extra";;
f6ea51
+    esac
f6ea51
 
f6ea51
     . $TOP/config.sh
f6ea51
 
f6ea51
-- 
f6ea51
2.17.1
f6ea51