diff --git a/configure.ac b/configure.ac index 5e0e5bf7..6ae6a5ee 100644 --- a/configure.ac +++ b/configure.ac @@ -72,6 +72,12 @@ AC_ARG_ENABLE([perfflow], [enable_perfflow=$enableval], [enable_perfflow=no] ) +AC_ARG_ENABLE(caliper, + [AS_HELP_STRING([--enable-caliper[=OPTS]], + [Use caliper for profiling. [default=no] [OPTS=no/yes]])], + , + [enable_caliper="no"] +) # TODO Add support for libb64 back once base64 encoding/decoding is fully complete # AC_ARG_VAR([LIBB64_DIR], [root directory for libb64]) @@ -134,6 +140,13 @@ AX_PERFFLOW_ASPECT([PERFFLOW], if test "x$enable_perfflow" = "xyes" && test "x$pkg_check_perfflow_found" = "xno"; then AC_MSG_ERROR([requested PerfFlow Aspect support, but cannot find PerfFlow Aspect with pkg-config]) fi +if test "$enable_caliper" = "yes"; then + PKG_CHECK_MODULES([CALIPER], [caliper], [], []) + CFLAGS="${CFLAGS} ${CALIPER_CFLAGS} " + # Do not use CALIPER_LIBS, only link to libcaliper-stub + LIBS="${LIBS} ${CALIPER_LIBS} -lrt " + AC_DEFINE([HAVE_CALIPER], [1], [Define if you have libcaliper]) +fi AM_CONDITIONAL([PERFFLOW], [test "x$enable_perfflow" = "xyes"]) ###########################