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