From: Andrew Price Date: Tue, 21 Jun 2016 14:53:30 +0100 Subject: [Cluster-devel] [PATCH] gfs2-utils: Add --enable-gprof to configure Message-ID: <1466517210-6662-1-git-send-email-anprice@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Add a convenience flag to the configure script which inserts -pg into the build flags. Signed-off-by: Andrew Price --- configure.ac | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/configure.ac b/configure.ac index f6174ff..b421fbe 100644 --- a/configure.ac +++ b/configure.ac @@ -92,6 +92,10 @@ AC_ARG_ENABLE([debug], AC_ARG_ENABLE([gcov], AC_HELP_STRING([--enable-gcov],[enable coverage instrumentation [default=no]]), [], [enable_gcov="no"]) +AC_ARG_ENABLE([gprof], + AC_HELP_STRING([--enable-gprof],[enable profiling instrumentation [default=no]]), + [], [enable_gprof="no"]) + # We use the Check framework for unit tests PKG_CHECK_MODULES([check], [check >= 0.9.8], @@ -162,6 +166,14 @@ if test "x${enable_gcov}" = xyes; then OPT_CFLAGS="-O0 $GCOV_CFLAGS" fi +if test "x${enable_gprof}" = xyes; then + GPROF_CFLAGS="-pg" + if ! cc_supports_flag $GPROF_CFLAGS; then + AC_MSG_ERROR([your compiler does not support gprof instrumentation]) + fi + OPT_CFLAGS="$OPT_CFLAGS $GPROF_CFLAGS" +fi + # extra warnings EXTRA_WARNINGS="" @@ -226,6 +238,7 @@ echo " udevdir : $udevdir" echo " ------------------" echo " debug build : $enable_debug" echo " C unit tests : $have_check" +echo " gprof build : $enable_gprof" echo " gcov build : $enable_gcov" echo echo "Now run 'make' to build and 'make check' to run tests" -- 2.7.4