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