summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.global15
-rw-r--r--configure.in4
2 files changed, 16 insertions, 3 deletions
diff --git a/Makefile.global b/Makefile.global
index f833efa5e7..c571f3455d 100644
--- a/Makefile.global
+++ b/Makefile.global
@@ -130,5 +130,18 @@ distclean: clean
fi
$(EGREP) define'.*include/php' $(top_srcdir)/configure | $(SED) 's/.*>//'|xargs rm -f
-.PHONY: all clean install distclean test
+prof-gen:
+ CCACHE_DISABLE=1 $(MAKE) PROF_FLAGS=-fprofile-generate all
+
+prof-clean:
+ find . -name \*.lo -o -name \*.o | xargs rm -f
+ find . -name \*.la -o -name \*.a | xargs rm -f
+ find . -name \*.so | xargs rm -f
+ rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_MILTER_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
+
+prof-use:
+ CCACHE_DISABLE=1 $(MAKE) PROF_FLAGS=-fprofile-use all
+
+
+.PHONY: all clean install distclean test prof-gen prof-clean prof-use
.NOEXPORT:
diff --git a/configure.in b/configure.in
index ffc714ff5f..9aefa2b964 100644
--- a/configure.in
+++ b/configure.in
@@ -1435,10 +1435,10 @@ CC=$old_CC
PHP_CONFIGURE_PART(Generating files)
CXXFLAGS_CLEAN=$CXXFLAGS
-CFLAGS_CLEAN=$CFLAGS
+CFLAGS_CLEAN="$CFLAGS \$(PROF_FLAGS)"
CFLAGS="\$(CFLAGS_CLEAN) $standard_libtool_flag"
INLINE_CFLAGS="$INLINE_CFLAGS $standard_libtool_flag"
-CXXFLAGS="$CXXFLAGS $standard_libtool_flag"
+CXXFLAGS="$CXXFLAGS $standard_libtool_flag \$(PROF_FLAGS)"
if test "$PHP_PHAR" != "no" && test "$PHP_CLI" != "no"; then
pharcmd=pharcmd