reorganise PAPI configuration: off by default, even if library is found
authorSimon Marlow <simonmar@microsoft.com>
Mon, 20 Nov 2006 14:36:57 +0000 (14:36 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Mon, 20 Nov 2006 14:36:57 +0000 (14:36 +0000)
Add GhcRtsWithPapi=YES to mk/build.mk to turn it on

configure.ac
mk/config.mk.in
rts/Makefile

index a4a229c..f1e5fa2 100644 (file)
@@ -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])
index 9420663..67875e1 100644 (file)
@@ -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
 
index 08240a1..e7df18e 100644 (file)
@@ -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