Skip to content

Commit

Permalink
allow PAPI to be installed somewhere non-standard
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Marlow committed Nov 1, 2007
1 parent 1a4ff8d commit 5c6aded
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
3 changes: 2 additions & 1 deletion mk/config.mk.in
Expand Up @@ -468,7 +468,8 @@ 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@
PapiLibDir=
PapiIncludeDir=

################################################################################
#
Expand Down
14 changes: 14 additions & 0 deletions rts/Makefile
Expand Up @@ -277,9 +277,23 @@ endif
# Add PAPI library if needed

ifeq "$(GhcRtsWithPapi)" "YES"

SRC_HC_OPTS += -optc-DUSE_PAPI
PACKAGE_CPP_OPTS += -DUSE_PAPI

PACKAGE_CPP_OPTS += -DPAPI_INCLUDE_DIR=$(PapiIncludeDir)
PACKAGE_CPP_OPTS += -DPAPI_LIB_DIR=$(PapiLibDir)

ifneq "$(PapiIncludeDir)" ""
SRC_HC_OPTS += -I$(PapiIncludeDir)
SRC_CC_OPTS += -I$(PapiIncludeDir)
SRC_HSC2HS_OPTS += -I$(PapiIncludeDir)
endif
ifneq "$(PapiLibDirs)" ""
SRC_LD_OPTS += -L$(PapiLibDirs)
endif

endif # GhcRtsWithPapi==YES

#-----------------------------------------------------------------------------
# make depend setup
Expand Down
6 changes: 3 additions & 3 deletions rts/package.conf.in
Expand Up @@ -15,13 +15,13 @@ hidden-modules:
import-dirs:

#ifdef INSTALLING
library-dirs: LIB_DIR GMP_LIB_DIRS
library-dirs: LIB_DIR GMP_LIB_DIRS PAPI_LIB_DIR
# ifdef mingw32_HOST_OS
, LIB_DIR"/gcc-lib"
/* force the dist-provided gcc-lib/ into scope. */
# endif
#else /* !INSTALLING */
library-dirs: FPTOOLS_TOP_ABS"/rts" GMP_LIB_DIRS
library-dirs: FPTOOLS_TOP_ABS"/rts" GMP_LIB_DIRS PAPI_LIB_DIR
# if !defined(HAVE_LIBGMP) && !defined(HAVE_FRAMEWORK_GMP)
, FPTOOLS_TOP_ABS"/gmp"
# endif
Expand Down Expand Up @@ -60,7 +60,7 @@ extra-libraries: "m" /* for ldexp() */
#endif

#ifdef INSTALLING
include-dirs: INCLUDE_DIR GMP_INCLUDE_DIRS
include-dirs: INCLUDE_DIR GMP_INCLUDE_DIRS PAPI_INCLUDE_DIR
# ifdef mingw32_HOST_OS
, INCLUDE_DIR"/mingw"
# endif
Expand Down

0 comments on commit 5c6aded

Please sign in to comment.