From 424b4e66a96672414e1c8ea13662b528b7ad1fd2 Mon Sep 17 00:00:00 2001 From: "Stephane E. Potvin" Date: Fri, 22 Jan 2010 14:05:48 +0000 Subject: [PATCH] Introduce two new flags PO_CFLAGS and PO_CXXFLAGS to make it possible to have different flags when building profiled objects. MFC after: 1 month --- share/mk/bsd.lib.mk | 8 ++++---- share/mk/sys.mk | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 982ff50cfc48..470d9d4da766 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -67,7 +67,7 @@ PO_FLAG=-pg .endif .c.po: - ${CC} ${PO_FLAG} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CC} ${PO_FLAG} ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET} .if defined(CTFCONVERT) ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} .endif @@ -79,7 +79,7 @@ PO_FLAG=-pg .endif .cc.po .C.po .cpp.po .cxx.po: - ${CXX} ${PO_FLAG} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CXX} ${PO_FLAG} ${PO_CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} .cc.So .C.So .cpp.So .cxx.So: ${CXX} ${PICFLAG} -DPIC ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} @@ -115,7 +115,7 @@ PO_FLAG=-pg .endif .asm.po: - ${CC} -x assembler-with-cpp -DPROF ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CC} -x assembler-with-cpp -DPROF ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET} .if defined(CTFCONVERT) ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} .endif @@ -128,7 +128,7 @@ PO_FLAG=-pg .endif .S.po: - ${CC} -DPROF ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CC} -DPROF ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET} .if defined(CTFCONVERT) ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} .endif diff --git a/share/mk/sys.mk b/share/mk/sys.mk index c469a0354cec..e0527e424df6 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -44,6 +44,7 @@ CFLAGS ?= -O2 -pipe CFLAGS += -fno-strict-aliasing .endif .endif +PO_CFLAGS ?= ${CFLAGS} # Turn CTF conversion off by default for now. This default could be # changed later if DTrace becomes popular. @@ -66,6 +67,7 @@ CFLAGS += -g CXX ?= c++ CXXFLAGS ?= ${CFLAGS:N-std=*:N-Wnested-externs:N-W*-prototypes:N-Wno-pointer-sign} +PO_CXXFLAGS ?= ${CXXFLAGS} CPP ?= cpp