From e4e7b37c7ed6b2cd39c34c30f7dcf9369a562496 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Mon, 20 Nov 2006 14:36:57 +0000 Subject: [PATCH] reorganise PAPI configuration: off by default, even if library is found Add GhcRtsWithPapi=YES to mk/build.mk to turn it on --- configure.ac | 6 ++++-- mk/config.mk.in | 8 +++++--- rts/Makefile | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index a4a229c..f1e5fa2 100644 --- a/configure.ac +++ b/configure.ac @@ -1207,9 +1207,11 @@ AC_SUBST(HavePapiLib) AC_SUBST(HavePapiHeader) if test "$HavePapiLib" = "YES" -a "$HavePapiHeader" = "YES"; then - USE_PAPI=YES + HavePapi=YES +else + HavePapi=NO fi -AC_SUBST(USE_PAPI) +AC_SUBST(HavePapi) AC_CONFIG_FILES([mk/config.mk ghc.spec docs/users_guide/ug-book.xml]) AC_CONFIG_COMMANDS([mk/stamp-h],[echo timestamp > mk/stamp-h]) diff --git a/mk/config.mk.in b/mk/config.mk.in index 9420663..67875e1 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -431,6 +431,11 @@ GhcRtsCcOpts=-fomit-frame-pointer # Include the front panel code? Needs GTK+. GhcRtsWithFrontPanel = NO +# Include support for CPU performance counters via the PAPI library in the RTS? +# (PAPI: http://icl.cs.utk.edu/papi/) +GhcRtsWithPapi = NO +HavePapi = @HavePapi@ + ################################################################################ # # nofib @@ -987,9 +992,6 @@ UNAME = uname # GTK+ GTK_CONFIG = @GTK_CONFIG@ -# PAPI -USE_PAPI = @USE_PAPI@ - #----------------------------------------------------------------------------- # DocBook XML stuff diff --git a/rts/Makefile b/rts/Makefile index 08240a1..e7df18e 100644 --- a/rts/Makefile +++ b/rts/Makefile @@ -181,8 +181,8 @@ endif #----------------------------------------------------------------------------- # Add PAPI library if needed -ifeq "$(USE_PAPI)" "YES" -SRC_HC_OPTS += -lpapi -optc-DUSE_PAPI +ifeq "$(GhcRtsWithPapi)" "YES" +SRC_HC_OPTS += -optc-DUSE_PAPI PACKAGE_CPP_OPTS += -DUSE_PAPI endif -- 1.7.10.4